Scheming on the Pocket PC
I've temporarily adopted a Pocket PC -- and wanted to do something fun on it.
Some people suggested I download some games... but there are better things than games.
Code! Code is where the fun is.
So I tried to find some tools for Programming on the Pocket PC.
Not programming for the Pocket PC mind you -- I mean I want to sit on the bus or train and write programs on the tiny screen.
There was very little available, or very little I could find. (Got any suggestions?)
One thing I found was very intriguing though -- so I downloaded it immediately:
Pocket Scheme -- a scheme interpreter for the pocket PC.
Scheme is a variant of Lisp (yes... that.) and i've been keen to get further into lisp (or to escape the nonsense ravings of lisp-nut-jobs and the like ;-)) for a while.
Lately this introduction to lisp has been my friend.
Within 24 hours of downloading pocket scheme:
- i'd ordered a copy of 'the little schemer' from amazon
- i'd decided to purchase my own pocket pc ;-)
As part of dabbling with Scheme while on the train (and without internet access) I decided i needed some Scheme documentation on the Pocket PC. A bit of research told me that 'Teach Yourself Scheme in FixNum days' would suit my needs nicely.
But screen real-estate is expensive on the Pocket PC. And even scrolling is a pain. I worked out that what I really wanted was just the code samples from the book all in one page.
This is where it got fun. I decided to write a powershell script to extract all the code samples and put them into a html file. Any excuse for a bit of powershell ;-)
Here's the basic script:
PS C:\> $webclient = new-object system.net.webclient
PS C:\> 3..23 | %{$page=$webclient.DownloadString("http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme-Z-H-$_.html");"<h2><a
href='http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme-Z-H-$_.html'>Chapter
$_</a></h2>" >> c:\matches.html;get-matches $page "(<pre
.*?/pre>)" >> c:\matches.html }
Oh -- and that also relies on this function, get-matches, which is based on a snippet of Lee Holmes --
Get-Matches
function get-matches (
[string] $content = "",
[string] $regex = ""
)
{
$returnMatches = new-object
System.Collections.ArrayList
$resultingMatches = [Regex]::Matches($content,
$regex, "IgnoreCase,Singleline")
foreach($match in $resultingMatches)
{
[void]
$returnMatches.Add($match.Groups[1].Value.Trim())
}
$returnMatches
}
The result is almost half a megabyte of lisp examples, in neatly formatted html (zips down to just 23K).
I've written to the author (Dorai Sitaram) to request permission to share the resulting file. I haven't heard back yet -- but if i do, I'll make it available as a download.
Now, about those Games. To increase the WAF, I'll need to find some good games for the pocket PC. Suggestions?
Next → ← PreviousMy book "Choose Your First Product" is available now.
It gives you 4 easy steps to find and validate a humble product idea.