Posts

php - How can I bind quantity (input of type number) and item (input of type checkbox) in HTML? -

i have list of dynamically generated items (in php) , have let user chose quantity each item, how can bind (and distinguish) each input of type number corresponding item? each item has code attribute "value" , give names (attribute "name") "numitems_".$itemcode input tags of i'm not sure clean solution. there several ways of doing this. i set name of inputs array: echo '<input type="number" name="numitems['.$itemcode.']" />'; then can check this: foreach($_post['numitems'] $code => $number){ echo 'value of '.$code.' is: '.$number; }

Android Volley Synchronize Server SQLite -

i new android development, started sqlite. working on location app should retrieve locations mongo server, , populate local sqlite db. listview, search queries etc.. should use local db data. i using volley library networking. questions: 1- after getting volley response, how populate sqlite? 2- how send updated location data server device? (i dont need update server device info.) 3- how ensure sqlite gets updated, not overwriten server everytime? i have seen examples using asynctask, syncadapter etc... @ point in project cannot change code volley. my volley code below (currently parses json object): private void getresource() { requestqueue rq = volley.newrequestqueue(this); jsonarrayrequest jobjr = new jsonarrayrequest(url_all_points, new response.listener<jsonarray>() { @override public void onresponse(jsonarray response) { parsejson(response); } }, new response.errorlistener() { ...

machine learning - spell checker uses language model -

i spell checker use language model. i know there lot of spell checkers such hunspell , see doesn't relate context, token-based spell checker. for example, i lick eating banana so here @ token-based level no misspellings @ all, words correct, there no meaning in sentence. "smart" spell checker recognize "lick" correctly written word, may author meant "like" , there meaning in sentence. i have bunch of correctly written sentences in specific domain, want train "smart" spell checker recognize misspelling , learn language model, such recognize thought "lick" written correctly, author meant "like". i don't see hunspell has such feature, can suggest other spell checker, so. see "the design of proofreading software service" raphael mudge. describes both data sources (wikipedia, blogs etc) , algorithm (basically comparing probabilities) of approach. source of system, after deadline , availab...

javascript - localStorage value turns back into zero -

i made kind game using html, css, js, ajax , php. however, in order save user's best score, used localstorage (for first time). for reason, though best score being displayed in "best score" box while user still playing (as wanted), it's being removed when refresh page, , turns 0 again (which defined default value). can please point @ problem me? here specific part of code: $(".pi_tab .best_result #score").html(localstorage.record); $("#pi_input").keyup(function() { // on pressing digit var num = parseint($("#counter").html()); // convert counter's value integer if (!isnan(num)) // if it's legal number { if (num + 1 > localstorage.record) // if it's score new record { localstorage.record = num + 1; // update record $(".pi_tab .best_result #score").html(localstorage.record); // show record "best score" } } }); try us...

java - How does iterator work with constructor -

hi i'm new java , encountered following problem in homework. i'm required write class adds new object list when void method called. hint, structure of iterator method given, core structure of code looks this: public class objectlist implements iterable<obj> { private arraylist<obj> objectlist; attribute_a a; attribute_b b; attribute_c c; public objectlist(attribute_a a, attribute_b b, attribute_c c){ objectlist = new arraylist<obj>; this.a = a; this.b = b; this.c = c; } public void extendlist(attribute_a a, attribute_b b, attribute_c c){ objectlist.add(new obj(a,b,c)); } public iterator<obj> iterator(){ return objectlist.iterator(); } @override public string tostring(){ newstr = ""; for(i = 0;i<objectlist.size();i++) { //assuming obj has method tostring() //it prints out details of each object, join 1 string newstr += objectlist....

Facebook Unity SDK Feed Dialog - iOS callbacks always "cancelled" -

using latest facebook sdk unity, whenever make request using fb.feed api, , user has official facebook app installed on ios, callback returns "cancelled:true". if uninstall official facebook app ios device, callback returns post id expected. any here appreciated. adam

text - Image Description on Hover Image Link -

i have page 9 images. each image links page project. want project name , faded color appear when 1 hovers on image. cannot figure out if can hover definition of link style, or if need use javascript. not know if need multiple divs overlapped-- expecially because want fade color cover entire image, text left-indented. below find divs of top row of images place holders. <div id="wrapper"> <div id="images"> <div id="thumbnails_row1"> <div id="houses_01"><div class="site_nav_left">project title</div class="site_nav_left"></div> <div id="houses_02"><div class="site_nav_right">project title</div class="site_nav_right"></div> <div id="houses_03"><div class="site_nav_right">project title</div class="site_nav_right"></div> </div> </div> </div> click demo...