Posts

Stop a controlling object to move in Corona sdk -

i have 2 controls in space shooter-like game, left , right. ship move left , right , when ship moves left of x=40 (far left), revert x=40 , disable "move left" function temporarily, problem whenever move far left or far right of screen, middle of screen, ship moves further x=40(about x=35) moves , continues until let go of button. how can make when move ship far left, stops , lets me move right? here code: function left:touch() if(car01.x>40 , car01.x<280) motionx=-speed; return false end end left:addeventlistener("touch",left) function left:touch2() motionx=0; end local function movecar(event) if(car01.x>40 , car01.x<280) car01.x=car01.x+motionx return false elseif(car01.x==40) car01.angularvelocity=0 left:addeventlistener("touch2",left) car01.x=car01.x+motionx elseif(car01.x<40) car01.x=40 end end runtime:addeventlistener("enterframe",movecar) local function stop(event) if (event.phase==...

how to select all of duplicate record in mysql -

my records is: name | id | avg(point) point | 1 | 6 b | 2 | 6 c | 3 | 5 d | 4 | 5 e | 5 | 4 f | 6 | 3 g | 7 | 2 how select record below: 1.i want select top 3 record, result follow: name | id | avg(point) point | 1 | 6 b | 2 | 6 c | 3 | 5 d | 4 | 5 e | 5 | 4 2.i want select record not top 3, result follow: name | id | avg(point) point f | 6 | 3 g | 7 | 2 how can do? there several ways these. here's couple using in , not in . for top 3, can use in : select * yourtable point in (select distinct point yourtable order 1 desc limit 3) for rest, use not in instead: select * yourtable point not in (select distinct point yourtable order 1 desc limit 3) other...

osx - How to let other people use ssh to connect to my computer? -

my operating system mac os x. want use bash command let other people use ssh connect computer. how do? set user account them on computer; allow logon privileges user. os x server puts pretty gui face on doing this.

Materialize.toast in angular 2 -

i working on angular 2. have used materialize-css works fine classes problem came materialize toast . configured materialize gulpfile.js need add other js file in gulpfile? <a class="btn" (click)="materialize.toast('i toast', 4000)">toast!</a> used console shows error materialize not defined this works me. wish knew why - not find documented anywhere. import { toast } 'angular2-materialize'; ngoninit() { toast("i best toast there is!", 4000); }

How do I execute Windows commands in Java? -

i'm working on project, , give list of windows commands. when select one, perform command. however, don't know how that. going in visual c#, or c++, c++ classes complicated, , don't want make forms , junk in visual c# (really bad @ console applications). i hope helps :) you use: runtime.getruntime().exec("enter command here");

objective c - Obj-c is NSMutablearray thread safe in this Queue, and does reading it needs to be queued also? -

i'm working on ios app in xcode 7, , have had problems thread safety of global nsmutablearray read many times updates on tableview. because of strange chrashes, tried adding queue updating of global array (global view), array updated database function call (written class method other global functions). update called main threads other calls coming background threads , timer events. i add globals: nsmutablearray *mymutarray ; dispatch_queue_t the_queue ; then in viewdidappear the_queue = dispatch_queue_create("my_queue", dispatch_queue_serial) ; and function updating array (from classinstance) -(void)update_array { dispatch_sync("my_queue"),^{ mymutarray = [[nsmutablearray alloc] initwitharray:[globalfunction updatearrayfromdb] ] ; } } with hoping avoid thread problems, necessary have read function like: -(nsarray*)read_array{ __block nsarray *array ; dispatch_sync("my_queue",^{ array = [nsarray ar...

hashtable - Why the powershell convert my hash table into string block -

i have hashtable ( $applications ) looks that: name version ---- ------- adobe flash player 19 activex 19.0.0.226 enterprise library 4.0 - may 2008 4.0.0.0 entity framework designer visual studio 2012 - enu 11.1.21009.00 fiddler 2.4.0.6 google chrome 49.0.2623.87 iis 8.0 express 8.0.1557 so i'm trying exclude applications list , i'm using: [array]$excludeapps = "fiddler","chrome" foreach ($excludeapp in $excludeapps){ $applications = $applications -notlike "*$excludeapp*" } the result maybe filtered out exclude list not expected: @{name=adobe flash player 19 activex; version=19.0.0.226} @{name=enterprise library 4.0 - may 2...