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 is
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
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
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
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/div2) into
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
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
repeat with y = 1 to the number of lines of temp
put item 1 of line y of temp / div1 , item 2 of line y of temp /
div2 into
top of head, not tested
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.
/blah
On 10 March 2011 10:51,
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
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
repeat with y = 1 to the number of lines of temp
put item 1 of line y
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
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
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
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
On Thu, Mar 10, 2011 at 4:40 PM, Bob Sneidar b...@twft.com 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
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
16 matches
Mail list logo