1. RE: Changing data types, Continued

Allen V Robnett wrote:
> 
> 
> I have found that peek4u() works to get the RAM data into 4-byte atom 
> form, and that  bytes_2_int can be used to change the user input into an 
> 
> atom. Since I appear to be restricted to using a multiple of 4 bytes, I 
> have elected to use a for loop and wait_key to get the 4-character 
> input. Is there a better way to accomplish all of this?

I strongly suspect you're going about this the wrong way. 
If, as the original post suggested, you are searching for a short 
ASCII pattern within a long string of ASCII characters, perhaps 
match() would be faster than all that peeking, byte conversion, 
and looping.

Irv

new topic     » topic index » view message » categorize

2. RE: Changing data types, Continued

Allen V Robnett wrote:

<snipped response>
> Thanks for the response. I believe match() is restricted to sequences. 
> Given the 200MB size of my data file, even without Euphoria's sequence 
> delimiters, and given the relative speed of reading the undelimited file 
> into RAM at the beginning of a session, and then back out at the 
> conclusion, it seemed preferable to me to use peek and poke on an 
> undelimited, allocated file buffer. The editor program will search the 
> entire file in 7 seconds.

After reading this, I'm not sure if you still have a question.  It might 
help to know at least what platform (DOS, *nix, Win) you are working 
with to determine the best (or fastest?) solution.

-- Brian

new topic     » goto parent     » topic index » view message » categorize

3. RE: Changing data types, Continued

> -----Original Message-----
> From: Allen Robnett [mailto:alrobnett at alumni.princeton.edu]
> Subject: Re: Changing data types, Continued
>
>
>
> >>I am very interested in seeing code for how you are loading
> and accessing
> >>200meg file in ram now.
> >>
> >>Kat,
> >>
> >>
> >Sure Kat, I wrote it! Allen shouldve mentioned that...
> >
> >Euman
> >
> >
> Yes, Euman was of inestimable help in telling me how to read the file
> into an allocated buffer using the API.
> As far as accessing the data is concerned, the only trick is
> having the
> pointer to the start of the buffer. Then just use peek and poke with
> appropriate offsets.

Yes, it was a rather salient point as we all assumed you were using standard
Euphoria code to read and search the file. Using the API and raw ram buffers
instead changes things a lot, as we are no longer talking about atoms and
sequences.

--
Derek

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu