Programming

Apple Releases Flashback Removal Tool For Users Without Java

Apple has released the same Flashback Trojan Removal Tool that is found in the Java update for OS X 2012-003 as a standalone tool.  The new standalone version of the tool is for those users without Java installed.

You can download the Flashback malware Removal Tool from the Software Update feature under the Apple menu or from the Apple support website at:

http://support.apple.com/kb/DL1517

Apple Updates Java for 3rd Time This Month To Deal With Flashback Trojan

Apple has released a third update to Java for both Mac OS x Lion and Mac OS X 10.6 to deal with the infections of the Flashback Trojan.  Infections reached a whopping 600,000 machines globally according to three anti-virus companies that were monitoring it (Dr. Web, the discoverer of the Trojan, Kaspersky, and Symantec) , however, that number has dropped to 270,000 in recent days.

The update on the Apple Support Website updates Java to Version 1.6.0_31.  This brings it inline with the Oracle version of Java.  You can download the latest version of Java through the Software Update feature under the Apple menu or from Apple’s Support website at :

http://support.apple.com/downloads/

GEOS for Apple ][ File Strucures Explained

Oliver Schmidt, long known for his work on several projects in the Apple][ community including Contiki and Applewin, has now delved into documenting the internals of  GEOS, the Berkeley Softworks  produced operating system for the Apple ][.

In his announcement in the comp.sys.apple2 newsgroup, Oliver says" Although the Apple GEOS filesystem is based on ProDOS 8 the Apple GEOS  files are not standard ProDOS 8 files. I’m not refering to file  content here but to the file structure – meaning that Apple GEOS files  aren’t seedling, sapling nor tree files.

I’ve done some reverse-engineering and have documented my findings here:

http://wiki.cc65.org/doku.php?id=cc65:apple2:geosfileformats

GEOS files are more than the usual byte stream with a few attributes. Therefore they need to be converted in order to represent them in other filesystems. This is just the same as with GEOS 64/128. And again just the same as with GEOS 64/128 it is desirable to have this conversion work “in place” instead of creating copies. To facilitate this a suitable “convert format” has to be specified. I defined one here:

http://wiki.cc65.org/doku.php?id=cc65:apple2:geosconvertformat

Who can make use of this “convert format”?

1. Convert tools running on Apple GEOS (like on GEOS 64/128) or on ProDOS 8. I’ve already written a ProDOS 8 convert – which however currently only supports the “deconversion”.

2. Apple disk image tools like CiderPress or AppleCommander. They could use the “convert format” to represent Apple GEOS files in the host filesystem – and do the (de-)convert on-the-fly when moving files from/to an Apple GEOS disk image.

What’s the benefit of all this?

1. In general it becomes possible to move Apple GEOS files around, transfer them with any filetransfer technicque and share them on the
net etc.

2. I’m working on porting the cc65 GEOSLib (http://www.cc65.org/ snapshot-doc/geos.html) from GEOS 64/128 to Apple GEOS. The cc65 linker creates a “convert format” file which is then tranfered to the Apple GEOS filesystem and finally deconverted there. That’s the reason why my ProDOS 8 convert tool only supports this direction.

3. Now that the basic Apple GEOS file structures are known one can apply the already present knowledge on GEOS file contents – as they are the same for Apple GEOS and GEOS 64/128. Thus it becomes i.e. possible to implement an Apple geoPaint file viewer (or editor):

ftp://ftp.zimmers.net/pub/cbm/geos/programming/documents/geoPaint%20format.txt

From the cc65 developers perspective it would of course be great if  CiderPress and/or AppleCommander would allow to place the output file of the cc65 linker directly in an Apple GEOS disk image as Apple GEOS file, thus superseding the additional convert step.

A.P.P.L.E. obtained permission to distribute the documentation for GEOS in 2003 and if you would like to check GEOS out or to run it on your own system, you can download the entire GEOS CD complete with all of the documentation from our December posting about the program at:

http://www.callapple.org/2011/12/10/geos-apple-cd-re-posted-to-download-section/

 

Robot War Tournament Proposed by Digital Antiquarian

The Digital Antiquarian website, run by Jimmy Maher is proposing an old fashioned version of a Robot War Tournament.   His recent posting about Muse Software’s Robot War for the Apple ][ brought out the folks who have long wondered if a tournament like those of the early 1980's could be once again be held.

In Jimmy Maher's posting on comp.sys.apple2, he says "I've been writing about the Apple II quite a lot in recent months, as I judge it the best overall platform for that kind of gaming in the early 1980s. (I'm currently mired in 1981.) I've recently had occasion to write a bit about Silas Warner, Muse Software, and Robot War (http://www.filfre.net/tag/muse). The latter is a bit outside of my usual fare, but just so interesting and historically significant that I couldn't resist. As the most recent article in that series attests, I would love to hold a Robot War tournament of the sort that Computer Gaming World sponsored back in the day, only (thanks to modern technology) better and more interactive. See the post in question for my complete vision of how such a tournament could work."

If you are interested in participating in the tournament, send an email to Jimmy Maher at: maher at filfre dot net. To try out the game and see if this is something you would like to participate in, you can go to the Robot War page at Virtual Apple ][

http://www.virtualapple.org/robotwardisk.html

 

VirtualGS Book Now Available in iTunes Book Store

T. C. Lim has been working on a book about Pascal programming for the Apple II gs for the past several weeks, releasing preliminary versions along the way.  The book includes a number of programs his kids have developed for the Apple IIgs in Pascal, Orca Pascal, and GSoft BASIC.

The book was produced with iBooks Author and is the first Apple ][ series related book to be produced specifically for iBooks 2.0.  T.C. has announced the immediate availability of the VirtualGS book in the Apple iTunes Book Store.

VirtualGS for iBooks 2.0 is a free download.  To get your copy, go to:

http://itunes.apple.com/book/virtual-gs/id498416459?mt=11

Firefox 10 Released

Mozilla has updated their popular Firefox Internet browser to Version 10.  Their email client Thunderbird has also been updated to compliment the Firefox package.  The primary focus of these updates are the inclusion of  developer toos, giving the developer easy access to the HTML and CSS code associated with the website being viewed.  The latest implementation of Firefox also makes it easy to build WebGL 3 dimensional graphics without additional software.

The latest version includes the following fixes and updates:

  • New: The forward button is now hidden until you navigate back
  • New: Most add-ons are now compatible with new versions of Firefox by default
  • New: Anti-Aliasing for WebGL is now implemented (see bug 615976)
  • New: CSS3 3D-Transforms are now supported (see bug 505115)
  • HTML5: New <bdi> element for bi-directional text isolation, along with supporting CSS properties (see bugs 613149 and 662288)
  • HTML5: Full Screen APIs allow you to build a web application that runs full screen (see the feature page)
  • Developer: We’ve added IndexedDB APIs to more closely match the specification
  • Developer: Inspect tool with content highlighting, includes new CSS Style Inspector
  • Fixed: Mac OS X only – after installing the latest Java release from Apple, Firefox may crash when closing a tab with a Java applet installed (700835)
  • Fixed: Some users may experience a crash when moving bookmarks (681795)

To download Firefox 10 Browser

Apple /// Cobol now on the Apple ][ Scans website

Mike Maginnis has managed to make the Apple /// Cobol software and manuals available ont he Apple ][ Scans website.  Thanks to a loan of the materials from David Scmenck, the Apple /// collection is one item richer today.  Originally released by Apple in 1982, it sold for a whopping $500 at the time.

To download the software and the manuals, check out the Apple][ scans website at:

http://apple2scans.net/apple-iii/apple-iii-cobol/

Virtual GS Programming Book Now Available

Lim Thaye Chen has made his Virtual GS Programming book available in both PDF and iBook format on the Virtual GS website.  The book is the first Apple ][ specific book to have been created with the new iBooks Author package introduced by Apple this month.

You can download the book in it’s entirety for free from the Virtual GS website at:

http://virtual-gs.appspot.com/web/Book.html

Mac OS X Lion 10.7.3 Build 11D50 Now Available to Developers

Apple, Inc. has released another update to the upcoming release of Mac OS X, 10.7.3.  The Build 11D50 is a 997mb download and while there are still questions about what Apple has planned, the laast few builds have been fairly stable.   To download the latest build, you will need a Developer account.   The build can be downloaded at:

http://developer.apple.com/

Virtual String Memory For Applesoft

If one really thinks about it, text files are a kind of virtual memory.  You can add strings, retrieve strings.  And if the strings are of a fixed length, then you can even replace strings in a text file.

But I found the text file commands of DOS3.3 and Basic.system very slow.  Some recommendations were to save your strings to a BIN file instead. So I combined the two and created a sort of semi-Virtual memory for strings

Applesoft is limited with what it can do with variables.  The maximum value for any dimension is 32767, and the actual string space available for strings is far less.

Using my virtual string array add on, you can define up to 65536 strings including string zero.  And the maximum length of any string is 255 characters (not 256 because string zero cannot be used since it is used as an end of string marker) Strings used this way can reach Prodos’s maximum file size of 16 Mb limit (65536 x 255 = 16711680)

Advantages -
Only one virtual string array variable is created in memory with 255 characters, one master block and one single byte block is also loaded with the pointers  (the 1 block that is loaded with the actual text uses basic.systems buffer so does not take any additional space.  If the string spans 2 blocks, then the first part of the string is moved to the string space, then the 2nd block is loaded)

Text files of Prodos’s maximum files size can be created

Multiple Virtual String Array files can be created and used within the same program

Virtual Array Text files can be created using any Word Processor that can create large files  (I wrote a short applesoft program that creates a header from the text files so any string can be jumped to automatically as if it were the first string in the list)

Disadvantages – every string must be retrieved from disk although with the advent of flash cards has made the speed of drives more tolerable.
One extra file is created for the pointers.

The commands to use

& DEF VA$(0) – creates a virtual string variable and sets its length to $FF (255) and makes space in string space
& GET VA$(0-65535),”Virtual String Array filename” – gets string from file
& STORE X$,”Virtual String Array filename” – appends the string X$ to the end of the file.  If file does not exist then create it.  If file is not a Virtual Array file then return with error

Also a separate short applesoft program was created to make a header for the pointers to every string.  I used a pretty neat trick to compress the header so that only one byte is needed to point to each string instead of three and a one block master header to point to the start of each string block.

Long story short, hopefully.  One block can point to 512 strings.  so only 128 blocks would be needed to point to 65535 strings plus one master block.  The master block holds the two high bytes of the start of each of the 128 blocks so only one master block is needed.  Once one of the 128 blocks has been chosen by a little math (# of the string divided by 512 gives one of the 128 blocks)(coincidently, this same result also points to the hi bytes in the master block), a short search is then made in the found block so that each time the next byte is less than the preceding byte, a counter advances the high bytes until the start of the correct string is found.

Remember, these blocks can point to 512 strings of 255 characters, so the master pointers may also need to be incremented.  There, short and sweet.

A three byte pointer header would take 384 blocks to point to each string to reach the 16 MB limit.

One last thought for a use of Virtual String Arrays.  One String Array can have 65535 strings and multiple Virtual files can be created.

Each file can be designated as a column.  Strings can become formulas.  Are you getting the picture.

A Virtual Spreadsheet with 65535 columns by 65535 rows.  There is a good program in Nibble magazine Vol6 No8.  Dynamic functions.  It puts formulas into a string and then uses redefined DEF and VAL commands to evaluate the formula.

To recap, I have created a couple short programs to turn a Random Access Text File (RATF) into a sequential text file to save space that a RATF would need since each line of text is padded to be all the same
length.  But a sequential file has all of its text lines in a sequential order of varying length and with a terminator character to mark the end of the line.  The only way to get to each line of text is by reading each previous line to get to the line that you may want.

Question:  How do you access each line quickly without the time consuming operation of reading each previous line?

Answer:  With pointers to each line.

This has the advantages of allowing one to create sequential files with a text editor but using the text file as a RATF.  And the file size is substantially reduced due to the removal of padded characters.

To continue on with this topic of creating even smaller RATF files.

A set of short programs can compress a large text file even further.

How, you ask?

Good question.  Here’s how.

By creating a library of words from the text file and having a pointer, called a descriptor, to each word from the library.  The average word length in our English language is between 4-5 characters.  There are only a couple of single letter words  (I and a) and also not too many two letter words. (an at is if as ad ah am be by do go my no so to we).  At the worst even with a 2 byte descriptor, we are basically at a break even point for compression.

Now keep in mind, that the first occurrence of a word is stored in a library, and you don’t get any compression until that word shows up again.  And also a one, two or three byte descriptor takes up memory as well.  So on the first occurrence of a word, you actually may lose a couple of bytes.  If a document only contained one occurrence of each word, then this compression technique would be an utter disaster.

Originally, only one byte is needed to start, to point to up to 256 words from a library.  This would soon be used up as most text documents easily have more than 256 distinct words.  So once the value 255 ($FF) is encountered, this would signal the decompression program that it now requires 2 bytes to point to a word from the library.

This would give us access of up to 65536 words from our library.  This is still pretty good compression if the majority of the words stored in the library are 3 characters or more.

For the most part, a two-byte descriptor and 65536 words should cover most of the words in a reasonable sized text file.  And if needed a third byte can be used with the descriptor to access up to 16,777,216 words in our library.  Even the use of this third byte can generally reduce a file by 25% or more since a three-byte descriptor would be used to point to an average 4 to 5 byte word.

Now, punctuation is a slightly different story.  Punctuation would have to be considered one-byte words due to their usage and they may follow any character of the alphabet or any word in the library.  You can not add punctuation to a word since that would make a new word, and the occurrence of that same word with the added punctuation mark would rarely be used again throughout a document.  So, for the best compression, punctuation should be added to the library first so as to be used by the single-byte descriptor without any loss of hard drive space since a one-byte descriptor uses one byte and the punctuation mark takes up one byte.

But, there may be one boon to saving space with punctuation.

Normally, spaces are not compressed and are not needed since pointers only point to a whole word, and it is assumed that a word is followed by a space.  If a word is followed by a punctuation mark, then that space would have to be recanted and the punctuation mark inserted.

Also, usually, a punctuation mark is followed by one space, and that space would not need to be included as part of the punctuation word either, but some punctuation marks may have 2 or more spaces following it.  Since spaces are not captured as a word unless there is more than one consecutive space, you could then include those extra spaces as part of the punctuation word.  The chance of a re-occurrence of the punctuation mark with extra spaces would be quite high, therefore space can be saved and the punctuation word can be compressed, or at the very least a break even point.

Another instance of repetitive punctuation is at the end of each paragraph.  A period can be combined with one or two carriage returns to form a word. Space savings can be fairly good when punctuation marks are repeated frequently in a document.  A one-byte descriptor with a three-byte punctuation is a 66% savings.

So for the most part, compression of a fair size text document should exceed the 50% mark and may reach as high as 75%.  The document would have to be quite large to recognize any significant savings.  For example, this short lecture would not see that much of a savings in compression but it may be worth to compress even it as there are some quite large words that are used a number of times.  (Compression, characters, descriptor, document, library, punctuation).  If each of these words had a two-byte descriptor would result in 60 – 80% compression for those words.

One last note is with capital letters.  Words that contain capitals would not have to be distinguished apart from its lower case counterpart if the word is at the beginning of a sentence, but if the word falls in the middle of a sentence, and contains any capital letters, then it will have to be added to the library as a separate word.

To recap.
-A RATF file with padded characters and no compression can be quite large.
-Close to a 50% reduction in file size can be recognized by being saved as a sparse file.
-Another 50% or more can be seen by removing padded characters and saving as a sequential file and using pointers.
-And lastly, the text document may be compressed to save another 50-75% by using a library of words and having a one, two or three byte descriptor to describe the word being used from the library.

All-in-all.  A 300 block RATF file could potentially be reduced down to about 30 blocks.  That is a 10 times savings.  A must need on a computer with limited memory or hard drive space.  A lot of information can be stored in a small amount of space.

That’s it for now