<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">]>
<rss version="0.92" xml:base="http://www.applefritter.com">
<channel>
 <title>Applefritter - Software</title>
 <link>http://www.applefritter.com/taxonomy/term/71/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>Digital Spelunking at America Online</title>
 <link>http://www.applefritter.com/aol</link>
 <description>The ephemeral nature of the web has appalling implications for the preservation of information.  Even many once common Mac OS 9 shareware apps are now impossible to find, to say nothing of older and more obscure programs.  How many web and ftp sites from 1994 still exist?

In the days when BBSes were more popular than the internet, America Online's file libraries rivaled the entire internet in their breadth of files.  It was in an effort to determine whether these ancient libraries still existed that I gingerly installed AOL on a spare computer and signed up for an account.

My hope was that even though the original keywords for these libraries no longer worked, I might still be able to find a link or url that would take me to the old file library search function, much in the way that it's still possible to access the Apple II forum on AOL by going to keyword: aol://4344:1264.a2main.10029531.514525857.

After much effort, I failed to find the search page, but I was able to use the Apple II libraries to understand the url syntax.  The url for the Apple II New Files library is aol://4400:8287, and here is the URL for the UnForkIt file, contained in that library: aol://4401:8287:636250.  The first value identifies the resource type.  In this case, either 4400 for a library, or 4401 for a file.  The second number, 8287, is the library ID.  636250 is the file ID.  The file IDs are not consecutive within libraries.

By changing the library id, it is possible to access file libraries that that no longer have direct links.  I began trying random IDs and was soon bookmarking the Connectix Macintosh Library and MacHacks.  Many libraries would load immediately.  On other occasions I'd get an error message stating no library existed at that ID.  Most disturbing were the libraries that AOL's software believed should exist, but that were "not responding".

As AOL has moved away from its proprietary Rainman language in favor of html, and sophisticated users have left for the Internet, these old areas of AOL have been abandoned and forgotten.  Each file records the date it was most recently downloaded.  In many of these libraries, the most recent download was from 1999.  In a few, the records have been confused with those for other files — the description will be for a shareware utility, but the file will be a jpeg.  Other file downloads fail half way through.  The system, it appears, has been left to decay.

Nonetheless, the bulk of the files I found were in salvageable condition.  The challenge now came of finding all the surviving software libraries and downloading their contents.  The AOL application isn't easily scriptable, but QuicKeys can automate it by simulating key combinations and clicks, so I wrote a QuicKeys script to open the "Keyword" window, type in a possible library address, and bookmark the address if it worked.  Over a period of several days, this script tried about 70,000 possible library locations.  Another QuicKeys script is now visiting each library and downloading the files.

To date, 7,236 files have been downloading, filling 4.1GB of disk space.  Much more work remains to be done, and volunteers are welcome.  Help is needed in the following areas:

[list]
[*]Downloading files from AOL.  This requires a dedicated Mac OS X computer running QuicKeys (or at least the 30-day demo).
[*]Writing scripts to check for redundancies and damaged files.
[*]Modifying upload scripts so that the files can be added to the file libraries.
[/list]

If you'd like to get involved, please email [url=mailto:owad@applefritter.com]Tom Owad[/url]</description>
 <pubDate>Fri, 18 Aug 2006 13:18:03 -0700</pubDate>
</item>
<item>
 <title>Tuner: iTMS For The Rest Of Us</title>
 <link>http://www.applefritter.com/tuner</link>
 <description>	A little over three years ago, Apple Computer introduced a new area in iTunes so interesting that they used the word groundbreaking twice in the press release. Since then, the iTunes Music Store has sold over one billion songs at 99 cents a piece. But until now, the iTunes Music Store interface has stayed locked in Apple's hands.

	Four months ago, I decides that I wanted to put his own audio in the iTunes Music Store.  Except that I wanted to give it away for free.  And I wanted to have total control over what's put up.  And I wanted to be able to change it however I want.
	
	iTunes is locked down to a couple different URL's.  If you're not a subdomain of phobos.apple.com or demios.apple.com, iTunes just refuses to load your content.  So the first step is to trick iTunes into thinking that your server with all your content on it is part of phobos.apple.com.
	
	To do this, we can use an /etc/hosts entry.  For those of you not familiar with networks, a hosts file is the first spot your computer looks when it's trying to convert a domain name (like phobos.apple.com) into an IP address.  By placing an entry into his hosts file that looks like this:
	
	123.123.123.123	workaround.phobos.apple.com
	
	we can convinces iTunes that the server at 123.123.123.123 is really a part of the phobos.apple.com domain.  In other words, now iTunes thinks that my server is alright to load data from.
	
	Using data that I picked up from http://hcsoftware.sourceforge.net/jason-rohrer/itms4all/, I grabbed some XML pages from the real iTMS and put them on my server.  They loaded up properly when I typed in itms://workaround.phobos.apple.com/itms.xml.
	
	With the angle of attack clear, I eventually decided that the only good way to do this would be to allow anyone to serve up content, not just me.  Very few people would be willing to alter their host files if the only result was being able to see my playlist.
	
	I put together a small group of shell scripts that, when run as an OS X startup item, would sit in the background on my system and listen for requests to my fake iTMS store.  Then they'd take a URL out of that request, get data from the real server that I wanted to find data from, and pass it back.  To iTunes, it looks like the data is coming from a perfectly legitimate iTMS server, when in reality it means that using these scripts you can now download an iTMS compatible playlist from any website.
	
	As an example, let's say that Applefritter has a number of recordings that we want to make available through the iTunes interface.  Assuming that you'd installed this group of scripts on your computer, you could send a request to the fake server with the Applefritter address included in it, the scripts would catch it, retrieve the actual data from Applefritter, and then return it to iTunes.
	
	To make these scripts easier to use, I've bundled it up, given it an installer, and called it "Tuner".  It's available as an OS X package at http://www.tunedial.org/download/

	
	[center][img]http://www.applefritter.com/images/tuner-18147_640x480.jpg[/img]
[i]iTunes displays a playlist showing several recordings from VCF[/i][/center]

	To help create iTunes compatible playlists, I've also put together tunedial.org.  Tunedial is built to create the correct XML files for iTunes, while keeping you away from the code itself.  Using a few interactive forms, you can create an iTMS compatible playlist.
	
	Those of you who love the Mac for it's simplicity may want to stop reading here.
	
	Tuner is installed in /Library/StartupItems/.  After installing Tuner, on reboot a StartupItem located at /Library/StartupItems/Tuner is activated. It starts a script (/Library/StartupItems/Tuner/check.sh) whose purpose in life is to execute the command:

	/Library/StartupItems/Tuner/retrieveURL.sh | sudo /usr/bin/nc -l -p 42139 127.0.0.1 &gt; /Library/StartupItems/Tuner/output.txt

	This command starts retrieveURL.sh, which cycles, waiting for nc (netcat) to dump data received on localhost:42139 into a buffer file. Once something has been received, it parses out the requested URL, and uses cURL to retrieve the XML content from any URL. retrieveURL.sh then sends it's data back through the netcat connection which leads to iTunes.

	Netcat is a small utility which allows you to talk directly to a network pipe from a shell script. You can find out more about it on [url=http://netcat.sourceforge.net/]its Sourceforge page[/url].

	As soon as the connection is complete, netcat exits, and the retrieveURL.sh script is finished. check.sh, which has been cycling quietly in the background, sees this and restarts it with the same command.

	The Tuner directory is [url=http://www.tunedial.org/files/Tuner.zip]available for download[/url] so you can examine the source for a clearer idea.
</description>
 <pubDate>Tue, 09 May 2006 13:33:47 -0700</pubDate>
</item>
<item>
 <title>Experiments with the Apple Motion Sensor</title>
 <link>http://www.applefritter.com/node/6838</link>
 <description>Throw your PowerBook off a cliff.  As it tumbles, sensors will detect changes in orientation and gravitational force.  With this data, your PowerBook will wisely ascertain that all is not well.  Faster than you can knock a laptop off a desk, it will swing the hard drive's head away from the platter and park it, preventing a deadly collision with your data.

The "Sudden Motion Sensor" in Apple's latest PowerBooks implements this technology.  The sensors are not built into the hard drive - they're an integral part of the system, compatible with any drive you install.  It's even possible to read the sensor output yourself.  [url=http://www.kernelthread.com/software/ams/]Amit Singh[/url] has written several programs that do just that.

This is where the fun starts.  [url=http://www.kernelthread.com/software/ams/download/AMSTracker.dmg]amstracker[/url] is a simple command-line utility that returns the values for the sensors' x, y, and z axes.  X is left/right tilt, y is forward/back, and z is the change in G force.  Amit's utility can output these values and then exit or can be configured to provide a continuous stream of data.

The trick  with a cool utility like this is coming up with a practical application.  One possibility is to keep a motion log.  Here's a sample in which data was collected every tenth of a second.  To produce these values, I let my PowerBook drop about eight inches and then gently caught it.  

[pre]   X    Y    Z
   3   27   49
   1   26   51
   2   24   53
   4   28   49
   2   31   49
   2   27   53
   9    8   16
  -6    8   16
   9   47   82
  11   28   46
   5   18   67
  -1   22   55
  -2   24   51
   1   23   49
  -1   23   51[/pre]

The first indication that something has gone wrong is a major the change in G force from 53 to 16.  At the same time, the Y axis shifts from 27 to 8, indicating a sudden backwards tilt, caused by the weight of the display.  A tenth of a second later, the logs indicate a rightward tilt as the X axis changes from 9 to -6.  Another tenth of a second - and impact.  The G force leaps from 16 to 82 as the PowerBook collides with my hands.

If you often lend your computer out, this data could make for some very interesting conversations.  "Larry, why did my PowerBook experience a sudden spike in gravitational force at 6:43 PM?"

The numbers are fun, but a visual makes for a more interesting demo.  Amit has done just this with [url=http://www.kernelthread.com/software/ams/download/AMSVisualizer.dmg]AMSVisualizer[/url], which displays a PowerBook on-screen and tilts it in sync with the computer's actual movements.  This is great for demoing the PowerBook to potential customers.

[center] &lt;img src="http://www.applefritter.com/files/pb.jpg" class="inline" alt="][/center" title="][/center"&gt; 

Amit has written one more entertaining demo: [url=http://www.kernelthread.com/software/ams/download/StableWindow.dmg]StableWindow[/url].  You can tilt your PowerBook any way you like, but this window refuses to tilt with it.  Those interested in reading more about these programs and the technology behind them should visit [url=http://www.kernelthread.com/software/ams/]Amit Singh's website[/url].

Of course, we haven't even addressed one of the most obvious uses for motion sensors: games.  It took Peter Berglund just four days after reading Amit's article to have a simple game working based on the motion sensors.  Berglund's [url=http://www.balooba.se/baloobasoftware/index.html]BubbleGym[/url] gives the player a marble on a board. Tilting the computer tilts the board and causes the marble to roll.  The objective is to roll the ball into the cloud.  With each success, a new cloud appears and the allotted time grows shorter.  The player has four balls (i.e. lives) and each one exhibits different physical characteristics.  Graphics and gameplay are rudimentary, but as a technology demonstration, the game is excellent.  BubbleGym is mildly fun to play and a lot of fun to share with others.

[center] &lt;img src="http://www.applefritter.com/files/bubblegym.jpg" class="inline" alt="][/center" title="][/center"&gt; 

Where will Apple's motion-sensing technology go from here?  A more convenient tool for logging data might also be useful and hopefully an adaptation of the arcade game [url=http://icculus.org/neverball/]Neverball[/url] will soon be in the works.  Post your ideas below.</description>
 <pubDate>Sat, 12 Mar 2005 07:56:19 -0800</pubDate>
</item>
<item>
 <title>Apple I Programming</title>
 <link>http://www.applefritter.com/node/2937</link>
 <description>Here are a few simple tips and programs for those interested in programming the Apple I:

[h2]To print to screen:[/h2]

[code]
   Echo = $FFEF

   LDA value_to_print
   JSR Echo
[/code]

The above snippet relies on the Echo subroutine in the Apple I's ROM. All you need to do is load an ASCII value into the accumulator, then call that subroutine.

[h2]To read a character:[/h2]

[code]
   KbdRdy = $D011
   Kbd = $D010                  

GetChar:
   LDA KbdRdy       ; Key ready?
   BPL GetChar       ; Loop until ready.
   LDA Kbd            ; Load character.
   RTS                    ; Exit.
[/code]

This subroutine loops until a key is pressed, then loads its ASCII value into the accumulator. It is not dependant upon the Apple I's ROM. KbdRdy and Kbd are in the 6821.

Subroutine: [node:2936].

[h2]Tools[/h2]

[list][*][url=http://www.floodgap.com/retrotech/xa/]xa65[/url] - cross-assembler
[*][url=http://www.ameth.org/~veilleux/dcc6502/]dcc6502[/url] - disassembler
[*][url=http://www.cc65.org/]cc65[/url] - C compiler[/list]</description>
 <pubDate>Tue, 21 Dec 2004 12:11:42 -0800</pubDate>
</item>
</channel>
</rss>
