Posts

Showing posts from February, 2015

php - Retrieving aggregated results from two queries -

i trying figure out best way compare results 2 queries , display difference. table 1 = user table table 2 = page table table 3 = assigned table example: there users 1 , users 2 in user table. user 1 has been assigned 10 pages, user 2 has been assigned 1 page. this works fine finding pages have assigned, 1 page example. select * assigned_table user= 2 but can not figure out how results of other pages doesn't have access to. this not work because there user 1 has access 10, gets results of other users except user2 select * assigned_table user != 2 so need pages user2 have access to, , pages not have access , display both results separately any assistance appreciated. sorry if similar topic posted elsewhere, unable find looking for. you should use join this. here's documentation on https://dev.mysql.com/doc/refman/5.0/en/join.html . something like select pt.pagename `assigned table` @ join `page table` pt on at.pageid = pt.id at.use...

ini set - Probem with max_execution_time during file import in php 5.4.22 -

php version : php version 5.4.22 js :extjs i'm facing problem below: i've csv import in php , after 30 30.5 seconds xhr process canceled, browser ( chorme, firefox ) hang on , finished process. all data imported database. ok, that's : @ beginning , @ end of import function i've log-function ( start ) , @ end ( end: xx imported files. ) the problem is, in database 2 start , 2 end log entries. i looks, during second start of function these entries generated. i read lot of stackoverflow posts , php.net too, there no solution. if've tried : ini_set('max_execution_time', 0); ini_set('memory_limit', '128m'); ini_set('upload_max_filesize', '12m'); but without result. michael i've change following setttings remoteapi.maxretries = 0; remoteapi.timeout = 300000; now work perfekt!!

r - Updating only certain values of data frame based on match -

i'm trying update variable ( popsnp ) in higher scope within lapply , on basis of match. can't quite figure out syntax updating values though, have overwrites existing values na : lapply(1:22, function(i){ in.name<-paste("/data/mdp14aps/ld/chr", i, ".ld", sep="") out.name<-paste("/data/mdp14aps/r/ldatachr", i, ".rda", sep="") ldata<-read.csv(in.name, sep="", header=true, colclasses=c(na,na,na,na,na,na,"null")) freq<-count(ldata, c("snp_a", "chr_a", "bp_a")) #the part i'm not sure popsnp$chrom<<-freq[match(popsnp$marker, freq$snp_a),2] popsnp$position<<-freq[match(popsnp$marker, freq$snp_a),3] popsnp$freq<<-freq[match(popsnp$marker, freq$snp_a),4] save(ldata,file=out.name) rm(ldata, freq) }) i want preserve values i'm setting between iterations of lapply end popsnp containing all val...

Biztalk: Side-by-Side Versioning in different Applications -

i want deploy 2 applications, publish biztalk wcf service publishing wizard different endpoints. second application new version of first application. have changed assembly version , target namespaces in schema properties. applications , ports have different names. the first application works before deploy second application. then first 1 fails following message: <s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:body> <s:fault> <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:internalservicefault</faultcode> <faultstring xml:lang="de-de">&lt;?xml version="1.0"?> &lt;string>unexpected error occured.&lt;/string></faultstring> <detail> <exceptiondetail xmlns="http://schemas.datacontract.org/2004/07/system.servicemodel" xmlns:i="http://www.w3.org/2001/xmls...

numpy - How to replace certain symbols in dtype.names in Python? -

i have data file of form given below: column_1 column 2 column-3 column-4 column_5 column 6 1 2 3 1 2 3 4 3 2 3 2 4 1 4 3 1 4 3 5 6 4 5 6 4 when import following file header names spaces automatically replaced underscores replace spaces. how preserve hyphens. code used is: import numpy np open('data.dat', 'rb') f: header = f.readline().split('\t') arr = np.genfromtxt(f, names = header, comments='#', delimiter='\t', dtype=none) arr.dtype.names = [j.replace('_', ' ').replace('-', ' ') j in arr.dtype.names] print arr.dtype.names output ('column_1', 'column_2', 'column3', 'column4', 'column_5', 'column_6') how hyphens of column 3 , 4 in python? hint - can use regex extracting data in columns, above case expression similar exp = r'column.\d'

Java program crashes while updating the database (hibernate) -

i developing java app client. have postgresql table (dossier) 21 columns. in 1 of functions have save 13 rows of 21 columns each in database. doing using 1 hibernate session; if not program crashes. database save 13 rows crashes, don't know if asking don't know way of doing this. if not application works perfectly, issue. here code: private void creeretchargerar(string numdossier) throws exception{ //creation du dossier //start session session1= hibernateutil.getsessionfactory().opensession(); transaction tx1 = session.begintransaction(); dossieraras dossier = new dossieraras(); dossierarasid iddos = new dossierarasid(); iddos.setmatricule(labelmatricule.gettext()); iddos.setcode(labelcode.gettext()); iddos.sethorodatage(control.horodatage()); iddos.setdatedebutdemande(control .datelabelswttodatepostgres(labeldatedebdemande .gettext())); iddos.settypeattestation(labeltypeatt.gettext()); ...

javascript - Dynamic radio button value 1 checked by default -

i use code display radio buttons, code , values loaded dynamically, cannot add checked html. the differences between radio buttons values. is there way let value 1 selected default? code: <div class="input-box"> <strong><?php echo $this->__('would recommend product friend?') ?></strong> <?php foreach ( $this->getoptions() $option ): ?> <label class="recommend"> <input type="radio" name="recommend" id="recommend_field" class="radio-gender" value="<?php echo $option['value'] ?>"<?php if ($option['value'] == $value) echo ' checked="checked"' ?>><?php echo $this->__($option['label']) ?></input> </label> <?php endforeach ?> </div> please try bellow code select first radio button on page load jquery(docum...

ios - Find out if Character in String is emoji? -

i need find out whether character in string emoji. for example, have character: let string = "😀" let character = array(string)[0] i need find out if character emoji. what stumbled upon difference between characters, unicode scalars , glyphs. for example, glyph 👨‍👨‍👧‍👧 consists of 7 unicode scalars: four emoji characters: 👨👩👧👧 in between each emoji special character, works character glue; see the specs more info another example, glyph 👌🏿 consists of 2 unicode scalars: the regular emoji: 👌 a skin tone modifier: 🏿 so when rendering characters, resulting glyphs matter. what looking way detect if string , 1 emoji. render larger normal text (like messages on ios10 , whatsapp nowadays). described above, character count of no use. (the 'glue character' not considered emoji). what can use coretext break down string glyphs , count them. furthermore, move part of extension proposed arnold , sebastian lopez separate extension of...

php - SQL injection from an Active Directory -

i have problem don't understand. want make php script fill sql's tables active directory. here part of code : $result=ldap_list($connect, "ou=profs,".$base_dnref, "(ou=*)"); $res = ldap_get_entries($connect, $result); ($i=0; $i < $res["count"]; $i++) { $result2=ldap_list($connect, "ou=".$res[$i]["ou"][0].",ou=profs,".$base_dnref, "(cn=*)"); $res2 = ldap_get_entries($connect, $result2); for($j=0;$j<$res2["count"];$j++){ $insert=$db->query("insert professeurs(nom) values ('".$res2[$j]["cn"][0]."')"); $insert->fetch(); } } $result=ldap_list($connect, "ou=eleves,".$base_dnref, "(ou=*)"); $res = ldap_get_entries($connect, $result); ($z=0; $z < $res["count"]; $z++) { $insert=$db->query("insert classe(numero) values ('".strval($res[$z]["ou"][0])."')"); $i...

android - How to exactly fit camera preview to the screen -

i need have portrait activity , actionbar , fill rest of screen camera preview. should not squeeze or strech image. on devices ratio of screen not fit ratio of avilable camera outputs. action bar decreases available height, too. for example, display size of sony xperia t2 ultra d5303 1208x720. however, avilable camera sizes given getsupportedpreviewsizes() are: 1200x1600 720x1280 720x960 480x720 480x640 320x480 288x352 240x320 144x176 the optimal camera output (th 1 closest ratio) 720x1280. thus, camera preview not fill screen, there black blocks both on left , right. is there way of filling screen without deteriorating image? (cropping top , bottom, perhaps)

how to request angular version that is lower than default with angular-meteor -

i'm trying use third party commercial js library in angular-meteor project vendor informed me, support angular version 1.3.11 is there way install urigu:angular-meteor specific version of angular? according meteor documentation can set version using @= should that: meteor add angularjs:angular@=1.3.11 however, doing might have versions conflict that: >meteor add angularjs:angular@=1.3.11 => errors while adding packages: while selecting package versions: error: potentially incompatible change required top-level dependency: urigo:angular 0.6.8, 0.8.4. constraints on package "urigo:angular": allow potentially incompatible changes top-level dependencies, must pass --allow-incompatible-update on command line. so have here few alternatives: downgrade urigo:angular: think not option, there might major changes since package pretty new. convince vendor "take risk" since angular more mature angular-meteor , 1.3.11 1.3.15 should ...

javascript - New to web developing, got an error (jsfiddle) -

i absolute begginer web developing , want chance calculator in online tool: jsfiddle. got error:"shell form not validate" , strange errors after. here html code: <body> <form method="post">the chance of succes: <input type="number" name="chance"> <br>how many tries: <input type="number" name="tries"> <br> <input type="submit" value="calculate!"> <br> </form> </body> and javascript code is: function calculate(chance, tries) { console.log(chance / tries * 100); } as said, new please try explain step step. you have few problems. 1 form trying submit itself. calculate function never called. your parameters function never called either. let's change inputs have id instead of name. example: <input type="number" id="chance"> this makes easi...

hyperlink - HTML link scroll down the page -

<div class="menu right-float clearfix"> <nav id="main-nav"> <ul> <li class="current-menu-item"><a href="#home" class="scroll-to">home</a></li> <li><a href="#gaelic" class="scroll-to">gaelic sports</a></li> <li><a href="#soccer" class="scroll-to">soccer</a></li> <li><a href="#cricket" class="scroll-to">india cricket</a></li> <li><a href="#contact" class="scroll-to">contact</a></li> <li><a href="#basket" class="scroll-to">basketball</a></li> </ul> </nav> <nav id="menu-controls"> <ul> <li class="current-menu-item"><a href="#home" class="scroll-to"><s...

java - Not able to send message to Solace JMS Queue -

i need push message solace jms queue webpshere getting below error during send message. have increase message listener size not solved problem. error: 503: spool on quota. message vpn limit exceeded caused by: com.solacesystems.jcsmp.jcsmperrorresponseexception: 503: spool on quota. message vpn limit exceeded - topic '#p2p/que/testqueue' [subcode:30] @ com.solacesystems.jcsmp.impl.jcsmpxmlmessageproducer.getandprocessresponse(jcsmpxmlmessageproducer.java:1001) @ com.solacesystems.jcsmp.impl.jcsmpxmlmessageproducer.handlepubmsgresponse(jcsmpxmlmessageproducer.java:1621) this not configuration problem on listener side; solace queues can have several size limits applied, , 1 of them tripped here. there can limit entire message vpn, override queue specific size limits. there can configured limit on queue (testqueue) hit. to reduce spool usage on appliance, you'll have consume , ack messages queues in vpn or use queue browser delete messages direct...

c# - Add Multidimensional Array To List -

i have multidimensional double array number of rows , columns: var values = new double[rows, columns]; i have list of double arrays: var doublelist = new list<double[]>(); now, add each column in multidimensional array list. how do that? wrote illustrate want, not work violation syntax. for (int = 0; < columns; i++) { doublelist.add(values[:,i]; } you need create new array each column , copy each value it. either simple for-loop (like other answers show) or linq: for (int = 0; < columns; i++) { double[] column = enumerable.range(0, rows) .select(row => values[row, i]).toarray(); doublelist.add(column); }

spark sql failed to parse parquet -

spark sql parse parquet file, failed. cmd create temporary table testparquet using org.apache.spark.sql.parquet options ( path "file:////tmp/table_generic.parquet" ); this error log: java.lang.nullpointerexception @ parquet.format.converter.parquetmetadataconverter.fromparquetstatistics(parquetmetadataconverter.java:249) @ parquet.format.converter.parquetmetadataconverter.fromparquetmetadata(parquetmetadataconverter.java:543) @ parquet.format.converter.parquetmetadataconverter.readparquetmetadata(parquetmetadataconverter.java:520) @ parquet.hadoop.parquetfilereader.readfooter(parquetfilereader.java:426) @ org.apache.spark.sql.parquet.parquetrelation2$metadatacache$$anonfun$refresh$6.apply(newparquet.scala:298) @ org.apache.spark.sql.parquet.parquetrelation2$metadatacache$$anonfun$refresh$6.apply(newparquet.scala:297) @ scala.collection.parallel.mutable.pararray$map.leaf(pararray.scala:658) @ ...

javascript - populate one div with array data on if statement -

i have 5 div tags same id "answer" these div tags need execute script: document.getelementbyid("answer").innerhtml = answer; when trigger made (already completed, reference): var arranswers = ["specialword", "word1", "word2" "word3" "word4"]; socket.on('answer', function (answer) { console.log('answer: ' + answer); if ( $.inarray(answer, arranswers) > -1 ) { console.log('correct answer!'); } else { console.log('incorrect answer :('); } }); i have in html: <div class="answer"></div> <div class="answer"></div> <div class="answer"></div> <div class="answer"></div> <div class="answer"></div> i need make if answer correct, picks 1 empty div tag , populates answer specified variable "answer". i in theory...

javascript - display the value of all selected radio buttons on a form -

Image
i have multiple radio buttons generated in php loop looks this while(){ <input type="radio" id="picks'.$x.'" name="picks['.$x.']" value="'.$row['team1'].' " onclick="return disp()""><span>'.$team1.'</span> <input type="radio" id="picks'.$x.'" name="picks['.$x.']" value="'.$row['team2'].' "onclick="return disp()""><span>'.$team2.'</span> <input type="radio" name="picks'.$x.'" value="draw" onclick="return disp()"> } what want do display selected radio buttons in div on bottom of page my code var elmnts = document.getelementbyid("makepicksform").elements var lngth = document.getelementbyid("makepicksform").length; var div = document.getelementbyid("disppick...

registration - setKeepAliveTimeout is deprecated in iOS9 -

the current api changes ios9 state -setkeepalivetimeout:handler: deprecated. up now, way voip sip app on ios maintain registration sip-server. this technique used various apps linphone , others. does have view on proposed alternatives apple ? or sip crippled starting (post-)ios9 ? see: https://developer.apple.com/library/prerelease/ios/documentation/uikit/reference/uiapplication_class/index.html#//apple_ref/occ/instm/uiapplication/setkeepalivetimeout:handler : http://www.linphone.org/docs/liblinphone/group__ios.html apple document alternative in page linked: discussion in ios 8 , later, voice-over-ip (voip) apps register uiremotenotificationtypevoip remote notifications instead of using method.

excel vba - Replacing a variable in vba powerpoint -

i trying replace , save integer in vba powerpoint. i have variable in 1 subroutine named projectid. @ moment, variable set 617. in subroutine running user input method prompts user new projectid , stores new projectid replace "617". issue projectid go 0 when close powerpoint , reopen it. is there way physically replace code projectid = 617 projectid = 699 example. below code im working with, notice projid global veriable: dim projid integer sub changeprojid() dim strprojid string dim intprojid integer strprojid = inputbox("enter project id given example:", "project id input") on error goto notvalidid intprojid = cint(strprojid) projid = intprojid msgbox " new project id set " & intprojid & " until changed again" exit sub notvalidid: msgbox " must enter valid integer" end sub public sub commentconnect(control iribboncontrol) dim url string ...

javascript - ReCaptcha V2.0 IE 8 script error 5009 'Node' is undefined -

i working getting new recaptcha work on server application, in ie edge running ie 8 compatibility mode recaptcha breaks on 'recaptcha__en_gb.js, line: 29, column: 709' code "script5009: 'node' undefined". there work arounds this, , affect actual ie 8 browsers , not edge in ie 8 mode?

javascript - Gallery images overflow to left -

i working on carousel - gallery viewer website , have problems elements in it. images @ bottom overflowing left. have set overflow property hidden not seem work in side. in addition, images not affected property margin-right reason, margin left. here demo of image viewer: http://codepen.io/anon/pen/xbgdwo this code using image items. use margin-right show not working properly. .slider-item img { width: 100%; margin-left: 5px; margin-right: 5px; overflow: hidden; @include transition('all .2s ease-in-out'); } .slider-item:hover { img { @include transform(scale(1.1)); } } i appreciate if have @ it. have no idea fix it. thanks in advance. you don't need have overflow:hidden on image itself, containing element - have. the effect after works fine, have issue margin - have put on img when should on parent ( .slick-slide ). i have forked codepen here , fixed issue, added red background img container can see changes, code still messy gets job done. con...

Powershell regex filter files -

i trying filter files using powershell, need insert new line character in between </tr><tr> break separate lines , remove lines match <tr> lots of characters bte lots of characters </tr> , save files in place. forgive me, new powershell , simple in sed must use powershell. have wrong. get-content *.htm | foreach-object {$_ -replace '</tr><tr>', '</tr>\r\n<tr>'; $_}f get-content *.htm | foreach-object {$_ -replace '<tr>.*bte.*</tr>', ''; $_} so sounds need save changes original files. should able make these changes in 1 pass instead of reading files twice. get-childitem *.htm | foreach-object { $singlefilename = $_.fullname (get-content $singlefilename) -replace '</tr><tr>', "</tr>`r`n<tr>" -replace '<tr>.*bte.*</tr>' | set-content $singlefilename } you cant read , write same file in pipe. place (get-cont...

python - Numpy - Difference between two floats vs float type's precision -

i looking @ numpy.finfo , did following: in [14]: np.finfo(np.float16).resolution out[14]: 0.0010004 in [16]: np.array([0., 0.0001], dtype=np.float16) out[16]: array([ 0. , 0.00010002], dtype=float16) it seems vector able store 2 numbers such difference 10 times smaller type's resolution. missing something? floating point numbers have fixed amount of resolution after initial digit. number telling is, when first digit @ 1.0 position, resolution of number. can see trying add smaller amounts 1.0: in [8]: np.float16(1) + np.float16(0.001) out[8]: 1.001 in [9]: np.float16(1) + np.float16(0.0001) out[9]: 1.0 this related nextafter function, gives next representable number after given one. taking difference gives approximately resolution: in [10]: np.nextafter(np.float16(1), np.float16(np.inf)) - np.float16(1) out[10]: 0.00097656

actionscript 3 - Have Adobe changed Flash's ExternalInterface marshalling? -

i have application written in actionscript 3 has run on versions of flash runtime, including latest - flash 18. one section of code passes rather complex object (actually tree of objects) as3 js via externalinterface.call(). object has internal cyclic references, , used work, , including flash version 17. in flash 18 object no longer gets passed, there long pause, , stack overflow thrown. upon further inspection (with debugger , flashbuilder) find pause in tojson method getting called recursively (obviously not correctly handling cycles in object). the documentation externalinterface states marshalling done using xml , in past i've had problems when i've tried marshal data can't represented in xml work in json, appear having opposite issue, , quite backward step if cyclic references in existing compiled applications break. has else seen issue? do know if intentional, permanent, and/or documented? doesn't appear in release notes flash 18, far can see. ...

How to use newPosition(element, offset) in Google Document? -

i want place cursor @ beginning of new line after taken position : var position = document.getcursor(); i tried use document.newposition(element, offset) don't know put in element , in offset, if me appreciate it.

sql - How to setup influxDB -

i found influxdb there isn't many sources other there website. trying push networks info database every 30 seconds. how can add columns without points? there's no need , no way define columns or series front, write points , series automatically created.

javascript - launch other application in android/IOS devices with Cordova -

i try launch in cordova(phonegap) skype application on devices (android, ios, windows). i have compiled following function, works on samsung galaxy tab 3 (android). on many other mobile devices does'nt work function. on iphone , ipad not. the function: function launchskype() { var scheme; if (device.platform === 'ios') { scheme = 'skype://'; } else if (device.platform === 'android') { scheme = 'com.skype.raider'; } else if (device.platform === 'wp') { scheme = 'skype:'; } else if (device.platform === 'windows8') { scheme = 'skype:'; } navigator.startapp.check(scheme, function(message) { /* success */ navigator.startapp.start(scheme, function(message) { }, function(error) { /* error */ alert("skype not started!"); }); }, function(error) { alert("skype not installed!"); }); }...

sql server - Cannot enable Full-Text search on Azure SQL Database V12 -

i'm trying enable full-text search on azure sql database. upgraded db v12 standard instance. upgrade has got completed successfully. because status says "online" on portal. however, when execute command below, create fulltext catalog ftcatalog default; it throws error saying, msg 9972, level 16, state 100, line 2 database not started or not in online state. try full-text ddl command again after database started , becomes online. i following blog post what wrong? executing below 2 statements connecting database fixes if in case want avoid round trip of communicating msft. alter database [dbname] set read_committed_snapshot off rollback immediate alter database [dbname] set read_committed_snapshot on rollback immediate

java - Jamod Modbus Slave - assign registers -

i tried modbus slave program jamod library.i can set input register with: spi.addinputregister(new simpleinputregister(45)); i can set 3 input registers with: spi.addinputregister(new simpleinputregister(45)); spi.addinputregister(new simpleinputregister(45)); spi.addinputregister(new simpleinputregister(4563)); this registers 0,1 , 2. how can set registers register address 100,101,102? have add fake registers? greets andreas you can create "fake" registers adding registers in loop. won't create hole in modbus map, "fake" registers usable masters , won't cause illegal address exception responses. i have modified j2mod, fork of jamod, supports sparse modbus maps of svn revision 95. j2mod available on sourceforge.

java - JPA not receiving updated data -

i use managedbean goes db , defines bean properties db data. when update db data receive in bean not updated. the query in db this: private static final string jpql_find_by_id = "select c category c c.idcategory=:id"; @override public category findcatbyid(int id) { query query = em.createquery(jpql_find_by_id, category.class); query.setparameter("id", id); category cat = null; try { cat = (category) query.getsingleresult(); } catch (exception e) { e.printstacktrace(); } return cat; } the managed bean use category asks ejb make lookup in db: @managedbean public class categorybean { private string idcategorystr; private category category; private int id; @ejb private categorylookup categoryservice; @postconstruct public void init() { this.category = categoryservice.findcatbyid(id); //id defined in constructor system.out.println(this.category.getname());//this give...

Cannot precompile all files (app\assets) in rails application though rake assets:precompile -

i have rails application , try run local server on win2012 right. https://github.com/carloscoca/loccasions i tried precompile files in app\assets though command rake assets:precompile , no errors came out. however, ran website though localhost, incomplete need files , checked log file. (some files precompile others not, in manifest file same). i tried config.assets.compile = true, not result , configuration too, no luck started "/stylesheets/layout.css" 127.0.0.1 @ 2015-06-07 10:28:45 -0400 actioncontroller::routingerror (no route matches [get] "/stylesheets/layout.css"): rendered c:/ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.0ms) started "/assets/default.css" 127.0.0.1 @ 2015-06-07 10:28:45 -0400 served asset /default.css - 404 not found (2ms) actioncontroller::routingerror (no route matches [get] "/assets/default.css"): rende...

ios - Allow "auto lock" while video is being played -

no matter whether using mpmovieplayercontroller or avplayer ( avfoundation ), ios not allow device auto lock (to enter sleep mode ) while video playing. i have case extremely slow video being played in loop in background. while video playing, device never goes sleep. so far, option have detect when user did not make actions while , pause video. after that, device counts down "auto lock" duration specified in ios settings. i looking alternative avplayer make possible. similar questions: how allow iphone auto-lock while playing video is possible set avplayer allow device go sleep during video playback? how enable iphone auto lock during mpmovieplayer playback? i had idea use html5 video inside uiwebview , ios not allow autoplay on those. remember private api, i'm not sure if can use appstore release or not. tested on ios 9. avplayer *player = // alloc init... if ([player respondstoselector:nsselectorfromstring(@"_preventssleepduring...

Bootstrapping Chef to Windows Node failing -

i new chef , have chef server installed , chef dk installed on 1 windows 2008 r2 machine (the workstation), , trying bootstrap 2nd windows 2008 r2 machine workstation using: knife bootstrap windows winrm ip_of_node -x administrator -p password --node-name node1 -v -v and failing. have debug enabled , repeats following bunch of times before failing: ..debug: adding 192.168.0.101 debug: :session => :init debug: :relay_to_servers => echo . & echo response received. debug: :relayed => 192.168.0.101 debug: 192.168.0.101 => :run_command ..debug: adding 192.168.0.101 debug: :session => :init debug: :relay_to_servers => echo . & echo response received. debug: :relayed => 192.168.0.101 debug: 192.168.0.101 => :run_command ..debug: adding 192.168.0.101 debug: :session => :init debug: :relay_to_servers => echo . & echo response received. debug: :relayed => 192.168.0.101 debug: 192.168.0.101 => :run_command error: no response received remo...

swift - UUIDString unexpectedly found nil -

i working on piece of code using corelocation , clbeaconregion , i'm receiving error: fatal error: unexpectedly found nil while unwrapping optional value i want create region variable holding clbeaconregion so: let region = clbeaconregion(proximityuuid: nsuuid(uuidstring: "am_2015-06-10")!, identifier: "anymorning") a bit later in code, calling: locationmanager.startrangingbeaconsinregion(region) and when launch app, receive above error. right way solve this? "am_2015-06-10" not valid uuidstring! nsuuid(uuidstring: "am_2015-06-10")! crash application uuids (universally unique identifiers), known guids (globally unique identifiers) or iids (interface identifiers), 128-bit values.

python - Regex matching MAC address -

i'm trying valid mac addresses string: 00:1e:68:51:4f:a9 <-> 00:1a:8c:10:ad:30 9 540 8 336 17 876 90.457130000 198.0143 i've tried , few other regexes: ^([0-9a-f]{2}[:]){5}([0-9a-f]{2})$ regex 101 here: https://regex101.com/r/ki5ni6/1 i can't figure out why i'm not getting matches. you have remove anchors ^ , $ you have add a-z in character set.. or make searches case insensitive (?i) (i modifier) following work: ([0-9a-fa-f]{2}[:]){5}([0-9a-fa-f]{2}) see demo

javascript - Need to append / delete id into hidden field on "change" -

i ve got numérous checkboxes in page, each time click checkbox, id im interested in , fill hidden form. script working if unclick checkbox, should delete id hidden field (right appends again id in hidden field). how can writte such script ? here's code far: $(document).ready(function() { var string = ""; $('.checkbox').on('change', function() { var subscription_id = $(this).parent().attr('id'); if(string == "") { string = subscription_id; } else { string = string + ", " + subscription_id; } $('#select_players').val(string); $('#subscription_ids_export').val(string); }) }) you can simplify retrieving subscription_id values checkboxes checked instead of adding/removing values each time. try this: $('.checkbox').on('change', function() { var subscriptionids = $('.checkbox:checked').map(function() { return $(this).pa...

java - Can you set up a simple log on system with google endpoints -

i have demo create needs have 3 different log on types. not familiar php , have been using google app engine endpoints quite recently. i looking have simple log on system user name , password , have set 3 different entity types (admin, merchant , store manager). the problem objectify queries created need pre defined , cannot search user username , password matching correct 1 specified on index page means can't retrieve data datastore using api's unless filter before had won't work log on system. the problem objectify queries created need pre defined , cannot search user username , password matching correct 1 specified on index page means can't retrieve data datastore using api's unless filter before had won't work log on system. not sure mean this, nor got info. implementing login simple pretty straightforward using endpoints + objectify. query user, if user not null check password , act accordingly. @apimethod(name = "...

angularjs - Authentication: "cannot execute _executeQueryCore until metadataStore is populated" -

i trying add authentication mobile app, built using angular , breeze. in app.js: app.config(function ($httpprovider) { $httpprovider.interceptors.push(intercept) }); //intercept runs on every http request , response //when there 401 error uses broadcast send event //the application scope function intercept($rootscope) { return { request: function (config) { $rootscope.$broadcast('loading:show'); return config; }, response: function (response) { $rootscope.$broadcast('loading:hide'); return response; }, responseerror: function (error) { if (error.status === 401) { $rootscope.$broadcast('error:401'); } return error; } } } app.run(function ($rootscope, $ionicloading, $state) { $rootscope.$on('loading:show', function () { $ionicloading.show({ template: 'loading...' }); ...

php - Cyrillic characters in friendly URLs not working with IIS -

i building wordpress website hosted on windows server 2008 r2 iis 7.5 for fancy urls using web.config file url rewrite 2.0 the urls website.com/my-page work fine. problem when have russian or cyrillic characters in url - ( website.com/сито-для-угля/ ) wordpress can't find page. note: these urls work fine in wamp. problem when hosted in iis 7.5 i have tried isapi rewrite module iis too, still same problem. i have tried disable kind of rewriting ( url rewrite module , isapi rewrite module ) still cyrillic characters in url received ???-???-??? in index.php file of wordpress. also tried website.com/index.php?page=сито-для-угля , gives me сито-для-угля correctly in index.php. problem friendly urls. so seems iis issue? 1 knows how fix this?

ruby on rails - How to validate the input value of text_area is JSON format? -

i using rails 4.2 ruby 2.1.5 here description model: class description < activerecord::base validates :value, presence: true belongs_to :api end what can validate input of value json format? add custom validate method parse value . rescue exception , add error if fails parsing. validate :validate_json_format private def validate_json_format return if value.blank? json.parse(value) rescue json::parsererror errors.add(:value, 'invalid json format') end

python - Checkbuttons and buttons: using lambda -

i trying make number of checkboxes based on list, looks if screwing command call , variable aspect of button. my code is: class example(frame): def __init__(self, parent): frame.__init__(self, parent) self.parent = parent self.initui() def initui(self): self.courses = ["cse 4444", "cse 4343"] self.vars = [] self.parent.title("homework helper") self.course_buttons() self.pack(fill=both, expand=1) def course_buttons(self): x = 0 y = 0 in range(0, len(self.courses)): self.vars.append(intvar()) cb = checkbutton(self, text=self.courses[i], variable=self.vars[i], command=lambda: self.onclick(i)) cb.select() cb.grid(column=x, row=y) y = y+1 def onclick(self, place): print place if self.vars[place].get() == 1: print self.courses[place] the test far course printed on console when check box on, ...

excel vba - VBA: Checking a number in an array and proceeding when not present -

i new vba. in below code, attempting search list of numbers in array in dynamic column. if number found, new line inserted. however, error when number in array not found. if there more efficient way same thing, happy change code. appreciated. sub insertlines() dim vbusort variant dim vsheet worksheet dim integer vbusort = array("3", "4", "5", "6", "7", "8", "9", "10") each vsheet in thisworkbook.worksheets range("a1").select application.activesheet.range("1:2").find(what:="bu sort priority", _ lookin:=xlvalues, _ lookat:=xlwhole, _ searchorder:=xlbyrows, _ searchdirection:=xlnext, _ matchcase:=false).select activecell.entirecolumn.select = lbound(vbusort) ubound(vbusort) selection.find(what:=vbusort(i), after:=activecel...

xml - XSLT sort order to match order of different parent node -

i have 2 nodes incidentally share subset of data. need sort first set based on original order of second. to give example, consider following sets of points , lines. every "start" , "end" point each line in every case listed in points list. <points> <point name="point1">0 0</point> <point name="point2">0 1</point> <point name="point3">1 1</point> <point name="point4">1 0</point> </points> <shape> <line name="line1"> <start>0 0</start> <end>0 1</end> </line> <line name="line2"> <start>0 1</start> <end>1 1</end> </line> <line name="line3"> <start>1 1</start> <end>1 0</end> </line> <line name="line4"> <st...

ember.js - Ember-cli , how do i change rest call on fly in the rest adapter -

im working on ember-cli, how change rest call on fly in rest adapter. if use path params not query params?for example: export default ds.restadapter.extend({ namespace:'res/v1/users/id', pathfortype: function() { return ember.string.underscore("friends");},}); based on user selection dropdown "id", using id need user friends database. please suggest better way do. aapplication supports pathparams not query params to customize url, override buildurl method in adapter. the tricky part access related records adapter. example, request friends given user. work in friend adapter, need know user 's id include in url. for purpose, use record property on snapshot argument of buildurl method. alternatively, might want override of buildurl 's underlying methods such urlforfindquery , depending on how request model store. find.query() , retrieve id of user query. if not you, please respond way you'r...

How to show uploaded image in view page? I am new in yii, I am unable to fix this please help me -

in myprofile.php <?php echo chtml::image(yii::app()->request- >baseurl.'/xampp/htdocs/myapp/images/'.$model- >image,"image",array("width"=>200,"hieght"=>200)); ?> your image url incorrect. yii::app()->request- >baseurl.'/xampp/htdocs/myapp/images/'.$model- >image should change into: yii::app()->request->baseurl.'/images/'.$model->image

javascript - Turn a button into a loading circle animation -

i reproduce animation below : http://gph.is/1milwlq i found not have progress bar (the loading time not defined) : http://tympanus.net/tutorials/circularprogressbutton/ how can ? you can add event listener temporarily replace image , have callback of ajax (or whatever happens) perform replacement of it. in example, used settimeout have replace button again after 3 seconds. functionality go inside of ajax callback (or whatever else waiting on): here's jsfiddle example: https://jsfiddle.net/jetweedy/m0qpm1xh/2/ var mybutton = document.getelementbyid('mybutton'); var myparent = document.getelementbyid('myparent'); mybutton.onclick = function() { myparent.removechild(mybutton); var myimage = document.createelement("img"); myimage.src = "http://chimplyimage.appspot.com/images/samples/classic-spinner/animatedcircle.gif"; myparent.appendchild(myimage); settimeout(function() { myparent.removechild(myim...

php - CakePHP HABTM Select box in edit mode not populating -

i feel i'm going insane. can figure these things out 1 has stuck. i'm using cake 2.3.7. noticed there bug in earlier versions of cakephp. hope can point out i'm going wrong. on site have articles have 3 habtm associations > flies, rivers , lakes. so: article - habtm - fly article - habtm - river article - habtm - lake controller: ... $flies = $this->article->fly->find('list'); $lakes = $this->article->lake->find('list'); $rivers = $this->article->river->find('list'); $this->set(compact('flies', 'lakes', 'rivers')); view: echo $this->form->input('fly'); echo $this->form->input('lake'); echo $this->form->input('river'); this syntax seems described in manuals cakephp 2.x, , works on local test system, upload server, fails. any appreciated, , let me know if more information needed. for habtm associations form fields should be:- ...

python - Using curl to POST obtains a different response than when using requests to POST -

i new python programming , have reached impasse can't seem solve. trying use python requests module to post request service in ibm bluemix. works fine when use curl make request when try requests module error message. since using same data file, confused why getting different results. can enlighten me? here code access keys , url modified think relevant part of response: here curl: curl -i -v -h "content-type: application/json" -x post \ "https://ibm.someservice.ibmcloud.com:9999/action/modelname?accesskey=xxxxyyyyyzzzzz+++++etc" \ --data-binary @sample-data.json here request code: import requests import json def post2ndrequest(): url = 'https://ibm.someservice.ibmcloud.com:9999/action/modelname?accesskey=xxxxyyyyyzzzzz+++++etc' files = {'file': open('sample-data.json', 'rb')} headers = {'content-type':'application/json'} r = requests.post(url, headers=headers, files=files) pri...

wordpress - Targetting the background of a div for a jquery parrallax scroller -

i'm trying edit wordpress plugin targets background image of body makes scroll page. code plugin quoted below. i want same effect target background images of other divs can't work using $(".class").style.backgroundposition = "0px " + (0 - (math.max(document.documentelement.scrolltop, document.body.scrolltop) / 4)) + "px"; but not working. i've tried use dom path target div document.div.class.style.backgroundposition = ..... can shed light on why isn't working? $(window).scroll(function () { document.body.style.backgroundposition = "0px " + (0 - (math.max(document.documentelement.scrolltop, document.body.scrolltop) / 4) ) + "px"; });

Send event from parent to child element in polymer.dart -

i trying fire event polymer element, , listen event in element inside of it. these 4 files of consequence: main_app.html <link rel="import" href="../../packages/paper_elements/paper_input.html"> <link rel="import" href="../../packages/paper_elements/paper_button.html"> <link rel="import" href="canvas_container.html">; <polymer-element name="main-app"> <template> <paper-button on-click="{{onbuttonclicked}}">text</paper-button> <canvas-container"></canvas-container> </template> <script type="application/dart" src="main_app.dart"></script> </polymer-element> main_app.dart import 'dart:html'; import 'package:polymer/polymer.dart'; @customtag('main-app') class mainapp extends polymerelement { mainapp.created() : super.created(); onbuttonclicked...

vba - combo box to change filters on excel pivot table -

Image
excel 2013. using 3 combo boxes change filters on pivot table. first combo box has "project1", "project2" & all. second combo box has "customer1", "customer2" & all. third combo box has "country1", "country2" & all. i using 9 pivot tables, of them have filters [project], [customer], [country]. my intention change first combo box project1 & pivot tables filter should change project1.i able that. however when select first combo box "all". first combo box cell link y1. vba run time error 1004: application-defined or object-defined error. sub projectname() activesheet.pivottables("pvt1").pivotfields("project name").clearallfilters activesheet.pivottables("pvt2").pivotfields("project name").clearallfilters activesheet.pivottables("pvt3").pivotfields("project name").clearallfilters activesheet.pivottables("pvt1").pivo...

node.js - JavaScript - Does a self-invoking anonymous function protect variables against the global namespace sufficiently? -

would code better written using closure? there better way write it, or function protect variables? (function(){ var http = require('http'), port = process.argv[2], string = "", length = 0; http.get(port, function(res){ res.on('data', function(data){ length += data.length; string += data; }); res.on('end', function(){ console.log(length); console.log(string) }); }); })(); this keep variables within , out of reach external code: (function() { var = '//stackoverflow.com'; alert(so); alert '//stackoverflow.com' })(); alert(so); // alert undefined **see note @ bottom take @ post found quick google search note: stated in comment below, not alert undefined, throw reference error, since so non existent in scope outside of iife. take @ mdn more!

javascript - AngularJS Set Value to $scope from Nested Function -

i'm trying value function inside function: controller $scope.vm = {}; function myfunc(){ $scope.vm.hello = 'hello'; function myfunction(){ $scope.vm.world = 'world'; } } myfunc(); view <p>{{vm.hello}} {{vm.world}}</p> here's plunk . how can display "hello world"? i assume trying achieve called 'closure'. if so, modify controller to: app.controller('mainctrl', function($scope) { $scope.vm = {}; function myfunc(){ $scope.vm.hello = 'hello'; return function () { $scope.vm.world = 'world'; } } var hello = myfunc(), // invokes outer function world = hello(); // invokes inner function console.log($scope.vm); }); in code, inner function myfunction() cannot called outside myfunc() method, because scope bounded outer method. can of course call directly inside outer method, or better - make inner function immediate: ...

javascript - svg rect doesnt respond with another div fixed with a high z-index -

i want have rectangles in svg tag show , change opacity on hover. had whole code working, after adding fixed div high z-index, svg no longer worked (the hover effect has worked briefly not consistently know elements still should be). <style> .hover_group:hover { opacity:1; } #projectsvg { position: relative; width: 100%; vertical-align: middle; margin: 0; overflow: hidden; margin:10px; } #projectsvg svg { position: relative; float: left; top: 0; left: -199; } </style> <div class="row" style="background-image: url(../img/home/blue_bk.jpg);"> <div class="col-xs-1 col-sm-0"></div> <div class="col-xs-10 col-sm-5 col-lg-4"> <figure id="projectsvg"> <svg vers...