Posts

Showing posts from April, 2013

java - ksoap2 - Same method works wih AsyncTask but no when using inside normal activity -

i'm developing app , has funcionality can used user in 2 different ways: task in real time, he/she have wait till task finishes; or task in background he/she can other things in meanwhile. i've developed task in background asynctask , works, don't know why i'm getting , error when try call same method inside normal activity. this method uses ksoap2, value of param i'm testing " http://www.google.com " public string sendurl(string url) { log.i("url", url); //create request soapobject request = new soapobject(namespace, method_name); request.addproperty("url", url); //create envelope soapserializationenvelope envelope = new soapserializationenvelope(soapenvelope.ver11); envelope.dotnet = false; envelope.implicittypes = true; envelope.setaddadornments(false); envelope.setoutputsoapobject(request); //create http call object httptransportse androidhttptransport = new httptransportse

ssl - Generate CSR that is connected with 2 domains -

i'm using plesk, how csr 2 domains @ same time? if want generate certificate signing request (csr) domains, depends on type of ssl certificate use. if each domain have separate ssl certificate, need generate 1 csr each domain. if using "let's encrypt" plesk extension, should read documentation on how use it.

ios - Catch/guard crash earlier for [SCNSpriteKitEventHandler touchesCancelled:withEvent:]? -

can me identify why app crashing or how can better catch crash earlier know line of code causing it? this crash log crashlytics: #0 crashed: com.apple.main-thread exc_bad_access kern_invalid_address 0x0000000000000010 crashed: com.apple.main-thread 0 libobjc.a.dylib 0x188ecef70 objc_msgsend + 16 1 scenekit 0x19a486324 -[scnspritekiteventhandler touchescancelled:withevent:] + 528 2 scenekit 0x19a5666c8 -[scnview touchescancelled:withevent:] + 60 3 uikit 0x1904cde04 __98-[uiapplication _cancelviewprocessingoftouches:withevent:sendingtouchescancelledtoviewsoftouches:]_block_invoke + 552 4 uikit 0x1903c4b44 -[uiapplication _canceltouches:withevent:includinggestures:notificationblock:] + 908 5 uikit 0x1904cdb84 -[uiapplication _cancelviewprocessingoftouches:withevent:sendingtouchescancelledtoviewsoftouches:] + 172 6 uikit

c++ - Deprecated header <codecvt> replacement -

a bit of foreground: task required converting utf-8 xml file utf-16 (with proper header, of course). , searched usual ways of converting utf-8 utf-16, , found out should use templates <codecvt> . but when deprecated , wonder new common way of doing same task? (don't mind using boost @ all, other prefer stay close standard library possible.) std::codecvt template <locale> isn't deprecated. utf-8 utf-16, there still std::codecvt<char16_t, char, std::mbstate_t> specialization. however, since std::wstring_convert , std::wbuffer_convert deprecated along standard conversion facets, there isn't easy way convert strings using facets. so, bolas answered: implement - or use third party library.

tensorflow - TensorBoard summary on multiple GPUs -

just wondering if can me on plotting scalars in multiple gpus setting. what have @ moment is: device_index in xrange(args.num_gpus): tf.device('/gpu:%d' % device_index), tf.name_scope('tower_%d' % device_index) scope: loss, grads = get_loss_grads() all_losses.append(loss) allr_grads.append(grads) summaries = tf.get_collection(tf.graphkeys.summaries, scope) r_loss = tf.reduce_mean(all_losses) ...later... summaries = tf.merge_summary(summaries) sess = tf.session(config=tf.configproto(allow_soft_placement=true)) while training: summary, loss_value, _ = sess.run(feed, fatch) writer.add_summary(summary, step) however, "code" can save last tower. basically, i'd have losses each tower , r_loss displayed in tensorboard. thanks, edit: i can plot each tower now: all_summaries = [] device_index in xrange(args.num_gpus): tf.device('/gpu:%d' % device_index), tf.name_

c# - how to host a site with https using iis -

i have site in iis , wan't hosted in https domain name. tried adding https in bindings ssl certificate. when browse site "your connection not private" error. this site guide how generate , install free certificate on server: https://www.sslforfree.com here have big explanation why error occurs (maybe because self-signed certificate, , browser not trust it): http://www.zerodollartips.com/your-connection-is-not-private-chrome

How to change the push notfication, when android app is in focus -

when receiving push notification app onesignal, while app open, show alert box. change alertbox little. change ok view , normal action , no or cancel button close alertbox , ignore push notification. is et possible change current alertbox or need create new dialog? if new dialog needed. generate onesignal.notificationreceivedhandler interface? using onesignal.notificationextender ignore unwanted notifications (which know should happen server side, don't have access to, temporary solution now)

jQuery extraction of data in Shopping Cart -

Image
here screenshot of shopping cart i'm trying pull data from. the main class of whole cart called div.phable_row can enough count how many elements in in cart $(".phable__row").length , because phable__row[0] heading subtract 1 , know how many line items in cart. but moving on more apparent headache pulling out site, item, price, qty , total values in variables in gtm. <div class="phable__row "> <div class="phable__cell phable__cell--2-12"> <figure class="phable__item-logo"> <img src="/img_responsive/icon/icon-sportscene.png" class="phable__item-logo-img"> </figure> </div> <div class="phable__cell phable__cell--6-16"> <div class="phable__item"> <figure class="phable__item-figure"> <a class="phable__item-link" href="http://www.sportscene.co.za/pdp/nike-men-s-ai

php - how to automate a button html -

so have written html code create webpage , after reading rfid tag. page creates button on webpage must clicked in order upload data sql database. how make automatic when tag read automatically upload tag data without asking user click upload button? i trying use <meta http-equiv=”refresh” content=”5" /> function unsure put in code an please? how remove 'upload code' button automate process , refresh page each time tag read void loop() { // check if client has connected client = server.available(); if (!client) { return; } // wait until user sends data serial.println("new user"); while (!client.available()) { delay(1); } //wait serial data available i.e. because tag has been scanned if(serial.available()) { //read serial port , store data in char array serial.println("data available"); (int i=0;i<15;i++) { val = serial.read(); valarray[i] = val; yield(); //delay(10) } serial.pri

c++ - Suitable type of function when more than one integer is returned -

how can have function in c++ array returning type ? for example consider simple function calculate divisors of number, in every step of loop i has new value . int divisordeterminer(int num) { int = 0 ; (i; < num; i++) { if (num % == 0) { return i; } } } i want have divisors array , don't know how ? std::array thing, if know how many items contain @ compile time. in case number of items vary, std::vector work. there various containers in standard library; it's worth reading them, std::vector go-to data type. std::vector<int> divisordeterminer(int num) { std::vector<int> divisors; (int i=1; < num; i++) //<--- start @ 1, not 0 { if (num % == 0) { divisors.push_back(i); } } return divisors; } edit: original code checks i=0 , should 0 count divisor of anything? not. strays undefined behaviour (ub), discussed in this questi

entity framework - NuGet Installation of EntityFramework -

i have been doing testing between vs2015 , vs2017. created .netframeworkapp , .netcoreapp website in both systems. installed couple of packages in 4 websites; in particular entitytframework. installed in both vs2015 websites , vs2017 .netframeworkapp website without problem wouldn't install in vs2017 .netcoreapp website. got following error messages. net45 (.netframework,version=v4.5) 1 or more packages incompatible .netcoreapp,version=v1.1. package restore failed. rolling package changes 'rlsbcwebsite_nc'. time elapsed: 00:00:01.4470850 error package restore failed. rolling package changes 'rlsbcwebsite_nc'. 0 anyone idea why should be. assuming should install otherwise how use codefirst etc. the "entityframework" package not supported .net core app, use the: microsoft.entityframeworkcore.sqlserver package instead

html - jquery identify which div is clicked -

i have 4 divs in 1 main div. no div has id. want identify div clicked jquery. below html code have. <div class="body"> <div class="summery-item-widget">details 1</div> <div class="summery-item-widget">details 2</div> <div class="summery-item-widget">details 3</div> <div class="summery-item-widget">details 4</div> </div> thank in advance. you can use this keyword in event handler reference clicked element: $('.summery-item-widget').click(function() { var text = $(this).text(); console.log(text); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="body"> <div class="summery-item-widget">details 1</div> <div class="summery-item-widget">details 2</div> &l

javascript - Chart.js unable to display data -

i have here code of chart, trying display chart getting values on label function (the output of function var label3, if use label3 labels on chart not work, if use format label2 work. question how can make label3 format of label2? var ctx = document.getelementbyid('mychart').getcontext('2d'); var label2 = ['28 dec','29 dec','30 dec']; var label3 = '28 dec,29 dec,30 dec'; var data1 = '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0'; var linechartdata = { labels: label2, datasets: [{ label: ' no. of clicks', backgroundcolor: "lightblue", data: data1 }] } var mychart = new chart(ctx, { type: 'line', data: linechartdata }); i have made code check here there small mistake made, data variable should array. this

r - json parsing for inconsistent data -

i have excel file downloaded json database. here sample: df = data.frame("name" = c("john","jane"), "city" = c("la","ny"), "attributes" = c("edu: abc; gender: male;language: english","edu: def; hobby: cycling; gender: female")) the 'attributes' column contains multiple attributes. not attributes present in rows/observations , not attributes in same order. how can parse data data frame looks this? https://drive.google.com/file/d/0bxgpxv4cwusrc2fodlfuckw2y2s/view?usp=sharing (this dummy data .the actual client data confidential share in forum) in advance you may consider working "list wise". create data frames each list , try rbind.fill hope works

Clone repo from github website opens Visual Studio 2015 instead of 2017 -

Image
steps clone github repository github website. choose open in visual studio answer yes 'did mean switch applications' expected result: opens in visual studio 2017 actual result: opens in visual studio 2015 context: windows 10 anniversary edition visual studio 2015 , 2017 installed in order tested in edge check default programs. maybe it's set open visual studio 2015? checking have 2 ways: inside windows 10 go settings > system > default apps , check if visual studio 2015 set open project default. go control panel (make sure it's not set on category view) > default programs > set default programs this should work, didn't try if helps, great.

java - PDF containing link to internal server not working -

can please me following issue? i work on java web application in xyz company has button links pdf file. pdf file contains image stored in internal server. while creating pdf file, link server location of image given against particular image. however, on clicking image pdf file in google chrome, link appends server address , therefore, breaks. link image location in server (provided while creating pdf): //vmspfsfsir05.ger.corp.xyz.com/techbm_infodb/07_bre_newsletter/nl_2017-01_edition42/devices_overview_explained_v1_final.png after automatically appending server address in chrome (this link breaks): http://muswweb002.ger.corp.xyz.com//vmspfsfsir05.ger.corp.xyz.com/techbm_infodb/07_bre_newsletter/nl_2017-01_edition42/devices_overview_explained_v1_final.png ideally, should (this works): file://vmspfsfsir05.ger.corp.xyz.com/techbm_infodb/07_bre_newsletter/nl_2017-01_edition42/devices_overview_explained_v1_final.png

Google charts - Main title and axis size -

Image
i'm trying change font size main title , axis titles cannot code: var options = { title: 'ratio de supervivencia de aerolĆ­neas europeas', chartarea:{ top: 20, bottom: 50, height: '75%' }, width: 800, height: 600, haxis: {title: 'nĀŗ total de aerolĆ­neas histĆ³ricas', titlefontsize: 24}, vaxis: {title: 'ratio de supervivencia', format: 'percent', maxvalue: 0.7, titlefontsize: 24}, bubble: {textstyle: {fontsize: 11}} }; could me? thanks in advance & regards, luis there no option --> titlefontsize instead, use option --> titletextstyle e.g. haxis: { titletextstyle: { fontsize: 24 } } see configuration options more...

assembly - assembler: values on heap -

i have very simple program in assembler at&t: .text .global main main: push $1 push $1 mov $1, %eax int $0x80 i wanted see, values on heap. i'm using gdb> x/3xw $sp get: 0x7fffffffdd40: 0x00000001 0x00000000 0x00000001 0x00000000 - did come from?

r - unable changing linetype ggplot2 -

Image
i change color , line type in ggplot . using code: <- runif(84, 20, 80) a<-ts(a,start = 2009,frequency = 12) #a<-ts(result$`dataset1$summe`,start = 2009,frequency = 12) a3 <- zoo(a, order.by = as.date(yearmon(index(a)))) p1 <- autoplot(a3) p1 + scale_x_date(labels = date_format("%m/%y"),breaks = date_breaks("2 months"), limits = as.date(c('2009-01-01','2017-08-01')))+ theme(axis.text.x = element_text(angle = 90))+ theme(axis.text.x = element_text(angle = 90))+ labs(x = "date",y="test") + theme(panel.background = element_rect(fill = 'white', colour = 'black'))+geom_line(linetype="dotted", color="red") but color changed. should change line type? autoplot() pick sensible default object it's passed. if want customize appearance it's better use standard ggplot() function. able zoo object should passed trough fortify() : ggplot(fortify(a3, melt = true)

mysql - Code for convert db data into json file -

i have list of entity(id,email,empname,designation) called dblist. want json file contain json array of json. import org.primefaces.json.jsonarray; import org.primefaces.json.jsonobject; import java.io.filewriter; import java.io.ioexception; jsonobject objbig = new jsonobject(); jsonarray company = new jsonarray(); dblist.foreach(e -> { jsonobject obj = new jsonobject(); obj.put("id", e.getuserprincipalname()); obj.put("email", e.getemail()); obj.put("empname", e.getempname()); obj.put("designation", e.getdesignation()); company.put(obj); }); objbig.put("data", company); string path = "c:/xyz"; filewriter file = null; try { file = new filewriter(path); file.write(objbig.tostring()); log.info("successfully copied json object file

android filterable - How to add SearchView in FoldingCell library -

Image
i using foldingcell library , want add searchview using filterable interface in action bar in below image : please me out..

Plot validation error and training error for Convolutional network in matlab -

does know how plot validation error, conv net in matlab? vanilla neural net, there function called plotperform , not work conv nets. as far know there no built-in function cnn plotperform. can following: save neural network performance using checkpoints parameter of training options options = trainingoptions('sgdm', ... 'maxepochs', 10, ... 'initiallearnrate', 1e-6, ... 'checkpointpath', 'models'); this save .mat file each epoch. use predict create training , validation accuracy points learning curve you run detect functon on cnn prediction: [bboxes, score, ~] = detect(cnn, testimage); then depending on kind of cnn have, need come accuracy benchmark. classification problems, calculate f1 score example.

javascript - Complex mathematical horizontal parallax easing function -

Image
i'm diving parallax effects on web. parallax scrolling technique in computer graphics , web design, background images move camera slower foreground images, creating illusion of depth in 2d scene , adding immersion. ~ wikipedia i want create little container (could image, or block level element) , move across screen horizontally user scrolls. the effect should scalable across viewports. meaning hight , width of element element moving across should not matter. when user has scrolled half of height of screen "moving element" should in exact center. since user have scrolled half of screen element vertically already. we're worried horizontally right now. i've thought question while , came pretty idea of how. take hight , width of element want "moving element" move across. example screen 1000px tall , 600px wide. divide width height. example (600px / 1000px = 3/5 = 0.6) take amount of pixels user scrolled , multiply number created. e

excel - Choose Columns to show in a table? -

basically have table 100 columns, , i'd able choose of columns want see, sort of how it's done pivot table, list of columns instead, i'd exact same table (ie no summaries , not pivoted @ all) etc. so i'd "reduced" table, without having go , hide each column manually, , forget columns hidden etc. any way this? tremendously!

Java android delete File -

i want delete file (pdf file) did : boolean deleted = fileslist.get(pos).delete(); but when in phone see file , application doesn't see file to delete file directory, can use method: public static void deletefile(file directory, string filename) { if (directory.isdirectory()) { for(file file : directory.listfiles()) { if (file.getname().contains(filename)) { if (file.isfile()) { if (file.exists()) { file.delete(); } } } } } } and if want delete entire directory: public static void deletedirectory(file directory) { if (directory.isdirectory()) (file child : directory.listfiles()) deletedirectory(child); directory.delete(); } as mentioned ylmzekrm1223 , should provide permissions read , write storage in androidmanifest.xml , before attempting delete file or direc

Tensorflow: Retraining inception v3 shows 0 % GPU usage -

i trying out tensorflow's inception model , while use gpu bottlenecks generation, doesn't seem on training-wise. gpu usage monitored through nvidia-smi , stays @ 0% log_device_placement returns gpu:0 80% of operation seems fine. at beginning detect titan x usual /job:localhost/replica:0/task:0/gpu:0 -> device: 0, name: titan x (pascal), pci bus id: 0000:01:00.0 the memory on gpu allocated cuda installed , cudnn both last version the temperature rise (about 20 celsius 40->60) cpu heating whole case? another way check whether gpu used nvprof. can tell sure. for many models, check argument specify gpu count. example: num_gpus. few examples default not use gpu unless specified.

user interface - Bitmaps in OS design -

Image
i have unusual question adding graphics os gui. when use resource viewer see there few different versions of 1 graphics in same file, take example windows xp start menu bitmap: there 1 graphic mouseover, 1 clicked, , 1 clicked. question, 3 in total. my question is, how display 1 graphics though there 3 in file? here real life screen shot of mean: also when view bitmap resource, has pink there whitespace, reason too? it no big deal display desired part of image depending on state. as said in comments, color can reserved indicate transparency which, depending on viewer, can rendered differently. when progressive transparency supported, need alpha plane instead.

java - Installing Tomcat-8 using Chef -

i'm trying install tomcat 8 using chef terraform. working fine adding tomcat run list node. after getting logged client system, when hit sudo chef-client gives me error attached below. tomcat , it's dependence downloaded chef supermarket. please me resolve this. tia enter image description here from attached exception need provide in recipe's attributes/default.rb openjdk_version attribute. node['java']['jdk_version'] = '8' in way override default 6 version of jdk. i'm not entirely sure correct syntax here, can try too: default['java']['openjdk_version'] = 'openjdk-8-jdk' for reference can check https://github.com/agileorbit-cookbooks/java

javascript - Failed to load resource: the server responded with a status of 504 (Gateway Timeout) -

i developing project using django - python, javascript. when call long running process (time-consuming) approx more 20 minutes views process starts successfully. used loader in ajax notify user process running. after process completes loader stop , change completed state. but issue every time after 14.59 minutes process started, loader stops , status change completed. process running in background not yet completed. page crash after time. after process complete bind result under tag in web page. in tag error 504 (gateway timeout) arise. in web console log failed load resource: server responded status of 504 (gateway timeout) , above error prints. if knows please me fix this. is django closing connection after time ? if there possible mention timeout in django settings (settings.py). tried giving timeout in ajax call same issue returns. doubt on django development server. there timeout in django development server. when search issue found, in nginx server same type of issue

html - Truncating Text to 3 Lines in IE -

i have simple span tag content spans multiple lines, , have figured out how cap off @ 3 lines, , follow ellipsis (...) the problem is, doesn't work in ie11, , to. here's code: html: <span class="itemlabel"> line 1<br/> line 2<br/> line 3<br/> line 4<br/> line 5<br/> </span> css: .itemlabel{ overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-size: 11px; } now content of span being populated dynamically, have 0 control of amount of text put span, , have set width of 180px on anchor tag surround span , product image, unable "don't use many break tags", i'm putting them there example though there 5 lines present, css cut span off @ 3 maximum. how can achieve same display in ie? since there no cross browser solution, needed kind of way limit textual output in user friendly design. end [database]

linux - Logging output from executable -

is possible in linux start program ./program , outputs gets written output.txt file? how ./program > /tmp/mylogfile.txt 2>&1 sending /tmp/mylogfile.txt file. the > redirection of standard out (stdout) , 2>&1 redirects standard error (stream file descriptor 2) standard out (stream file descriptor 1)

matlab - Copying axes position and camera properties -

Image
this question has answer here: re-use view output matrix in matlab 2 answers i have point cloud , tracks of cells display using following commands: showpointcloud(rawcoors,repmat(pointvalues([1,3])); hold on jj=1:5 %... calculate x,y,z each 1 of 5 tracks surface([x;x],[y;y],[z;z],[colors(1:ii);colors(1:ii)],'facecol','no','edgecol','interp','linew',5,'edgealpha',1); end this results in subpar rendering: as quick workaround display point cloud , overlay tracks. need camera position , zoom properties form point cloud: and apply tracks: however have not been able set correct combination of these parameters , view() this c=ax1.cameraposition; ax2.cameraposition=c; to correct view of tracks. is there way copy of axes properties in order right sized tracks? do have better way solve renderin

dictionary - Counting occurences from a dict and pandas -

i'm still quite new pandas , python, , count total number of occurrences of same combination of variables across multiple dataframes within single dict. i have created dict consisting of 6 df. key each df year (1985, 1990, etc.) , consists of index , single row of integers. index made of 2 variables (both strings) , separated comma while integer represents correlation between 2 variables: do-pspcp pt-wfrto -0.067934 pt-wswfr -0.067903 pt-wtotl -0.060489 pt-wswto -0.060485 do-sspop do-pspcp -0.050703 ps-swpop do-sspcp -0.048588 i know total number of times specific index correlated within entire dict years (key) , individual correlation. ideally, output (integers truncated space considerations): do-pspcp pt-wfrto 5 1985,1990,1995,2000 -0.06,-0.068,-0.07,-0.06,-0.06 do-pspcp pt-wswfr 2 1985,2000 -0.067,-0.07 the code used generate list uses calls correlation function (get_correlation) using list composed of larger df containing above variables

amazon web services - URL rewrite rule based on HTTP_X_FORWARDED_PROTO not working AWS Windows EBS -

i have deployed application on windows based elastic beanstalk application , enabled ssl. working fine whether access using http or https. but want force https on requests have added below rewrite rule in web.config <rule name="redirect https" enabled="true" stopprocessing="true"> <match url="healthcheck.html" negate="true" /> <conditions> <add input="{http_x_forwarded_proto}" pattern="https" negate="true" /> </conditions> <action type="redirect" url="https://{http_host}/{request_uri}" redirecttype="permanent" appendquerystring="false" /> </rule> but rule not working , none of request redirected http https. sure http_x_forwarded_proto giving me correct value because have check request.params["http_x_forwarded_proto"] , giving http , https respective requests.

javascript - jQuery set button element active and disabled dynamically -

i'm working on client side script using jquery. i achieve set button element disabled or enabled, when enter or delete text in 1 input field. however, need check if 2 input fields have value, otherwise buttons should disabled. though, buttons enabled if put text in 1 input field... html <button type="button" id="btnsave">save</button> <button type="button" id="btnsubmit">save</button> <input type="text" id="businesslineidlist" /> <input type="text" id="label" /> js $("#businesslineidlist").on("keyup", function () { checkbusinessline(); checklabel(); }); $("#label").on("keyup", function () { checklabel(); checkbusinessline(); }); function checklabel() { if ($("#label").val()) { setbtnactive(); } else { setbtndisabled() }; } function checkbusinessline()

javascript - JS error on Chrome 57+ for RichFaces application "Cannot read property 'switchToItem' of undefined" -

Image
i've jsp page tabs. , error occurs (when press tab) "cannot read property 'switchtoitem' of undefined" uncaught typeerror: cannot read property 'switchtoitem' of undefined @ init.__onheaderclick (packed.js:6102) @ htmltablecellelement.<anonymous> (packed.js:1333) @ htmltablecellelement.dispatch (jquery.js:846) @ htmltablecellelement.eventhandle (jquery.js:722) as understand error happens in packed.js (this js-file packed richfaces of version 4.3.4). i've looked inside file , found richfaces try find list of tabs. these tabs located in property "rf" ( element[richfaces.rich_container] ), in moment when pressed tab, there no property. this bug reproduce in chrome v.57, in version 56 doesn't reproduce. me advice, how can fixed? some technical details: i use xmlns:rich="http://richfaces.org/rich" <rich:tabpanel> tag in jsp page in pom.xml <richfaces.version>4.3.4.final</richfaces.version>

java - Search for keyword in .txt file on web with Selenium -

can me, how search keyword in .txt file selenium , file on internet. if keyword found should redirect webpage. to make clear, link textfiles.com/internet/autonet.txt, have keyword, screen. so, need search keyword on webpage , if finds keyword, webpage should opened. doing selenium, stuck, because don't know how accomplish this try solution. in selenium page. public boolean istextpresent(string str) { iwebelement bodyelement = driver.findelement(by.tagname("body")); return bodyelement.text.contains(str); } then later can redirect other page. think redirection more business logic, should not part of selenium tests

forecasting - Multiple Scenario in Excel for Fiscal Years -

i have question regarding creating forecast in excel. might basic. create forecast compare current year vs past years actuals , forecast , variance. enter image description here in attached picture values of actual , forecast change choose year. compare data of 2 years eg 2016 actuals vs 2017 actuals . can please tell me how can ? understand need separate sheet data.

php - regex inside tags with specified string -

i'm not @ regex have string : $str = '<span id="mainstatusspan" style="background: brown;"> incoming: 012345678 group- supermoney &nbsp; fronter: - 992236 uid: y3281602190002004448</span>'; $pattern = '/(?:fronter: - )[0-9]{1,6}/i'; preg_match($pattern, $str, $matches); print_r($matches); /*** ^^^^^^^ prints :*/ array ( [0] => fronter: - 992236 ) in case of fronter not - or spaces don't fronter - number . can example works in case, there fronter , number . you can use fronter:\w*[0-9]{1,6} fronter:\w*[0-9]{1,6} : match fronter: \w* : 0 or more non-word characters [0-9]{1,6} 1 6 digits you regex find match fronter:99222236 must use \b avoid overflow digit length fronter:[- ]*[0-9]{1,6}\b

docker - client is newer than server (client API version: 1.24, server API version: 1.21) -

when : sudo docker version i obtain error: error response daemon:client newer server (client api version: 1.24, server api version: 1.21) anyone can me understand have do? docker running on client / server model, each docker engine release has specific api version. the combination of release version , api version of docker follows: https://docs.docker.com/engine/api/v1.26/#section/versioning according table above, docker api v1.24 used in docker engine 1.12.x , docker api v1.21 used in docker engine 1.9.x. server needs api version equal or later client. you have following 3 options. upgrade server side docker engine 1.12.x or later. downgrade client side engine 1.9.x or lower. downgrade api version used @ run time exporting docker_api_version=1.21 environment variable on client side.

VB.NET-Column header of DataGridView when importing the DataSet -

insert data dataset.. dim table new datatable table.columns.add("name") table.columns.add("score") table.tablename = "group1" dataset.tables.add(table) combine datagridview dgv.datasource = dataset.tables("group1") there 2 different situations set column collection in designer didn't set in designer if set dgv column "name" , "score" in designer, outcome name score name score john 100 jack 100 duplicate columns appeared... if set nothing dgv, outcome fine. however, if there no data in dataset, column header, "name" , "score", won't show in dgv. how solve problem? display dataset in dgv when dataset has no data , header still can displayed.

ios - From a main app, how can a framework get its own bundle? (Localizable.strings) -

so have main ios app includes framework made. in framework, created localizable helper date helper. date helper has function timeago() can return "8 hours ago". , want localize string. have in framework: public extension string { public func localized(in bundle: bundle) -> string { if let path = bundle.path(forresource: localize.currentlanguage(), oftype: "lproj"), let bundle = bundle(path: path) { return bundle.localizedstring(forkey: self, value: nil, table: nil) } return self } } public extension date { public func timeago(format: dateunitformat = .short) -> string { let thisframeworkbundle = bundle(for: localize.self) // class declared in framework //whatever, display localized word return "second".localized(in: thisframeworkbundle) } } when run local test (unit testing inside framework itself), localize thing works. bundle found. but when ca

ran into build error with Tensorflow Android examples: tensorflow/core/kernels/split_v_op.cc -

i cloned tensorflow android example https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android/ , followed steps @ https://bazel.build/versions/master/docs/install-ubuntu.html build it, ran problems following error: tensorflow/core/kernels/split_v_op.cc:172:12: note: in instantiation of member function 'tensorflow::splitvopcpu::compute' requested here explicit splitvopcpu(opkernelconstruction* c) : base(c) {} the build command used is: sudo bazel build --genrule_strategy=standalone --spawn_strategy=standalone --local_resources 4096,4.0,1.0 -j 1 -c opt //tensorflow/examples/android:tensorflow_demo please share ideas fix issue. the issue similar 1 posted @ https://github.com/tensorflow/tensorflow/issues/8641#issuecomment-288586320 the bazel builder not work latest ndk build comes android studio. need use ndk r12b in workspace file. code compiled, still spilled out warnings...

jquery - How to get the height of an element and use it in a function? -

i'm trying use jquery determine height of element , determine if user has scrolled distance. application have header followed navbar. user scrolls down page header disappear , navbar stay fixed top of screen. have working using following code: <script type="text/javascript"> jquery(window).scroll(function () { if (jquery(this).scrolltop() > 100 ) { jquery("#top-header").hide(300); } else { jquery("#top-header").show(300); } }); but want use media queries change height of #top-header based on screen size instead of leaving same. i'd determine height of #top-header (or element within it) , use value in function hide it. know can use form of $('#top-header).height i'm not sure how incorporate function. thanks, cj instead of predefined height, use jquery height() element function. var header = $("#top-header"); $(window).scroll(function() { if ($(this).scrolltop() > header.height

c++ - OpenCV assertion fail inside roi? -

#include <fstream> #include <iostream> #include <string> #include <stdlib.h> #include <stdio.h> #include <iomanip> #include <stdio.h> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> using namespace cv; using namespace std; int main(int argc, char** argv) { ofstream fout("e:\\fyp\\image analysis\\imageanalysis\\imageanalysis\\cropped_image\\details.txt"); mat image = imread("rsz_2rsz_2iron-man.png", -1); //declare global parameters int kernel = 3; //to input int levels = 16; //to input int gap = 5; //to input in mm double depth_gap = 0.2; //to input in mm int feedrate = 300; //to input int background = 0; int width = image.cols; int height = image.rows; double x_window

Excel Formula to fetch data from corresponding cells of a search result -

this question has answer here: two column lookup in table array using index , match 2 answers vlookup using 2 columns reference another 1 answer i have tab in excel employee details. column b first name, column c last name,column h employment status ( left, employed etc) i want formula in next tab fetch data of column h of given name want search for. lets in 2nd tab, put name john doe, sam bravo, leah casey , 25 names. on right handside cells of each name entered, need employment status appear. have database of 18000+ employees. formula lot. many thanks.

gpgpu - Android renderscript never runs on the gpu -

exactly title says. i have parallelized image creating/processing algorithm i'd use. kind of perlin noise implementation. // logging never used here #pragma version(1) #pragma rs java_package_name(my.package.name) #pragma rs_fp_full float sizex, sizey; float ratio; static float fbm(float2 coord) { ... } uchar4 rs_kernel root(uint32_t x, uint32_t y) { float u = x / sizex * ratio; float v = y / sizey; float2 p = {u, v}; float res = fbm(p) * 2.0f; // rs.: 8245 ms, fs: 8307 ms; fs 9842 ms on tablet float4 color = {res, res, res, 1.0f}; //float4 color = {p.x, p.y, 0.0, 1.0}; // rs.: 96 ms return rspackcolorto8888(color); } as comparison, exact algorithm runs @ least 30 fps when implement on gpu via fragment shader on textured quad. the overhead running renderscript should max 100 ms calculated making simple bitmap returning x , y normalized coordinates. which means in case use gpu surely not become 10 seconds. the code using renderscript with: // non-support

ssvnc using .ssh/config with ProxyCommand -

i have using ssvnc handle unix based vnc connections because can save profiles separate hosts including ssh tunneling information. in past have opened direct port ssh of remote server if it's machine behind nat or other firewall/router setup. upgraded router @ home dd-wrt tomato , since has it's own built in ssh server, can connect machines behind nat using dd-wrt ssh server proxycommand stepping stone without having open ports directly pc's behind nat. creates dilemma however, when trying connect using vnc. to hop off router ssh tunnel, have router set use specific id_rsa key pair (specified in .config) connect. , hop off vnc host's ssh server, has use proxycommand configuration in .ssh/config so know if ssvnc settings can either reference alias configurations in .ssh/vnc and/or if can specify equivalent proxycommand somewhere in ssvnc settings same thing?

android - Fabric: TwitterSession always null -

i want check if user connected on twitter in order post tweets android application. using fabric, check twittersession via code: twittercore twittercore = twittercore.getinstance(); twittersession twittersession = twittercore.getsessionmanager().getactivesession(); return (twittersession != null && !twittersession.getauthtoken().isexpired()); the problem twittersession null, if i'm connected on twitter application. how can solve problem? you have initialize in oncreate firstly. used twitter digits , initilize somthing : twitterauthconfig authconfig = new twitterauthconfig(twitter_key, twitter_secret); fabric.with(this, new answers(), new twittercore(authconfig), new digits()); strictmode.setthreadpolicy(new strictmode.threadpolicy.builder() .detectall() .penaltylog() .build()); strictmode.setvmpolicy(new strictmode.vmpolicy.builder() .detectall()

javascript - Augmented Reality library support React Native? -

i'm planning develop campus navigation mobile application combine augmented reality technology academic project. decide use react native develop cross-platform mobile application (ios , android). totally new in react native , ar. here questions. 1) ar libraries support react native? , able work in android , ios? (i found few ar sdk support android , ios, not sure whether support react native) 2) react vr builds on react native framework. means react vr can used achieve goal(ar navigation)? 3) can share experience in react native , ar? have clear way started.

matlab - How to avoid loss of accuracy when converting symbolic expressions to functions? -

tl;dr: observe complete loss of accuracy when converting symbolic expression function handle matlabfunction . wonder if there ways improve conversion in order avoid loss of accuracy. i have symbolic variable x 1 <= x && x <= 2 holds true: syms x real assumealso(1 <= x & x <= 2); i have many computer-generated, lengthy symbolic expression in variable. 1 of them looks this: expression = ( ... 1015424780204960143215273323910078528628754663952913658657288835138029704791686717561885487746105223164496264397062144000 ... *( ... 60345244216851610523130575942127473698515638085026410114070496399315754724985170479034760688327679099512793302302720*2^(1/2) ... - 85341062796188128379389251264141456937242003828816791711306294886439805159655912635773490018204138847163921224639041 ... )*(x - 2)^2 ... ) ... /3150428834687237271206156281294141942716756115321621360514686411758632333115580029402140085753704120203956587985619082172994521693552670743884

java - Replace only the first specific occurrence -

i want replace spaces in parentheses. code changes spaces in string & don't know why. wrote code this. public static void main(string[] args) { scanner scanner = new scanner(system.in); string line; line = scanner.nextline(); (int i=0; i<line.length(); i++){ if (line.charat(i)=='('){ while (line.charat(i)!=')'){ i++; if(line.charat(i)==' '){ line=line.replacefirst(" ", "-space-"); } } } } system.out.println(line); } just replaced 1 line: spaces in parantheses changed. public static void main(string[] args) { scanner scanner = new scanner(system.in); string line; line = scanner.nextline(); (int i=0; i<line.length(); i++){ if (line.charat(i)=='('){ while (line.charat(i)!=')'){ i++; if(line.charat(i)==&

html - Can you make this shape in CSS -

Image
is possible make shape in css without using circle , hiding overflow in div? have tried use border-radius , sure not possible this. i able svg. .shape { fill: #1d7c4f; } <svg version="1.1" id="layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/adobesvgviewerextensions/3.0/" x="0px" y="0px" width="150px" height="100px" viewbox="0 0 150 100" style="enable-background:new 0 0 150 100;" xml:space="preserve"> <path class="shape" d="m150,100h17.8c17.8,100,0,85,0,50s17.8,0,17.8,0h150v100z" /> </svg>

python - What can I do to scrape 10000 pages without appearing captchas? -

hi there i've been trying collect information in 10,000 pages of page school project, thought fine until on page 4 got mistake. check page manually , find page asks me captcha. what can avoid it? maybe set timer between searchs? here code. import bs4, requests, csv g_page = requests.get("http://www.usbizs.com/ny/new_york.html") m_page = bs4.beautifulsoup(g_page.text, "lxml") get_pnum = m_page.select('div[class="pagenav"]') max_page = int(get_pnum[0].text[9:16]) print("recolectando informaciĆ³n de la pĆ”gina 1 de {}.".format(max_page)) contador = 0 information_list = [] k in range(1, max_page): c_items = m_page.select('div[itemtype="http://schema.org/corporation"] a') c_links = [] = 0 link in c_items: c_links.append(link.get("href")) i+=1 j in range(len(c_links)): temp = [] s_page = requests.get(c_links[j]) i_page = bs4.beautifulsoup(

c# - Question Mark (?) after session variable reference - What does that mean -

i have had code snippet comes modify. in there found such syntax. session("lightboxid")?.tostring() i didn't understand question mark (?) there means. no googling helped me hint it performs null-check on session("lightboxid") before attempting call .tostring() on it. msdn: null-conditional operators (c# , visual basic)