Posts

Showing posts from September, 2013

How to block User creation in QuickBlox Android API -

i making app quickblox. want manage users signup through own server. plan use existing user base , server makes rest calls quickblox create corresponding users in database. on app side, i'll provision these users along "passwords" on air each of users through own apis. see if modifies client app (using reverse engineering or copying quickblox auth key/secret app), can call users.signup api , keep creating number of users , throw off scheme. possible block user creation android app? to exclude "signup" method quickblox android sdk recommend use following service: http://proguard.sourceforge.net/

Google Developers Console - datastore dashboard inaccessible - Backend Error -

in new google developers console , when trying access: storage -> cloud datastore -> dashboard / query / settings error saying: error: backend error the old developers console functions fine, exception of trying access: data->datastore admin , displays message: error: not found my project created using old console. disabling , enabling datastore api did not help related issues: google console - cloud datastore query returning "backend error" google datastore returning "503 backend error"

Ruby check if variable exists in a file -

i have text file of 1 word per line. i want check if ruby variable exists on lines in file. @username = john and in bannedwords.txt: alex adam mary john james so true. best function use in ruby this? just read in file , convert set can use test inclusion: require 'set' banned = set.new(file.readlines('bannedwords.txt').collect(&:chomp)) banned.include?('john') # => true banned.include?('papa smurf') # => false

windows 7 x64 - Plastic SCM FIPS error -

Image
during configuration of plastic scm client - server connection on several machines receive error: this implementation not part of windows platform fips validated cryptographic algorithms this on windows 7 enterprise sp1 64 bit fips support added plastic scm bl700 in oct 2015 can find here

Why does batch processing with unusal usage of command SET hang on running in console emulator Cmder? -

i have made small batch script generate md5 sum of file. works great when remove line @echo off , hangs on execution in console emulator cmder version 1.1.4.1 when leave line. @echo off if [%1]==[] goto usage /f "delims=" %%i in ('certutil -hashfile %1 md5 ^| find /v "certutil" ^| find /v "md5"') set output=%%i set /p =%output: =%<nul >%1.md5 goto :eof :usage @echo usage: %0 filename exit /b 1 if replace line set /p =%output: =%<nul >%1.md5 echo %output: =% >%1.md5 , batch file executed in cmder , not cmd.exe of windows works, outputs additional newline don't want. what going on? edit : line doesn't hang on batch processing in cmder : set /p ="hello" <nul this line hangs on batch processing in cmder : set /p ="hello" <nul >out both lines work in batch file executed windows command processor in command prompt window.

php - Symfony2 : send a HTTP Request -

i trying make http request 1 of controller contact url, goal being contact url, , print html answer in page. tried : $r = new request(); $r->create('http://www.google.com', 'get'); return $this->render(...mytemplate..., array('name' => $r->getcontent()); template printing variable "name". when that, nothing returned. seems me request never sent, why nothing returned. my question : how send request , content of response? thanks in advance. edit : made gremobuzzbundle buzz browser. it's similar sensiobuzzbundle has nice configuration options. i suggest use buzz browser , dependency injection. buzz wrapper around curl or file_get_contents. edit deps file adding these lines: [buzz] git=https://github.com/kriswallsmith/buzz.git target=/buzz then install vendors download library: php bin/vendors install then add two services ( src/yourcompany/yourbundle/resources/config/services.yml ): # curl ...

android - AWS Device Farm - Failed upload when using the CLI -

i trying upload apk device farm using bash script, have used create-upload endpoint pre-signed url put request, , using curl put apk end point. response=$(aws devicefarm create-upload --project-arn %devicefarmprojectarn% --name platforms/android/build/outputs/apk/android-release-unsigned.apk --type android_app --content-type application/octet-stream) apk_arn=$(echo "$response" | grep arn:aws:devicefarm | gawk 'match($0, "(arn:aws:devicefarm(.*))\"", ary) {print ary[1]}') apk_put_url=$(echo "$response" | gawk 'match($0, "\"url\": \"(.*)\"", ary) {print ary[1]}') echo "$apk_arn" >> apkarn.txt curl $apk_put_url -x put --upload-file platforms/android/build/outputs/apk/android-release-unsigned.apk -h "content-type:application/octet-stream" the file upload seems work, when check status using returned arn status failed, , reason "invalid application uploaded" "...

java - Using \n as delimiter prints an extra empty line -

i have following code: scanner input = new scanner(system.in); input.usedelimiter("\n") system.out.println(input.next()); system.out.println("end"); when run , type "orange apple" enter, print orange apple end instead of orange apple end which wanted print. have no idea why keeps printing empty line. how can fix this? system.out.println makes new line opposed system.out.print doesn't. when system.out.println used \n you're making 2 new lines.

apache - One SSL certificate on One IP Address Served for Multiple Domains -

i have server 1 ip address assigned it. use 1 wildcard ssl certificate multiple sub-domains. achievable using apache? is possible have multiple apache virtual host files use same wildcard ssl certificate same ip address used different subdomains? yes long have wildcard certificate there wont issue. you can create virtual hosts , add same certificate , key, hosts want have ssl. please refer wiki apache.org below while configuring https://wiki.apache.org/httpd/namebasedsslvhosts

ios - sprite kit swift, detecting collision for game over -

i making first game. have collision function ballcollidewithwall(_:ball:) called expected, game on scene not presenting. verified collision function called using nslog . // game on function func gameover(){ // presenting game on scene let transition = sktransition.fadewithduration(1.5) self.view?.presentscene(gameoverscene(), transition: transition) } which called in function collision as func ballcollidewithwall(wall: skspritenode, ball: skspritenode) { gameover() } you presenting scene in wrong way. should change code like let scene = gameoverscene(size: self.view!.bounds.size) self.view!.presentscene(scene, transition: transition)

javascript - Weird flot behaviour in AJAX calls -

Image
i'm getting weird behaviour when adding flot plots through ajax. this result: it displays last graph. can confirmed due fact calls asynchronous, , such order of plots random - data being fed flot not issue. my current code ajax call: function addgraph(x, y, z){ $.ajax({ datatype: "json", method: "get", url: "/api.php", data: { a: "b", c:$("#d").val(), e: z} }).done(function( plotdata ){ $("#graph").html($("#graph").html() + y.format(x)); $.plot($("#plot-"+x), plotdata.data, plotdata.options); }); } the y variable string that's formatted through sprintf function , looks this: <div class="col-md-6" style="height:250px;" id="plot-{0}"></div>

PHP Contact Form Advice -

i have built contact page website, , when test out, thing appears message. there no contact information, except url of hosting site. advice on how fix appreciated. thank you. here html code: <form action="contact.php" class="form-style-9" method="post"> <ul> <li> <input type="text" name="first_name" class="field-style field-split align-left" placeholder="first name" /> <input type="text" name="last_name" class="field-style field-split align-right" placeholder="last name" /> </li> <li> <input type="text" name="phone" class="field-style field-split align-left" placeholder="phone" /> <input type="email" name="email" class="field-style field-split align-right" placeholder="email" /> </li> <li> <input type="text"...

c# - Remove c__DisplayClass from code coverage -

i'm getting c__displayclass files appearing in code coverage analysis appear auto generated code closures (see this link ). my question is, how remove auto generated code code coverage results? after research, i've discovered can make use of .runsettings file ( documentation ). you can customize code coverage results within file so: <codecoverage> <modulepaths> <exclude></exclude> </modulepaths> <functions> <exclude> <function>.*c__displayclass.*</function> </exclude> </functions> </codecoverage> this gave me results wanted. auto generated c__displayclass functions excluded results.

sql - Getting count of detail sections printed in Crystal Reports (multiple details sections) -

so, have crystal report working on background image set in report , have fixed space description section print details sections. subreport used align text on section in image. basically, customer wants me use 7 lines in description (the subreport), when 7 lines used, second page print (same background image) , lines continue in same description area. the problem have have multiple details sections. report built overflow second page using counter of rows returned (if > 7 next page used). worked 1 details section. have print multiple fields of data across 2-4 lines. so need count of details sections printed make work, since have details a, details b, details c, details d, , details e. does crystal have easy way count how many details sections printed per record, not how many records printed? create local variable in detail section , increment , reset @ start of group footer or report footer. intialise varialbe create formula @ini shared numbervar count:=0; //pl...

How to read a page with an infinite scroll bar using selenium's html unit driver for java? -

for example , if wanted find post on facebook year ago using selenium how able scroll down , text. have figured out how scroll using selenium whenever try elements or page source includes initial loaded page, nothing scrolled down to. i'm not using facebook, i'm using website doesn't have java developer tools, stock twits. the logic followed in example find post text content let allposts while timeout visible posts has text in remove allposts currentposts [so dont need check same post again] , add currentposts allposts[to maintain list] each post in currentposts check if post's text contains given text stop scroll bottom[which invokes ajax call load more posts] //replace above button loadmore or if scroll dint invoke ajax load wait till page loaded again this worked me found post on wall on birthday[1 month ago]. it took 20 mins [depends on no of posts , time of post take...

Groovy Spock: is it possible to make "shared" a group of variables? -

i have big group of variables in spock test. first half of them objects need serious effort created, , second 1 constants. want mark these objects @shared annotation. may there better , shorter way evaluate task? placing 20 or 30 similair annotations 1 after 1 not groovy way, suppose.. you have single context, 1 @shared class test extends specification { @shared context = [ one: new one(), two: new two() ] def "use of context"() { expect: context.one.// context.two.// } }

python - Numpy Compare unequal rows and make both array of same dimension -

a= [[43655, 1428, 0, 2554] [44580, 1428, 0, 2555] [44930, 1428, 0, 2556] [47708, 1428, 0, 2557]] b= [[41641, 1428, 0, 2554] [44075, 1428, 0, 2555] [44901, 1428, 1, 2556] [45377, 1428, 0, 2557] [48056, 1428, 0, 2558]] new b= [[41641, 1428, 0, 2554] [44075, 1428, 0, 2555] [44901, 1428, 1, 2556] [45377, 1428, 0, 2557] i have 2 numpy array unequal rows. eg. array a has 4 rows while array b has 5 rows. edit: no. of rows in array 'b' greater array 'a'. every element of a[:,3] lies in b[:,3]. there function extract rows of array b b[:,3]=a[:,3] you can compare elements of 3rd column using zip , np.equal within list comprehension convert result numpy array , desire rows array b . >>> b[np.array([np.equal(*i) in zip(a[:,3],b[:,3])])] array([[41641, 1428, 0, 2554], [44075, 1428, 0, 2555], [44901, 1428, ...

php - echo result as part of bind_param -

i trying use code in order echo information, required have bind_param, in order generate data. changes need make code in order work? function get_header_link($sql, $image) { include 'connect.php'; $id = $_get['id']; $select = $conn->prepare($sql); $select->bind_param('s', $id); if ($result = $select->execute()) { foreach($select $value => $row) { echo "<h4>" . $row['display'] . "</h4>\n <div class='placeholder' id='large'>\n <img src='" . $row[$image] . "'/>\n <div class='name'> <h1>" . $row['display'] . "</h1>\n </div> </div>"; } } } on running code above, using: get_header_link("select * homelinks linkid=?...

php - CakePHP error query with integer -

i state new cakephp, moved site made cakephp on new server, using postgres database (version 8.4 on old server, new server 9.4), problem new server can not logging in plugin auth. this code, can not understand why: if(isset($this->data) && !isset($this->data['user']['username_owner']) && isset($this->data['user']['guest_access_key'])) { $dbuser = $this->user->find('all', array( 'conditions' => array( 'user.guest_access_key' => $this->data['user']['guest_access_key'], 'user.valid_to >=' => date("d-m-y"), 'user.active'=> 1, 'user.list_type_id' => 1 ) )); //ecc.. if go debug, find in query changes me last state 'user.list_type_id'=>1 the query shown thus: user.list_type_id = '\x31' why?

java 8 - Getting "Expecting a stackmap frame at branch target" when running Maven integration testing -

i’m using maven 3.2.3 version of java davea$ echo $java_home /library/java/javavirtualmachines/jdk1.8.0_45.jdk/contents/home when run mvn clean install i errors below in integration tests … testfindsampleusersbycodeascbydefault(org.mainco.subco.user.service.sampleuserservice2it) time elapsed: 2.204 sec <<< error! java.lang.verifyerror: expecting stackmap frame @ branch target 57 exception details: location: org/mainco/subco/user/service/sampleuserserviceimpl$valuecomparator.compare(lorg/mainco/subco/user/domain/user;lorg/mainco/subco/user/domain/user;)i @10: ifnull reason: expected stackmap frame @ location. bytecode: 0x0000000: 2ab4 001b 2bb9 002e 0200 c600 2f2a b400 0x0000010: 1b2b b900 2e02 00c0 0030 b600 34c6 001c 0x0000020: 2ab4 001b 2bb9 002e 0200 c000 30b6 0034 0x0000030: b600 39b6 003e a700 0512 404e 2ab4 001b 0x0000040: 2cb9 002e 0200 c600 2f2a b400 1b2c b900 0x0000050: 2e02 00c0 0030 b600 34c6 001c 2ab4 001b 0...

Trigger Amazon SNS message via Amazon Lambda -

i have amazon lambda instance , amazon sns instance. lambda code watches changes in our database , make call amazon sns send pushes our users. example: when user on 1 of our forums gets new message, lambda code recognizes change every time run (every 10 minutes) , should send push user's smartphone via sns. i'm running wall when comes documentation; amazon's docs talk how trigger lambda code via sns, not reverse. have example of how can accomplish this? yes, can use aws lambda achieve want. need give proper iam permissions allowing lambda iam role publish messages sns topic . example sns publish iam policy : { "statement":[ { "effect":"allow", "action":"sns:publish", "resource":"arn:aws:sns:*:<your account id>:<your topic id>" } ] }

c# - Looking for other ways to hide abstract inheritance method from a subclass? -

i want inherited method invoke() hidden final subclass concreteexecutableplugin . whole situation: public abstract class pluginbase { public abstract void invoke(idictionary parameters); } public abstract class jobplugin : pluginbase { protected void checkparameter(){//....} public bool isactive(){//....} } public class concretejobplugin : jobplugin { public override void invoke(idictionary parameters){//...} } public abstract class executablejobplugin : jobplugin { protected abstract void initialize(idictionary parameters); public sealed override void invoke(idictionary parameters) { //final realization of invoke() method } } public class concreteexecutableplugin : executablejobplugin { //here want method invoke() has been hiden //!!!or use base.invoke() better? protected override void initialize(idictionary parameters) { //concrete plugin initialization } } i have found 1 soluti...

css - jQuery tooltip class not working after ajax call -

Image
i have functions called onclick events, works excelent. send $.post() request , on success retrieve (data) returned php file called in post() request. my wierd problem jquery tooltip plugin doesn't read css stylesheet after ajax call, partially. yeap, that's why said wierd. i customized tooltip black, 3 rounded corners , small, white text, , looks great, after ajax call, corners , size of text changed (all corners rounded , bigger text). tooltip works looks strange. here's code: css declarations #atooltip { position: absolute; display: none; z-index: 50000; } #atooltip .atooltipcontent { position:relative; margin:0; padding:0; } .defaulttheme { border:2px solid #444; background:rgba(102,102,102,1); color:rgba(255,255,255,1); text-shadow:0 0 3px #666; font-weight:bold; font-size:11px; margin:0; padding:3px 6px; -moz-border-radius: 12px 12px 12px 0; -webkit-border-radius: 12px 12px 12px 0; -khtml-border-radius: 12px 12px 12px 0; border-radius: 1...

c# - Model not binding on RedirectToRoute -

i've scoured , down answer thought common problem, haven't been able find solution... here's question: i have following model: public class usermodel { public string usertype { get; set; } public string username { get; set; } public string password { get; set; } public string userclaim { get; set; } public string redirectaction { get; set; } public string jsonwebtoken { get; set; } public string message { get; set; } } i'm "populating" model in web api controller: return redirecttoroute("default", new { controller = "redirect", action = "ssoredirect", method = "get", usertype = thisuser.usertype, username = thisuser.username, password = thisuser.password, userclaim = thisuser.userclaim, redirectaction = this...

ios - How to use setHTTPBody from UITextField input -

i using mycontacts restful api integrate in application. now, want use username , password entered uitextfield not manually. not know, how in sethttpbody. suggestions? nsurl *url = [nsurl urlwithstring:@"https://api.addressbook.io/v1/login"]; nsmutableurlrequest *request = [nsmutableurlrequest requestwithurl:url]; [request sethttpmethod:@"post"]; [request setvalue:@"application/json" forhttpheaderfield:@"content-type"]; //here want use username , password obtained uitextfield. [request sethttpbody:[@"{\n \"username\": \"enter username\",\n \"password\": \"enterpassword\",\n \"client\": \"apiary\"\n}" datausingencoding:nsutf8stringencoding]]; nsurlsession *session = [nsurlsession sharedsession]; nsurlsessiondatatask *task = [session datataskwithrequest:request completionhandler: ^(nsdata *data, ns...

scheduling - Round robin worst case response time -

the pseudo-codes below shows typical round robin software architecture. if every device requires 20ms service , updatelcd() requires 10ms execute, worst case response time? void main (void) { while(1) { if (!! device needs service) { !! handle device } if (!! device b needs service) { !! handle device b } . . . . if (!! device d needs service) { !! handle device d } updatelcd(); } } since there total of 4 devices (a,b,c,d) , if after servicing device a, device needs servicing, worst case response time here should 20+20+20+10 = 70ms (assuming devices b, c , d needs servicing). however, in answer selection, there only: 85ms, 110ms, 35ms , 25ms. think need on understanding of round robin architecture.. thanks! first, math wrong: if there 4 devices (a, b, c, , d), worst case time 20*4 + 10 = 90ms. by process of elimination, though, can't 85, 35, or 25 (since provided times multiples of 10...

c++ - Display geotiff images with qt -

i trying make graphical interface script projecting dsms (geotiff file) on images. thought idea display both image , dsm before making computations. unfortunately, if there no problem display image, have following error while trying display dsm: tiffreaddirectory: warning, foo: unknown field tag 33550 (0x830e) encountered. tiffreaddirectory: warning, foo: unknown field tag 33922 (0x8482) encountered. tiffreaddirectory: warning, foo: unknown field tag 42112 (0xa480) encountered. tiffreaddirectory: warning, foo: unknown field tag 42113 (0xa481) encountered. foo: sorry, can not handle images 32-bit samples. qpixmap::scaled: pixmap null pixmap here trying: qstring s1 = qfiledialog::getopenfilename(this, "open dsm", "/home", "images (*.png *.xpm *.jpg *.tif *.tiff)"); ui->dsmpath->settext(s1); qpixmap dispdsm(s1); int w = ui->dsmdisplay->width(); int h = ui->dsmdisplay->height(); ui->dsmdisplay->setpixmap(dispdsm.scaled(w,h,qt:...

angularjs - bootstrap Label type=checkbox not setting on scope -

using angular. i have label type=checkbox , class=btn btn-default. have set ng-model="{{vurd.vurderinger}}" , set ng-true-value="ho" , ng-false-value="". <label type="checkbox" class="btn btn-default" ng-model="vurd.vurderingsudfaldid" ng-true-value="'ho'" ng-false-value="''">ok</label> it not setting $scope = vurd.vurderingsudfaldid true or false value when clicking. there bootstrap label+input type i'm not getting? the following example working not way want button : <input type="checkbox" ng-model="vurd.vurderingsudfaldid" ng-true-value="'bo'" ng-false-value="''" /> you still need have input type of checkbox.. not label type of checkbox. 1 of these alternatives work you? http://plnkr.co/edit/9cbr5z6eqmbdsjigngh9?p=preview the first option shows checkbox: <label><input type=...

iphone - iOS Blank White Space at bottom of viewcontroller -

Image
a strange white space appears @ bottom of viewcontroller disappear. white space hides button @ bottom left. please, me out, i've searched lot thing came across is self.automaticallyadjustsscrollviewinsets = false; but it's not working thanks this can happen due either of 2 reasons 1. view overlapping view 2. height view not enough contain contents , view.clipstobounds set yes. view debugging option in xcode can show happening. reproduce issue in simulator , press 'debug view hierarchy' button in xcode. xcode render 3d model of view hierarchy can view angle moving model around mouse. click on point on model , xcode tell view , can identify overlapping view.

xml - Unclear use of // in XPath -

let's @ following xml file: <a> <b w="w"> <b1 x="x" /> <b2 y="y" /> </b> </a> the following xpath query returns elements b1 , b2 : /*/*//* from conclude //* means select elements descendants of b not including b itself . however following xpath query returns attributes w , x , y : /*/*//@* so conclude //@* means select attributes appear in descendants of b including b itself . how work? // work differently elements vs attributes, or there i'm missing? // short /descendant-or-self::node()/ /* meanwhile identifies child nodes current position. starting root, /*/*// therefore moves <a> (child of root) , <b> (all children of <a> being single <b> ) , selects descendant-or-self::node() , say, <b> , <b1> , <b2> . it's starting point of <b> , <b1> , <b2> matched /*/*// 2 paths differ. /*/*//*...

r - Multiplying one matrix with a set of scalars -

i have r script systematically perform changes 3x3 matrix scalar multiplication follows r <- matrix(rexp(9, rate=.1), ncol=3); (i in 1:360) { k = i*r; ... } and use modified matrix further calculations within loop. however, loop nested inside 2 other loops, making script slow. question is, how can vectorize innermost loop such result instead three-dimensional array of size 3x3x360 where a[,,i] = i*r; for ranging 1 360? how basic multiplication , reshaping set.seed(15) #for reproducibility r <- matrix(rexp(9, rate=.1), ncol=3); r # [,1] [,2] [,3] # [1,] 2.042281 1.760375 2.9230182 # [2,] 19.466458 6.628580 0.1818078 # [3,] 2.544348 27.541514 4.1325714 dd <- array(sapply(1:360, `*`, r), dim=c(dim(r), 360)) dd[,,1] # [,1] [,2] [,3] # [1,] 2.042281 1.760375 2.9230182 # [2,] 19.466458 6.628580 0.1818078 # [3,] 2.544348 27.541514 4.1325714 dd[,,2] # [,1] [,2] [,3] # [1,] 4.084562 3.520749 5...

asp.net - how to disable the particular log, dynamically in Nlog using C#? -

i tried disable particular log in nlog config , added logger name="*" minlevel="trace" maxlevel="trace" writeto="t" enabled="false" is working fine. need programmatically in c#. you need this: // lookup rule in nlog config var rule = logmanager .configuration .loggingrules .firstordefault(_ => _.loggernamepattern == "*"); // disable rule if (rule != null) rule.disableloggingforlevel(loglevel.trace);

libsvm - SVM in R library e1071 error in predict function -

i'm using model , predict of library e1071, seems working fine training , test data, not new data i'm providing. code: data2<-read.table('checked.bed') data3<-read.csv('result_20_02.csv', header = false) index<-1:nrow(data2) testindex<-sample(index,trunc(length(index)/3)) testset<-data2[testindex,] trainset<-data2[-testindex,] model1<-tune.svm(v3 ~ .,data=trainset,gamma=10^(-6:1),cost=10^(1:3)) bestgamma<-model1$best.parameters[[1]] bestc<-model1$best.parameters[[2]] svm.model<-svm(v3 ~ .,data=trainset,method='c-classification', kernel='radial', cost=bestc,gamma=bestgamma,verbose=true,cross=10) svm.pred<-predict(svm.model,testset[,-3],decision.values = true) svm.pred1<-predict(svm.model,data3[,-3],decision.values = true) svm.pred working fine, not svm.pred1. error: error in scale.default(newdata[, object$scaled, drop = false], center = object$x.scale$"scaled:center", : length of...

Using a javascript Object attribute's value as a function name -

i have following javascript code function myfunc () { var add = function () { return "hello add"; }; var div = function () { return "hello div"; }; var funccall = function (obj) { if (!obj) { throw new error("no objects passed"); } return obj.fname(); }; return { func: function (obj) { funccall(obj); } }; } var lol = new myfunc(); when lol.func({fname: add}); passed should invoke function private function add or when lol.func({fname: div}); passed should invoke private div function. have being tried not work. how can achieve this. demo in case it's better store inner function in object can access variable name. if define function "map" var methods = { add: add, div: div }; you able call methods[obj.fname](); . full code: function myfunc() { var add = function () { return "hello add...

openssl - Should the same Random Number Generator be used for multiple crypto operations -

is recommendable instantiate openssl or crypto++ cryptographically secure random number generator, seed once, , use sequentially in multiple cryptographic operations generating keys, encryption, signing etc.? will be secure enough handle multiple uses without compromising security? is considered safe practice use different prngs each operation , seed them differently? there nuances should considered? stay same cryptographically secure prng. know seems make more sense change, big mistake apply common sense when higher math called for. never "roll own" crypto, or change methods, or make "improvements" no matter how sense seem make. stick proven methods, tested algorithms, , open source code written people reputation. cryptographically secure prngs different standard prngs used things monte carlo simulation. designed unpredictable when long sequence of values taken. if try "improve" on switching, more screw up. also, hardware true rngs c...

javascript - Toggle Background Image HTML -

i have simple question, need make switch/button in user clicks toggle background image on or off here's code: body style = "background-image: url('websitebg.jpg')" and here's css it: <style> body{ background-size: cover; background-repeat: no-repeat; background-attachment: fixed } </style> well, can using jquery or javascript . basic idea toggle class of body tag. see example below : javascript solution : html: <body> <div style="color:red;">some random text here</div> <input type="button" id="btnback" value="toggle background" /> </body> css: body { background-size: cover; background-repeat: no-repeat; background-attachment: fixed } .bgclass { background-image: url('http://freedomwallpaper.com/wallpaper2/funky-wallpaper-hd.jpg'); } javascript var btnback = document.getelementbyid(...

java - wsimport -extension equivalent Apache CFX command? -

i have wsdl , have non-unique operation signatures. can create client jax-ws below command(with parameter -extension ). wsimport -s build/src http://localhost:9080/testservice/test?wsdl -extension how can generate client apache cfx wsdl2java tool. of paces asked use -validate=none maven below. <wsdloption> <wsdl>${basedir}/src/main/wsdl/my.wsdl</wsdl> <validate>none</validate> </wsdloption> is there way generate web service client wsdl2java tool command line ? in order generate client can use wsdl2java this wsdl2java -client <wsdlurl> here full command description. wsdl2java -fe|-frontend -db|-databinding -wv -p <[wsdl-namespace =]package-name>* -sn -b * -reserveclass * -catalog -d -compile -classdir -impl -server -client -clientjar -all -autonameresolution -allowelementreferences|-aer<=true> -defaultvalues<=class-name-for-defaultvalueprovider> -ant -nexclude * -exsh <(tr...

select - find biggest value field from table mysql -

would know , how find biggest value storing field table .? table has 40 fields string , know field has biggest string.. thanks run following query on each column. select max(length(column_name)) table_name;

scala - Confusing resolution of a named argument -

a following code giving me error scala 2.11.7 confusing me: class a(val a: string, val bval: option[string] = none) { val b: string = bval.getorelse("") def copy(a: string = a, b: option[string] = some(b)) = new a(a, b) } the intellij ide not showing error, on compile error: error:(4, 52) type mismatch; found : option[string] required: string def copy(a: string = a, b: option[string] = some(b)) = new a(a, b) ^ for comparison, compiles fine: class a(val a: string, val bval: option[string] = none) { val b = bval def copy(a: string = a, b: option[string] = some(b.getorelse(""))) = new a(a, b) } when replace some(b) some(this.b) , error goes away, still confusing me why error there in first place. looks compiler resolving b in some parameter of copy , not b member of a . if case, how can second version compile without error? this has got bug. scope of default expression includ...

process - How to parse an email from the custom folder from the outlook.office365.com and move it to the another customfolder after processing it? -

how parse(retrive) email custom folder outlook.office365.com , move customfolder after processing it? i have used pop3client think doesn't contain facility retrieve email specific folder , move email custom folder. thanks, kandarp

video is not displayed on smartphone using video tag html5 -

i'm making landingpage website. use video display, problem video not shown on phone when go website. code used implement video <video autoplay loop id="bgvid"> <source src="video/bgvid7.mp4" type="video/mp4"> </video> does know how solve ?

objective c - Getting Ensembles Idiomatic OSX App to sync with iCloud -

i try implement ensembles icloud sync cocoa app of our working , syncing ios apps. because have problem in cocoa app, thought try ensembles sample app. so try idiomatic app osx sync through icloud. same error, not logged icloud, because [filemanager urlforubiquitycontaineridentifier:ubiquitycontaineridentifier] always returns nil me. i logged icloud on macbook , sync eg dayone works fine between iphone , macbook. so, not being logged in not problem. question is, why filemanager not return identifier? i hassle 3 days , worked time , broke because of 'i don't know'. restored ~/library folder timemachine , worked time again, broke again. created new os user , used apple-id icloud, worked time , broke again. i little confused, not sure, if has do, signing, sandboxing, provisioning ... or whatever. so, did do? i opened ensembles 1.4 idiomatic project, on target-general -tab changed bundleidentifier , enabled macappstore signing , chose our devteam . ...

What is the latest version of Entity Framework? -

according stuff on net it's 6.1.2 according version number in files i've got coworker, it's higher so. ef delivered microsoft msdn should right place check. isn't it? please note i'm not talking abut azurific preview version 7. i'm talking version 6 later subversion. trust here? ef 6.1.3 latest version @ time, released in march, , @ least officially mentioned in monday's rtm of vs2015 http://blogs.msdn.com/b/adonet/archive/2015/07/20/entity-framework-and-visual-studio-2015-rtm.aspx however, 6.1.3 minor bug fixes, why there little fanfare , mention believe.

performance - Matlab only using half of each core -

i running matlab code on 4 core computer. using parfor command expected matlab using 4 cores run it. however, when go task manager see half of each core used - i.e. in total 50% of cpu taken matlab. is there reason why matlab not using full 100%? i not sure whether appropriate forum question. if not, please let me know. thanks, v the explanation have hyperthreading turned on. windows see things if there 8 cores rather 4. if turn hyperthreading off, bet you'll see rising 100%. matlab doesn't benefit hyperthreading in case (in fact there may small reduction in performance), if concern maximise matlab performance may turn off. of course, other applications (such outlook or word) benefit hyperthreading may suffer if that. there other possibilities - example, other cpu (such file i/o, memory) may bottleneck in application - if you're seeing consistent 50% usage, bet hyperthreading reason.

java - cannot resolve symbol setOnPageChangeListener -

i couldnot find relevant solution scenario.i working on select respected tab manually on tab swipe..i learning http://www.androidgreeve.com/2014/01/android-actionbar-navigating-with-swipeable-tabs-and-views.html in mainactivity ,on adding viewpager.setonpagechangelistener doesnot recognizes ..it thows error ... cannot resolve symbol setonpagechangelistener here code package com.example.administrator.fragmentsexample; import android.support.v7.app.actionbar; import android.support.v4.view.viewpager; import android.os.bundle; import android.support.v7.app.appcompatactivity; import com.example.administrator.adapter.tabspageradapter; public class mainactivity extends appcompatactivity implements actionbar.tablistener { private viewpager viewpager; private tabspageradapter madapter; private actionbar actionbar; // tab titles private string[] tabs = {"social", "organizer", "movies"}; @override protected voi...

ruby - Access variable hash depth values with square brackets notation -

given hash: hash1= { node1: { node2: { node3: { node4: { node5: 1 } } } } } we access inside nodes square brackets this: hash1[:node1][:node2][:node3][:node4] now have hash know nested xml response soap webservice, neither depth of hash nor names of nodes stay same. nice if ask user of application hash depth , store in variable. , able hash1[:hash_depth] , achieve same result above. i have accomplished want following code: str = 'node1,node2,node3,node4' str_a = str.split(',') hash_copy = hash1 str_a.each { |s| hash_copy = hash_copy.[](s.to_sym) } hash_copy => {:node5=>1} hash1[:node1][:node2][:node3][:node4] => {:node5=>1} that asking user enter hash depth separated commas, store in string, split it, make array, clone original hash, go down each level , modify hash till desired node. there way square brackets notation , using variable store depth without modifying hash or needing clone it? edit : answered following (can't see post a...

git - GitEye - No Repository Selected -

i "no repository selected". how select repository? googled it, did not found solution. searched whole giteye ui seems there no possibility select repository. many people claim "enabling linking between git staging view , other views" solved issue. please refer post on so . "enabling linking between git staging view , other views" didn't in case. tried deleting branch , checking out again. nothing worked. what did was: right click on of modified file -> team -> commit. somehow worked , see modified files in unstaged changes.

c# - Set specific card caption Layout View Devexpress -

i use devexpress grid control layout view. want set 1 card caption when newly added (for example "new card") , when card lose focus set caption default ("record [x of x]") as far can see, trying provide specific caption new card. if suggest review following devexpress support center 's thread, issue has discussed: how change card caption new card . related articles: card caption localizing winforms controls via localizer objects

jquery - How to use window.location.reload -

i new jquery, advise , appreciated. the aim is: when user refreshes page below jquery action should take place unsure how use window.location.reload in code - advise appreciated <script> $(document).ready(function () { $ window.location.reload(true); $(".message-content" ).removeclass( "hide" ) $(".unlimited-content" ).addclass( "hide" ) $(".basic-content" ).addclass( "hide" ) $("#paypal_express_checkout input:first").val("10165346"); }); }); </script> i decided try below, partially works displays jquery action automatics refresh not display result of jquery code excuted <script> $(window).on('beforeunload', function(){ $(".message-content" ).removeclass( "hide" ) $(".unlimited-content" ).addclass( "hide" ) $(".basic-content" ).addclass( ...

ios - WatchKit super.awakeWithContext() and super.willActivate() -

i wondering if should set objects before or after these methods in watchkit, , why? i think saw wwdc video saying should before super.willactivate(), can not remember 1 is. anyone can help? what should following: override func awakewithcontext(context: anyobject?) { // call super super.awakewithcontext(context) // whatever want self.dointerfaceconfiguration() } in method, should interface configuration. main reason behind doing configuration here in point can sure outlets connected objects , controller configured. more methods can found in apple docs . edit: answer second question willactivate() method, taken documentation: the willactivate method lets know when interface become visible on apple watch. use method make last minute updates controls or start times or other tasks. (do not use initialization.) use corresponding diddeactivate method perform final cleanup.

c# - Backgroundworker and CPU usage -

i need background work every 20 seconds (it doesn't have 20000ms, can allow delays). using backgroundworker executes function , wait 20 seconds using timer: private readonly backgroundworker worker = new backgroundworker(); volatile bool keepworkerrunning; worker.dowork += worker_dowork; private void worker_dowork(object sender, doworkeventargs e) { system.timers.timer atimer = new system.timers.timer(); atimer.elapsed += new elapsedeventhandler(ontimedevent); atimer.interval = 20000; atimer.enabled = true; keepworkerrunning = true; while (keepworkerrunning) ; atimer.enabled = false; } this worker active whole time while software running. the problem takes of cpu. noticed software using around 70% of cpu time, , deactivating backgroundworker cpu usage drops 0.5%. how can same job without overloading cpu? the cpu eaten loop: while (keepworkerrunning); you instruct cpu loop "doing not...

This is Dropdown can you please tell me how to select 2nd or 3rd option from the dropdown in selenium webdriver. Mr is default selected -

i not able select dropdown value. can please me out. <div id="sbholder_43830942" class="sbholder" tabindex="1"> <a id="sbtoggle_43830942" class="sbtoggle" href="#"/> <a id="sbselector_43830942" class="sbselector" href="#">mr.</a> <ul id="sboptions_43830942" class="sboptions" style="top: 24px; max-height: 100px; display: none;"> <li><a class="" href="#mr" rel="mr">mr.</a> </li>` <li><a class="" href="#ms" rel="ms">ms.</a></li> <li><a class="" href="#mrs" rel="mrs">mrs.</a></li> <li><a class="" href="#mx" rel="mx">mx.</a></li> </ul> </div> //clicks on drop down box ...

c# - What is an IndexOutOfRangeException / ArgumentOutOfRangeException and how do I fix it? -

i have code , when executes, throws indexoutofrangeexception , saying, index outside bounds of array. what mean, , can it? depending on classes used can argumentoutofrangeexception an exception of type 'system.argumentoutofrangeexception' occurred in mscorlib.dll not handled in user code additional information: index out of range. must non-negative , less size of collection. what it? this exception means you're trying access collection item index, using invalid index. index invalid when it's lower collection's lower bound or greater or equal number of elements contains. when thrown given array declared as: byte[] array = new byte[4]; you can access array 0 3, values outside range cause indexoutofrangeexception thrown. remember when create , access array. array length in c#, usually, arrays 0-based. means first element has index 0 , last element has index length - 1 (where length total number of items in array) code doesn...