Hi,
I'm stuck with a simple loop that takes more than an hour to run, and need help to speed it up.
Basically, I have a matrix with 31 columns and 400 000 rows. The first 30 columns have values, and the 31st column has a column-number. I need to, per row, retrieve the value in the column indicated by the 31st column.
Example row: [26...
Hey.
I have an array like this (one dimension only):
$arr = array('one', 'two', 'three', 'foo', 'bar', 'etc');
Now I need a for() loop that creates a new array from $arr, like that:
$newArr = array('one', 'onetwo', 'onetwothree', 'onetwothreefoo', 'onetwothreefoobar', 'onetwothreefoobaretc');
Seems to be simple but I can't figur...
I am trying to pass login details to different machines through ssh in a shell script. Even though I have used a for loop, I am ending up sending all the login information to all the machines. Can someone please help me with this?
for system in ${allSystems}
do
machine=`echo $system | awk -F ";" '{print $1}'`
use...
In a form I have, a consumer can choose to add a blood test, a vision test, or both (combo) to several enrollee's accounts. This is all done at one time. Based on the choice made, I am able to select the 'choice' and echo a respective price but am having the hardest time building a script to 'add or sum' all the variables together.
I a...
Im using Vb.net visual studio 2008. i have got a process(system.diagnostics.process) to be run in background and it updates the Ui thread progressbar and a label and i have worked it using backgroundworker.runworkerAsync. Now the problem is i have to work the same process for a number of time with different inputs.
The code block is :
...
Hi
I would like some help in creating a loop that will take one of my files extension .tar.gz
unzip it untar it and search the files inside (with extension .tlg) using grep -a >> output.text.
In the outout.text i will require the matching data as well as the name of the file and parent tar it came from
one this search has been perfo...
I'm trying to work with large numbers (~10^14), and I need to be able to store them and iterate over loops of that length. ie.
n=SOME_BIG_NUMBER
do i=n,1,-1
I've tried the usual star notation, kind=8 etc. but nothing seemed to work.
Then I checked the huge(i) functions, and the code:
program inttest
print *,huge(1)
print *,huge...
Hi,
I went through several examples posted online but I cant answer my question.
I have my 'p' variable that is being increased by 1 in the for loop. I want the UI to display the progress of calculation (to show how 'p' is increasing from 0 to 1000000). I do the calculation on the separate thread and the I call dispatcher to update the...
I am primarily a CSS and HTML guy but I have recently ventured into PHP.
I can't see why this script hangs:
$loop_Until = 10;
while($i < $loop_Until)
{
// do some code here
$loop_Until = $loop_Until + 1;
}
Can anyone please help?
...
I have a server with multiple databases. I need to loop through these databases and change a value in one record, in one table, in each database. How can this be done?
...
I have a do/while loop that goes over database rows. Because it runs many days at the time processing 100000s of rows, memory consumption is important to keep in check or it will crash. Right now every iteration adds about 4kb to script's memory usage. I'm using memory_get_usage() to monitor the usage.
I unset every variable used in the...
Possible Duplicate:
Break statements In the real world
Some days ago I started a quick open source project and, when some mates looked at the code on svn, one of them told me that using break statement inside a for loop is considered harmful and shouldn't be done.
He added, though, that I would find several cases of break st...
Here is my .htaccess:
Options +FollowSymLinks +SymLinksIfOwnerMatch
#non .PHP files
<Files manage>
ForceType application/x-httpd-php5
SetHandler application/x-httpd-php5
</Files>
<Files profile>
ForceType application/x-httpd-php5
SetHandler application/x-httpd-php5
</Files>
<Files process>
ForceType application/x-httpd-php5
SetHandle...
hi guys,
i have this code that was made from tips here long time ago.
var tm
var tn;
var rot = true;
var rot2 = true;
var th = 482;
var tmh = 0;
var $paneTarget = $('#lyr1');
var slideshow = {
delay: 5000,
actions:[],
run: function() {
if (slideshow.actions.length) {
var current = slideshow.actions.shif...
i have a code that does something like this:
while (doorIsLocked()) {
knockOnDoor();
}
openDoor();
but i want to be polite and always knock on the door before i open it.
i can write something like this:
knockOnDoor();
while (doorIsLocked()) {
knockOnDoor();
}
openDoor();
but i'm just wondering if there's a better idiom that do...
How can one loop a command/program in a Unix shell without writing the loop into a script or other application.
For example, I wrote a script that outputs a light sensor value but I'm still testing it right now so I want it run it in a loop by running the executable repeatedly.
Maybe I'd also like to just run "ls" or "df" in a loop. I...
I need to get populator to build me an order history such that:
The record has a start_date and end_date
Each record specifies a period between 0 and 5 years
Events are pretty much consecutive (meaning the end date of record n affects the start date of record n+1)
There can be gaps between events (periods of no orders) but no overlaps
...
For efficiency reasons, I always avoid writing loops like this:
for(std::size_t i = 0; i < vec.size(); ++i) { ... }
where vec is an STL container. Instead, I either do
const std::size_t vec_size = vec.size();
for(std::size_t i = 0; i < vec_size; ++i) { ... }
or use the container iterators.
But how bad is the first solution really...
I have a friend who has an assignment on arrays and because I lack experience in Javascript and she just needs some real quick help understanding how to implement a Javascript loop to store data in an array which converts a letter grade to a number. Can someone just guide her in a general direction?
https://docs.google.com/fileview?id=...
Hi, I am stuck in a Clojure loop and need help to get out.
I first want to define a vector
(def lawl [1 2 3 4 5])
I do
(get lawl 0)
And get "1" in return. Now, I want a loop that get each number in the vector, so I do:
(loop [i 0]
(if (< i (count lawl))
(get lawl i)
(recur (inc i))))
In my mind this is supposed...