Posts

python - PyQt on Android -

i'm working on pyqt now, , have create application on android, i've seen kivy library, it's crude. is there way run application on android made on pyqt? android not support pyqt4. pyqt5 supported(read this: https://groups.google.com/forum/#!topic/android-scripting/hubyuynm3z8 ). however, port application use pyside( https://pypi.python.org/pypi/pyside ). provides bindings qt4 platform. can use pyside-android( http://thp.io/2011/pyside-android/ ).

javascript - Animating different markers API V3 Google Maps -

i have got markers in map , wanted animate 1 or marker depending in 1 made "click". animation work last marker create , not others ones. tried make marker array same problem. here code: <script type="text/javascript"> var marker = null; var address = null; var altura = null; function codeaddress() { altura = document.getelementbyid('altura').value; address = document.getelementbyid('address').value + ' ' + altura ; geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.geocoderstatus.ok) { map.setcenter(results[0].geometry.location); // marker marker = new google.maps.marker({ map: map, icon: document.getelementbyid('icono').value, position: results[0].geometry.location, animation: google.maps.animation.drop }); // animating listener google.maps.event.addlistener(marker, 'clic...

javascript - How do I integrate jasmine into mocha? -

i have large set of unit test written in jasmine-node node project. want use mocha expanded feature set i'm pretty in bed jasmine both style , extensive use of spies. have several helpers , custom code jasmine dependent. how can use jasmine-node or jasmine library framework while mocha testing engine? can 2 play nicely or have rewrite testing environment mocha, chai, , sinon? how can use jasmine-node or jasmine library framework while mocha testing engine? what? mean want code tests against jasmine , somehow run them in mocha? while i'm sure it's possible, sounds bizarre. for given suite of tests, it's 1 or other. have similar different apis have choose one. choosing both in single project poor judgement imho. other mocha's vastly superior async support, can't see how justify using both when closely related. it's going create confusing annoyance maintenance. suggestion: split project apart smaller, separate modules. can port each of...

ios - CAGradientLayer with Angle -

Image
i drawing cgpath not rectangle or square,and adding cgpath cashapelayer . cashapelayer 's frame getting cgpath using cgpathgetboundingbox(path) . rectangle or square. want set gradient color layer path not rectangle or square not spreading gradient color equally in whole cgpath . there way set gradient color cgpath or how can set gradient color angle? please refer screen shot understand situation. here white color indicates frame of cgpath , green colour, our drawn cgpath . @ bottom of cgpath can see white gradient colour not distributed equally in cgpath . the start , end points of linear gradient specified in points relative whole size of layer, (0,0) @ top left , (1,1) @ bottom right. therefore, make linear gradient @ angle, need set start , end points appropriately. example, if used (0,0) , (1,1) start , end points, gradient run top left bottom right, @ 45 degree angle. working out specific start , end points needs therefore matter of trigonometry. ...

multithreading - Are C++11 compilers allowed to introduce additional loads of atomic variables? -

in this answer , bdonlan states code similar following: int t; volatile int a, b; t = x; = t; b = t; may transformed compiler into: a = x; b = x; my question is, still allowed if x atomic variable relaxed loads, in following? atomic<int> x; int t; volatile int a, b; t = x.load(std::memory_order_relaxed); = t; b = t; assert(a == b); // hold? as title says, c++11 compilers allowed introduce additional loads of atomic variables? additional stores? the compiler allowed under as-if rule, load same memory location twice, compiler have show no other thread accessing same variable. either way, guaranteed a==b in example.

What is correct way to declare varbinary in SQL Server 2008? -

what correct way declare varbinary in sql server 2008? declaring this declare @binaryvalue varbinary(max) the correct way this: declare @binaryvalue varbinary(max) consider specifying length instead of max , if can.

php - Reorder the sequence of records in mysql -

how rearrange multiple records after deleting multiple records.my code deletes 1 record , rearrange records when delete multiple records,it cant reshuffle. this codes works great when delete 1 record not work multiple records, $sql="delete $user id='$id'"; $result=mysql_query($sql,$connection) or die(mysql_error()); $reorder = "update $user set id=id-1 id > $id"; $catch = mysql_query($reorder,$connection); you may need query for rows require reorder, re-order them calling update statement 1 @ time, careful set id='xx-1' id='xx'