• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Question: Arrays and Matrixes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question: Arrays and Matrixes


  • Subject: Re: Question: Arrays and Matrixes
  • From: Arthur J Knapp <email@hidden>
  • Date: Tue, 12 Mar 2002 17:27:45 -0500

> From: email@hidden
> Date: Tue, 12 Mar 2002 16:00:34 EST
> Subject: Re: Question: Arrays and Matrixes

> It has to do with some number theory and encryption/decryption thoughts I was
> playing with. Yes, I know how many data items that means. At each one having
> a short-byte (char), it would be approximately 610Mb worth of data. I was
> just curious if the structure for it could be created in AppleScript. Every
> point would contain a single (printable/viewable) character. Meanwhile, my
> question has been answered (lists of lists, not the best form imaginable).

>>> (100x250x320x160) filled with datatype character.

Perhaps some kind of file-based solution involving the read/write
commands, something along the lines of 100 folders each containing 250
files each containing 320 lines of 160 characters?

set c to GetByte( { 34, 92, 81, 7 } )

on GetByte( loc )
--
-- Note: In *real* code, we would want a lot more error-checking!!!
--
tell app "Finder"
set theFolder to folder ("Mac HD:encrypt:" & loc's item 1)
set theFile to file ("" & loc's item 2) of theFolder
set openFile to open for access (theFile as alias)
set theLine to ""
repeat (loc's item 3) times
set theLine to read (openFile) until (return)
end repeat
close access openFile
return theLine's item (loc's item 4)
end tell
end GetByte

Actually, there is no reason to think in terms of 320 "lines",
one could just grab every 160 characters, (which would be alot
more robust, come to think about it, because the data itself
might contain returns):

repeat (loc's item 3) times
set theLine to read (openFile) for (160)


P.S. I'm not really advocating that someone try a system like this,
it would be way too slow for any practical purpose, (but it
sure is fun to think about). ;-)


{ Arthur J. Knapp, of <http://www.STELLARViSIONs.com>
<mailto:email@hidden>
try
<http://homepage.mac.com/kshook/applescript.html>
on error number -128
end try
}
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Questions questions...
  • Next by Date: Re: file size and creation date
  • Previous by thread: Re: Question: Arrays and Matrixes
  • Next by thread: Re: Question: Arrays and Matrixes
  • Index(es):
    • Date
    • Thread