Posts

Showing posts from March, 2013

php - Laravel session/storage is empty on refresh -

php - Laravel session/storage is empty on refresh - i have next code: echo 'first try: <br />'; $input = session::get('input'); pre($input, false); echo 'second try: <br />'; session::put('input', 'test'); pre(session::get('input')); which gives next output first time it's loaded : first try: sec try: test that expected on first time, when reload page, exact same output. info lost after refresh. i know it's not flash data, can't find out why it's not storing data. i'm using file based sessions , xampp on windows (the same happens when using artisan serve). the storage folder writable. edit: tried database sessions, same result. , i'm doing straight in routes file, theres no other code can mess up. the pre function: function pre( $data , $kill = true) { echo '<pre>'.print_r($data,t

javascript - When to compare several Arrays in a 'for' loop -

javascript - When to compare several Arrays in a 'for' loop - i'm still quite new javascript , google apps script, , i'm attempting create script takes friends steam ids, loops on owned games, lists them spreadsheet, , displays if owns game or not. i've achieved first part, looping on of owned games each id , adding them array if don't exist in array works using: var steamid = ['somesteamids']; var gameids = []; var games = []; function getgames(){ (var = 0; < steamid.length; i++){ var response = urlfetchapp.fetch("http://api.steampowered.com/iplayerservice/getownedgames/v0001/?key=**yoursteamkey**&steamid=" + steamid[i] + "&format=json&include_appinfo=1");//steam url. logger.log('response code: ' + response.getresponsecode());//checks request connected. var info = json.parse(response.getcontenttext());//gets plaintext json response , converts object. (var n = 0; n < data.respo

c# - Cannot get child nodes of a specific type that contain a specific text -

c# - Cannot get child nodes of a specific type that contain a specific text - using code below, can receive <job> elements in xml. however, when seek search jobs have kid called <name> , text equals "receiverjob" , selectnodes() method returns 0 though job exists. xmldocument dom = new xmldocument(); dom.load(textboxfilepath.text); xmlnamespacemanager nsmanager = new xmlnamespacemanager(dom.nametable); nsmanager.addnamespace("d", "http://quartznet.sourceforge.net/jobschedulingdata"); xmlnodelist jobelements = dom.documentelement.selectnodes("descendant::d:job[name=receiverjob]", nsmanager); xml: <?xml version="1.0" encoding="utf-8"?> <!-- file contains job definitions in schema version 2.0 format --> <job-scheduling-data version="2.0" xmlns="http://quartznet.sourceforge.net/jobschedulingdata" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance">

ios - Why is awakeFromNib called twice from a Cell in a TableView? -

ios - Why is awakeFromNib called twice from a Cell in a TableView? - i'm trying understand why awakefromnib beingness called twice in code. have tableview has special compressible cell appears 1 time @ end of table. first awakefromnib beingness called when tableview scrolled special cell @ end (which fine believe,as tableview reusing cells). however, whenever tap cell expand cell, awakefromnib beingness called again. could explain me why awakefromnib beingness called twice? , how create called once? thanks edit** code people have requested - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { if (indexpath.section >= (nsinteger)[self.trip.destinations count]) { guestcell *cell = (guestcell*)[tableview dequeuereusablecellwithidentifier:guestcellidentifier forindexpath:indexpath]; cell.selectionstyle = uitableviewcellselectionstylenone; [cell setupcellforguests:self.trip.guests];

Batch array call by variable -

Batch array call by variable - i got problem batch file echo 2 array contents. for /l %%i in (1,2,%n%) ( set /a next=%%i+1 echo !array[%%i]! echo !array[%next%]! //this doesn't work ) output: _content_array echo off. when turn echo on output is: _content_array echo on. _content_array perfect, works. 2nd phone call (!array[%next%]!) doesn't work, think failed call, tried out other calls never worked me. thx time. for /l %%i in (1,2,%n%) ( set /a next=%%i+1 echo !array[%%i]! %%n in (!next!) echo !array[%%n]! ) you may read total details solution @ this post. arrays variables batch-file

algorithm - OpenCL Cholesky Decomposition -

algorithm - OpenCL Cholesky Decomposition - i implemented next cholesky decomposition algorithm using opencl. code exhibiting random behavior. matches cpu output times. can please help me figure out wrong implementation. here algorithm: procedure cholesky(a) int i, j, k; k := 0 n − 1 /* 1st loop */ /* obtain square root of diagonal element. */ a[k, k] := a[k, k]; j := k + 1 n − 1 /* 2nd loop */ /* partition step. */ a[k, j] := a[k, j]/a[k, k]; end := k + 1 n − 1 /* 3rd loop */ j := n − 1 /* 4th loop */ /* elimination step. */ a[i, j] := a[i, j] - a[k, i] × a[k, j]; end end end methodology parallelize above algorithm: from algorithm, elimination step expensive. have outermost loop in host code, , phone call kernel within loop. single run of kernel corresponds single iteration of 3rd loop. therefore, launch (n-1 )- (k+1) + 1 work groups. number of work items within workgroup set n/2. 2nd loop

android - Text entry method for touchscreen devices for people with visually impaired -

android - Text entry method for touchscreen devices for people with visually impaired - i pupil programmer , topic grade work finalize 1 of input methods touchscreen devices visually impaired people (including blind). scientific leader got method , implementation (working). @ moment, need develop , implement sound input interface. perchance there users among site versed in android , ready voice wishes on subject. sorry awfull english. android audio input interface blind

scroll - CSS: How should I use `position` and other properties correctly to position my web page? -

scroll - CSS: How should I use `position` and other properties correctly to position my web page? - i'm have functioning web page 3 parts. banner container, menu container, , content container this layout: the problem these positioned using position: fixed; margin , left , , top properties. means when web browser smaller size of web page, can't scroll on it. , yes. know solution remove "position: fixed" (which has been pointed out on other threads regarding topic here on stackoverflow). problem haven't been able detain layout while removing fixed position, not close. the closest i've come changing position property of content container relative . not impact layout while size of web browser window larger width of entire page, , when it's web browser window smaller content container can indeed scroll on it. of course, when decrease size of browser window content container follows , overshadows menu container (since still has fixed positioning

sql - sqlite3 command line inconsistent return codes -

sql - sqlite3 command line inconsistent return codes - i cannot find documentation anywhere on net homecoming codes sqlite3 command line program. trying utilize programmatically, i've found errors print screen still homecoming zero. example, returns error message "error: incomplete sql" not cause command line application homecoming nonzero: $ echo 'foo' > /tmp/foo.sql $ sqlite3 /tmp/foo.db < /tmp/foo.sql error: incomplete sql: foo $ echo $? 0 is bug? think so, particularly given equivalent line: $ sqlite3 /tmp/foo.db "foo" -- loading resources /home/yomomma/.sqliterc error: near "foo": syntax error $ echo $? 1 can point me documentation on expected homecoming values sqlite3? (the problem not .sqliterc, reproduced in total here: .mode column .headers on .nullvalue '<null!>' ) edit: $ sqlite3 --version -- loading resources /home/yomomma/.sqliterc 3.7.13 2012-06-11 02:05:22 f5b5a13f739

java - How to throw RuntimeException deliberately? -

java - How to throw RuntimeException deliberately? - suppose topology simple : spout --> bolt --> bolt b --> bolt c and bolt c stores info in datastore. now advisable throw runtimeexception whenever there exception in storing info ? : try { datastoremanager.insert(mydata); } grab (exception e) { throw new runtimeexception(e); } or should throw failedexception , allow topology retry tuple ? what should practice ? i didn't see harm in deliberately throwing runtimeexception here because when happens , current worker thread dies , since ack not received topology , tuple re-tried on other worker, resulting in same overall output throwing failedexception except enhanced load on topology. consider extending runtimeexception public dataexception extends runtimeexception { } seek { datastoremanager.insert(mydata); } grab (exception e) { throw new dataexception(e); } now classes above in phone call hierarchy can take

html - I can't place objects in div's in the same line -

html - I can't place objects in div's in the same line - here html code work on. <div id="menu"> <center> <div style="list-style: none; class:" menu "> <div style="display: inline "><a href="indeks.html " class="button ">home</a> </div> <div style="display: inline "><a href="indeks.html " class="button ">repertuar</a> </div> </div> </center> </div> and here css part #menu { margin:20px; display: inline-block; padding: 20px; text-align: right; } .button { display : block; background: #ff0080; background: -webkit-linear-gradient(top, #ff0080, #ffb248); height: 50pxx; width : 100px; margin: 0; padding: 0; border : 2px solid rgba(33, 68, 72, 0.59); text-decoration: none; } i tried literaly lots of w

ios - Table view cell deletion animation not working -

ios - Table view cell deletion animation not working - -(void)tableview:(uitableview *)tableview commiteditingstyle:(uitableviewcelleditingstyle)editingstyle forrowatindexpath:(nsindexpath *)indexpath { if (editingstyle == uitableviewcelleditingstyledelete) { [self.myarray removeobjectatindex:indexpath.row]; [self.tableview deleterowsatindexpaths:[nsarray arraywithobject:indexpath] withrowanimation:uitableviewrowanimationfade]; } } changing animation type of other options not create difference, seem same animation every time. i've read due ios 7 bug, deployment target ios 8 . ideas? if (editingstyle == uitableviewcelleditingstyledelete) { if ([self.myarray count] >= 1) { [self.tableview beginupdates]; [self.tableview deleterowsatindexpaths:[nsarray arraywithobject:indexpath] withrowanimation:uitableviewrowanimationfade]; [self.myarray removeobjectatind

ksh - need to replace a string from file1 to file2 -

ksh - need to replace a string from file1 to file2 - hi all, i have 2 files ft2 source , sqll.ksh destination. my need alter control=raja control=kartik1 , etc others too. kmariappan $ cat ft2.txt karthik1 karthik2 karthik3 kmariappan $ cat sqll.ksh sqlldr aja/raja123 control=raja log=ssed.log sqlldr aja/raja123 control=raja1 log=ssed.log sqlldr aja/raja123 control=raja2 log=ssed.log expected output sqlldr aja/raja123 control=karthik log=ssed.log sqlldr aja/raja123 control=karthik1 log=ssed.log sqlldr aja/raja123 control=karthik2 log=ssed.log awk ' nr==fnr {name[nr]=$1; next} {sub(/control=[^[:blank:]]+/, "control=" name[fnr]); print} ' ft2 sqll.ksh if you're satisfied it's working, add together end of command > sqll.new && mv sqll.new sqll.ksh ksh

php login logout form display data from database -

php login logout form display data from database - i have 3 questions code. how can display user's name logged profile.php file? because current code display's every username no matter logs in. how can restrict profile.php page can seen if user logged in? how can create logout page works? below code in order each file config.php //connect info base, login.php, profile.php, , logout.php: //------------------------config.php--------------- <?php mysql_connect("localhost","root",""); mysql_select_db("login2"); ?> //------------------------login.php--------------- <?php session_start(); require('config.php'); if(isset($_post['submit'])){ $uname = mysql_escape_string($_post['uname']); $pass = mysql_escape_string($_post['pass']); $salt = ''; $pass = md5 ($pass . $salt); $sql = mysql_query ("select * `users` `uname` = '$uname' , `pass`= '

javascript - Get value of select and use this to display div jquery -

javascript - Get value of select and use this to display div jquery - i have select 2 options within: <select id="type"> <option value="1">one</option> <option value="2">two</option> </select> what want display hidden div when alternative 2 set. so need grab value select , if equals 2, show div. my effort jquery far follows: $('#type').on('change', function(){ if(this.value == 2){ ('#hiddendiv').show(); } }) i'm including jquery, nil happening. any ideas? thanks! apart obvious typo, think implementation should below because if select alternative 1 1 time again might want hide div class="snippet-code-js lang-js prettyprint-override"> //dom ready handler jquery(function($) { $('#type').on('change', function() { $('#hiddendiv').toggle(this.value == 2); }) }) class="sni

networking - Looking at protocols on non default ports in Microsoft Message Analyzer -

networking - Looking at protocols on non default ports in Microsoft Message Analyzer - i have been using microsoft network monitor. i'd migrate microsoft message analyzer cannot find out how view network traffic protocol (in case tds, protocol sql server uses) unless has default port. tds default tcp port 1433 need able @ tds traffic coming on different tcp ports. it possible in network monitor editing switch statement in tcp parser add together ports required along 1433 , rebuilding parsers. in wireshark it's simpler select traffic want , "view tds" wireshark's tds parsing not microsoft's , need parsing accurate possible. does know how parse traffic particular protocols if not on default port in message analyzer? many thanks rob rob, have had luck on this? i'm trying accomplish same thing , post closest i've come reply on issue. i'm going start reverse engineering science mma week hoping wouldn't have set in level of

utf 8 - Why there are no 5-byte and 6-byte code points in UTF-8? -

utf 8 - Why there are no 5-byte and 6-byte code points in UTF-8? - why there no 5-byte or 6-byte code points? know till 2003 when removed. cannot find why removed. wiki says in order match constraints of utf-16 character encoding but don't understand why it's important. because there no unicode characters require them. , these cannot added either because they'd impossible encode utf-16 surrogates. utf-8

c - Asynchronous I/O and time consuming work -

c - Asynchronous I/O and time consuming work - i know asynchronous socket programming more scalable synchronous. but there 1 thing don't understand it: if event loop should non blocking, how can delegate time consuming work thread without blocking? work queue needs mutex protection. know there lock free queues how done? can please give little concept thought of thing? the worker threads pulling queue block time. have when queue empty. else supposed do? it work items not supposed block need few queue worker threads. async io using less threads. if event loop should non blocking this assumption false. not supposed not block. loop contains blocking time. every time queue empty , worker tries dequeue. c sockets asynchronous tcp kqueue

sql - How to combine different queries results into a single query result table -

sql - How to combine different queries results into a single query result table - here thing.i trying find query can include there 3 results. i know how query 1 of them each. questions: each survey has had @ to the lowest degree 200 members participate, provide next information: 1)survey id , survey description 2)number of members started survey 3) number of members finished. query survey id , survey description have @ to the lowest degree 200 participations 1) select survey_id, survey_desc, count(tbl_survey.member_id) totalnumber tbl_survey,tbl_member_participation tbl-survey.member_id = tbl_member_participation.member_id grouping survey_id, survey_desc having totalnumber >= 200 2) query number of members started not finished. select count(survey_id) tbl_survey, survey_id exists ( select survey_id, survey_desc, count(tbl_survey.member_id) totalnumber tbl_survey,tbl_member_participation tbl-survey.

javascript - Google chrome - playing a file from local storage is not working -

javascript - Google chrome - playing a file from local storage is not working - i need play video file in local kiosk. has windows 8.1 64-bit, google canary/chrome latest version. have same problem latest google chrome/canary versions not playing files local storage. if play cloud have bandwidth issue+ there no net access kiosk. step 1 : allow 0 restrictions "c:\program files (x86)\google\chrome\application\chrome.exe" --incognito --allow-file-access-from-files --disable-web-security step 2: now open remote url https://stackoverflow.com/test.html, trying play video file located in users pc, c:\loop.webm example: test.html <video id="mediaplayer" autoplay="autoplay" poster="/images/vlc.jpg" type="video/webm" loop="" src="file:///c:/loop.webm" style="display: inline;"></video> result: the page @ 'https://....mysite.com/test.html' loaded on https, displayed insec

issues with get path method in java lucene program -

issues with get path method in java lucene program - i using lucene in java find rank documents against query i've found error in getpath method code: string directoryname = "doc50" ; file folder = new file(directoryname); file[] listoffiles = folder.listfiles(); (int = 0; < listoffiles.length; i++) // loop read files doc50 folder... { if (listoffiles[i].isfile()) // status if current file of filetype... { path path = filesystems.getdefault().getpath(directoryname, listoffiles[i].getname()); string contents = new string(files.readallbytes(path), standardcharsets.utf_8); //read whole document in single string adddoc(documentindexer, contents, listoffiles[i].getname()); //add document indexed documents } error exception in thread "main" java.lang.error: unresolved compilation problem: method getpa

scala - Forcing Redis to Timeout -

scala - Forcing Redis to Timeout - i trying forcefulness redis client timeout testing purpose , fail accomplish so. specify timeout 2ms in config , set operation perform takes > 2ms why not timeout? these settings kind of soft settings , not hard enforcement? using jedis 2.6 , scala 2.10 play 2.2.3 @singleton class redisclient extends cache { // set timeout val timeout = 2 private val pool = new jedispool(new jedispoolconfig(), getstringfromconfig("redis.url"), getintfromconfig("redis.port"), timeout); def isopen = pool.getnumactive() def set(key: string, value: string) = { isopen match { case -1 => throw new exception("redis server not running") case _ => { val jedis = pool.getresource() val before = platform.currenttime jedis.set(key, value) println("time taken " + (platform.currenttime - before)) pool.returnresource(jedis) } } } } actual

Automatically push engine datastore data to bigquery tables -

Automatically push engine datastore data to bigquery tables - to move info datastore bigquery tables follow manual , time consuming process, is, backing google cloud storage , restoring bigquery. there scant documentation on restoring part post handy http://sookocheff.com/posts/2014-08-04-restoring-an-app-engine-backup/ now, there seemingly outdated article (with code) https://cloud.google.com/bigquery/articles/datastoretobigquery i've been, however, waiting access experimental tester programme seems automate process, gotten no access months https://docs.google.com/forms/d/1hpc2b1hmtyv_puhpsugz_odq0nb43_6ysfavjufejtc/viewform?formkey=dhdpexlmrlzcnwlyse9bce5jc2nyoue6mq for entities, i'd force info big query comes (inserts , perchance updates). more biz intelligence type of analysis, daily force fine. so, what's best way it? there 3 ways of entering info bigquery: through ui through command line via api if take api, can have 2 different way

PHP strtotime returns whole year instead of a single day -

PHP strtotime returns whole year instead of a single day - i using php round , abs , strtotime calculate difference between 2 dates. the calculation works until select $_session['b_checkout'] new year. i.e. if b_checkin dec 30 , b_checkout dec 31, returns right $no_nights 1 day. $_session['b_checkin'] , $_session['b_checkout'] using 'd f js y' date format. e.g. $_session['b_checkin'] = "wednesday, 31 december, 2014" $_session['b_checkout'] = "thursday, 1 january, 2015" $no_nights = round(abs(strtotime($_session['b_checkout']) - strtotime($_session['b_checkin']))/(60*60*24)); currently outputs ( echo $no_nights ) 363 days instead of 1 day. problem? remove commas , see works! $b_checkin = "wednesday 31 dec 2014"; $b_checkout = "thursday 1 jan 2015"; $no_nights = round(abs(strtotime($b_checkout) - strtotime($b_checkin))/(60*60*24)); echo $no_night

powershell - Trying to disable users in AD who are not in a CSV -

powershell - Trying to disable users in AD who are not in a CSV - i've been trying find analogs in forums, it's logic that's tying me - putting together. i have advertisement , have csv of users should in particular ou. want compare users in ou csv, , users not in csv, want disable them , move them different ou. i'm new powershell , having bit of rough time this. what's getting me comparing , if-then logic...i can't syntax right. i've tried few options...this have right import-module activedirectory $path = "f:\admgmt\" $logpath = "f:\admgmt\logs\diable_ad_users.log" $userfile = $path + "\files\ad_currentemployees.csv" $location = "ou=faculty,ou=people,dc=mydomain,dc=com" $disabledou = "ou=disabledemployees,ou=disabled,dc=mydomain,dc=com" $ad_users = get-aduser -filter * -searchbase "ou=faculty,ou=people,dc=mydomain,dc=com" | select -expandproperty samaccountname $sams = $userfi

php - How to apply style in an echo'ed ? -

php - How to apply style in an echo'ed <td>? - this php code: $query="select name, surname, address employee"; $results = mysql_query($query); while ($row = mysql_fetch_assoc($results)) { echo '<tr>'; foreach($row $field) { echo '<td class="element">' . htmlspecialchars($field) . '</td>'; } echo '</tr>'; and css: .element{ color:red; } but fields displayed in html page aren't red. why doesn't work? i tried echo "<td class='element'>" . htmlspecialchars($field) . "</td>"; and echo '<td class=\"element\">' . htmlspecialchars($field) . "</td>"; but no success. i suggest specify element in css. td.element{ color:red; } also it's thought give "tr" id "tr id="mytr"... #mytr td.element{ color:red; } php

Load existing Model in Weka Knowledge Flow -

Load existing Model in Weka Knowledge Flow - i trying plot multiple roc curves in same diagram in weka. have learnt can in weka knowledge flow using "model performance chart". however, can't figure out how existing models. i have tried using arffloader , testsetmaker generate testing data, , connected suitable classifier icon (eg adaboostm1 when kind of model trying load). in configurations of classifier icon take "load model" , in status bar says "loaded model.". however, when run says "error: no trained/loaded classifier utilize prediction". can tell me doing wrong here? in advance! there post published here indicates ambiguity in meaning of error. continues state order of attributes , number , order of values rather important. it states 'for performance results computed, knowledge flow process need "classifierperformanceevaluator" component after classifier , before textviewer component.' if new kno

python 3.x - pygames / drawing circle that bounces off walls -

python 3.x - pygames / drawing circle that bounces off walls - b1 = {'rect':pygame.rect(300, 80, 50, 100), 'color':red, 'dir':upright} b2 = {'rect':pygame.rect(200, 200, 20, 20), 'color':green, 'dir':upleft} b3 = {'rect':pygame.rect(100, 150, 60, 60), 'color':blue, 'dir':downleft} b4 = {'rect':pygame.draw.circle((300, 50), 20, 0,), 'color':purple, 'dir':downright} blocks = [b1, b2, b3] # draw block onto surface pygame.draw.rect(windowsurface, b['color'], b['rect']) pygame.draw.circle(windowsurface, b['color'], (300, 50), 20, 0) brand new pygames (programming in general). 1 of our first assignments, edit simple programme bounces squares off walls. add together circle i'm not able figure out how fit pre-existing dict construction rectangles. i'm getting next error, not seeing: traceback (most recent phone call last): file "c:\users\ca11

javascript - how to cm.save() before ZeroClipboard action? -

javascript - how to cm.save() before ZeroClipboard action? - hi using codemirror, how used re-create info clipbord textarea using codemirror or utilize cm.save() before zeroclipboard action? <button class="copy" id="copy" data-clipboard-target="data_codemirror">copy</button> <textarea id="data_codemirror"></textarea> <script> var clienttarget = new zeroclipboard( $("#copybuttonindex"), { moviepath: "cssjs/zeroclipboard.swf", debug: false }); </script> javascript codemirror zeroclipboard

Scheme - retrieve occurrences of a digit in a number -

Scheme - retrieve occurrences of a digit in a number - i'm working through bert scheme exercises , having tough time one: example : (n-occurences 544555 5) => 4 any ideas how have count going? i thinking like: (define (occurences d n) (if (equal? (remainder d 10) n) (add1 (occurences (quotient d 10) n)) (occurences (quotient d 10) n) )) so in illustration such 1223 2 would: check if 3 2 say no, , move on , phone call 1 time again 122 2 check if 2 2 say yes, , add together 1 phone call 12 2 (count 1) check if 2 2. say yes, , add together 1 phone call 1 2 (count 2) check if 1 2. say no , done. you missing base of operations case of recursion; need stop if d 0. , mixed n , d few times: (define (occurences d n) (if (= 0 d) (if (= 0 n) 1 0) ; base of operations case (if (= (remainder d 10) n) (add1 (occurences (quotient d 10) n)) (occurences (quotient d 10) n)))) testing: > (o

r - knitr gets tricked by data.table `:=` assignment -

r - knitr gets tricked by data.table `:=` assignment - it seems knitr doesn't understand dt[, a:=1] should not result in output of dt document. there way stop behaviour? example knitr document: data.table markdown ======================================================== suppose create `data.table` in **r markdown** ```{r} dt = data.table(a = rnorm(10)) ``` notice doesn't display contents until ```{r} dt ``` style command. however, if want utilize `:=` create column ```{r} dt[, c:=5] ``` appear absence of equals sign tricks `knitr` thinking printed. knitr output: is knitr bug or data.table bug? edit i have noticed, knitr beingness weird when echo ing code. @ output above. in source code have dt[, c:=5] knitr renders dt[, `:=`(c, 5)] weird... edit 2: caching caching seems have problem := must different cause, separate question here: why knitr caching fail data.table `:=`? update oct 2014. in data.table v1.9.5 : := no lo

jquery - How to keep original user-entered value intact, while still being able to change it in the input field programmatically -

jquery - How to keep original user-entered value intact, while still being able to change it in the input field programmatically - how can store user input using js can restore later (i.e. via pressing button). assume user enters text input field of form, so: <form> <select name="unit_system" id="unit_system"> <option value="english">english</option> <option value="metric">metric</option> </select> <input class="input_gpm" type="text" value="<?=$value?>" /> </form> i want able revert originally-entered value, if value in input field changes programmatically, can happen when value converted 1 unit scheme of measurements another. why not store user input in own variable? using jquery: var $userinput; $(".input_gpm").on("change", function(){ $userinput = $(".input_gpm").va

ios - UILabel Animation in a Function Returning UIImageView -

ios - UILabel Animation in a Function Returning UIImageView - i having problem animating uilabels in ios. used thread reference (ios - animate motion of label or image), doesn't seem work me. i've tried several others, , don't work. i want smoothly move label location in set amount of time (by smoothly mean no jumps). however, when tested it, labels not move. here code. i've shortened think problem. because besides animation works. - (uiimageview *)createimagewithtransitionto:(nsmutablearray *) nextpois { //imageview uiimageview homecoming value of function imageview = [[uiimageview alloc] initwithimage:[uiimage imagenamed@"blank1.gif"]]; //initialize label , manipulate needs uilabel * label = /.../; //create animation [uiview animatewithduration:1.0 animations:^{ label.frame = nextlabelframe; //nextlabelframe cgrect }]; [imageview addsubview:label]; homecoming imageview; } my intuition te

python - Properly escaping quotations within a string -

python - Properly escaping quotations within a string - i have regex supposedly be-all-end-all detecting html tags. found here: http://haacked.com/archive/2004/10/25/usingregularexpressionstomatchhtml.aspx/ the original regex below: </?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)/?> when add together single quotes around it, becomes: '</?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)/?>' but leaves inner part ('.\*?') different entity string want make. ideas how prepare this? escaping inner quotes around .*? doesn't seem help since eol while scanning string error any ideas? you can utilize double quotes quote entire regex. >>> obj = re.compile(r"</?\w+((\s+\w+(\s*=\s*(?:\".*?\"|'.*?'|[^'\">\s]+))?)+\s*|\s*)/?>") >>> obj.pattern '</?\\w+((\\s+\\w+(\\s*=\\s*(?:\\".

c++ - Python type error while embedding -

c++ - Python type error while embedding - i trying run next python code c++(embedding python). import sys import os import time import win32com.client com.dtmilano.android.viewclient import viewclient import re import pythoncom import thread os.popen('adb devices') canalyzer = none measurement = none def can_start(config_path): global canalyzer,measurement canalyzer = win32com.client.dispatch('canalyzer.application') canalyzer.visible = 1 measurement = canalyzer.measurement canalyzer.open(config_path) measurement.start() com_marshall_stream = pythoncom.comarshalinterthreadinterfaceinstream(pythoncom.iid_idispatch,canalyzer) homecoming com_marshall_stream when seek phone call can_start function, getting python type error . error traceback mentioned below. "type 'exceptions.typeerror'. integer required. traceback object @ 0x039a198" the function executing if straight ran python , executing in pc, c

c - Store address information -

c - Store address information - i have question next code: //definition of base of operations used in ptr void *base; int query(win *ptr, void *baseptr) { *(void**) baseptr = ptr->base; ... } can alter statement following? baseptr = ptr->base; why cast baseptr void ** ? looks baseptr used output parameter. caller of query() should looks like: void *base = null; win *win = something; int result = query(win, &base); then, base in caller function may assigned received value. if write baseptr = ptr->base; , copy of base inside query() beingness updated. after query() returns, pointer in caller not updated @ all. c

git push failes with "access denied" error on gitlab 7 -

git push failes with "access denied" error on gitlab 7 - when seek force (from existing repo) new repository on freshly installed gitlab ce instance error: access denied. fatal: remote end hung unexpectedly strange thing pushing works first repository created. sec repository gives error. i installed gitlab (gitlab_7.3.2-omnibus-1_amd64.deb) on fresh digitalocean instance (1gb ram) on debian 7 x64. an ssh -vt git@[domain] command gives ok: welcome gitlab, ruurd adema! any ideas of what's going on? edit: when tying clone sec (empty) repo error: fatal: '/var/opt/gitlab/git-data/repositories/ruurdadema/encoder.git' not appear git repository fatal: remote end hung unexpectedly checking repositories folder tells me repository isn't there, wiki of project indeed there. edit: found error in log of omnibus 7.4.2: e, [2014-10-24t21:09:32.502741 #11717] error -- : api phone call <post http://127.0.0.1:8080/api/v3/internal/allowed> fai

python - Counting total number of tasks executed in a multiprocessing.Pool during execution -

python - Counting total number of tasks executed in a multiprocessing.Pool during execution - i'd love give indication of current talk in total only. i'm farming work out , know current progress. if sent 100 jobs 10 processors, how can show current number of jobs have returned is. can id's but how count number of completed returned jobs map function. i'm calling function following: op_list = pool.map(ppmdr_star, list(varg)) and in function can print current name current = multiprocessing.current_process() print 'running: ', current.name, current._identity if utilize pool.map_async can pull info out of mapresult instance gets returned. example: import multiprocessing import time def worker(i): time.sleep(i) homecoming if __name__ == "__main__": pool = multiprocessing.pool() result = pool.map_async(worker, range(15)) while not result.ready(): print("num left: {}".format(result._nu

c# - Cannot delete folder because it is being used by another > process (my app) -

c# - Cannot delete folder because it is being used by another > process (my app) - this question has reply here: delete file beingness used process 3 answers my wpf app creates temp directory (@"c:\myapptemp\"). within directory there downloaded images. after point in app (background workercompleted) dont need more folder , correspoding files, want deleted folder, tried if (directory.exists(@"c:\myapptemp\")) { iofileutils.deletedirectory(@"c:\myapptemp\", true); if (!directory.exists(@"c:\myapptemp\")) { displaymessage = "temp files deleted"; } } but i'm getting expcetion {"the process cannot access file 'c:\myapptemp\client1\6.jpg' because beingness used process."} iofileutils.cs public static void deletedirectory(string path, bool recursive) { //

javascript - Using Chrome's heap snapshot analyzer, how do I interpret dead-ends in the retainers view -

javascript - Using Chrome's heap snapshot analyzer, how do I interpret dead-ends in the retainers view - i have single-page app leaking substantially. trying track downwards memory leaks using chrome's built-in memory profiling tools. heap snapshot has been giving me lot of success in tracking downwards quite few problematic code blocks, have reached bit of dead-end. i have taken heap snapshot , isolated variable has leaked. open retainers view can see why object has not been garbage collected. seeing in retainers view (see below) confusing me. keeps reaching dead-end though claims given node in graph still has distance of 11. i'm not sure why won't allow me dig object when says there still depth there. expecting able expand way global variable on window object. javascript performance google-chrome memory-leaks google-chrome-devtools

angularjs - What are the benefits of returning a function in templateURL? -

angularjs - What are the benefits of returning a function in templateURL? - from https://github.com/angular-ui/ui-router/wiki templateurl can function returns url. takes 1 preset parameter, stateparams, not injected. $stateprovider.state('contacts', { templateurl: function ($stateparams){ homecoming '/partials/contacts.' + $stateparams.filterby + '.html'; } }) what of benefits of returning function in templateurl? sorry if bit vague. i'm trying wrap head around ui-router. a "benefit" perhaps unusual way set it. adds way router dynamically decide template utilize given route, depending on $stateparams . alternative way of achieving similar utilize ngif s or ngswitch s in single template route. which 1 utilize think own preference / think coding practice task in hand. if have 2 radically different, , long, templates, utilize function dynamic template url. if had short, or similar, templates, utilize ngif . als

php - How to parse string to array -

php - How to parse string to array - i have string this: "birs_appointment_price=&birs_appointment_duration=&birs_appointment_alternative_staff=&birs_shortcode_page_url=http%3a%2f%2flocalhost%2fstreamline-new%2fworkshop%2f&_wpnonce=855cbbdefa&_wp_http_referer=%2fstreamline-new%2fworkshop%2f&birs_appointment_location=17858&birs_appointment_staff=-1&birs_appointment_avaliable_staff=-1%2c17859&birs_appointment_service=-1&birs_appointment_date=&birs_appointment_notes=&birs_appointment_fields%5b%5d=_birs_appointment_notes&birs_client_type=new&birs_client_name_first=&birs_client_fields%5b%5d=_birs_client_name_first&birs_client_name_last=&birs_client_fields%5b%5d=_birs_client_name_last&birs_client_email=&birs_client_fields%5b%5d=_birs_client_email&birs_field_1=&birs_client_fields%5b%5d=_birs_field_1&birs_client_fields%5b%5d=_birs_field_6&s=" i want parse array in php. how ?. help m

ajax - symfony2 - How to create a form field of type "entity" without values -

ajax - symfony2 - How to create a form field of type "entity" without values - i have form, , in there regular field of type "entity". table values taken has grown, , select box rendered makes page big ( = slow load). so, replaced this: ->add( 'contact', 'entity', array( 'class' => 'crmcorebundle:contact', 'required' => false, 'empty_data' => null, ) ) with: ->add( 'contact', 'entity', array( 'class' => 'crmcorebundle:contact', 'choices' => array(), 'required' => false, 'empty_data' => null, ) ) render empty selectb

Chrome Extension for Android and Desktop? -

Chrome Extension for Android and Desktop? - this no, if develop chrome extension normal desktop browser, , extension relies on chrome api , normal web api's, work on chrome android? couldn't find much on api's supported , ones aren't. here quote google chrome faq does chrome android back upwards apps , extensions? chrome apps , extensions not supported on chrome android. have no plans announce @ time. so in short reply no, chrome android not back upwards extensions. here's older stack overflow asked similar question android google-chrome

c# - packaging 3rd party dll into wsp -

c# - packaging 3rd party dll into wsp - i have several 3rd party dll's .net. have next requirements: - must each in own sharepoint 2010 wsp - must deployed bin, not gac i'm having troubles accomplishing this. steps need taken this? i've tried creating new sharepoint application, mapping bin, placing dll there deploying. i've tried creating new sharepoint application, adding dll reference, selecting web application instead of global assembly cache , deploying. neither method has worked when tried utilize webpart required dll's. edit - page first-class illustration of need 3rd party dll's doesn't have details on how it. http://ranaictiu-technicalblog.blogspot.sg/2012/06/sharepoint-package-your-external.html appreciate help. oké, getting solution deploy dll bin folder need alter deployment target gac webapplication. when project deployed project assembly deployed bin folder of project dlll located @ c:\inetpub\wwwroot\wss\virtualdir

uitableview - Issues when using size classes -

uitableview - Issues when using size classes - i using size classes in app , trying set uitableview within uiscrollview , when added new constraints both views got warning (2 views horizontally ambiguous) . goal create both uitableview , uiscrollview have total size in devices check out answer question. think 2nd reply help out. also, sounds you're using single size class these views, any/any, if added constraints while in other size classes, impact size classes. if select constraint , go size inspector, tell size classes constraint installed on. uitableview uiscrollview autolayout xcode6 size-classes

node.js - How to use Promises/Chaining with Azure Mobile Services Custom API in Javascript -

node.js - How to use Promises/Chaining with Azure Mobile Services Custom API in Javascript - i trying figure out how utilize promises ams javascript api. these 2 functions have created 'promised' class="snippet-code-js lang-js prettyprint-override"> function checkusername(username, table) { homecoming table.where({username: username}).read({ success: function (results) { if (results.length === 0) { homecoming true; } else { homecoming false; } }, error: function(error) { homecoming false; } }); } function checkemail(email, table) { homecoming table.where({email: email}).read({ success: function (results) { if (results.length === 0) { homecoming true; } else { homecoming f

java - Android How Get Option Menu ItemId, that add "menu" Dynamacally ? Explain Below -

java - Android How Get Option Menu ItemId, that add "menu" Dynamacally ? Explain Below - there complexity ......how can resolve i add together alternative menu dynamacally @override public boolean oncreateoptionsmenu(menu menu) { menuinflater inflater = getmenuinflater(); inflater.inflate(r.menu.main, menu); menu.clear(); (int = 0; < splashactivity.arraylistssports.size(); i++) { lists.add(splashactivity.arraylistssports.get(i)); arrylist.add(splashactivity.arraylistssportsurl.get(i)); menu.add(i, i, i, splashactivity.arraylistssports.get(i)); // menu.add(groupid, itemid, order, title) } homecoming super.oncreateoptionsmenu(menu); } how can onoptionsitemselected(menuitem item) itemid mean id on "itemselected" , perform operation basically add together or parse info form xml , save required info oncreateoptionsmenu(menu menu) i want op

interpolation - solving differential equation with a constant -

interpolation - solving differential equation with a constant - i have simple differential equation this: s = ndsolve[{y'[x] == y[x] cos[x + y[x]], y[0] == 1}, y, {x, 0, 30}] where a constant. mathematica gives y function of x . want alter a factor 1 10. want find solution y function of a (y[x, a]) , integrate over [integral]y[x = x0, a] \[differentiald]a interpolation differential-equations

java - Creating a method for finding the root(s) of an equation -

java - Creating a method for finding the root(s) of an equation - i want create method calculates root of function of choice. far have: private static int function(int n){ int root; for(int = 0; i<=100; i++){ /** want replace x(see below see equation) value i, untill equation(n) == 0 , utilize value , homecoming integer variable called 'root' **/ } homecoming root; } for example, given 1 equation , using next lines in main: int equation = x - 2; system.out.println("the root(s) of " + equation + " is/are: " + function(equation)); i've been trying diffrent ways of achieving this, got errors far. been working on couple of hours it's not i'm not doing efforts, it's dont have plenty knowledge create functional. :( edited given task: exercise - function roots in order determine roots of given function there's easy algorithm: create sequential values of function until

unable to execute hadoop fs -put command from Java -

unable to execute hadoop fs -put command from Java - i trying execute hadoop fs -put <source> <destination> java code. when execute command straight terminal, works fine when seek execute command within java code using string[] str = {"/usr/bin/hadoop","fs -put", source, dest}; runtime.getruntime().exec(str); i error error: not find or load main class fs . tried execute non-hadoop commands ls,mkdir commands java , worked fine hadoop commands not getting executed though work fine terminal. what possible reason , how can solve it? java api try: tried utilize java api perform re-create operation error. java code : string source = "/home/tmpe/file1.csv"; string dest = "/user/tmpe/file1.csv"; configuration conf = new configuration(); conf.set("fs.defaultfs", "hdfs://node1:8020"); filesystem fs = filesystem.get(conf); path targetpath = new path(dest);

java - Connection refused in sftp server -

java - Connection refused in sftp server - i trying utilize localhost sftp server. i'm using jsch library of java implement sftp ssh2. next code upload text file directory on local machine sftp. cannot connect localhost. import java.io.bufferedinputstream; import java.io.bufferedoutputstream; import java.io.file; import java.io.fileinputstream; import java.io.fileoutputstream; import java.io.outputstream; import com.jcraft.jsch.channel; import com.jcraft.jsch.channelsftp; import com.jcraft.jsch.jsch; import com.jcraft.jsch.session; public class server{ public server() { } public static void main(string[] args) { string sftphost = "localhost"; int sftpport = 22; string sftpuser = "root"; string sftppass =""; string sftpworkingdir = "d:\\upload"; session session

how change checkbox webview android -

how change checkbox webview android - i have android app load webview. on webview have checkbox don't can alter size. input[type="checkbox"] { width: 25px; height: 25px; } screen http://postimg.org/image/l9lg35czj/ change size input[type="checkbox"] { width: 250px; height: 250px; } http://postimg.org/image/v96ow0otv/ why size not changed on webview, (if page browser checkbox size changed)? full code <html> <head> <style> .single_user { width:100%; height:120px; border: black; background:#e5e5e5; margin-bottom: 10px; } .user_image { padding-left: 10px; padding-top: 10px; } h1 { display: inline-block; } input[type="checkbox"] { width: 25px; height: 25px; } </style> <meta name="viewport" content="width=device-width, target-densi

How to find a dynamic element using selenium webdriver? -

How to find a dynamic element using selenium webdriver? - i want locate element id in webpage text field come in name. element : the first time, test works well. if add together loop click 1 time again element, selenium not find because id has changed. ex: id changing each time click on it. <input type="text" id="a110_name" name="name" maxlength="255"> <input type="text" id="a120_name" name="name" maxlength="255"> my code: driver.findelement(by.id("a110_name")).sendkeys("test"); how can resolve problem? give thanks you good hear have solved using xpath. can solve using css locator below: driver.findelement(by.cssselector("input[id$='_name']")); we have utilize xpath's "contains" keyword caution, in cases might match other element. if more comfortable xpath, improve utilize //input[ends-with(@id,'_na

excel - Fetch Class Name Tag From HTML Using VBA -

excel - Fetch Class Name Tag From HTML Using VBA - i'm trying utilize vba grab inner text tag within source code in next website: http://www.amazon.com/gp/node/index.html?ie=utf8&marketplaceid=atvpdkikx0der&me=a1a79b9ff9gb33&merchant=a1a79b9ff9gb33&redirect=true the class or tag or whatever called span class="nav-search-label . i thought possible using getelementsbyclassname . code executes, doesn't bring back. how can identify exact wording of these tags/id's/class names/ whatever may be. source code these tags have dashes , spaces it's hard exact string set quotes when asking vba elements. sub runnewmodule() dim ie internetexplorer dim html htmldocument dim sellerid dim name dim sellername set ie = createobject("internetexplorer.application") ie.visible = false ie.navigate "http://www.amazon.com/gp/node/index.html?ie=utf8&marketplaceid=atvpdkikx0der&me=a2p5i4nw0qqax1&merchant=a2p5i4nw0qqax1&red

Why doesn't the Javadoc for java.util.Scanner describe under what conditions it blocks? -

Why doesn't the Javadoc for java.util.Scanner describe under what conditions it blocks? - the javadoc java.util.scanner notes that: "both hasnext , next methods may block waiting farther input. whether hasnext method blocks has no connection whether or not associated next method block.". in descriptions of various has* , next* methods, notes "may block while waiting input scan". page mention under conditions these methods may block, in spite of knowledge beingness prerequisite using them. my question hence, why doesn't javadoc describe under conditions scanner's methods may block? there legitimate reason omitting information, or case of poor documentation? now you've mentioned it, pretty vague. although, explaining mean digging implementation details. the scanner relies on underlying stream. scanner#next() throw nosuchelementexception whenever underlying stream's read() method returns -1 upon reading: (implement