Hi list,
What is the best and most efficient way to write the following
javascript loops in LC ?
for (let i = 0, j = myArray.length - 1; i < myArray.length; j = i++) {
}
This goes beyond simple nested loops.
So far, because of lack of time, I have pre-calculated the successive
values of i and j
There may be other approaches, but without knowing what the data looks
like, what the resulting index should look like, and how big the data is
we'd just be guessing.
--
Richard Gaskin
Fourth World Systems
Rick Harrison wrote:
Hi Richard,
I was looking at the offset function and thinking
Hi Bob,
Nice to know this for the future.
Thanks for your research!
Rick
> On May 16, 2022, at 7:53 PM, Bob Sneidar via use-livecode
> wrote:
>
> OK so it appears there is a log2 property. The log2 of 1000 yields 9.965784
> so I suppsoe if you round up, that would give you the maximum numbe
Hi Bob,
Yes, I was looking into the binary sort idea. It’s too bad that
isn’t just a built-in function for LC. I’m not sure it’s worth
that kind of effort for my particular case.
Thanks,
Rick
> On May 16, 2022, at 6:44 PM, Bob Sneidar via use-livecode
> wrote:
>
> So this has got me thin
Hi Bob,
I just need to make one pass at the data, so building an SQL database for it
doesn’t make sense.
I don’t have any definitive line for the boundary between good and bad data.
It’s more of a
consistent first guess used just to cut down on the amount of data to process.
I start looking
OK so it appears there is a log2 property. The log2 of 1000 yields 9.965784 so
I suppsoe if you round up, that would give you the maximum number of iterations
to isolate a single line in a 1000 line sorted list.
Bob S
> On May 16, 2022, at 15:44 , Bob Sneidar via use-livecode
> wrote:
>
>
So this has got me thinking. Apparently what I am calling Divide and Conquer is
really called a binary sort. I have looked up on the interwebs to calculate the
maximum number of iterations for a given number of values, but it seems that
all the formulas offered up use functions for C. I am tryin
A maximum of 7 recursions are necessary to isolate a single instance of 100
possible values. 1000 requires a maximum of 10. 1 values requires 14. The
idea is that for every factor of 10, you need roughly 3 more recursions. This
of course assumes the data is sorted, which in your case is sort
Do you know exactly which lines you need to toss, or do you need to searc the
data to find out where the beginning and end of the useful data is?
If the former, then just put line x to y of your data into a new variable. If
the latter, then a divide and conquer approach might be the answer. Get
Hi Ralph,
Filtering the data first made a huge difference in the size of the data I need
to search.
Thanks!
Rick
> On May 16, 2022, at 4:01 PM, Ralph DiMola via use-livecode
> wrote:
>
> If the needed OR unneeded lines have something in common then the filter
> command is your friend. Filt
Hi Ralph,
I was looking at filter. It might help me to
cut down on the amount of data to search,
but I would still have to throw out the
first 1/3 of the data. Perhaps filtering
first and then processing what’s left
by line number wouldn’t be too slow.
Thanks for the suggestion!
Rick
> On May
If the needed OR unneeded lines have something in common then the filter
command is your friend. Filter is blazingly fast.
Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net
-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com
Hi Richmond,
Doesn’t the following still require a loop?
LC doesn’t like the syntax you provided.
Thanks,
Rick
> On May 16, 2022, at 2:23 PM, Richmond via use-livecode
> wrote:
>
> 3 put chars 1-SLICER of MyDATA into firstTHIRD
___
use-livecode m
Hi Richard,
I was looking at the offset function and thinking about
the starting points. It still presents a looping problem
for me that I’m trying to avoid. If other methods aren’t
more efficient I will play with it more.
Thanks,
Rick
> On May 16, 2022, at 2:32 PM, Richard Gaskin via use-liv
Hi Richmond,
An interesting approach. I’ll give it try
Thanks!
Rick
> On May 16, 2022, at 2:23 PM, Richmond via use-livecode
> wrote:
>
> Well one of the things you could do is this:
>
> slightly pseudo
>
> 1 put the number of chars in MyDATA into MyNUM
> 2 put MyNUM / 3 into SLICER
> 3 p
On 5/10/22 12:35 PM, Richard Gaskin via use-livecode wrote:
Mark Clark wrote:
> Wondering if anyone has used LiveCode for encrypting-decrypting large
> files?
...
> I’m thinking about using LC for decrypting zip compressed log files
> that can be multiple gigabytes in size. I’d like to use jus
Rick Harrison wrote:
I have a large chunk of data that I want to
search as quickly as possible.
Unfortunately the part I want to search is the
middle third of the data. The other thirds at
the beginning and at the end are just junk and
slow down my search so I want to get rid of them.
I
Great Behinds Stink Alike. :)
On 16.05.22 21:19, Craig Newman via use-livecode wrote:
Hi.
Can you get the number of lines of the whole blob, if lines are pertinent,
divide that number by 3, and search from there? Another words, if you had 1000
lines, divide by 3 and search from line 333 to 6
Well one of the things you could do is this:
slightly pseudo
1 put the number of chars in MyDATA into MyNUM
2 put MyNUM / 3 into SLICER
3 put chars 1-SLICER of MyDATA into firstTHIRD
4 put chars SLICER-(SLICER * 2) into secondTHIRD
5 put chars (SLICER * 2)-(SLICER*3) into thirdTHIRD
at which po
Hi.
Can you get the number of lines of the whole blob, if lines are pertinent,
divide that number by 3, and search from there? Another words, if you had 1000
lines, divide by 3 and search from line 333 to 666.
Craig
> On May 16, 2022, at 1:46 PM, Rick Harrison via use-livecode
> wrote:
>
>
> Dan wrote:
> My client wants to make a music playing app. Need to replicate a music
> player... so, we need to keep our [custom] transport in sync with the sound.
> Stop, Start, Pause, Scrub, update current time and time remaining, etc. EASY
> on desktop, can't seem to do this on mobile wit
I have a large chunk of data that I want to
search as quickly as possible.
Unfortunately the part I want to search is the
middle third of the data. The other thirds at
the beginning and at the end are just junk and
slow down my search so I want to get rid of them.
I don’t want to search lin
22 matches
Mail list logo