Posts

Showing posts from January, 2014

crashlytics - iOS libobjc.A.dylib objc_release + 20 crash -

i have several production ios apps use fabric framework crashlytics , twitter integration. past few months i've been seeing low-level crash show in crashlytics, have been unable duplicate it. here stack trace , have go on: thread : crashed: com.apple.main-thread 0 libobjc.a.dylib 0x0000000194eec174 objc_release + 20 1 libobjc.a.dylib 0x0000000194eed724 (anonymous namespace)::autoreleasepoolpage::pop(void*) + 564 2 corefoundation 0x0000000183141074 _cfautoreleasepoolpop + 28 3 foundation 0x0000000184072588 -[nsautoreleasepool release] + 148 4 uikit 0x0000000187d443f4 -[uiapplication _run] + 588 5 uikit 0x0000000187d3ef40 uiapplicationmain + 1488 6 gt cfplus 0x000000010000e7ec main (main.m:16) 7 libdyld.dylib 0x000000019557ea08 start + 4 at point exc_bad_access kern_invalid_address @ 0x00000000e005bec8 message. ...

java - How to select options provided in a textbox using Selenium -

link: http://www.bbc.com/weather/ scenario: type "reading" on find forecast text box. shows 2 options. how select 1 option using selenium webdriver? i using following command type "reading" driver.findelement(by.id("locator-form-search")).sendkeys("reading"); use following locator click on first element (first suggestion displayed after typing): driver.findelement(by.cssselector("div[class='locator-suggestions locator-suggestions-default'] li:nth-child(1)")).click(); similarly can click on other element changing locator. example select second element: driver.findelement(by.cssselector("div[class='locator-suggestions locator-suggestions-default'] li:nth-child(2)")).click(); just add here, may need wait elements/suggestions (which you're trying select) visible, before trying click on those. use/search appropriate wait method testing. so, first need type "reading" in fi...

amazon web services - AWS API Gateway won't open up -

Image
i created "hello world" lambda function , deployed end-point using aws's api gateway : all basic settings sure change security "open" , while told take 15 minutes domain resolve found after 30 getting following response "open" end-point: {"message":"missing authentication token"} am missing obvious? shouldn't have been available did? note, pointed out image of put not get. tried both , both came errors. check i've run , put through postman , similar not identical response: and ... when test lambda function in console runs running in api gateway gives me different articulation of same error: tue sep 29 20:57:43 utc 2015 : execution failed due configuration error: invalid permissions on lambda function and yet used default permissions console suggested. lambda function basic , can found here: code i having exact problem today. whatever did didn't work figured out. turns out in ord...

r - Possible to cancel a command that is queued to run, but that has not yet run? -

i've got script take few hours longer run. meanwhile, open different r script work on else. forgot open new r console tab (i use rgedit), , accidentally did rm(list=ls()) second script. forget whether of relevant output long script saved, , want cancel commands in queue. there way this? here silly example illustrates point: >x = "something important" >sys.sleep(1000) rm(x) #oh no! don't want remove x! how stop before command runs??!?

keyboard - how to detect which UIViewObject is tapped in swift? -

i have uitextview in tableviewcell , trying save text. did textviewdidendediting save data. added gesture detect tap , hidekeyboard each tap. when user tap 1 textview other, keyboard gets closed , open again. don't like. thinking hidekeyboard if current tap not on textview. please me doing using swift. tapping outside close keyboard difficult. you try put gesture specific areas , not textfields, difficult because need set more geastures probably try find out if tap gesture located in view , if happens on textfield.... not cool throw away geasture. tableviews activate dismiss keyboard on drag. common behavior removing it. close keyboard when pressing return. delegate call textview function "textfieldshouldreturn" should call [textview resignfirstresponder]. or add custom keyboard accessory view has done button. on third case dont have fight , hack. feel free correct me :)

c# - System.Reflection.TargetInvocationException was unhandled in mscorlib.dll -

i'm trying read serial data dmm , think data gets corrupted sporadically. 95% of time can read data , display textbox fine once in while error: system.reflection.targetinvocationexception unhandled in mscorlib.dll. the innerexception is: message=input string not in correct format. i'm new windows wpf , c# programming think means data received wasn't terminated properly. here receive() code: private delegate void updateuitextdelegate(string text); private void recieve(object sender, system.io.ports.serialdatareceivedeventargs e) { // collecting characters received our 'buffer' (string). received_data = serial.readline(); dispatcher.invoke(dispatcherpriority.send, new updateuitextdelegate(writedata), received_data); } what's proper way handle corrupted data? update: here's writedata(): private void writedata(string text) { string mytextstripped; string avgtext; ...

activex - How to serialize DigitalPersona fingerprint template in Delphi -

i'm having big difficulty trying serialize digitalpersona fingerprint templates. don't know i'm doing wrong. i'm able deserialize template file saved demo exe distributed sdk , verify template without problems code in application procedure tfmain.button4click(sender: tobject); var blob: array [0 .. 1632] of byte; varblob: olevariant; myfile: file; p: pointer; teste: tdpfptemplate; begin // read binary data file. if opendialog1.execute begin assignfile(myfile, opendialog1.filename); reset(myfile, 1632); blockread(myfile, blob, 1); closefile(myfile); varblob := vararraycreate([0, length(blob) - 1], varbyte); p := vararraylock(varblob); try move(blob[0], p^, length(blob)); vararrayunlock(varblob); end; if not assigned(template) begin teste := tdpfptemplate.create(self); template := teste.defaultinterface; template.deserialize(varblob); end; end; but when try serialize te...

css - bootstrap grid not working -

Image
on picture right side of site. elements out bootstrap grid. <div class="container"> <div class="col-md-12"> <div class="row"> <a href="#" class="logo">first</a> <nav class="main_menu clearfix"> <button class="main_menu_button hidden-md hidden-lg"><i class="fa fa-bars"></i></button> <ul> <li class="active"><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> </ul> </nav> </div> </div> </div> why element nav can out bootstrap grid? main part gray ...

Xcode 7 - How to remove ld: warning: -read_only_relocs cannot be used with x86_64 -

i have updated xcode 7 , receive following warning when compile: ld: warning: -read_only_relocs cannot used x86_64 i don't think changed in build settings or code create this. know causing warning , how remove it? i have found problem interested. mentioned in comment, i'm using twilio api , if install via cocoapods adds -read_only_relocs flag other linker flags in xcode (found under build settings). not generate warning above (on simulator) wont compile on actual device because can't have both bitcode = yes , flag. if want compile, need set enable bitcode no in build options.

spring - create an instance of DataSource and use inside constructor -

in current spring-boot project, have class: @component public class oauthtokenstore extends jdbctokenstore { public oauthtokenstore() { super(...); } } the atribute super(...) should valid datasource. have configuration in application.properties : # jdbc.x spring.datasource.driverclassname=com.mysql.jdbc.driver spring.datasource.url=jdbc:mysql://localhost/lojacms spring.datasource.username=root spring.datasource.password= # hibernate.x spring.jpa.database-platform=org.hibernate.dialect.mysql5dialect spring.jpa.dialect=org.hibernate.dialect.mysql5dialect spring.jpa.show-sql=false spring.jpa.hibernate.ddl-auto=validate is there way create instance of datasource , use in constructor? you need inject datasource bean can pass oauthtokenstore constructor using @inject . @component public class oauthtokenstore extends jdbctokenstore { @inject public oauthtokenstore(datasource ds) { super(ds); } } if don't yet have bean of type datasource de...

Three.js buffergeometry disappears after moving camera to close -

my buffergeometry disappears after moving camera close. can see in drawcalls three.js example has trackballcontrols . in case it's alot worser. points disappear @ distance 0 400 , lines disappear @ distance 0 100. objects working fine simple geometry not buffergeometry. found out has centroid of buffergeometry. tryed use different camera's, change camera range , still doesn't work. how can stop objects disappear after moving camera? update got working adding linesmesh.frustumculled = false; , removing geometry.computeboundingsphere(); . help. three.js thinks object outside frustum. add linesmesh.frustumculled = false; and should stop disappearing

regex - split string in one liner in bash or ksh or perl -

var="valuea valueb" i want split above string shown below , want read value in 1 liner on bash shell. following script not working . echo $var |awk '{print $1 $2}' |while read var; echo var1=$1 , var2=$2;done echo $var |awk '{ var1=$1 ; var2=$2}' |while read var1 var2; echo var1=$var1 , var2=$var2;done in ksh93, work of shelf: echo "$var" | read var1 var2 && echo $var1 --- $var2 effectively same https://stackoverflow.com/a/32855720/667820 , values of $var1 , $var2 preserved. for bash, need bash 4.x , options need (un)set.

javascript - Jquery mobile clear touch screen "touched" button focus, active, hover -

trying figure out how reset button "untouched" state. using button as: <div id="service-control-buttons" data-role="controlgroup" data-type="horizontal"> <a href="#" id="service-previous" data-role="button" data-icon="arrow-l">prev</a> <a href="#" id="service-next" data-role="button" data-icon="arrow-r" data-iconpos="right">next</a> </div> when tap (on ipad) next or prev runs javascript function wrote , button remains permanently active, hovered or focused (not sure state). my goal: after javascript function runs, want reset button un-active, un-hovered or un-focused state. of course, doesn't happen on non-touch screen mouse click. i've tried: $(another-selecter).focus(); $(another-selecter).click(); $('#service-next').blur(); also $('#service-next').css(...

bash - How to use a linux expect script to reconnect to forticlientvpn -

i have code connects network external vpn, connection lost. need code detect error , try connect again. set force_conservative 0 if {$force_conservative} { set send_slow {1 .1} proc send {ignore arg} { sleep .1 exp_send -s -- $arg } } set timeout -1 spawn $env(shell) match_max 100000 proc tryconnection {} { send -- "./forticlientsslvpn_cli --server server:port --vpnuser user" expect -exact "./forticlientsslvpn_cli --server server:port --vpnuser user" send -- "\r" expect -exact "\r\npassword vpn:" send -- "password\r" expect -exact "\r\nstatus::setting tunnel\r\nstatus::connecting...\r" send -- "y\r" expect -exact "\r\nsslvpn down unexpectedly error:6\r" { puts "send ctrl+c" send \003 tryconnection } expect eof } tryconnection i remove -...

excel - Add a new row with data -

how can add new row excel sheet using macro data, i've search , find add new 'blank' row, , that's not need i want when execute macro, create row content in cells, like: cell 1 | cell 2 | cell 3 | userid username user last name the information hardcoded formulas or simple hardcoded data want every time macro runs rows created information. say want insert data @ row i. can this: myworksheet.rows(i).insert myworksheet.range("a" & i).value = userid myworksheet.range("b" & i).value = username myworksheet.range("c" & i).value = userlastname ' etc... if want have new row copy of row above (usually useful when wanting repeat formulas), can this: myworksheet.rows(i).insert myworksheet.rows(i-1).copy myworksheet.rows(i)

javascript - Submitting array of textfields using FormData() through ajax -

i have array of input text <input type="text" name="highlight" value="1"/> <input type="text" name="highlight" value="2"/> i used ajax , formdata() submit server. var form = $(this); var formdata = new formdata(form[0]); var target = form.attr('action'); $.ajax({ url: target, type: 'post', data: formdata, processdata: false, contenttype: false, }) .done(function(data){ console.log(data.message); }); **expected server result:**highlight=['1','2'] **actual server result:**highlight=2 im using nodejs server you need add brackets input name attributes highlight[] . way browser knows part of same array , won't overwrite 1 other. <input type="text" name="highlight[]" value="1"/> <input type="text" name="highlight[]" value="2"/>

xcode - UnrealEngiine4 First Programming QuickStart try and unexpected (?) results -

going through unrealengiine4 programming quickstart and i'm using osx 10.10.5. , xcode version 7.0 (7a220) , ue4.9.1 when create class, , add code in xcode, compile. i bunch of warnings - should care? they are; in quickstart.xcodeproj: ! update recommended settings: 1 target 'ue4cmdlinerun' - adopt "product bundle identifier" build setting 2 target 'ue4game - ios' - adopt "product bundle identifier" build setting 3 target 'quickstart - ios' - adopt "product bundle identifier" build setting these 3 want change info.plist cfbundleidentifier key each 4 project 'quickstart' - turn on "build active architecture only" when debugging 5 project 'quickstart' - turn on "enable testability" when debugging then: warning: --resource-rules has been deprecated in mac os x >= 10.10! , others that then, looking @ project document itself, xcode says it's using xcode 3.2-compatible se...

delphi - How to test MAPI Send Email errors -

we have program written in delphi can send emails via simple mapi people use mapi outlook installed 95% of time works fine but 5% of people doesn't work there anyway test mapi looking can find if there issue our program or if hardware guy needs fix. would if microsoft tool or official if go clients hardware/it guy , test trust results of test some errors have come across include api-ms-win-crt-runtime-l1-1-0.dll missing computer. try reinstalling program fix problem. access violation 1 contact in outlook address book - happened when calling mapiresolvename (no solution found - client didnt want reinstall outlook) mapi error 26 office build version 1703 - first email goes through ok fail after that. (you can make work around using mapilogon , pass session handle through in mapisendmail call) either there no default mail client or current mail client cannot fulfill messaging request

c++ - Using Semaphores in Visual Studio -

i'm trying use semaphores in visual studio project. however, i error c1083: cannnot open include file: 'pthread.h': no such file or directory is there way can download semaphores? i've tried including pthread directory , same error sounds trying compile *nix code on windows. not impossible, visual studio won't help. pthreads come posix standard, , windows not support posix particularly well. efforts have been made port posix windows, cygwin being successful, , others have tried implement can in add-on libraries gcc family of compilers. visual studio primary supports microsoft way of doing things. makes sense, that's bread , butter. posix support minimal. may have ported pthreads visual studio, cannot recommend any. so, can either port pthread-using program or library use win32 equivalents or select different compiler toolkit wraps pthreads. may or may not trivial without looking @ code need ported. mingw compile program or library , ca...

Haskell: How to convert a list to a list where each element is a tuple of its location in the list and the original data? -

this question has answer here: numeration count inside recursive function 3 answers i need convert list list each element tuple of location in list , original data.such [a,b,c,d] -> [(1,a),(2,b),(3,c),(4,d)] the easiest method can conceive of using zip function. takes 2 lists arguments , returns list of tuples. pair range [1..] , have desire: zip [1..] [a,b,c,d] will return [(1,a),(2,b),(3,c),(4,d)]

how to use jdbc in Spring Bean XML "org.apache.tomcat.dbcp.dbcp.BasicDataSource" is having error -

my error in class not know org.apache.tomcat.dbcp.basicdatasource <bean id="datasource" class="org.apache.tomcat.dbcp.dbcp.basicdatasource"> <property name="driverclassname" value="oracle.jdbc.driver.oracledriver" /> <property name="url" value="jdbc:oracle:thin:@192.168.0.100:1521:xe" /> <property name="username" value="gjhgsdaugfjh" /> <property name="password" value="asdfkasgdu" /> </bean>

ios - What is the image size of a native/unedited iPhone 6S / 6S Plus photo? -

the iphone 6s , 6s plus have brand new ~12mp cameras. i'm trying balance photo image quality in ios app processing power of new devices, , such, need know maximum image size in pixels. what image size in pixels of photo taken either of these devices? from iphone 6s plus, resolution of photo taken camera 4032x3024 , , front camera 2576x1932 .

Explanation of sizeof() with various data types in C++ -

additional question (1 point): assume using 32-bit windows operating systems , c/c++ programs. please estimate sizeof() follows (unit: byte) • char str[] = “hello” ; • char *p = str ; • int n = 10; please calculate: • sizeof ( str ) = __________ • sizeof ( p ) = __________ • sizeof ( n ) = __________ hello all, i trying wrap mind around fundamental concept in c++. tell think correct answers see if on right track. first one, sizeof(str), believe 6 bytes total. noticed pattern other problems there 1 byte added these types of strings. (5 letters +1). question is, "+1" from? second 1 down, referring size of pointer,p, correct? 4 bytes in size? finally, third one, believe referring size of int, n. know ints of size 4 bytes correct? mean ints 4 bytes regardless if 10 or 10000, or other number. other important info on topic appreciated , accepted open arms! thanks! char str[] = "hello" ; is equivalent to: char str[] = {'h', 'e', ...

java - Export MySQL Server database to file -

i have put java ee projects google drive can access them on laptop , desktop computer. of projects have database component have database stored in mysql server. there way can export database , access database file can store in project file can use on both laptop , desktop computer? this like: -be able work on java ee projects have database on both computers -store mysql server databases in file can go in project folder use java access database instead of going through server any alternate ways of doing me out 1 way can think of doing. note: using laptop on go desktop computer wont accessible laptop neither have active internet connection always. thanks install mysql on laptop, transfer database using backup/restore, e.g. using mysqldump. see https://dev.mysql.com/doc/refman/5.0/en/backup-and-recovery.html

swift - SKSpriteNode won't position after didBeginContact -

i'm working collision detection spritekit , swift. have skscene responds collision didbegincontact function: func didbegincontact(contact: skphysicscontact) { if (contact.bodya.categorybitmask == collidertype.food && contact.bodyb.categorybitmask == collidertype.head) { placefoodinrandomgridlocation() } } func placefoodinrandomgridlocation() { let randomx = arc4random_uniform(uint32(mygrid.columncount)) let randomy = arc4random_uniform(uint32(mygrid.rowcount)) foodspriteholder.position = cgpoint(x: collines[int(randomx)], y: rowlines[int(randomy)]) } the problem can adjust position of foodspriteholder before didbegincontact function fires. not move foodspriteholder when placefoodinrandomgridlocation called. it seems scope issue. i'm not sure how isolate why position won't update. can make foodspriteholder visibility hidden in flow...so, know can access it. for reference here how physics body setup food class item withi...

Install Laravel on GIT as well as LOCALHOST also on my PC -

hii need install laravel on localhost on git repository . as new laravel , git both, unable start. i working on linux , intsalled git through terminal. now next,i unable proceed. thanks you should first install laravel. can follow these steps , easiest way imo install homestead . 2 methods easy enough, should try it. then read documentation about git , how init or clone repository , update question if unclear. hope help!

youtube - You Tube Iframe API quota -

is there limit of youtube video in iframe api ? example : daily 1000 times etc? there no youtube iframe quota. api doesn't require api key , no mention of limit on it's documentation or developer console

java - Performing Recursion inside For loop -

Image
i trying understand code of writing permutations given input string. for example: input string:123,output:123,132,213,231,312,321. below pasted code snippet that. public static void main(string args[]) { permutestring("", "123"); } public static void permutestring(string beginningstring, string endingstring) { if (endingstring.length() <= 1) system.out.println(beginningstring + endingstring); else (int = 0; < endingstring.length(); i++) { try { // system.out.println(i); string newstring = endingstring.substring(0, i) + endingstring.substring(i + 1); permutestring(beginningstring + endingstring.charat(i), newstring); } catch (stringindexoutofboundsexception exception) { exception.printstacktrace(); } } i getting confused when integer 'i' gets incremented in loop i.e i=0 1. 1 thing understood first...

ios - Get color hex from colorWithHue -

i can color hex rgb. now, there way color hex colorwithhue ? return [uicolor colorwithhue:180.0f / 360.0f saturation:0.02f brightness:0.85f alpha:0.8f]; the following link job showing how to! has several code snippets! :-) can use calculator on same website check if calculations correct! the link

python - Numbering Items in Scrapy -

so have items.py following: class scrapyitem(scrapy.item): source = scrapy.field() link = scrapy.field() and json output is: [{"source": "some source", "link":"www.somelink.com"}, {"source": "some source again", "link":"www.somelink.org"}] is there way change output to: [{"source1": "some source", "link1":"www.somelink.com"}, {"source2": "some source again", "link2":"www.somelink.org"}] from docs, saw can manipulate item values, can same items themselves? edit here's new code i'm using output article_id item_field article_id = [1] def parse_common(self, response): feed = feedparser.parse(response.body) entry_n, entry in enumerate(feed.entries, start=article_id[-1]): try: item = newsbyteitem() item['source'] = response.url item[...

javascript - React hangs with _dereq_ -

i having problem makes page hang , can see in firebug following line of react selected: _dereq_- [1]<()react-0.13.3.js (line 20) _dereq_ = object { type="object"} module = object { type="object"} exports = object { type="object"} 'use strict'; var eventpluginutils = _dereq_(19); any idea or recommendation on case? conflict firebug - removed firebug

Couchbase Sync Gateway - limit on number of channels? -

does make sense define channel per 1-4 documents? the use case trying solve synching user's accounts between different devices of same user: example lets have 1 million docs (accounts) in bucket, defining 400k channels, channel each user. in example have 400k users each 2.5 accounts in average. does sound right case sync gateway? as per cb documentation roles : roles named collections of channels. user account can assigned 0 or more roles. user inherits channel access of roles belongs to. unix groups, except roles not form hierarchy. that hint me approach should amended , should design channels roles in mind. result you'll have less channels. work out roles like: usergroupa, usergroupb, etc. in humble opinion, approach sounds bit "unscalable" since if number of users grows channels number.

python - Odoo: How to override original function -

in odoo, quantities of product calculated each time products form opened. happens in model product.product ==> function _product_available. this function returns dictionary called res. example: res = {8: {'qty_available': 5000.0, 'outgoing_qty': 1778.5, 'virtual_available': 3221.5, 'incoming_qty': 0.0}} now want modify values. i've managed coding directly in original function _product_available. since not correct way this, want in inheritted model. think need override function? or overwrite? not sure it's called. everything read doing quite vague me. can't find information or examples. i'm struggling fact original function written in old style (osv) while i'm using new style (models). from pieces of information collected on internet wrote (which doesn't work). class product_product_inherit(models.model): _inherit = 'product.product' #api.v7 because of old style? tried .multi , .model... ...

lcm - Perl - least common multiple -

this code should lcm n numbers. i tried put prints wherever can in order see mistake. , think in: if($vec[0] == $vec[$n-1]){ $resultado = $vec[0]; last; } but can not make work. please me? i'm rookie perl. hope can solve problem. tried change variables not work. mean $u = 0 , $w = $n-1; full code to lcm, can split task multiple subroutines: is_prime # returns true if value prime roots # returns roots of number (all prime numbers make value. ex: roots of 12 are: 2, 2, 3) lcm # takes list of values. extract roots while number not prime. store in hash , increment everytime see root so we'll have hash like: %sub_total = ( value => times_found, 2 => 2, 3 => 1, ); we have hash total. if sub_total hash has key used more in total hash, add total. finally, loop through total hash , and find product using algorithm: for (%total){ $prod *= $_ ** $total {$_}; } note i'll shortly attach code wrote getting lcm. i...

javascript - How to Set Zoom of Map to cover all markers visible Markers? -

i have created map markers fetching latlongs data mongodb collection.i have set center particular location , zoom level 5 want map should zoom-in or zoom-out based on marker's location.so dont have give particular location in center. please help. the code below - <div class="page-content"> <div id="tab-general"> <div id="map" style="height: 500px; width: 100%;"> </div> </div> </div> <script type="text/javascript"> //load data mongo data= <%-json.stringify(data)%> </script> <script type="text/javascript"> var latlngs = []; (j=0;j<data.length;j++){ latlngs[j] = [data[j].latitude, data[j].longitude, data[j].time, data[j].name]; } var map = new google.maps.map(document.getelementbyid('map'), { center: new google.maps.latlng(23.2500, 77.4170), zoom: 5, maptypeid: ...

ios9 - UIWebView not loading data sometime in iOS 9 -

uiwebview not loading (mobile web page) sometime in ios 9. used ats bypass using nsallowsarbitraryloads .the issues not happening , works in ios 7 , 8. delegate method webviewdidstartload invoked webviewdidfinishload , didfailloadwitherror not getting called @ all. found solution.all need remove uiwebview in ios 9 , use wkwebview .my webpage had third party calls twitter,instagram etc https.also getting auth challenge in webpage..! (even disabled ats) .i found using wkwebview,which has delegate handle auth challenge. set below delegate auth challenge , handle it. - (void)webview:(wkwebview *)webview didreceiveauthenticationchallenge:(nsurlauthenticationchallenge *)challenge completionhandler:(void (^)(nsurlsessionauthchallengedisposition disposition, nsurlcredential *credential))completionhandler { sectrustref servertrust = challenge.protectionspace.servertrust; cfdataref exceptions = sectrustcopyexceptions(servertrust); sectrustsetexceptions(servert...

java - How to deserialize json string into object -

{ "locallocationid [id=1]":{ "type":"folderlocation", "id":{ "type":"locallocationid", "id":1 }, "parentid":{ "type":"locallocationid", "id":0 }, "name":"test", "accessibletouser":true, "defaultlocation":false, "timezoneid":"asia/calcutta", "children":[] }, "locallocationid [id=0]":{ "type":"folderlocation", "id":{ "type":"locallocationid", "id":0 }, "parentid":null, "name":"locations", "accessibletouser":false, "defaultlocation":false, "timezoneid":"asia/calcutta", "children":[{ ...

Cannot access uielements inside (within) UITableView by using Appium -

Image
i've being trying access uielements (labels) located within uitableviewcell located in uitableview. (see picture below) i set setisaccessibilityelement:yes , setaccessibilitylabel to each required label can access no issues. i'm adding accessibility cell , still can access each label in addition cell well i'm adding accessibility table point appium cannot recognise/inspect cell , labels , table ... the thing , ios accessibility inspector (runs ios simulator) able recognise table / cell / labels any idea need in sourcecode of app in order make work appium ? thanks found on http://appium.io/slate/en/v/?javascript#finding-and-interacting-with-elements there’s known issue table cell elements becoming invalidated before there’s time interact them. we’re working on fix however, did find if .click() on uitableview element picked row in center of screen. not sure if that's helpful in testing.

Java: inner test class compilation error - printing all cases of switch block -

edit: had been syntax issue - had been complete noob @ time of posting this, , had not been using proper ide, apologies community. also, please try avoid assuming on site guy. i'm wrestling inner class datetest . error message appears after compiling, , haven't been able figure out how fix bug. i've gone through many lines of code work out test class in trying effort print out twelve cases of switch block in date class. below i've included errors , code. might worth mentioning i'm writing in online ide, browxy, , double checking in codechef. this code: public class date { public static int daysinmonth(int month) { /** method uses switch block , takes in month number (1 january, 2 february, etc.) , returns number of days in month. **/ switch (month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: return 3...

c# - How to preserve System.Threading.Timer when function is call again -

i doing simple system.threading.timer testing because want use in window services . problem facing when call again function timer , existing running time gone , how preserve ? class file : - namespace worker { public class processingwork { public void testtimer() { datatable workcheck = getnewwork(); // new work database if there foreach (datarow dr in workcheck.rows) { if (dr["isnew"] == "true") { timer jobtimer = new timer(timer => { try { console.writeline("id " + convert.toint32(dr["workid"]).tostring()); int workid = convert.toint32(dr["workid"]); if (workid != 0) { console.writeline(datetime.now + " | running " + workid); ...

json - Nested API calls PHP -

i make api call return list of items. use foreach loop iterate json data: foreach($decoded_results['items'] $item) { $image_link = $item['thumb']; $link_url = $item['url']; $subject = $item['title']; } i need additional information each item , in order need call endpoint. in first response every item in json object has property id corresponds property same id in other json object, response when call second endpoint. id needed parameter in query string second api call. what best approach accomplish this? i've looked curl_multi little bit not sure if suitable situation. the best solution if second api has endpoint accepts list of ids , can return information need in 1 call, otherwise known the n+1 problem in database management, same here , not optimal solution.

linux - CMake save stripped debug information -

it's usual practice compile debug symbols , separate binary using objcopy release executable , file debug information (then wrap separate packages or store on symbol server). how separate debug symbols in cmake? i've seen discussions , incomplete code samples. platform linux , gcc. cmake doesn't have direct support this, can use post_build , install steps achieve result want. is, however, worth noting using objcopy isn't way sort of thing. can make use of build-id , may easier implement robustly cmake. rather repeat whole thing here, there's pretty description of choices , methods posted cmake mailing list few years ago michael hertling. i'll pick out working alternative here reference, recommend reading link. there's more complete discussion of 2 alternatives in gdb documentation should fill in remaining blanks 2 approaches (debug link versus build-id). here's michael's general build-id approach (the build-id explicitly given ...

bdd - Python Behave sharing data between features -

i'm starting python behave want make api testing thing. stumbled upon may not valid question is: can share data between features? store in db or files maybe there 'builtin'? or invalid , shouldn't share data that, or maybe it's possible inside feature? in practice looks like: i have make request endpoint, in response number required make request that's needed tested. yes, can, , trivial. in same directory have feature files can create file named environment.py . in it, can put: def before_all(context): context.db = whatever the before_all hook run before tests , whatever set there available features. use this, instance, create new selenium instance used tests in test suite. context.db above database connection. kind of sharing fine. what share should read-only or resettable known state between tests. not practice share writable resources between tests. makes hard figure out went wrong when test fails , makes tests dependent on eac...

javascript - AngularJS - Curly brackets not working consistently -

i'm developing spa using angularjs (and bootstrap) , there several controllers, each specific page , function. since site must support language, labels retrieved db upon language selection, , added $rootscope (i.e. $rootscope.labels). works when used like: <h2>{{labels.title}}:</h2> now, there page when additional data constructed , added $rootscope presentation, $rootscope.page_a_values. when running in debug mode (chrome) , both printing console contents of $rootscope.page_a_values, defined string there expected. within html of page included like: <h2>{{labels.this_page_title}}: {{page_a_values.actual_title}}</h2> getting: title: ("title" value of "labels.this_page_title") meaning, "page_a_values.actual_title" replaced nothing (i guess replacement takes place because curly brackets not shown). needless say, tried {{$rootscope.page_a_values.actual_title}} , didn't work either. any suggestion hi...

sql - Numeric IDs vs. String IDs -

i'm using stripped down example here please ask if need more context. i'm in process of restructuring/normalising database id fields in majority of tables have primary key fields auto-incremented numerical id's (1,2,3 etc.) , i'm thinking need change id field numerical value string value generated data in row. my reasoning follows: i have 5 tables; staff, members, volunteers, interns , students; of these have numeric id's. i have table called buildingattendance logs when people visited premises , reason has following relevant fields: id type premises attended to differentiate between staff , members. use type field, using mem member , sta staff, etc. example: id type premises attended 1 mem building 27/6/15 1 sta building 27/6/15 2 stu building b 27/6/15 i'm thinking might better design design use id similar following: id premises attended mem1 building 27/6/15 sta1 ...

javascript - How to stop the repeat of the jQuery functions mouseenter() and mouseleave()? -

problem: when hover mouse on div block, ul list items displayed fadein, , when distract mouse div block, ul list items fadeing out, , when same action fast 5,6,7 or more times , when nothing mouse, functions mouseenter() , mouseleave() repeating because of fadeing duration. want example if function mouseenter() has started, other function mouseleave() not start if user has mouse distracted div block, mouseleave() function must wait until mouseenter() function has finished job, , mouseleave() function can start, , on.. how can it? demo: https://jsfiddle.net/qcvl1xjg/ html: <div class="block"></div> <ul class="responser"> <li>home</li> <li>product</li> <li>about</li> </ul> css: .block { width: 100px; height: 100px; background-color: red; } jquery: $(document).ready(function() { $('.responser').hide(); $(".block").mouseenter(function() { ...

routes - Rails : add namespace to resource -

i have in routes.rb : namespace :api namespace :v1 namespace :me # ... resources :offers resources :state, only: %i(index) end end end end this gives me route : get v1/me/offers/:offer_id/state(.:format) api/v1/me/state#index but route have 1 : get v1/me/offers/:offer_id/state(.:format) api/v1/me/offers/state#index simply put, want able place state_controller.rb in offers folder, without changing path access it. how can achieve ? you should define controller resources explicitly: resources :state, controller: 'offers/state' this route requests app/controllers/api/v1/me/offers/state_controller.rb .

ubuntu - What to do if Drupal seems not to connect with outside? -

today, out of blue, drupal 7 website began show message: unable connect recaptcha server (www.google.com): 110: connection timed out in log error, found out gives error sending confirmation mail new accounts , i'm not able anymore long term access token facebook facebook wall module. seems drupal can't connect outside world... clue, don't see, going on? the ubuntu server of site , running, site reachable. in case, connection failed problem ipv6. reason reachable slowly. did telnet google.it 80 and found out reply 1) trying 2a00:1450:4007:80e::2003... 2) trying 216.58.208.227... 3) connected google.it. 4) escape character '^]'. took 1 minute pass line 1 line 2. disabled ipv6 on box adding these lines /etc/sysctl.conf net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 and restart sysctl sudo sysctl -p and problems gone.

html - Responsive image mapping does not work to scaled images -

i use picturefill.js responsive image feature. when place original image without specifying height , width, image shown in <picture> tag , pull different size of same images according screen size. but when specify height , width, responsive feature not work. image loaded <img> tag. here link the documentation of library explains should manage image size using sizes tag: <img sizes="(min-width: 40em) 80vw, 100vw" srcset="examples/images/medium.jpg 375w, examples/images/large.jpg 480w, examples/images/extralarge.jpg 768w" alt="…"> by defining style width , height forcing image keep aspect. from site: the sizes syntax used define spaces image occupy in layout. srcset defines list of images , inherent widths. allows browser choose smallest appropriate source size available in part of layout, rather viewport size alone.

javascript - If text box value matches then make that specific label text to yes else no -

iam trying check if text of label matches text box if matches make specific label text yes else no in code not sure wrong not happening showing "no" self demo html <input class="master" value="1"> <label class="user_label" >1</label> <label class="user_label" >0</label> <label class="user_label" >1</label> js: $(function() { var master = $('input.master').get(0).value; // master value var fn = function() { return this.text === master ? "yes" : "noo";//if current text-box matches master,then yes else no }; $('label.user_label').text(fn); // loop , replace text each user input }); this.text undefined inside fn , because this dom node, , doesn't have text property. you can wrap jquery object , use text() method: var fn = function() { return $(this).text() === m...

handlebars.js - Packaging a Handlebars-based widget: javascript and html -

i'm relatively new this, please excuse if i'm missing obvious point... i'd create reusable widget using handlebars, simplicity let's consider users table: <script type="text/x-handlebars-template" id="temp1"> <table> {{#users}} <tr><td>{{name}}</td><td>{{email}}</td></tr> {{/users}} </table> </script> <script> var template=handlebars.compile($("#temp1").html()); function renderuserstable(users, divid){ $("#"+divid).html(template(users:users)); } <script> this works, got work template script (text/x-handlebars-template) embedded business page . that's not reusable: if need on page, i'll need copy-paste. considered quoting template javascript string variable, that's ugly since real html pretty large. are there better practices, allow separate handlebars template dedicate...

How to send broadcast when Android service goes down? -

i issue broadcast when service goes down. callback guaranteed run when happens? want other apps know down, cannot take chance goes down , no 1 knows it. @ point in service lifecycle (which method) should issue sendbroadcast(imgoingdown)? example, how ondestroy() called? while answers here aiding in ondestroy approach, there many events on service being destroyed cannot intervene. instance, if user has force closed application, service destroyed, ondestroy not executed. on common scenario, service destroyed when has ran out of operations (mostly know finished), when no other process bound service, or when stopself() is executed, , common, when device running low on ram. ondestroy scenario can restart it. as suggestion, if device has killed process due low ram, dont restart right away. set handler or alarmmanager start bit later (so lack of memmomry dont execute in again.)

php - Yii2 : Vote for a Post in AJAX or Pjax -

i'm begginer in yii2 framework. i work on forum : in forum/posts method, there list of posts topic. each post have score want , down in ajax. in view posts.php , open pjax block : <?php pjax::begin(); ?> votes : <?= $val['score'] ?> <?= html::a('+', ['/post/voteup','id'=>$val['id']]) ?> <?= html::a('-', ['/post/votedown','id'=>$val['id']]) ?> <?php pjax::end(); ?> in postcontroller : public function actionvoteup($id){ //update request $postrepo=new postrepository(); $postrepo->vote('plus', "id=$id"); $post=$postrepo->getall("id=$id"); return $this->renderajax('vote', ['id'=>$id, 'score'=>$post[0]['score']]); } you can see return vote.php view in ajax, same code pjax. <?php pjax::begin(); ?> votes : <?= $score ?> <?= h...

c# - Copy only selected rows without not-selected rows between in RowHeaderSelect mode -

i'm looking possibility in c# in windows forms application able to: select multiple, full rows @ time. include unselected rows between selected ones. then copy them clipboard without empty spaces (which left unselected rows). the datagridviewselectionmode.fullrowselect doesn't cut need able select independent cells. need enable same behaviour in row copying datagridviewselectionmode.fullrowselect has datagridviewselectionmode.rowheaderselect mode. possible do? thanks in advanced. first, manually removing empty lines default copy results. call following method so: private void stripemptyfromcopy() { string[] separated = clipboard.gettext().split('\n').where(s => !string.isnullorwhitespace(s)).toarray(); string copy = string.join("\n", separated); if (!string.isnullorempty(copy)) { clipboard.settext(copy); } } solutions , cons my initial thought handling datagridview.keyup event, checking user inp...

PHP Populating a multi-dimensional array -

i trying make array in type of format array ( [name] => 'nick' [email] => 'nick@email.com' [groups] => array ( [0] => 'group1' [1] => 'group2' [2] => 'group3' ) ) name , email contain 1 value. groups contain multiple values (different people). so in loop defined so foreach($result $info) { } now $info variable contains lot of data, lots of users. name , email of each user, can do $name = $info["name"][0]; $email = $info["email"][0]; i can start building array attempting make $userdata = array( "name" => $name, "email" => $email ); to groups, need do foreach($info["group"] $group) { print_r($group["name"]); } my code @ moment looks following $userdata = array(); foreach($result $info) { $name = $info["disname"][0]; $email = $info["email"][0]; $us...

WooCommerce orders change page in URL with Python OAuth HTTP request -

i fetch orders woocommerce request using oauth client from: python oauth woocommerce . my code looks this: import time hashlib import sha1 import hmac import binascii urllib import quote, urlencode import httplib2 collections import ordereddict import json def key_compare(a, b): return cmp(a[0], b[0]) class restful_client(object): """docstring restful_client""" def __init__(self, endpoint, consumer_key, consumer_secret): super(restful_client, self).__init__() self.consumer_key = consumer_key self.consumer_secret = consumer_secret self.endpoint = endpoint def make_request(self, resource, params, method='get' ): oauth_params = { 'oauth_consumer_key': self.consumer_key, 'oauth_nonce': self.gen_nonce(), 'oauth_timestamp': self.gen_timestamp(), 'oauth_signature_method': 'hmac-sha1', # ...

Calculate the year quarter difference in java -

i have use case , have provide input start quarter , end quarter 2 input string. example provide 201501(start quarter) , 201602(end quarter) 2 quarter input. method give output in map previous start quarter , end quarter following previous start quarter 201303 previous end quarter 201404 ie first quarter difference between 2 time period calculated. previous last quarter 1 quarter previous input start quarter , quarter difference between 2 input derived , subtracted previous last quarter previous start quarter. public static map<string,string> getpreviousquarter( string start,string end){ string prevstartquarter= calulatepreviousquarter(start); string prevendquarter=calulatepreviousquarter(end); map<string,string> returnmap = new hashmap<string,string>(); returnmap.put("previousstartquarter", prevstartquarter); returnmap.put("previousendquarter",prevendquarter); system.out.println("the reurnmap is" +ret...

mysql - Java JTable Listener onChange -

i have data on mysql server , loaded jtable using code below: try{ st= conn.createstatement(); st.executequery(q); resultset rs = st.executequery(q); borrowers_list.setmodel(dbutils.resultsettotablemodel(rs)); } catch(sqlexception ex){ joptionpane.showmessagedialog(null,ex); } my data table has boolean, , want display in jtable checkbox. code works table listener not. want have event everytime there's changes in checkbox. used code below doesn't work.. borrowers_list = new jtable(){ @override public class getcolumnclass(int column){ (int row = 0; row < getrowcount(); row++) { object o = getvalueat(row, column); if (o != null) { return o.getclass(); } } return object.class; } }; borrowers_list.getmodel().addtablemodellistener(new tablemodellistener() { public void tablechanged(tablemodelevent e) { // even...