Posts

Showing posts from 2014

javascript - Goto specific Tab (accordin) on # hyperlink -

i using following code switch tabs. problem if put tabe id in url #, not goto specific tab. <a href="index.php#tab2">tab 2</a> <a href="index.php#tab3">tab 3</a> below code jquery(document).ready(function() { jquery('.tabs .tab-links a').on('click', function(e) { var currentattrvalue = jquery(this).attr('href'); // show/hide tabs jquery('.tabs ' + currentattrvalue).show().siblings().hide(); // change/remove current tab active jquery(this).parent('li').addclass('active').siblings().removeclass('active'); e.preventdefault(); }); }); html code <ul class="tab-links"> <li class="active"><a style="" href="#tab1">account</a></li> <li><a href="#tab2">jobs posted</a></li> <li

ios - Compound Predicate -

i'm trying compound search on core data via uitableview (search , display controller): let firstnamepredicate = nspredicate(format: "fname contains[c] %@", searchtext) let lastnamepredicate = nspredicate(format: "lname contains[c] %@", searchtext) let firstandlastnamepredicate = nspredicate(format: "fname contains[c] %@ or lname contains[c] %@", searchtext, searchtext) let companypredicate = nspredicate(format: "company contains[c] %@", searchtext) let predicate = nscompoundpredicate(type: nscompoundpredicatetype.orpredicatetype, subpredicates: [firstnamepredicate, lastnamepredicate, companypredicate, firstandlastnamepredicate]) fetchrequest.predicate = predicate all of predicates work except first , last name predicate. can type first name in , results perfectly, space , type last name i'll no results. idea what's wrong first , last name predicate?

objective c - XCode 6.2 default View Controller -

i've created new cocoa app in xcode 6.2 . has appdelegate.m/.h files, info.plist , mainmenu.xib . default nsviewcontroller? i need able grab view controller's instance code, can't find instance... thank you! there no default nsviewcontroller in case. defaults provide blank window only. have create 1 yourself. here 1 example of how people it. one example

SQL Business Day comparison of two dates -

i have researched calendar tables thought me accomplish need can't seem find anything. need business day comparison month on month. today 4/29/2015. call business day 20. date in prior month compares business day 20 march. thoughts on approach? thank everyone. a date or calendar table looking here. i'm not sure couldn't 'seem find anything', though. date tables can custom suited whatever business needs are. need few fields, use many fields. you'll need account holidays, also. memorial day count business day? open on mlk jr day? holidays vary country country, company company, name it. of powers involved out in identifying constitutes 'workday'. here's few articles on road, unfortunately, none of able built you need dicuss stakeholders in business. http://www.experts-exchange.com/articles/12267/build-your-own-sql-calendar-table-to-perform-complex-date-expressions.html http://www.sqlserver.info/database-design/how-to-c

php - URL issue - passing encoded characters like %2f and %2b -

i passing encrypted value through url using .htaccess file shown below : url : http://www.website.com/folder1/f1/tdt9eu%2b8kmae1u%2ft12rs htaccess file : rewriterule ^f1/(.+)$ index.php?id=$1 [ne] the issue server respond requested url not found on server. when replace %2f / , %2b b s+ works , can see content of page. it works when use url without rewriting shown below : http://www.website.com/folder1/index.php?id=tdt9eu%2b8kmae1u%2ft12rs could please , how can modify htaccess make work ? because need content using url rewriting shown above it due presence of %2f in uri not allowed apache web server default. allowed in query string that's why ?id=... working fine. you need turn on allowencodedslashes directive in apache config this. use: allowencodedslashes on to allow encoded slash in uris , restart apache web server.

c# - Bind Model property to multiple fields -

i have model string property: securitygroupmapping, want able set using 1 of 2 lists of strings. lists shown based on selection given in radio group assigned bool. i've looked @ post: mvc 3 bind model property 2 fields (e.g. other title) , have different scenario, , hoping there easy way disable field if it's not in use... <div class="editor-label"> @html.label("choose how assign users security group") </div> <div class="editor-field" style="width: 300px; display: inline;"> @html.radiobuttonfor(m => m.usedefaultgroupsecuritygroup, false) map individual security group @html.radiobuttonfor(m => m.usedefaultgroupsecuritygroup, true) use default security group </div> <br/> <div id="showusersecuritygroup"> <div class="editor-label"> @html.label("map csv field user's security group") </div> <div style="width:

php - javascript - update class based on url -

! latest i've tried. put in head.php include. i'll send on files if you'd want see them personally. directory of folder main_folder -main_files -- js_folder ---- js files -- includes_folder ---- head.php here <script type="text/javascript"> jquery(function($) { var path = window.location.href; // because 'href' property of dom element absolute path //alert($('ul a').length); $('ul a').each(function() { if (this.href === path) { $(this).addclass('sub-menu active'); } //alert(this.href); }); }); </script> whole sidebar: <div class="sidebar-scroll"> <div id="sidebar" class="nav-collapse collapse"> <!-- begin sidebar menu --> <ul class="sidebar-menu"> <li class="sub-menu"> <a class="" href="panel-admin.php"> <i class="icon-dashb

javascript - How to check whether the html has changed? -

Image
apologies if that's wrong place, have no clue ask. we building firefox addon works on selected websites. now, because websites tend change once in while, want run once day javascript script check whether specific part of code has been changed, , if did, return message (ideally directly email). what easiest, simplest way that? i've read webcrawlers, webscrappers, seem doing far more need. want run our pcs connected internet small script simple check , send email change specific part of html body has been detected (or more specific - selected elements have not been found). any appreciated basically might set google spreadsheet scrape pages' parts thru importxml function (here example) using xpath. set notifications in spreadsheet: tools -> notification rules now each time scraping function (importxml) gets content different previous one, spreadsheet should trigger mail you. as off-the-shelf alternative might recommend some tools track pages' an

asp.net - Visual Studio 2013 vb.net renaming variables not handling case sensitivity -

using visual studio 2013 , vb.net. when renaming variables using ide right-clicking on variable , selecting rename doesn't change references variable if it' casing change. example rename _testdate _testdate not propagating change throughout file. missing something? as specified on refactoring , rename dialog box (visual basic) location property holds the namespace search when perform rename operation. . field disabled, can't enter namespace want name in (which makes sense). in case, looks in classa , completes renaming there, doesn't rename in classb . isn't possible rename tool of visual basic. there third party plugins can though: coderush resharper they both have 30 day trials test out..

command line - Use qwinsta in PowerShell ISE -

i trying use qwinsta , rwinsta powershell code. when try run error "the term 'qwinsta' not recognized name of cmdlet, function, script file, or operable program." need able remotely on several machines without having add .dll's or modules other machines. tried terminal services powershell module, need able put on remote machines , not able that. within powershell ise how run qwinsta? not looking parse information gather it. following code have tried (which had found on site also): function get-tssessions { param( $computername = "localhost" ) qwinsta /server:$computername | #parse output foreach-object { $_.trim() -replace "\s+","," } | #convert objects convertfrom-csv } get-tssessions -computername "localhost" | ft -autosize best have running powershell ise (x86). when run command qwinsta there same error you. of course assuming have 64-bit os. th

python - Google app engine error 3 -

hi running google app engine has randomly stopped working here logs. not coder wondered if point me in right direction wrong? i2015-04-29 15:54:13.305 / xxxxxxxxxxxxxxxxx 500 7ms 2kb appengine-google; (+http://code.google.com/appengine) module=default version=1 0.1.0.2 - - [29/apr/2015:07:54:13 -0700] "post /solvehook http/1.1" 500 2352 "https:// xxxxxxxxxxxxxxxxx.appspot.com/" "appengine-google; (+http://code.google.com/appengine)" " xxxxxxxxxxxxxxxxx.appspot.com" ms=7 cpu_ms=9 cpm_usd=0.000263 queue_name= xxxxxxxxxxxxxxxxx task_name=4598293485967329217 app_engine_release=1.9.19 instance=00c61b117c99323f8203eca8b1aa54c6e0d29e i2015-04-29 15:54:13.302 start of: activities_update i2015-04-29 15:54:13.302 followupid: 141775527, contactid: 141774193 i2015-04-29 15:54:13.303 details set: make reservation i2015-04-29 15:54:13.303 contact categorise (pending reservation: 98837900 e2015-04-29 15:54:13.303 unsupported operand type(s) +: 'nonety

Firebase data consistency across multiple nodes -

according the firebase docs data flattened , indices used link different nodes in tree: users $userid widgets $widgetid widgets $widgetid in above example, if user creates widget, widgetid stored under user node. my question whether there way guarantee consistency of operation, considering there more 1 write required. assuming first operation is: var newkey = fb.child('widgets').push({ name: 'widge' }).key(); i can write to: fb.child('users').child(auth.id).child('widgets').child(newkey).set(true); but if there failure or other problem between 2 writes? or if have multiple places need store key , failure occurs between writes? is there way handle in firebase? if not, there plans support in future? and if so, can provide specific example of how done? note part of core firebase api. see this blog post details. var mergedupdate = {}; mergedupdate[ 'users/' + userid + '/widgets/' + widgeti

servlets - Action form forward path not a url -

what mean when have path example below in first forward (then success forward) <action type="com.testpackage.servlettest" path="/classhomepage" scope="request"> <forward name="success" path=".class.homepage" redirect="true" /> <forward name="failure" path="/homepage.do" module="/" redirect="false" /> </action> i understand failure forward forward page "/homepage.do" if "failure" returned return mapping.findforward("failure"); but happens if return return mapping.findforward("success"); what package try load? how find out looking @ web.xml , struct-config.xml files? you using tiles, , need in tiles definition file (usually

Microsoft Visual Studio 2013 Shell (Minimum) error in installation -

Image
when i'm installing microsoft visual studio express windows desktop keep getting error: here screenshot: . here log file: http://pastebin.com/z95nt0st i use magiciso extract iso vs2013.4_dskexp_enu. tried mount virtual disk too. i reformatted laptop theres no old version of vs here. i figured out why problem. when reformatted laptop, downloaded recovery software recover files need (visual studio installer , others), , when install it, didnt installed successfully. deleted file, think installed other components of visual studio uncompletely before fails installed vs. finally, downloaded vs shell, , installed in mvs folder fails install half of it, when try again install vs, got different error, says vs shell cannot opened, (so means i'm right) error because trying open "uncompletely" , continue install it, cannot open because "uncomplete". so when type command g:\wdexpress_full.exe/uninstall/force in cmd, deletes remnants of v

java - SimpleDateFormat Parse Exception Thrown Only On Specific Values -

i using following code parse date+time strings: simpledateformat sdf = new simpledateformat("mm/dd/yyyy hh:mm:ss a"); sdf.setlenient(false); date d = sdf.parse(datestr); this code works of time... but, found wouldn't accept value: "3/28/2014 02:39:59 am". stranger, when change value other hour, works fine. what missing? (my code single threaded, compiled jdk7, on timezone utc+2)

windows - Can't start Maven 3.0.5 from installation folder -

i'm using java version 1.5.0_30, java_home env. variable has been correctly set java bin folder in 'path'. have downloaded maven 3.0.5 , checked standard requirements (jdk 1.5 , above). using windows command prompt when went apache-maven-3.0.5\bin directory tried run 'mvn' , 'mvn -version' see if maven has been installed correctly or not keep receiving : 'mvn' not recognized internal or external command, operable program or batch file. please note can't update jdk because on corporate pc (so can't use more recent maven versions because don't support 1.5 java jdk). any appreciated, thanks. first have add ...\apache-3.0.5\bin folder path. afterwards need close , reopen console. furthermore java not needed being part of path java_home must set correctly. you can upgrade until maven 3.1.1 last release supports java 1.5 .

php - how Handler Exception CodeIgniter -

i need capture exception in codeigniter tried different solutions , don't work. want capture exception , print message. this exception default page: http://it.tinypic.com/r/sexf68/8 this code: $this->load->database(); $c=300; $query = $this->db->query("insert ut (u, p, n,c) values ('$u', '$p', '$n','$c')"); if($query->db->_error_message()){ } if($$query->db->_error_number()){ echo" bau"; } anyone can me?

Render XML output in HTML table using PHP -

i have xml output written in php looks below <twitch_xml> <twitch> <bird id="1"> <species>willow ptarmigan</species> <age>2</age> <sex>male</sex> <location>london</location> <image> http://www.kidzone.ws/images-changed/birds/willow_ptarmigan.jpg </image> <user>chamith</user> </bird> <bird id="5"> <species>grey partridge</species> <age>2</age> <sex>male</sex> <location>london</location> <image> https://www.rspb.org.uk/images/greypartridge_tcm9-17615.jpg?width=530&crop=(196,364,1006,820) </image> <user>raveen</user> </bird> </twitch> </twitch_xml> i want put output inside html table. please note i'm not using external xml document. retrieve data

javascript - storing data sent back from PHP to ajax in global array -

i have built life expectancy calculator , want create graph. created array x stores values age. program sends each elements in x php using ajax , php send results. i want store results in global array y can create graph. problem value assignment done inside success: function{}. elements discarded after that. below code: age(); var yearage = $('input:text[name=ageyr]').val(); value = parsefloat(yearage); var x = []; var yval = []; var change = [-5,-4,-3,-2,-1,0,1,2,3,4,5]; var stop = false; (var = 0; <= 10; ++i) { x[i] = value +change[i]; } console.log(x); $('form.ajax').on('submit',function(event){ var =$(this), url = that.attr('action'), type = that.attr('method'), data ={}; var radio_button_value; if ($("input[name='sex']:checked").length > 0){ gender = $('input:radio[name=sex]:checked').val(); } that.find ('[name]').each(function(index,value){ var = $(this), name = that.attr('name

ios - prepareForSegue won't work with custom segue (swift) -

i've created custom segue , keeps giving same error. happened when i've created real simple uistoryboardsegue class. overriding method selector 'prepareforsegue:sender:' has incompatible type '(customopensegue, anyobject?) -> ()' this how i'm calling it override func prepareforsegue(segue: customopensegue, sender: anyobject?) { segue.iconframe = sender!.view!.frame } my custom segue work without prepareforsegue (on simpler mode) need pass iconframe value work intended. any suggestions? change to override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { if segue customopensegue { let customopensegue = segue as! customopensegue customopensegue.iconframe = sender!.view!.frame } } if override method, can't change parameter types.

css - Why does the content in my div not remain the same when resizing window? -

i have page: http://bit.ly/1in9yce it looks intended on big screens (desktop) issue when window resized down small screen widths, "agree" , "disagree" labels start take own line instead of being nicely placed before , after slider on same line slider. can't life of me figure out why this, since available width should sufficient. kind soul please help? this because in css there display:block defined: @media screen , (max-width: 800px) .ui.form .choice-text { padding: 0; display: block; } if remove display:block should work.

Does Skype4py still work after Microsoft removed Skype Desktop API? -

does skype4py use skype desktop api? api appears have been (or being) removed microsoft 1 . does know how affects skype4py project? 1 "what desktop api?" on skype faq says: as communicated in blog post , due technology improvements making skype experience, features of api stop working skype desktop. example, delivery of chat messages using api cease work. skype4py still work, but, when sending message group chat, attention necessary. if group chat "cloud-based chats", skype4py not work well. for reference: skype faq - chat commands , roles? for example, following scripts work normally: # -*- coding: utf-8 -*- import skype4py user = 'username' # allow chats skype4py bot account skype = skype4py.skype(transport='x11') skype.attach() chat = skype.createchatwith(user) chat.sendmessage('hello!') and following scripts work too: # -*- coding: utf-8 -*- import skype4py # p2p-based chat , skype4py bot accoun

to many new lines and weird distribution in Java -

i writing program checks prime numbers , displays first 1000 in rows of 10. program works fine except fact when display them @ random there new lines. first 3 lines printed correctly after goes haywire. can please help? appreciated. public class primetest{ public static void main(string[] args){ boolean prime; int primecount = 0; //for loop increase integer checked 1 , print if prime (int = 2; primecount != 1000; i++){ prime = isprime(i); if (prime == true){ primecount++; system.out.print(i + " ");} else if (primecount % 10 == 0){ system.out.print("\n");} else ;} } // method check number primeness public static boolean isprime(int i){ boolean check = true; (int n = 2; n < i; n++){ if (i % n != 0){ check = true;} else if ( % n == 0){ check = false; break;} } return check; } } this (a part of) output get: 2 3 5 7 11 13 17 19 23 29

Translation cakephp not working -

i'm trying implement translation in cakephp isn't working , don't show me erros. i have html in element <a href="/sites/pages/servicos" target="_blank"> <span class="title">serviços</span> <div class="description"><?php __('o que fazemos') ?></div> </a> in app controller inside beforefilter() : configure::write('config.language', 'eng'); in folder locale/eng/lc_messages/default.po have this: msgid "o que fazemos" msgstr "what do" but isn't working... thanks i think you're forgot "echo" <?php echo __('o que fazemos'); ?>

xcode - Error: identifier "MAXFLOAT" is undefined -

i trying convert xcode project ( link ) vs2008 solution. in cuda filetype .cu , term maxfloat used. adding following headers error not resolved. #include <stdio.h> #include <math.h> in xcode project, tried locate definition there none. term used in file. specific xcode? maxfloat non-standard parameter. use 1 of following, portable alternatives: in c: use standard library flt_max (defined in <float.h> ). in c++: use std::numeric_limits<float>::max (defined in <limits> ). may still use c's flt_max , include <cfloat> instead.

ocaml - Issue with filling a rectangle with color in OcamlSDL -

i trying display colored square in center of window in ocamlsdl. creating surface , rectangle square , blitting on screen @ right position works without issue, when try color rectangle, part of gets colored (as seen in screenshot ). here code : open sdlevent open sdlkey open sdlvideo let image_src = "background.jpg" let win_x = 1200 let win_y = 800 let side = 10 let sq_size = 40 let seps = 10 let board_side = side * sq_size + seps * side let o_x = (win_x - board_side) / 2 let o_y = (win_y - board_side) / 2 let f_x = o_x + board_side let f_y = o_y + board_side let rec event_handler () = match wait_event () | keydown {keysym=key_escape} -> () | event -> event_handler () let main () = sdl.init [`video]; at_exit sdl.quit; let screen = sdlvideo.set_video_mode win_x win_y [] in let bg = sdlloader.load_image image_src in let pos_bg = sdlvideo.rect 0 0 win_x win_y in sdlvideo.blit_surface ~dst_rect:pos_bg ~src:bg ~dst:screen (); p

c - Windows CE UTF-16 encoding and "surrogates" -

according i've read here , there, windows ce using utf-16 (aka ucs-2) encoding strings. with encoding character below 0xffff in unicode table can represented using single windows wchar_t, , on called "surrogate" can take 2 wchar_t single "symbol". right ? now how windows handle these "surrogates" ? allow these "characters" take more single wchar_t ? in case there no way make sure n-th pair of bytes in n-th symbol right ? or "truncate" , treat each wchar_t separate symbol, cause symbols on 0xffff treated 2 different symbols ? thank you. :)

xml - XSL group by multiple conditions -

i want group items first element value, group results items other element value 'or' condition. i'll try explain myself following xml example <root> <request> <id_master>222</id_master> <id_x>1</id_x> <text>hey</text> </request> <response> <id_master>222</id_master> <id_y>1</id_y> <text>hello</text> </response> <request> <id_master>222</id_master> <id_y>1</id_y> <text>bye..</text> </request> <response> <id_master>222</id_master> <id_x>1</id_x> <text>bye</text> </response> <request> <id_master>222</id_master> <id_y>2</id_y> <text>i want ice..</text> </request>

Optimization has not converged in R -

i have function estimates 2 moments of truncated gaussian distribution using maximum likelihood method. in database, not obtain results converge. put warning see how many of them are. then tried erase them, using trycatch function seems don't know how use properly. does have idea ? here code : df=as.data.frame(matrix(0,1000,2)) df$v1=runif(nrow(df),0,1) df$v2=sample(c(1:10),nrow(df), replace=true) library(truncnorm) f <- function(d) # d vector { trycatch( { f2 <- function(x) -sum(log(dtruncnorm(d, a=0, b=1, mean = x[1], sd = x[2]))) res <- optim(par=c(mean(d),sd(d)),fn=f2) if(res$convergence!=0) warning("optimization has not converged") return(list(res1=res$par[1],res2=res$par[2]^2)) }, error = function(error) {return()} ) } res1=tapply(df$v1, df$v2, function(x) f(x)$res1) so idea "clean" res1 deleting values have not converged. best regards. here small example of how trycatch works. need run expression within tr

ruby on rails - How to upgrade Spree from 2.2.6 to 3.0.0 -

i have ruby on rails shopping site project built using spree 2.2.6 , want migrate spree 3.0.0 getting tons of errors related configuration settings. has done before or know how achieve this? versions using: ruby: 2.1.1 rails: 4.0.10 spree: 2.2.6 i using compatible versions of other gems like: 'spree_gateway', 'spree_auth_devise', 'spree_i18n', 'spree_recently_viewed', 'spree_tax_cloud', 'spree_gift_card' some of these can upgraded while can't be. thanks in advance. from https://guides.spreecommerce.com/release_notes/spree_3_0_0.html looks pretty simple, looks upgrade rails 4.2 (probably step you're missing. upgrade gems in gemfile: gem 'spree', github: 'spree/spree', branch: '3-0-stable' run bundle update spree . copy on migrations spree (and other engine) , run them using these commands: rake railties:install:migrations rake db:migrate looks though configuration sett

ios - How can I open the iPhone phone keypad programmatically? -

i don't want call number. want open phone keypad programmatically. how can this? i think can add uitextfield , hide , call becomefirstresponder: var textfield : uitextfield //create , set hidden true textfield.keyboardtype = uikeyboardtype.phonepad //keyboardtype textfield.hidden = true //to fire keyboard textfield.becomefirstresponder()

Use a python variable in uwsgi's emperor.ini -

i using uwsgi run flask app. index.ini looks this: [uwsgi] vassal_name = %n chdir = *a specific dir* module = project.web.%(vassal_name) callable = app http-socket = :8080 the chdir variable hard coded, makes sense deployment, local development nuissance change. want make variable. i have settings management set in this example taken 2 scoops of django, book. prefer set chdir variable in local settings.py. how can variable local settings.py file , use in ini file?

android - JSON <=> Java Object Mapper which translates well with J2objc -

i use org.json.* classes part of j2objc distribution. mapping of dto classes , json objects made hand far. know there gson , jackson. is there json object mapper library translates j2objc , works in translated objective-c code? jackson , gson 2 best libraries, , both have been translated using j2objc ios apps different teams (no public ports i'm aware of, though). if control server-side of app, though, protocol buffers faster json->java alternative. why they're used of google's ios apps, including inbox , sheets use j2objc. j2objc publicly supports protocol buffers .

c# - Creating a selectable text content in WPF -

i need create report page wpf project, content has generated dynamically. need bind content view model. implemented: <scrollviewer horizontalscrollbarvisibility="auto" padding="5"> <itemscontrol itemssource="{binding path=mylistcategorywise}"> <itemscontrol.itemtemplate> <datatemplate> <stackpanel orientation="vertical"> <textblock text="{binding path=key}" fontsize="15" fontweight="bold" /> <itemscontrol itemssource="{binding path=value}"> <itemscontrol.itemtemplate> <datatemplate> <grid> <grid.columndefinitions>

php - Mixed sorting of dates in MySQL -

i have date column holds either date value or null. use hold product's expiration date. want write query fetch them in order: not yet expired, no expiration (null), , expired. for example, assuming today may 15: prd_id prd_name expiry date ----------------- 1 name1 may 16 2 name2 may 17 3 name3 may 18 4 name4 may 21 5 namex null 6 namex null 7 namex null 8 namex may 14 9 namex may 12 (a null value denotes no expiration) how this? you can try follwing syntax:- select * your_table order case when expire_date > curdate() 1 end, when expire_date null 2 desc end, when expire_date < curdate() 3 desc end;

javascript - JQuery Datepicker - displaying date in several fields -

i'm having list several activities, , want jquery datepicker display date in field in each row. @ moment i'm able display date in first row, seem display in 1 field id="date" @ time. field in each row this: <td><input id="date" name="date" /></td> so, i'm wondering: there way can display date in every input field id="date"? ids must unique on page. use class instead identify elements. the reason browsers maintain fast-lookup dictionary of id value vs element , there 1 entry per value available in dictionary. to use class <td><input class="date" name="date" /></td> and target $(".date").datepicker(); instead of $('#date').datepicker() jsfiddle: http://jsfiddle.net/trueblueaussie/d4agz/485/

android - How to detect single tap on TouchImageView in ViewPager? -

i made app in displaying images inside viewpager . using universal image loader. images loading fine, , can zoom in , out because have added touchimageview imageview . when single tap on screen want display buttons, such share , delete . not able detect single touch gestures. why? code viewpager public class imageviewpager extends activity { // declare variable int position; button delete, gimmy, done; viewpager viewpager; imagepageradapter pageradapter; touchimageview imageview; textview text; runnable r; handler mhandler; relativelayout rel; gesturedetector gesturedetector; @suppresslint("newapi") @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // set title viewpager setcontentview(r.layout.view_pager); mhandler=new handler(); delete=(button) fin

html - Make border width wider than element (not using padding) -

Image
screenshot of want achieve: (i covered logos , links) i have header contains 2 element : logos section , navigation bar. now trying create border-top nav element, 100% width of screen in given size. i can not use padding-left-right , avoid using markup. is achievable? using :before? <header> <div class="site-header"> stuff + full width border in middle! </div> <nav> <ul> <li>linka</li> <li>link b</li> </ul> </nav> </header> .site-header, nav { max-width: 500px; margin: 0 auto; } nav { border-top: 1px solid red; } fiddle: https://jsfiddle.net/oodrabm2/1/ your nav should outside header or need set width on site-header , ul not nav like: .site-header, nav ul { max-width: 500px; margin: 0 auto; } nav { border-top: 1px solid red; } <header> <div class="sit

ios - How to fix the issue “Command /bin/sh failed with exit code 1” in my shell script phase -

building ios app using xcode, trying run shell script obfuscate project code. got following error while doing that. warning: wipe not committed changes in repository press ctrl-c cancel or enter proceed. command /bin/sh failed exit code 1 how can fix problem? based on warning text, script awaits user input proceed. since xcode runs headless , there no user input ever, killed eventually looking @ script right: # in case echo "warning: wipe not commited changes in repository" echo "press ctrl-c cancel or enter proceed." read solution issue posted: either remove code (i would... script phase thats not imo) or fake input shell script (see input within shell script )

sql server - Autohotkey will prematurely end loop during execution -

i've written autohotkey script allows me run sql query @ cursor's current position in microsoft sql server management studio 2012. , works--most of time anyway. the implementation uses sort of delta movement determine when it's reached top of sql query block or top of window. selects downward until reaches bottom of window or bottom of block in same fashion. afterwards, presses f5 run script highlighted. here's script: $f5:: ; first check current line isn't blank (the cursor has on text) send, {home} hltext := selectnextchar() if hltext = `r`n { ; return current position send, {left} return } ; move cursor until gets top of text block ; first length future comparisons send, {end} send, {shift down}{home}{shift up} send, ^c stringlen, slctsize, clipboard ; begin checking lengths see if there still 'movement' loop { send, {shift down}{left}{home}{shift up}