loops

Looping DisplayObject animation

I have multiple object doing random movement with random speed. i wanted to repeat the animation. I tried to use onComplete to restart each object once the animation end, but how could I specifically target it to that object? Currently its overflow private function lineAnimation (e:DisplayObject):void { TweenLite.to (e,rand...

PHP & Pear::Mail Memory Exhaustion

Solution below Hi guys. I've been trying different ways to approach this but still hitting the same error. I have a form where you can select some users email addresses and some pdf file and it will send to them. Problem is that PHP will throw an error because the script is using massive amounts of memory (over 90 meg). I have tried usi...

I created a new table in the database of wordpress (paging system)

I created a new table in the database of wordpress. Also I create a new template page to view the records in the new table, but I want to create a system paging for this data .. this is my code global $wpdb; $querystr = "SELECT * FROM wp_hotel WHERE id_city = ".$_GET['city-id']; $pageposts = $wpdb->get_results($querystr); if ($pagepos...

Tricky one here - Trying to go through a loop and only return values where them values are equal to another loop

Hi, I have a problem here, Basically. . I have a loop which has a list of sites, im going through each and every site. I have another loop which only contains some sites I want to return only the sites where the attribute t.title == F.title If this is true I want to tick a check box if not then dont tick a check box The problem ...

Two Loops at almost the same time.

Hello everybody, i don't what this process is called, but i've seen that it's possible. what is this process called? basically, i have a method that has a loop, and in every iteration has a delay second. function myLoop(float delay) { for(int x=0; x<100; x++) { Print("Loop number: " + x); TimeDelay(delay); ...

How to write an index loop for a json object

I have an image updater. I am loading by JSON the exact same file/partial that show my images. I would like to write a loop that runs through an index and replaces every image with its equal. This is the first div in my json object : [{ "photo": { "position":1, "photo_file_size":45465, "created_at":"2010-10-05T09:51:13-0...

Round-robin processing with MPI (off by one/some)

I have an MPI implementation basically for IDW2 based gridding on a set of sparsely sampled points. I have divided the jobs up as follows: All nodes read all the data, the last node does not need to but whatever. Node0 takes each data point and sends to nodes 1...N-1 with the following code: int nodes_in_play = NNodes-2; for(int i=0;i...

Idiomatic R method for "left joining" two data frames

I have two data frames that both have a column containing a factor like the following: > head(test.data) var0 var1 date store 1 109.5678 109.5678 1990-03-30 Store1 2 109.3009 108.4261 1990-06-30 Store1 3 108.8262 106.2517 1990-09-30 Store1 4 108.2443 108.6417 1990-12-30 Store1 5 109.5678 109.5678 1991-03-30 Store1 6 109...

How can I retrieve data from an array, 3 at a time?

Is there a better way in PHP to access this array in groups of three? Let's say my array is a comma separated string like : ("Thora","Birch","Herself","Franklin Delano","Roosevelt","Himself (archive footage)","Martin Luther","King","Himself (archive footage) (uncredited)") although the array can end up being much larger, each one wil...

Why use a for loop instead of a while loop?

Possible Duplicates: Iterate with for loop or while loop? Loops in C - for() or while() - which is BEST? When should one use a for loop instead of a while loop? I think the following loops are identical, except for their syntax. If so, then why choose one over the other? int i; for (i = 0; i < arr.length; i++) { // do w...

Ruby Loops with Grandma

Okay, I'm trying to write a ruby simulation of my grandmother. I can't quite get the loop to work the way I'd like though. I want granny to respond with "OH, THAT REMINDS ME OF BACK IN (random year) ..." when you answer her in all caps but I also want her to respond with "WHAT'D YOU SAY????" when you don't use all caps. I can...

Is there a do-until (postcondition) loop in Scala 2.8?

An algorithm of mine could be better readable if I could use a postcondition (do-until) loop instead of precondition (while) loop. Is there such a feature in Scala 2.8? ...

how to execute an for loop till the queue is emptyin c++

hello, i need to execute an for loop till the queue is empty my code queue<string> q; for(int i=0;i<q.size(),i++) { // some operation goes here // some datas are added to queue } ...

macro in loops?

for(x;x<crap;x++){ macro(x,y); } how is this handled by preprocessor? is the loop unrolled or something else? ...

Java for Loop evaluation

Hi, I want to know if the condition evaluation is executed in for and while loops in Java every time the loop cycle finishes. Example: int[] tenBig = new int[]{1,2,3,4,5,6,7,8,9,10}; for(int index = 0;index < tenBig.length;index++){ System.out.println("Value at index: "+tenBig[index]); } Will the index < tenBig.length be execut...

Looping through several functions in PHP

Hello, Basically I want to achieve such functionality that 5-10 functions are executed in a row (like normally). However, I want the script to go back several steps back (ex. from 5th back to 3rd) and continue further (like 4,5,6,7,8,9,10), if specific return is received. Example: <? function_1st(); function_2nd(); function_3rd(); funct...

Walking a tree backwards in SQL

Hello: I have a table with a very simple schema: CREATE TABLE q( orig INTEGER NOT NULL, dest INTEGER NOT NULL, cost FLOAT, PRIMARY KEY (orig, dest) ); I need to walk that table backwards in a cost minimizing way. Let me explain. I need a tour of 15 points, a point can be an orig or a dest. My algorithm is a backtracking from t...

Storing a PHP loop as a string in a variable

Hello! I have a problem storing a PHP loop in a variable. The loop is like this: for( $i = 1; $i <= 10; $i++ ) { echo $i . ' - '; } for this it's OK for an echo or print as it will produce: 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - now I want to store the whole loop in a variable like $my_var which means: echo $my_var; ...

Java Loop Efficiency. if-continue OR if

Hi. The question being thought today while completing my task is about the loop efficiency.. Lets say. I have an array {'a','x','a','a'} And a loop that should avoid 'x' element Now i wonder how these two approach differ in term of efficiency - not taking the while or do-while or for loops differentiation char[] arrExample = {'a','x'...

Android: not abe to find Looper.quit()

The title explains it all. I have a class that extends AsyncTask. I call it directly in main thread using new classname.execute(). Now in the doInBackground(params) i have Looper.prepare. Since i am getting an error "Only one Looper may be created per thread", i need to use Looper.quit() inside it. But i am not able to find it inside Lo...