On Mar 12, 2011, at 6:13 PM, Alex Tweedly wrote:
You're right. Sorry - I was misled by the docs, which describe the
order of the combine following the description of the 'first' form
of the combine command, and then go on to describe the second form,
including the fact that the keys of the
You're right. Sorry - I was misled by the docs, which describe the order
of the combine following the description of the 'first' form of the
combine command, and then go on to describe the second form, including
the fact that the keys of the array must be all numeric. I put 2 + 2
together and
This has been a sore point for me concerning arrays. You should at least expect
the array to be sorted by when the element was created. That way you could see
the most recent items by looking at the last elements first, like Filemaker.
Unsorted, you can always depend on seeing the last records a
"newer", but not "new" :-)
'split by column' and 'split by row' appeared somewhere around 3.5 (I think)
-- Alex.
On 12/03/2011 01:11, Bob Sneidar wrote:
Wha?? There is a newer form of split and combine??
Bob
On Mar 11, 2011, at 4:42 PM, Alex Tweedly wrote:
FlexibleLearning wrote:
This i
Summary:
We are trying to divide pairs of comma-delimted items in a return-delimited
list by two different numbers.
>Use "split by column" to separate the two columns
>Then use "split by row" to convert the columns into arrays
>Then use "divide by " to do the maths
>Then combine them back again.
Wha?? There is a newer form of split and combine??
Bob
On Mar 11, 2011, at 4:42 PM, Alex Tweedly wrote:
>
>> FlexibleLearning wrote:
>>
>>> This is BAD...
>>> repeat for each line L in tData
>>> add 1 to n
>>> put (item 1 of L/div1) into item 1 of line n of stdout
>>> put (item
FlexibleLearning wrote:
This is BAD...
repeat for each line L in tData
add 1 to n
put (item 1 of L/div1) into item 1 of line n of stdout
put (item 2 of L/div2) into item 2 of line n of stdout
end repeat
The use of "put ... after ..." is so efficient this may be an
intere
hmmm interesting, concatenation is much better than enumeration. Whoda think
it? I will keep that in mind for large data sets. Thanks for the info!
Bob
On Mar 11, 2011, at 3:24 AM, FlexibleLearning wrote:
> Proof of how optimized syntax can make an enormous difference to speed (by
> orders of
FlexibleLearning wrote:
> Proof of how optimized syntax can make an enormous difference to speed (by
> orders of magnitude in this case).
>
> This is BAD...
> repeat for each line L in tData
> add 1 to n
> put (item 1 of L/div1) into item 1 of line n of stdout
> put (item 2 of L/div
Proof of how optimized syntax can make an enormous difference to speed (by
orders of magnitude in this case).
This is BAD...
repeat for each line L in tData
add 1 to n
put (item 1 of L/div1) into item 1 of line n of stdout
put (item 2 of L/div2) into item 2 of line n of stdout
end
Of course, using a faster processor would give faster results.
What would be the speed difference if the data block was sent to an
irev script and run on a faster processor?
Jim Ault
Las Vegas
On Mar 10, 2011, at 12:07 PM, Alex Tweedly wrote:
use repeat for each line L ... and collect the mo
On Thu, Mar 10, 2011 at 4:40 PM, Bob Sneidar wrote:
> How about chunking the data with the new method? I would put money on the
> notion that it won't matter much.
>
> Bob
>
It didn't. :)
~ Chris Innanen
~ Nonsanity
___
use-livecode mailing list
u
How about chunking the data with the new method? I would put money on the
notion that it won't matter much.
Bob
On Mar 10, 2011, at 1:25 PM, Nonsanity wrote:
> I didn't use that style because he mentioned he tried it without much
> success. I tried it down on the straight-up 100,000 pass and
I didn't use that style because he mentioned he tried it without much
success. I tried it down on the straight-up 100,000 pass and it finished in
4 seconds. Hands down the fastest. I should have tried that on my own just
for completeness' sake.
I guess I was too taken with the faster results I got
You should also try using the form:
repeat for each line theLineValue in theData
Apparently this creates an internal array of theData and is much faster. The
big caveat is that you do not alter what theData contains while in the repeat
loop, as this will really screw things up. That is because
use repeat for each line L ... and collect the modified lines in a
separate variable, replace the original variable after the loop
repeat fer each line L in tData
put ... & CR after temp
end repeat
put temp into tData
should be very quick.
-- Alex.
btw - not needed in this case, but you cou
e@lists.runrev.com
Sent: Thu, Mar 10, 2011 2:18 pm
Subject: Re: Efficiency question for list modification
I ran this with a field "rawData" containing 5000 lines:
on mouseUp
put the ticks into aa
put fld "rawdata" into temp
put 3 into div1
put 5 into div2
r
I made a quick test stack to try out a few ides:
http://dl.dropbox.com/u/144280/Divide%20List%20Tests.livecode
It generates 100,000 random integer pairs into one field, then has four
buttons to do the sample division you gave to the two items in each line.
The first is a straight-up "repeat
perhaps find a way to speed up the other code inside that is parsing and
doing the math.
can't you add an index (id) column to the data? even temporarily?
therefore create the arrays in a way where you can restore the original
order.
On 10 March 2011 10:51, FlexibleLearning wrote:
> Problem:
>
numbered:
If you had:
3,6
4,7
5,8
Make it into:
1,3,6
2,4,7
3,5,8
Now you can use an array, and the ordering can be recovered since the lines
contain unique identifiers.
Craig Newman
-Original Message-
From: FlexibleLearning
To: use-livecode@lists.runrev.com
Sent: Thu, Mar 1
Problem:
I have a long list of several thousand lines.
Each line contains two comma-separated numbers.
I want to divide the first item of each line by one divisor, and divide the
second item of each line by a different divisor.
The list order must stay the same.
Example:
Using 2 and 5 as divisors.
21 matches
Mail list logo