Posts

sql - MySQL join update: Updating join table row twice -

to explain problem have outlined example situation below. orderrows id|ordernumber|productnumber|quantity|done 1 |10 |100 |1 |no* 2 |10 |101 |1 |no 3 |10 |100 |4 |no* *have same product number stock productnumber|quantity 100 |5 101 |1 update orderrows inner join stock on stock.productnumber=orderrows.productnumber set done='yes' ,stock. quantity = stock. quantity -orderrows. quantity ordernumber='100' , done='no' the result table stock below. productnumber|quantity 100 |4 101 |0 the order rows updated correctly. order row 3 stock not adapted. because order row 3 has same product number order row one. question is, how can fix this? you need use group by here. can't use directly. can achieve using sub-query this: update orderrows o join stock s on s.productnumber = o.productnumber join ( select pr...

html - Google Sites checkbox value in Google Spreadsheet -

on google sites on edit mode, have prepared checkbox using insert - html box and within html box following code.. <style> div{ width:100px; height:30px; } </style> <script> function putresult(e) { var ss = spreadsheetapp.openbyid("0akkxdnrvyzqzde1yu21frgj6akj6mmzisvhtn0jmnnc"); var calc = ss.getsheetbyname("customer"); var chvalue = e.parameter.bike calc.getrange("c3").setvalue("chvalue"); } </script> <div> edc: <input type="checkbox" id="bike" onclick="putresult(e)"> </div> now requirements: i want true/false based on checkbox populated in ss.calc (c3) sheet. the page should automatically refreshed each time checkbox clicked. i novice , in learning stage. please shout if things unclear. ps: i copied code within gas, that's e.parameter.bike comes from, don't know if that's right way... i have inserted chart in goo...

javascript - Displaying popup when data processing is going on -

i have created html file demo . table can contain more 2000 rows. on clicking on each row, related data displayed in separate pane. $('table tr').on('click', function () { $('#showcontent').html($(this).find('.content').html()); }); i want add popup display processing message, displayed on clicking on row before displaying row related data in separate pane. once data ready display, popup should closed automatically. thoughts! you can use jquery blockui plugin: $('table tr').on('click', function () { $('#showcontent').html($(this).find('.content').html()); $.ajax({ url: url ... beforesend: function(){$.blockui();} complete: function(){$.unblockui();} }); });

core data - How to insert NSManagedObject in other NSManagedObjectContext? -

i getting data server , converts them array of nsmanagedobject objects. array used display table. how insert first element array peoples in persistent store? - (void)viewdidload { [self loaddata]; [self insertfirstpeople]; } - (nsmanagedobjectcontext *)managedobjectcontext { if(!_managedobjectcontext) _managedobjectcontext = [nsmanagedobjectcontext mr_context]; return _managedobjectcontext; } - (void)loaddata { ... network request ... peoples = [nsmutablearray array]; (nsdictionary *item in items) { people *people = [podcast mr_createincontext:self.managedobjectcontext]; people.name = [item valueforkeypath:@"im:name.label"]; [peoples addobject:people]; } } -(void)insertfirstpeople { people *people = peoples[0]; nsmanagedobjectcontext *moc = [nsmanagedobjectcontext mr_defaultcontext]; [moc insertobject:people] [moc mr_savetopersistentstoreandwait]; } error: an nsmanagedob...

sip - OpenSIP not sending cancel to UAS in case it received 200 from UAC. Verified in 1.7.2 and 1.8 -

sip call graph diagram when bug comes: a = uac b = opensips c = uas a ---------- invite ---------> b <-------- status 100 trying ------- b b ---------- invite ---------> c b <-------- status 100 trying --------- c b <-------- status 200 ok --------------- c <-------- status 200 ok ------------- b ---------- cancel ------------------> b <-------- 200 canceling ----------- b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b ---------- ack ---------------> b b <-------- status 200 ok --------- c <-------- status 200 ok --------- b b <-------- status 200 ok --------- c ...

How to get the MAC-address from MSSQL server 2000 -

i'm working on project (among other things) need find mac address remote computer. problem i'm restriced accessing computer throught sql queries. (so can't use wmi) the remote computer running windows server 2000, , ms sql server 2000. i know ip of remote computer , able log in admin account. how can mac address(preferably of them) remote computer? thankful answers. according this , doesn't seem can. if using sql server 2005+, i'd think code in sqlclr without effort.

c - How can I wait until specified "xterm" finished? -

in c-shell file, did like: xterm -e "source xxxx0" & xterm -e "source xxxx1" & wait code.... it works fine code after "wait" executed after 2 xterm finished. but gives problem. if have ps open, txt file opened geditn, or have eclipse open, hung there since "wait" waiting jobs finished. so how can let "wait" wait 2 xterm jobs. or in word, want 2 "xterm" run concurrently. , after both done, code can continued. how shall that? thank much tell wait process ids should wait for: xterm ... & pid1=$! xterm ... & pid2=$! wait $pid1 $pid2 that's assuming use shell wait supports multiple arguments (bash,zsh, ...). if use sh portability, have 2 waits: wait $pid1 wait $pid2 this wait untill both finished. if second finishes before first, wait return.