Hi Folks,
I need to grab ASCII codes for chars in a very large string and drop
those codes into a list. At the moment, I'm doing the obvious and
simple i.e. looping to the number of chars in the big string and
returning the code for each char retrieved with charToNum() then
appending the code
Hello Gilles,
Unfortunately, not much. OSX just seems to be very slow at handling
text in Director.
A minor improvement might be the following:
cnt = reallyBigString.length
repeat with i = 1 to cnt
myCodeList.append(charToNum(reallyBigString.char[i])
end repeat
Note: I don't know that the
Daniel,
Ah, I see...I'll try that...any speed improvement (even a small one)
will be welcome.
Yes, I've noticed OSX seems to be handling text very slowly. It also
seems to be handling lists slowly as well. I'm going to give PRegEx
Xtra a shot to see if I can't get around some of the speed
Well, unless the string is changing in size right under your nose, you
don't need to calculate the number of chars every single time. That's one
small optimization you can do...
numChars =the number of chars in reallyBigString
repeat with x=1 to numChars
...
I doubt the size of the string
Hey,
Just been playing around with MUI xtra, and found out that widgets display
the lunar interface buttons (like XP) in authoring but when exported to
projector they don't. Not that I want to say that the xtra doesn't work, but
the Creating dialog boxes from MUI.pdf (or sth like that) says:
But again, OSX is just slow with text.
I'm handling fairly big chunks of text in OS X without it seeming
slow. How big is the original string that needs to be converted to a
list of numbers? Also, how many times do you have to do that
conversion, and does it really matter if it takes a while?
At 07:04 AM 5/1/04, Peter Bochan wrote:
Hey,
Just been playing around with MUI xtra, and found out that widgets display
the lunar interface buttons (like XP) in authoring but when exported to
projector they don't. Not that I want to say that the xtra doesn't work, but
snip
Just so you know,
I don't know if this is the case for Gilles or not, but trying to use
Director to read or export text file representations of images results
in very large strings.
Regards,
Daniel
On May 1, 2004, at 7:33 AM, Colin Holgate wrote:
But again, OSX is just slow with text.
I'm handling fairly big
Hi Colin,
The biggest are about 7 bytes/characters...in one session there
may be as many as 10 or 20 of these files to import and convert. Speed
in the conversion is essential.
Overnight, I've adjusted my code so that bytes from the files are read
in (and converted) in 5000 byte chunks.
On Saturday, May 1, 2004, at 06:16 US/Eastern, Tab Julius wrote:
Well, unless the string is changing in size right under your nose, you
don't need to calculate the number of chars every single time. That's
one small optimization you can do...
numChars =the number of chars in reallyBigString
Whoa Nellie...that made a pretty noticeable difference.
On Saturday, May 1, 2004, at 10:15 US/Eastern, 2702NET wrote:
Well, unless the string is changing in size right under your nose,
you don't need to calculate the number of chars every single time.
That's one small optimization you can
Are you at liberty to use other encryption schemes that don't require
char-by-char conversion? UpdateStage has a bunch at
http://www.updatestage.com/products_table.html#Encryption . I use BlowFish.
Slava
At 10:15 AM 5/1/04 -0400, you wrote:
Conceptually, what I'm trying to do is pretty
Hi Slava,
No, unfortunately, I'm writing to a specification. I'm not doing the
encryption...just the decryption. Normally I just use DirectOS or Vlist
Xtras for that.
On Saturday, May 1, 2004, at 10:40 US/Eastern, Slava Paperno wrote:
Are you at liberty to use other encryption schemes that
Ultimately, I guess I'll probably look at cooking something up in
RealBasic and launching that from my projector. It'd be nice to make it
work natively in Lingo though.
On Saturday, May 1, 2004, at 10:40 US/Eastern, Slava Paperno wrote:
Are you at liberty to use other encryption schemes that
On May 1, 2004, at 11:07 AM, 2702NET wrote:
Ultimately, I guess I'll probably look at cooking something up in
RealBasic and launching that from my projector. It'd be nice to make
it work natively in Lingo though.
I'd be surprised if PregEx wasn't fast enough. It's certainly as fast
or faster
A minor improvement might be the following:
cnt = reallyBigString.length
repeat with i = 1 to cnt
myCodeList.append(charToNum(reallyBigString.char[i])
end repeat
A major improvement is to do all your work on char 1, then delete it as
you go:
on test
parentString = member(test string).text
I just copied a groklaw page into a text member (about 63K) and ran the
above on a dual mirror 1.25GHz G4. (10.2.6) Here are the results:
-- 63679
-- Walk: 14603
-- Delete: 9509
I added this to your routine:
reallyBigString = parentString
myCodeList = []
start = the milliseconds
wcnt =
and on my 1 GHz iMac saw this:
I was getting my machines mixed up, my iMac is 800 MHz.
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is
I added this to your routine:
As usual, Colin is a stud.
Adding Colin's elegant delete by word to my test code gives:
-- Walk: 14175
-- Delete: 9222
-- Delete Words: 1909
I'm still in the habit of following the always operate at the head of a
string rule, because when processors were a lot
I added this to your routine:
As usual, Colin is a stud.
Ok, if you want studly performance, I tried a different approach:
on chunky chunk
m = the milliseconds
thetext = member(test string).text
c = the number of chars in thetext
chunkcount = c/chunk
thelist = []
repeat with a = 0
Finally got some sleep...woke up to get a glass of water...shuffled
over to the computer to check email
and Wow, what a nice surprise. I'm going to try dropping it in now.
Thanks,
Gilles
On Saturday, May 1, 2004, at 15:25 US/Eastern, Colin Holgate wrote:
I added this to your routine:
As
and Wow, what a nice surprise. I'm going to try dropping it in now.
To save you some time, the sweet spot seemed to be about 220 character chunks.
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email
I've used PRegEx for a very simple text search (just dropping contents
of a text member into a PRegEx StringList) and it saved me on a
previous project. Truth is, I'd already hammered together quite a bit
of code to do this XOR thing w/o it and wanted to make it work.
Thomas/Colin's approach
Perfect!...I'll keep the chunks to that size.
Thanks again Colin,
Gilles
On Saturday, May 1, 2004, at 16:24 US/Eastern, Colin Holgate wrote:
and Wow, what a nice surprise. I'm going to try dropping it in now.
To save you some time, the sweet spot seemed to be about 220 character
chunks.
At 2:32 AM -0400 5/1/04, you wrote:
This is very inefficient and slow, particularly under OS X. Is there
any slick way to do this (more) efficiently?...perhaps break it up
somehow to run more quickly?
I scanned thru the responses didn't see anybody suggest this:
Don't do all those charToNum()
Thanks Buzz. Cool idea.
#1 building a limited-size string-driven proplist that contains all
256 chars their charToNums().
(then the overhead for of the function calls is limited and DONE)
What do you mean when you say limited-size? Won't the above prebuilt
propList always be the same size?
Duh...never mind. sheepishly I've parsed it. You meant limited size
as opposed to the arbitrary (most often large) sized list of charToNum
values we were building before
got it,
Gilles
On Saturday, May 1, 2004, at 17:33 US/Eastern, 2702NET wrote:
#1 building a limited-size string-driven
#2 Use Colin's first-char approach to grab each char then use that
as an index into the prooList to get it's charToNum()
That wasn't my idea, but even so, the lookup table only gives a
slight speed increase because it's the string[i] part that is slow,
not the chartonum() part.
But wait, I
Hi Buzz,
You method - defying all logic (at least *my* logic) - is actually a
good deal slower than calling the charToNum() function for each loop.
It's about 3 times slower. Tried it a few times just to be sure.
Gilles
On Saturday, May 1, 2004, at 17:12 US/Eastern, Buzz Kettles wrote:
I
Didn't see this until after I posted... Yep.
On Saturday, May 1, 2004, at 18:06 US/Eastern, Colin Holgate wrote:
#2 Use Colin's first-char approach to grab each char then use that
as an index into the prooList to get it's charToNum()
That wasn't my idea, but even so, the lookup table only
On May 1, 2004, at 6:06 PM, Colin Holgate wrote:
But wait, I tested it anyway, and it turns out that the property list
lookup to save doing chartonum() ends up taking longer than just doing
the chartonum, so no prize for Buzz at all!
No fair. Buzz should at least get an alternate approach
31 matches
Mail list logo