Posts

sql: how to select all records with field set to 0 and set the value of that field to one -

is possible in 1 sql statement? pointer nice sql tutorial on subject appreciated. know can use command select * mytab myfield = 0 , use server script go through result , update myfield of result rows. wouldn't work? update mytab set myfield=1 myfield=0 edited add: if interested in sql tutorials, lightweight 1 has nice feature of allowing edit , run sql commands in webpage see how work w3schools here: http://www.w3schools.com/sql/

javascript - Onclick of Checkbox,place the checked value into a textbox and delete the unchecked value from textbox -

my code: <!doctype html> <meta charset="utf-8"> <html> <head> <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> <script type="text/javascript" src="http://cdn.datatables.net/1.10.9/js/jquery.datatables.min.js"></script> <script type="text/javascript" src="https://raw.githubusercontent.com/mpryvkin/plugins/master/pagination/simple_numbers_no_ellipses.js"></script> <link rel='stylesheet' href='style.css'> <link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/1.10.9/css/jquery.datatables.min.css"> </head> <body> <div> <form action="/home/divya/html_docs/click.html" method="pos...

angularjs - How to generate an HTML table from the following Hierachical Json? -

Image
i have got json this, can find complete json in plunker "name": "total", "imageurl": "", "type": "total", "children": [ { "name": "motor car", "imageurl": "", "type": "motor car", "children": [ { "name": "private", "imageurl": "", "type": "private", "size": 9221 }, { "imageurl": "", "type": "hiring", "name": "hiring", ...

java - Unable to configure resource mapping in spring framework 4.2.1 release -

i tried develop web project using spring framework 4.2.1 release raised error in resource mapping. can't find mapped resources(image,css,javascript, etc.) -myservices-servlet.xml <context:annotation-config/> <context:component-scan base-package="com.mv.services"/> <bean class="org.springframework.web.servlet.view.internalresourceviewresolver"> <property name="prefix" value="/web-inf/views/pages/" /> <property name="suffix" value=".jsp" /> </bean> <bean id="tilesviewresolver" class="org.springframework.web.servlet.view.urlbasedviewresolver"> <property name="viewclass" value="org.springframework.web.servlet.view.tiles3.tilesview" /> <property name="order" value="1"/> </bean> <bean id="tilesconfigurer" class="org.springframe...

gridview - yii dataprovider returns error 500 -

i tried defining dataprovider cgridview in yii getting error 500: trying property of non-object the following model , view/admin.php code snippets model.php: public function search2() { $sql='select family_tree.tree_creator_id, c.user_fullname, family_tree.tree_user1_id, a.user_fullname, family_tree.tree_user2_id,b.user_fullname, family_tree.tree_type, family_tree.tree_type_name family_tree join user on a.user_id=family_tree.tree_user1_id join user b on b.user_id=family_tree.tree_user2_id join user c on c.user_id=family_tree.tree_creator_id '; if($this->tree_creator_id!=null) { $sql.="where family_tree.tree_creator_id='$this->tree_creator_id'"; } $a= yii::app()->db->createcommand($sql) ->queryall(); return new carraydataprovider($a, array( 'id'=>'family-tree', 'keyfield'=>'tree_id')); } admin.php: ...

performance - How to fill redis with redis-cli with dummy data of size weigh hundreds of MB? -

i getting hand dirty redis monitoring. far came metrics useful monitor redis: memory_used through put latency connections replication i newbie on this. trying fill redis redis-cli dummy data as: in `seq 10000000`; redis-cli set users:app "{id: '$i', name: 'name$i', address: 'address$i' }" ; done doesn't scale need fillup redis-db fast enough... also need regarding latency , throught put monitoring. know mean, don't know how measure them... eyes don't see rellated on output redis-cli info thanks, support/guidence :d to "fill fast", follow instructions in documentation mass insert - gist using --pipe directive on pre-prepared data file.

How to create a cocos2d-x's PhysicsBody that does not rotate -

i'm using cocos2dx write simple game. wanted use cocos2dx's physics engine don't need object rotate it's initial direction. turns out can't find way it. tried put static physics body , attaching other bodies physicsjoinmotor or physicsjointgear o avail. ideas on how accomplish this? body->setrotationenable(true);