<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>blog</title>
    <link>http://samskivert.com/blog/</link>
    <description>Recent content on blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 04 Dec 2024 00:00:00 +0000</lastBuildDate><atom:link href="http://samskivert.com/blog/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Advent of Rust Day 4</title>
      <link>http://samskivert.com/blog/2024/12/aoc-rust-day4/</link>
      <pubDate>Wed, 04 Dec 2024 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2024/12/aoc-rust-day4/</guid>
      <description>In Day 4 we need to look at the characters in a grid and count up the number of occurrences of a word (XMAS) in &amp;ldquo;word search&amp;rdquo; style (can go any direction including diagonals and backwards).
Initially, I thought it would be fun to create my own custom iterator that was given a position in the grid and delta x and y values and which yielded each character in that direction until we ran out of grid.</description>
    </item>
    
    <item>
      <title>Advent of Rust Day 2</title>
      <link>http://samskivert.com/blog/2024/12/aoc-rust-day2/</link>
      <pubDate>Mon, 02 Dec 2024 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2024/12/aoc-rust-day2/</guid>
      <description>In Day 2 we need to do &amp;ldquo;things&amp;rdquo; to the consecutive pairs in a list of ints. The Rust standard library was created by thorough, right-thinking people, so getting consecutive pairs from a Vec is pretty easy:
nums.windows(2).map(|w|(w[0],w[1]))But I&amp;rsquo;m not a barbarian. If I need to do three or four things to this list of pairs, I&amp;rsquo;m not going to reify that transformation into a concrete collection. I&amp;rsquo;m going to fold over the transformed collection and compute what I need along the way.</description>
    </item>
    
    <item>
      <title>Old man yells at cloud</title>
      <link>http://samskivert.com/blog/2022/03/firebase-complaints/</link>
      <pubDate>Tue, 22 Mar 2022 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2022/03/firebase-complaints/</guid>
      <description>[Editor&amp;rsquo;s note: This post vents anger at other software engineers. If they read it, they&amp;rsquo;ll probably feel bad. I hope they don&amp;rsquo;t read it, as my goal is not to make them feel bad, it is merely to express the boundless frustration I feel as we collectively fumble our way, in the dark, through the never ending battle against complexity. Undoubtedly people who have used software that I have created have felt equally frustrated and it is only by luck that I have not inspired sufficient despair to motivate them to vent in a blog post.</description>
    </item>
    
    <item>
      <title>The year in puzzles</title>
      <link>http://samskivert.com/blog/2019/12/year-of-puzzles/</link>
      <pubDate>Wed, 25 Dec 2019 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2019/12/year-of-puzzles/</guid>
      <description>I like to do puzzles. Crossword puzzles, logic puzzles, number puzzles, even a well conceived word search can tickle my fancy. My 2019 was nicely full of puzzles, so I&amp;rsquo;m recapping the year with a little summary of my puzzle throughput. Perhaps I&amp;rsquo;ll lure more people into the wild world of puzzling with my enthusiasm.
For the past few years, I&amp;rsquo;ve been a subscriber to Games World of Puzzles (nee Games Magazine), which is where I generally get my puzzle fix.</description>
    </item>
    
    <item>
      <title>Practice makes perfect</title>
      <link>http://samskivert.com/blog/2019/05/renshu/</link>
      <pubDate>Wed, 08 May 2019 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2019/05/renshu/</guid>
      <description>Hey kids, gather around the campfire. It&amp;rsquo;s time for side project story time with Uncle Mike. Today we&amp;rsquo;re going to talk about a little app I made to support my taiko practice.
The motivation for the app is to answer the question &amp;ldquo;What am I practicing today?&amp;rdquo; when I go down to my practice space and prepare to make a lot of noise banging on drums. I&amp;rsquo;m trying to stick to a program of deliberate practice, which means I don&amp;rsquo;t want to just noodle around playing whatever pops into my head.</description>
    </item>
    
    <item>
      <title>New Year&#39;s Resolutions</title>
      <link>http://samskivert.com/blog/2019/01/resolves/</link>
      <pubDate>Mon, 07 Jan 2019 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2019/01/resolves/</guid>
      <description>I usually wait until my birthday to introspect on my life and make any course corrections that have been percolating in my subconscious. However, this year my subconscious seems to be ready for the percolations to bubble up on a more traditional &amp;ldquo;New Year&amp;rsquo;s resolution&amp;rdquo; schedule, so I&amp;rsquo;m going to run with it.
Three things have percolated up, all somewhat intertwingled:
 Have more fun! Do more small projects. Share/write about them.</description>
    </item>
    
    <item>
      <title>The eternal cycle of PIM samsara</title>
      <link>http://samskivert.com/blog/2018/11/pim-samsara/</link>
      <pubDate>Wed, 07 Nov 2018 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2018/11/pim-samsara/</guid>
      <description>What I originally took to be a quest for personal information management (PIM) nirvana, I now realize is in fact a perpetual cycle of personal information management samsara: the constant death of old tools and birth of new. As someone who loves building tools, I suppose this is a good thing.
Before introducing the newest incarnation in this cycle, let me give a brief history. If you don&amp;rsquo;t want to listen to the ramblings of an old man, skip down to the Input/Output section.</description>
    </item>
    
    <item>
      <title>Ramblings on programming language design</title>
      <link>http://samskivert.com/blog/2018/06/lang-design-rambling/</link>
      <pubDate>Wed, 13 Jun 2018 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2018/06/lang-design-rambling/</guid>
      <description>Mario asked me an interesting question the other day. As is often my tendency, I gave him a multi-thousand word answer. Then he foolishly asked more interesting questions, so I hit him with additional walls of text. Be careful what you ask for kids. In the end, we figured we&amp;rsquo;d share with the class because perhaps some useful explanations happened along the way.
[Note: because I&amp;rsquo;m lazy I did not edit out all the profanity.</description>
    </item>
    
    <item>
      <title>Gradle Difficulties</title>
      <link>http://samskivert.com/blog/2015/03/gradle-difficutles/</link>
      <pubDate>Tue, 17 Mar 2015 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2015/03/gradle-difficutles/</guid>
      <description>When I first started doing Android stuff in earnest, I kept a list of Things That Sucked™ about Android, but I never cleaned it up and published it. Now (years later) I&amp;rsquo;ve forgotten the details of many of my infuriated scribblings, so I&amp;rsquo;m unlikely to ever publish it as I&amp;rsquo;d likely be complaining about things that have long since been fixed and end up misleading anyone who happened upon my rantings.</description>
    </item>
    
    <item>
      <title>Anne the Van</title>
      <link>http://samskivert.com/blog/2014/04/anne-the-van/</link>
      <pubDate>Mon, 21 Apr 2014 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2014/04/anne-the-van/</guid>
      <description>After fourteen long and glorious years of driver automobile partnership, Anne the Van and I are parting ways. Natalie has finally decided that it might be useful to drive, but she&amp;rsquo;s not ready to drive something as majestic as Anne, so we&amp;rsquo;re getting a smaller car.
Before turning her loose on the open market, I am putting out feelers to see if anyone &amp;ldquo;in the family&amp;rdquo; is in the market for the Fahrvergnügen experience.</description>
    </item>
    
    <item>
      <title>Thinking out loud about RSP</title>
      <link>http://samskivert.com/blog/2013/11/thinking-aloud-rsp/</link>
      <pubDate>Thu, 07 Nov 2013 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2013/11/thinking-aloud-rsp/</guid>
      <description>For a combination of reasons, I&amp;rsquo;ve finally gone completely mad and decided to try my hand at the Quixotic task of developing a new programming model. Naturally it will solve all of our problems and make delicious toast.
This is somewhat inspired by Bret Victor&amp;rsquo;s excellent presentations, but is also something that has been gnawing at the back of my mind for some time. I even went so far as to spend a year in the PhD program with the PLSE group at UW before realizing that my preferred approach to tackling these problems doesn&amp;rsquo;t fit well with that of CS academia.</description>
    </item>
    
    <item>
      <title>F# Cheat Sheet</title>
      <link>http://samskivert.com/blog/2013/05/fsharp-cheat-sheet/</link>
      <pubDate>Wed, 08 May 2013 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2013/05/fsharp-cheat-sheet/</guid>
      <description>I was looking for a good F# cheat sheet and found a nice one originally published by a6systems, which has since disappeared from the Internet.
I wasted thirty minutes of my life trying to track down a copy of the PDF. I found half a dozen sites that linked to the defunct original website, and a quarter dozen &amp;ldquo;document hosting&amp;rdquo; sites that insisted I register with them to download the damned thing.</description>
    </item>
    
    <item>
      <title>Spellwood Post-mortem</title>
      <link>http://samskivert.com/blog/2013/03/spellwood-postmortem/</link>
      <pubDate>Fri, 01 Mar 2013 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2013/03/spellwood-postmortem/</guid>
      <description>The fruits of the last year and change of my, Sean Keeton&amp;rsquo;s, and a few other Dread Ringers&#39; labor finally made its way to the App Store and Google Play last December. Now three months have gone by while I too infrequently found time to work on this post-mortem. I&amp;rsquo;m forcing myself to wrap it up today, lest the game be long forgotten by everyone but its author before this post-mortem is published.</description>
    </item>
    
    <item>
      <title>Aloha Aloha!</title>
      <link>http://samskivert.com/blog/2013/02/aloha-aloha/</link>
      <pubDate>Tue, 05 Feb 2013 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2013/02/aloha-aloha/</guid>
      <description>We finally moved into our new house on Aloha after many months of remodeling. It&amp;rsquo;s not completely finished, but it&amp;rsquo;s done enough that we&amp;rsquo;re moving in and enjoying the company of the contractors for a few weeks.
I&amp;rsquo;ve posted some photos on the Googley Plus.</description>
    </item>
    
    <item>
      <title>Everthing but the kitchen async</title>
      <link>http://samskivert.com/blog/2012/08/async-java/</link>
      <pubDate>Tue, 07 Aug 2012 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2012/08/async-java/</guid>
      <description>I frequently suffer from Java&amp;rsquo;s complete lack of assistance when it comes to asynchronous programming, but this little multi-phase maneuver really brings home the pain:
protected void findFriends (final Socks.Network sock, Group contents) { contents.removeAll(); final Label status = UI.wrapLabel(_msgs.findingFriends); contents.add(status); class FriendFinder { public void start () { // make sure we&amp;#39;ve authenticated with this network  sock.authenticate(new Callback&amp;lt;Socks.Member&amp;gt;() { public void onSuccess (Socks.Member self) { gotSelf(self); } public void onFailure (Throwable err) { fail(_msgs.</description>
    </item>
    
    <item>
      <title>Stars (and brackets) on thars</title>
      <link>http://samskivert.com/blog/2012/02/stars-and-brackets-on-thars/</link>
      <pubDate>Thu, 09 Feb 2012 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2012/02/stars-and-brackets-on-thars/</guid>
      <description>One of my colleagues recently committed a change with the comment:
Log Message: ----------- Switching from &amp;quot;type *varname&amp;quot; to &amp;quot;type* varname&amp;quot;  It gave me hope for the future, that we might overcome the legacy of K&amp;amp;R&amp;rsquo;s terrible mistake when they pioneered the styles foo *pointer and foo array[].
The world has mostly come around to the view that [] is part of the type, not the variable (i.e. foo[] is how you declare &amp;lsquo;array of foo&amp;rsquo;).</description>
    </item>
    
    <item>
      <title>Happy New Year to Me!</title>
      <link>http://samskivert.com/blog/2012/01/happy-new-year-to-me/</link>
      <pubDate>Tue, 03 Jan 2012 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2012/01/happy-new-year-to-me/</guid>
      <description>I logged into the server that hosts samskivert.com yesterday and noticed that someone had done a very ham fisted job of hacking into my server (in addition to whatever nefarious business they hacked in to perpetrate, they changed the uid of my primary account to 0 and left the passwd file thusly modified). That&amp;rsquo;s what I get for having anything other than Apache and sshd running.
Naturally, the only thing to do in such a case was to take off and nuke the site from orbit.</description>
    </item>
    
    <item>
      <title>“Fun with edge cases” or “Why your spec can never possibly be complete”</title>
      <link>http://samskivert.com/blog/2011/08/fun-with-edge-cases-or-why-your-spec-can-never-possibly-be-complete/</link>
      <pubDate>Fri, 12 Aug 2011 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2011/08/fun-with-edge-cases-or-why-your-spec-can-never-possibly-be-complete/</guid>
      <description>(Apologies for the duplication with Google+, still sorting out my syndication process.)
What do you think should happen if you do the following in Java?
Map&amp;lt;String,String&amp;gt; map = new HashMap&amp;lt;String,String&amp;gt;(); map.put(&amp;#34;foo&amp;#34;, &amp;#34;bar&amp;#34;); Iterator&amp;lt;Map.Entry&amp;lt;String,String&amp;gt;&amp;gt; iter = map.entrySet().iterator(); Map.Entry&amp;lt;String,String&amp;gt; entry = iter.next(); iter.remove(); entry.setValue(&amp;#34;baz&amp;#34;); Should the entry freak out because you tried to update the mapping after it has already been removed? Should it reintroduce a mapping from “foo” to “baz”? Should the call succeed but have no effect on the map?</description>
    </item>
    
    <item>
      <title>Forecast: cloudy</title>
      <link>http://samskivert.com/blog/2011/06/forecast-cloudy/</link>
      <pubDate>Sat, 04 Jun 2011 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2011/06/forecast-cloudy/</guid>
      <description>Far too often, Google App Engine reports that everything is smooth sailing:
when the view from my app looks substantially less rosy:
My app is not complex. It stuffs data into the app engine data store and pulls it back out again. The total size of all my entities is one meeeellion bytes. The code is not massive; it’s seven jar files, the largest of which is the app engine API.</description>
    </item>
    
    <item>
      <title>Too much Maven Kool-aid</title>
      <link>http://samskivert.com/blog/2011/06/too-much-maven-kool-aid/</link>
      <pubDate>Thu, 02 Jun 2011 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2011/06/too-much-maven-kool-aid/</guid>
      <description>A post on the Sonatype blog cheerfully reports:
 Adding an additional source folder is as simple as:
 &amp;lt;project&amp;gt; ... &amp;lt;build&amp;gt; &amp;lt;plugins&amp;gt; &amp;lt;plugin&amp;gt; &amp;lt;groupId&amp;gt;org.codehaus.mojo&amp;lt;/groupId&amp;gt; &amp;lt;artifactId&amp;gt;build-helper-maven-plugin&amp;lt;/artifactId&amp;gt; &amp;lt;version&amp;gt;1.1&amp;lt;/version&amp;gt; &amp;lt;executions&amp;gt; &amp;lt;execution&amp;gt; &amp;lt;id&amp;gt;add-source&amp;lt;/id&amp;gt; &amp;lt;phase&amp;gt;generate-sources&amp;lt;/phase&amp;gt; &amp;lt;goals&amp;gt; &amp;lt;goal&amp;gt;add-source&amp;lt;/goal&amp;gt; &amp;lt;/goals&amp;gt; &amp;lt;configuration&amp;gt; &amp;lt;sources&amp;gt; &amp;lt;source&amp;gt;some directory&amp;lt;/source&amp;gt; ... &amp;lt;/sources&amp;gt; &amp;lt;/configuration&amp;gt; &amp;lt;/execution&amp;gt; &amp;lt;/executions&amp;gt; &amp;lt;/plugin&amp;gt; &amp;lt;/plugins&amp;gt; &amp;lt;/build&amp;gt; &amp;lt;/project&amp;gt;   If that’s simple, I don’t want to see complicated.</description>
    </item>
    
    <item>
      <title>How I Learned to Stop Worrying and Love (Coding on) the Mac OS</title>
      <link>http://samskivert.com/blog/2011/05/how-i-learned-to-stop-worrying-and-love-coding-on-the-mac-os/</link>
      <pubDate>Tue, 24 May 2011 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2011/05/how-i-learned-to-stop-worrying-and-love-coding-on-the-mac-os/</guid>
      <description>I’ve been using Linux and X Windows as my primary operating system for development for a long time. Owing to the spotty or non-existent support of consumer applications over the years, I have generally maintained an auxiliary machine (sometimes Windows, sometimes a Mac) on which to run things like iTunes or the Flash Authoring Tool (or even the Flash player when Linux support was crap).
My primary machine has generally been a Mac, because I like the hardware, I just haven’t ever run Mac OS on it.</description>
    </item>
    
    <item>
      <title>Euler 66</title>
      <link>http://samskivert.com/blog/2011/01/euler-66/</link>
      <pubDate>Fri, 14 Jan 2011 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2011/01/euler-66/</guid>
      <description>Problem 066: (source):
import scala.collection.mutable.{Map =&amp;gt; MMap} object Euler066 extends EulerApp { def leastx (d :Int) = { val amap = MMap[Int,BigInt]() val pmap = MMap[Int,BigInt]() val qmap = MMap[Int,BigInt]() val ppmap = MMap[Int,BigInt]() val qqmap = MMap[Int,BigInt]() def a (i :Int) :BigInt = amap.getOrElseUpdate(i, i match { case 0 =&amp;gt; math.sqrt(d).toInt case _ =&amp;gt; (a(0) + pp(i))/qq(i) }) def p (i :Int) :BigInt = pmap.getOrElseUpdate(i, i match { case 0 =&amp;gt; a(0) case 1 =&amp;gt; a(0)*a(1) + 1 case _ =&amp;gt; a(i)*p(i-1) + p(i-2) }) def q (i :Int) :BigInt = qmap.</description>
    </item>
    
    <item>
      <title>Euler 65</title>
      <link>http://samskivert.com/blog/2011/01/euler-65/</link>
      <pubDate>Thu, 13 Jan 2011 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2011/01/euler-65/</guid>
      <description>Problem 065: (source):
object Euler065 extends EulerApp { case class Frac (numer :BigInt, denom :BigInt) { def + (n :BigInt) = Frac(n * denom + numer, denom) def invert = Frac(denom, numer) } def compute (count :Int, n :Int) :Frac = { val term = if (n == 1) 2 else if (n % 3 == 0) 2*(n/3) else 1 if (n == count) Frac(term, 1) else compute(count, n+1).invert + term } def answer = compute(100, 1).</description>
    </item>
    
    <item>
      <title>The eternal quest for personal information management nirvanaz</title>
      <link>http://samskivert.com/blog/2010/11/the-eternal-quest-for-personal-information-management-nirvana/</link>
      <pubDate>Sun, 28 Nov 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/11/the-eternal-quest-for-personal-information-management-nirvana/</guid>
      <description>I have progressed through a broad variety of personal information management tools over the course of my life, and they invariably fail to meet my needs in one way or another. This periodically motivates a flurry of note taking on what would comprise the “perfect” personal information management system, which I generally record using whatever duct tape and baling wire contraption I am currently using to keep track of things, and then promptly forget about.</description>
    </item>
    
    <item>
      <title>WTFF?</title>
      <link>http://samskivert.com/blog/2010/09/wtff/</link>
      <pubDate>Tue, 14 Sep 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/09/wtff/</guid>
      <description>I saw some weird background activity on my network interface and undertook an investigation. netstat readily revealed that Firefox had a metric ton of TCP connections open:
 yonami.local:58809 cdce.sef004.interna:www ESTABLISHED 7215/firefox-bin yonami.local:58828 cdce.sef004.interna:www ESTABLISHED 7215/firefox-bin yonami.local:33425 pv-in-f106.1e100.ne:www ESTABLISHED 7215/firefox-bin yonami.local:58829 cdce.sef004.interna:www ESTABLISHED 7215/firefox-bin yonami.local:46025 208.50.77.78:www ESTABLISHED 7215/firefox-bin yonami.local:46001 208.50.77.78:www ESTABLISHED 7215/firefox-bin yonami.local:41860 208.50.77.95:www ESTABLISHED 7215/firefox-bin yonami.local:45853 pv-in-f100.1e100.ne:www ESTABLISHED 7215/firefox-bin yonami.local:45339 px-in-f102.1e100.ne:www ESTABLISHED 7215/firefox-bin yonami.local:58807 cdce.sef004.interna:www ESTABLISHED 7215/firefox-bin yonami.local:58801 cdce.</description>
    </item>
    
    <item>
      <title>Better symlink behavior for Git and Mercurial</title>
      <link>http://samskivert.com/blog/2010/09/better-symlink-behavior-for-git-and-mercurial/</link>
      <pubDate>Fri, 10 Sep 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/09/better-symlink-behavior-for-git-and-mercurial/</guid>
      <description>Like most developers, you probably don&amp;rsquo;t like unnecessary typing. By that, I don&amp;rsquo;t mean the static and dynamic variety, but the fingers on keyboard variety. However, when it comes to manipulating files via version control, we have recently taken a step backward.
Historically, when faced with paths that look like the following:
src/main/java/com/company/project/foopkg/MyAwesomeFoo.java src/main/java/com/company/project/barpkg/MyAwesomeBar.java src/main/java/com/company/project/bazpkg/MyAwesomeBaz.java src/test/java/com/company/project/foopkg/MyAwesomeFooTest.java  I have created symlinks at the top-level of my project as follows:
% ln -s src/main/java/com/company/project code % ln -s src/test/java/com/company/project tcode  This allows me to do things like:</description>
    </item>
    
    <item>
      <title>Why Maven Sucks: Act I, Reprise</title>
      <link>http://samskivert.com/blog/2010/09/why-maven-sucks-act-i-reprise/</link>
      <pubDate>Fri, 10 Sep 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/09/why-maven-sucks-act-i-reprise/</guid>
      <description>The XML insanity of passing compiler arguments to Maven like so:
&amp;lt;compilerArguments&amp;gt; &amp;lt;Xlint/&amp;gt; &amp;lt;Xlint:-serial/&amp;gt; &amp;lt;Xlint:-path/&amp;gt; &amp;lt;/compilerArguments&amp;gt;  has not surprisingly, come back to bite me in the ass. Most normal Maven actions seem to have no problem with it, but when I try to actually publish my project (via mvn release:prepare), I get the error I expected to see all along:
[INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error reading POM: Error on line 104: The prefix &amp;quot;Xlint&amp;quot; for element &amp;quot;Xlint:-serial&amp;quot; is not bound.</description>
    </item>
    
    <item>
      <title>Why Maven Sucks: Halftime Show</title>
      <link>http://samskivert.com/blog/2010/09/why-maven-sucks-halftime-show/</link>
      <pubDate>Thu, 09 Sep 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/09/why-maven-sucks-halftime-show/</guid>
      <description>One can, and is indeed encouraged to, sign one&amp;rsquo;s Maven artifacts with GPG. This involves generating an artifact-version.jar.asc file containing the ASCII representation of the cryptographic signature for the artifact in question. This is uploaded to the Maven repository along with the artifact.
Maven then helpfully generates artifact-version.jar.asc.md5 and artifact-version.jar.asc.sha1, and uploads those to the repository as well. I don&amp;rsquo;t need one, let alone two, cryptographic hashes to tell me that my cryptographic signature has not been tampered with.</description>
    </item>
    
    <item>
      <title>Why Maven Sucks: Act I</title>
      <link>http://samskivert.com/blog/2010/09/why-maven-sucks-act-i/</link>
      <pubDate>Wed, 08 Sep 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/09/why-maven-sucks-act-i/</guid>
      <description>These ruminations were languishing in commit messages, which would normally satisfy my urge to complain. But now I need to complain further, and don&amp;rsquo;t have a commit message in which to express my discontent, so I&amp;rsquo;m airing the whole basket of dirty laundry here, and going on the record as a Maven hater. For those of you privy to the original commit messages, my new complaints will be aired in Act III.</description>
    </item>
    
    <item>
      <title>Why Maven Sucks: Act II</title>
      <link>http://samskivert.com/blog/2010/09/why-maven-sucks-act-ii/</link>
      <pubDate>Wed, 08 Sep 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/09/why-maven-sucks-act-ii/</guid>
      <description>Sun, in their infinite wisdom, circa Java 1.3, extended the jar file specification to allow dependencies to be expressed inside jar files by adding a Class-Path attribute to the MANIFEST.MF file. This causes the JVM (and javac, and various app servers) to try to magically add dependent jar files to the classpath. This is half-assed and wrong in too many ways to enumerate here.
Some other enthusiastic Sun engineer then helpfully added activation.</description>
    </item>
    
    <item>
      <title>Why Maven Sucks: Act III</title>
      <link>http://samskivert.com/blog/2010/09/why-maven-sucks-act-iii/</link>
      <pubDate>Wed, 08 Sep 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/09/why-maven-sucks-act-iii/</guid>
      <description>The saga (act i, act ii) continues.
More reasons why Maven sucks:
  Plugin version handling sucks.
I learned this when I was trying to get Maven to generate javadocs. I was configuring the Maven Javadoc plugin with links to external javadocs when I discovered the very handy detectJavaApiLink option. It automatically adds a link to the standard Java API javadocs whose version matches the version specified in the -source argument to your compilation.</description>
    </item>
    
    <item>
      <title>Euler 2⁶</title>
      <link>http://samskivert.com/blog/2010/08/euler-2%e2%81%b6/</link>
      <pubDate>Wed, 25 Aug 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/08/euler-2%e2%81%b6/</guid>
      <description>Problem 064: (source):
object Euler064 extends EulerApp { case class Root (root :Int, add :Int, div :Int) { def expand = { val term = ((math.sqrt(root) + add)/div).toInt val nadd = term*div - add (term, Root(root, nadd, (root - nadd*nadd)/div)) } override def toString = &amp;#34;(√&amp;#34; + root + &amp;#34;+&amp;#34; + add + &amp;#34;)/&amp;#34; + div } def expansion (terms :List[Int], roots :List[Root]) :List[Int] = { val (term, root) = roots.</description>
    </item>
    
    <item>
      <title>Shoot me now</title>
      <link>http://samskivert.com/blog/2010/08/shoot-me-now/</link>
      <pubDate>Wed, 25 Aug 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/08/shoot-me-now/</guid>
      <description>I&amp;rsquo;m foolishly trying to write a javac annotation processor in Scala. This has already been a road fraught with gratuitous obstacles, but the latest wrinkle has driven me to vent in public.
When I run my annotation processor thusly:
javac -processor FooProcessor -processorpath fooproc/classes:blah/scala-library.jar SomeFile.java  I get java.lang.IllegalStateException: zip file closed when my processor tries to load Scala classes. But if I unpack scala-library.jar into fooproc/classes then it works. Joy!</description>
    </item>
    
    <item>
      <title>Euler 62</title>
      <link>http://samskivert.com/blog/2010/08/euler-62/</link>
      <pubDate>Sat, 21 Aug 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/08/euler-62/</guid>
      <description>Problem 062: (source):
object Euler062 extends EulerApp { def search (n :Long, cubes :Map[Long,List[Long]]) :Long = { val cube = n*n*n val key = cube.toString.sortWith(_&amp;gt;_).toLong val perms = cube :: cubes.getOrElse(key, Nil) if (perms.length == 5) perms.last else search(n+1, cubes + (key -&amp;gt; perms)) } def answer = search(1, Map()) } I was originally using the dreaded mutation here, and then realized that I could easily rewrite the code to use an immutable map, making it about 10% shorter and about 10% slower.</description>
    </item>
    
    <item>
      <title>Euler 63</title>
      <link>http://samskivert.com/blog/2010/08/euler-63/</link>
      <pubDate>Sat, 21 Aug 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/08/euler-63/</guid>
      <description>Problem 063: (source):
object Euler063 extends EulerApp { def pows (n :Int) = Stream.from(1) prefixLength(p =&amp;gt; BigInt(n).pow(p).toString.length == p) def answer = 1 to 9 map(pows) sum } The main observation here is that the number of digits of ax, for a ≥ 10, is guaranteed to exceed x. So we can restrict ourselves to looking only at the numbers from 1 to 9. Furthermore, the number of digits of ax, for 1 ≤ a ≤ 9, will equal x up to some maximum x, and then be less than x for all higher x.</description>
    </item>
    
    <item>
      <title>An emacs on every desktop</title>
      <link>http://samskivert.com/blog/2010/08/an-emacs-on-every-desktop/</link>
      <pubDate>Thu, 12 Aug 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/08/an-emacs-on-every-desktop/</guid>
      <description>I am a heavy user of virtual desktops. I generally have a couple of shell windows, an emacs window, possibly a browser, and whatever target program I&amp;rsquo;m working on, on each of a few virtual desktops. When I&amp;rsquo;m interrupted from one project, I flip to the next virtual desktop, open a shell window, open an emacs window and start hacking away on said interruption. Often the stack will get three or four virtual desktops deep, and I&amp;rsquo;ll find myself flipping back and forth between the various in-progress projects.</description>
    </item>
    
    <item>
      <title>Euler 58</title>
      <link>http://samskivert.com/blog/2010/07/euler-58/</link>
      <pubDate>Tue, 27 Jul 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/07/euler-58/</guid>
      <description>Problem 058:
object Euler58 extends EulerApp { def checkring (r :Int, primes :Int, nums :Int) :Int = { if (primes*10/nums &amp;lt; 1) 2*r-1 else { val skip = 2*r val base = (skip-1)*(skip-1) val rp = List(1, 2, 3).map(base+skip*_).filter(isprime).length checkring(r+1, primes+rp, nums+4); } } def answer = checkring(2, 3, 5) } This one is pretty easy after observing that you skip twice the “radius&amp;quot; to get from one corner to the next for a given ring of the spiral.</description>
    </item>
    
    <item>
      <title>Euler 59</title>
      <link>http://samskivert.com/blog/2010/07/euler-59/</link>
      <pubDate>Tue, 27 Jul 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/07/euler-59/</guid>
      <description>Problem 059:
object Euler59 extends EulerApp { val cipher = readline(&amp;#34;cipher1.txt&amp;#34;) split(&amp;#39;,&amp;#39;) map(_.toInt) def decode (cipher :Array[Int], key :Array[Char]) = (0 until cipher.length) map(ii =&amp;gt; cipher(ii) ^ key(ii%key.length)) def answer = (for { a &amp;lt;- &amp;#39;a&amp;#39; to &amp;#39;z&amp;#39;; b &amp;lt;- &amp;#39;a&amp;#39; to &amp;#39;z&amp;#39;; c &amp;lt;- &amp;#39;a&amp;#39; to &amp;#39;z&amp;#39; val decoded = decode(cipher, Array(a, b, c)) if (decoded.map(_.toChar).mkString.contains(&amp;#34; chapter&amp;#34;)) } yield decoded.sum).head } Nothing fancy here. I do a brute force search, trying each key in turn and looking for a particular English word to indicate that the decoding is correct.</description>
    </item>
    
    <item>
      <title>Euler 60</title>
      <link>http://samskivert.com/blog/2010/07/euler-60/</link>
      <pubDate>Tue, 27 Jul 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/07/euler-60/</guid>
      <description>Problem 060:
object Euler60 extends EulerApp { val primes = genprimes(10000) filter(0.!=) val ppairs = Set() ++ (for { ii &amp;lt;- 0 until primes.length-1; jj &amp;lt;- ii until primes.length; val pi = primes(ii); val pj = primes(jj); if (isprime((pi.toString+pj).toInt) &amp;amp;&amp;amp; isprime((pj.toString+pi).toInt)) } yield (pi, pj)) def isset (pset :List[Int], prime :Int) = pset.foldLeft(true)((b, a) =&amp;gt; b &amp;amp;&amp;amp; ppairs((a, prime))) def find (pset :List[Int], plist :List[Int]) :Option[List[Int]] = { if (pset.size == 5) Some(pset) else if (plist.</description>
    </item>
    
    <item>
      <title>Euler 61</title>
      <link>http://samskivert.com/blog/2010/07/euler-61/</link>
      <pubDate>Tue, 27 Jul 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/07/euler-61/</guid>
      <description>Problem 061:
object Euler61 extends EulerApp { case class Pn (card :Int, value :Int) { def valid = (value &amp;lt; 10000) &amp;amp;&amp;amp; (value &amp;gt; 999) def ab = value / 100 def cd = value % 100 } def tri (n :Int) = Pn(3, n*(n+1)/2) def square (n :Int) = Pn(4, n*n) def pent (n :Int) = Pn(5, n*(3*n-1)/2) def hex (n :Int) = Pn(6, n*(2*n-1)) def hept (n :Int) = Pn(7, n*(5*n-3)/2) def oct (n :Int) = Pn(8, n*(3*n-2)) def gen (max :Int)(gen :(Int) =&amp;gt; Pn) = (1 to max) map(gen) filter(_.</description>
    </item>
    
    <item>
      <title>Euler 56</title>
      <link>http://samskivert.com/blog/2010/07/euler-56/</link>
      <pubDate>Mon, 26 Jul 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/07/euler-56/</guid>
      <description>Problem 056:
object Euler56 extends EulerApp { def answer = (for { a &amp;lt;- 90 to 100; b &amp;lt;- 90 to 100 } yield BigInt(a).pow(b).toString.map(_-&amp;#39;0&amp;#39;).sum) max } I&amp;rsquo;m in Switzerland at the moment, so my mind naturally turns to Project Euler.
I have made some changes to my problem harness. Previously, I relied on Scala&amp;rsquo;s Application class&amp;rsquo;s jiggery pokery to stuff your whole program into a static initializer and execute it.</description>
    </item>
    
    <item>
      <title>Euler 57</title>
      <link>http://samskivert.com/blog/2010/07/euler-57/</link>
      <pubDate>Mon, 26 Jul 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/07/euler-57/</guid>
      <description>Problem 057:
object Euler57 extends EulerApp { case class Frac (numer :BigInt, denom :BigInt) { def add (n :BigInt) = Frac(n * denom + numer, denom) def invert = Frac(denom, numer) def numheavy = numer.toString.length &amp;gt; denom.toString.length } def expand (count :Int) :Frac = if (count == 0) Frac(1, 2) else expand(count-1).add(2).invert def answer = (0 to 1000) filter(i =&amp;gt; expand(i).add(1).numheavy) length } I took the opportunity to use a case class to model just enough of a rational to get the job done.</description>
    </item>
    
    <item>
      <title>Grand Central Corner</title>
      <link>http://samskivert.com/blog/2010/07/grand-central-corner/</link>
      <pubDate>Sun, 11 Jul 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/07/grand-central-corner/</guid>
      <description>I have graduated to the ranks of property ownership in sunny Seattle. I present photographic proof for your visual enjoyment.</description>
    </item>
    
    <item>
      <title>Riddle me this</title>
      <link>http://samskivert.com/blog/2010/06/riddle-me-this/</link>
      <pubDate>Wed, 09 Jun 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/06/riddle-me-this/</guid>
      <description>I don’t expect anyone to know the answer to this question, but I’m hoping that bitching about it will improve my mood sufficiently to prepare me for the painful foray into the guts of javac that will be needed to find the answer myself.
There’s a very sophisticated pile of code in com.sun.tools.javac.comp.Infer that infers the type of a universally quantified method application, given its signature and actual parameter types.</description>
    </item>
    
    <item>
      <title>Life on the edge (case)</title>
      <link>http://samskivert.com/blog/2010/05/life-on-the-edge-case/</link>
      <pubDate>Sun, 16 May 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/05/life-on-the-edge-case/</guid>
      <description>My current research project has given me myriad opportunities to break the Java compiler. Usually, this is because I’m tinkering with its internal data structures in a way that it neither anticipated nor feels especially good about. In such circumstances, I usually apologize profusely and look for a less intrusive way to accomplish my goals. Today however, I managed to cause javac to take umbrage without having first gone rummaging around in its underwear drawer.</description>
    </item>
    
    <item>
      <title>On space between sentences</title>
      <link>http://samskivert.com/blog/2010/02/on-space-between-sentences/</link>
      <pubDate>Sat, 06 Feb 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/02/on-space-between-sentences/</guid>
      <description> In the nineteenth century, which was a dark and inflationary age in typography and type design, many compositors were encouraged to stuff extra spaces between sentences. Generations of twentieth-century typists were taught to do the same, by hitting the spacebar twice after every period. Your typing as well as your typesetting will benefit from unlearning this quaint Victorian habit.
Robert Bringhurst, “The Elements of Typographic Style”
 Hear, hear! </description>
    </item>
    
    <item>
      <title>“Duplicate field expected”</title>
      <link>http://samskivert.com/blog/2010/01/duplicate-field-expected/</link>
      <pubDate>Sun, 24 Jan 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/01/duplicate-field-expected/</guid>
      <description>In my recent programming adventures, I separately encountered two perplexing error messages:
 RuntimeException: Variable is used without definition! IllegalArgumentException: Duplicate field expected  Inspection of the underlying code brought clarity:
 throw new RuntimeException(&#34;Variable &#34; + m + &#34; used without definition!&#34;); throw new IllegalArgumentException(&#34;Duplicate field &#34; + fieldName);  The former was reporting a problem with a variable declared as InputStream is, the latter a problem with JUnit’s @Test annotation which defines a parameter  java.</description>
    </item>
    
    <item>
      <title>Euler 52</title>
      <link>http://samskivert.com/blog/2010/01/euler-52/</link>
      <pubDate>Fri, 01 Jan 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/01/euler-52/</guid>
      <description>Problem 052:
object Euler52 extends Application { def sort (n :Int) = n.toString.toList.sortWith(_&amp;lt;_).mkString.toInt def g (n :Int, sn :Int) = (2 to 6).forall(m =&amp;gt; sort(n*m) == sn) def f (n :Int) = g(n, sort(n)) println(Stream.from(1).find(f).get) } Happy New Year! What better way to ring in the new year than doing math problems while sitting on the lanai under the Hawaiian sun? I&amp;rsquo;m already up to Euler 90, so I&amp;rsquo;ve got some catching up to do with my posts.</description>
    </item>
    
    <item>
      <title>Euler 53</title>
      <link>http://samskivert.com/blog/2010/01/euler-53/</link>
      <pubDate>Fri, 01 Jan 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/01/euler-53/</guid>
      <description>Problem 053:
object Euler53 extends Application { def fact (n :BigInt) :BigInt = if (n &amp;lt; 2) 1 else n * fact(n-1) def choose (n :BigInt, r :BigInt) = fact(n)/(fact(r)*fact(n-r)) println((for (n &amp;lt;- 1 to 100; r &amp;lt;- 1 to n; if (choose(n, r) &amp;gt; 1000000)) yield 1).sum) } Another simple brute force solution. Enumerate and count. BigInt lets us avoid any serious thinking.</description>
    </item>
    
    <item>
      <title>Euler 54</title>
      <link>http://samskivert.com/blog/2010/01/euler-54/</link>
      <pubDate>Fri, 01 Jan 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/01/euler-54/</guid>
      <description>Problem 054:
object Euler54 extends EulerApp { class Card (s :String) { val suit :Char = s.charAt(1) val rank :Int = &amp;#34;23456789TJQKA&amp;#34;.indexOf(s.charAt(0)) def &amp;gt; (o :Card) = if (rank == o.rank) suit &amp;gt; o.suit else rank &amp;gt; o.rank } class Hand (c :Seq[Card]) { def groupCards (cards :List[Card]) :List[List[Card]] = if (cards.isEmpty) Nil else { val g = cards.takeWhile(_.rank == cards.head.rank) g :: groupCards(cards.drop(g.length)) } val cards = c.toList.sortWith(_&amp;gt;_) val group = groupCards(cards).</description>
    </item>
    
    <item>
      <title>Euler 55</title>
      <link>http://samskivert.com/blog/2010/01/euler-55/</link>
      <pubDate>Fri, 01 Jan 2010 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2010/01/euler-55/</guid>
      <description>Problem 055:
object Euler55 extends EulerApp { def ispal (n :String) = n.take(n.length/2) == n.takeRight(n.length/2).reverse def islychrel (n :BigInt, iter :Int = 0) :Int = if (iter &amp;gt; 0 &amp;amp;&amp;amp; ispal(n.toString)) 0 else if (iter == 50) 1 else islychrel(n + BigInt(n.toString.reverse), iter+1) println((1 to 9999).map(n =&amp;gt; islychrel(n)).sum) } Nothing much to see here, other than that I took advantage of a couple of nice features of Scala 2.8 while cleaning this up for posting.</description>
    </item>
    
    <item>
      <title>Thank Gosling</title>
      <link>http://samskivert.com/blog/2009/11/thank-gosling/</link>
      <pubDate>Wed, 04 Nov 2009 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2009/11/thank-gosling/</guid>
      <description>The following is not legal Java:
 public static void main (String[] args) { int[] foo = new int[1]; int[] bar = new int[1]; ((args.length == 0) ? foo[0] : bar[0]) = 1; }  That makes my life easier.</description>
    </item>
    
    <item>
      <title>Loft Remodel</title>
      <link>http://samskivert.com/blog/2009/10/loft-remodel/</link>
      <pubDate>Mon, 12 Oct 2009 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2009/10/loft-remodel/</guid>
      <description>Shortly before I departed sunny San Francisco, I had my loft remodeled. I finally got some pictures from my contractor as I didn’t have time to take any of my own before I took off. They are here for your viewing pleasure.</description>
    </item>
    
    <item>
      <title>GWT AsyncGen</title>
      <link>http://samskivert.com/blog/2009/10/gwt-asyncgen/</link>
      <pubDate>Fri, 09 Oct 2009 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2009/10/gwt-asyncgen/</guid>
      <description>The back-breaking straw landed on this camel earlier today when adding some methods to a GWT RemoteService interface and then remembering that, “Oh yeah, I have to go add those manually to the async mirror interface that goes with my service.”
First I poked around on the web. I found some sort of Maven plugin that in theory automatically generates these extra services, but I don’t use Maven and I’m not about to start now.</description>
    </item>
    
    <item>
      <title>Pike Place</title>
      <link>http://samskivert.com/blog/2009/09/pike-place/</link>
      <pubDate>Tue, 22 Sep 2009 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2009/09/pike-place/</guid>
      <description>I moved to Seattle and have a new place to live. Check out the pictures.</description>
    </item>
    
    <item>
      <title>Why am I surprised?</title>
      <link>http://samskivert.com/blog/2009/09/why-am-i-surprised/</link>
      <pubDate>Sun, 20 Sep 2009 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2009/09/why-am-i-surprised/</guid>
      <description>I go to set up my My Qwest account page for my glorious new phone service and when I click “Create account” after typing in a bunch of annoying crap, it gives me a page that says “Oh, sorry, our shit is down right now. Try again later.” (I’m paraphrasing.) I try again a few minutes later and it claims that my username already exits. Awesome.
My account must already be created, so I try logging in and get:</description>
    </item>
    
    <item>
      <title>A technique for type-safe, concise actors in Java</title>
      <link>http://samskivert.com/blog/2009/06/a-technique-for-type-safe-concise-actors-in-java/</link>
      <pubDate>Wed, 17 Jun 2009 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2009/06/a-technique-for-type-safe-concise-actors-in-java/</guid>
      <description>Actors are great. They provide a concurrency model that is not too taxing to reason about and an organizing principle that tends to jive with how you would naturally structure your code. I recently put actors to use in a real project (implemented in Java), and in the process had to overcome some aesthetic difficulties with a technique that seemed worth sharing.
The Itch
The requirements I was trying to satisfy are as follows (note: I realize that most people use the term messages to describe what actors process but I prefer to say that actors process actions, so hopefully you can bear with my rogue nomenclature):</description>
    </item>
    
    <item>
      <title>iPeggle</title>
      <link>http://samskivert.com/blog/2009/06/ipeggle/</link>
      <pubDate>Sun, 14 Jun 2009 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2009/06/ipeggle/</guid>
      <description>I discovered recently that Peggle is available on the iPhone for $1 and I am simply appalled. I don’t know what to think about a universe where one can obtain, for a single US dollar, a quantity of awesome in proportions so epic as to tax the imagination. It spits in the face of the very notion of value. Next they’ll be selling Ferraris for $7.50 and caviar for $.</description>
    </item>
    
    <item>
      <title>A Whirled Tour</title>
      <link>http://samskivert.com/blog/2009/03/a-whirled-tour/</link>
      <pubDate>Thu, 26 Mar 2009 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2009/03/a-whirled-tour/</guid>
      <description>I gave a talk at the GDC this year, this time with a more technical bent than the usual business + metrics talks that Daniel and I have established an annual tradition of delivering.
The slides are available here for the curious and indulgent:
http://samskivert.com/work/2009/gdc/WhirledTour.pdf
I dare say it seemed to go over well. At least that was my impression and I have no intention of disabusing myself of it.</description>
    </item>
    
    <item>
      <title>Brazil &#43; Argentina</title>
      <link>http://samskivert.com/blog/2009/03/brazil-argentina/</link>
      <pubDate>Sun, 01 Mar 2009 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2009/03/brazil-argentina/</guid>
      <description>Lo, it is photodocumentary of my recent trip to South America.</description>
    </item>
    
    <item>
      <title>Git out of my head</title>
      <link>http://samskivert.com/blog/2008/12/git-out-of-my-head/</link>
      <pubDate>Mon, 01 Dec 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/12/git-out-of-my-head/</guid>
      <description>Last night I dreamt about GIT and implementing complex revision control policies atop its basic tools. In my dream I danced around the room as changes were fetched and pushed.</description>
    </item>
    
    <item>
      <title>OMG Best Cookies Ever</title>
      <link>http://samskivert.com/blog/2008/09/omg-best-cookies-ever/</link>
      <pubDate>Wed, 03 Sep 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/09/omg-best-cookies-ever/</guid>
      <description>My friend Jes, who has on multiple occasions humbled me in head to head games of Dictionary Attack (beaten at my own game, oh the humanity), has now thrown down the gauntlet. Behold:

I hope I can eventually come to terms with the fact that her pixel art skills exceed my own in even the squishiest of media.</description>
    </item>
    
    <item>
      <title>Burning Man 2008</title>
      <link>http://samskivert.com/blog/2008/08/burning-man-2008/</link>
      <pubDate>Sun, 31 Aug 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/08/burning-man-2008/</guid>
      <description>Through some combination of subconscious neglect and happy coincidence, I discovered that my camera battery was just about dead when I arrived at Burning Man. Thus I made a quick photo tour shortly after arrival and spent the rest of the event blissfully free of any feeling of responsibility to document my adventures.

The small selection of photos I took before the juice ran out can be seen on Flickr.</description>
    </item>
    
    <item>
      <title>Euler 050</title>
      <link>http://samskivert.com/blog/2008/08/euler-050/</link>
      <pubDate>Mon, 18 Aug 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/08/euler-050/</guid>
      <description>Problem 050:
object Euler50 extends EulerApp { val pvec = genprimes(1000000) val primes = pvec.filter(0.!=) case class PSum (sum :Int, length :Int) { def add (prime :Int) = PSum(sum+prime, length+1) } def fsum (idx :Int, csum :PSum, lsum :PSum) :PSum = { if (idx &amp;gt;= primes.length || csum.sum &amp;gt;= pvec.length) lsum else fsum(idx+1, csum.add(primes(idx)), if (pvec(csum.sum) != 0) csum else lsum) } def longer (one :PSum, two :PSum) = if (one.</description>
    </item>
    
    <item>
      <title>Euler 051</title>
      <link>http://samskivert.com/blog/2008/08/euler-051/</link>
      <pubDate>Mon, 18 Aug 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/08/euler-051/</guid>
      <description>Problem 051:
object Euler51 extends EulerApp { def cprimes (n :String)(d :Char) = { val variants = “0123456789″.toList.map(nd =&amp;gt; n.replace(d, nd)) variants.filter(!_.startsWith(&amp;#34;0″)).map(Integer.parseInt).filter(isprime).length } def count (prime :String) = { prime.toList.removeDuplicates.map(cprimes(prime)).reduceRight(Math.max) } println(genprimes(150000).filter(0.!=).find(p =&amp;gt; count(p.toString) &amp;gt; 7).get) } A robust set of functional libraries really makes our lives easier here. Our function for obtaining the count of primes that can be generated by substituting all digits for one particular digit in the original prime takes our number as a string, turns that into a list of digits, removes duplicates, maps a (curried) function onto each of those individual digits and then folds the resulting list with max to find the largest value.</description>
    </item>
    
    <item>
      <title>Euler 048</title>
      <link>http://samskivert.com/blog/2008/08/euler-048/</link>
      <pubDate>Mon, 11 Aug 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/08/euler-048/</guid>
      <description>Problem 048:
object Euler48 extends Application { println(1.to(1000).map(a =&amp;gt; BigInt(a).pow(a)).reduceRight(_+_) % BigInt(10).pow(10)) } The Right Thing ™ here was to not rely on the magic of BigInt, but to do the addition modulo 10^10 as well as to compute the powers modulo 10^10, but laziness and the allure of a one line solution won out in the end.</description>
    </item>
    
    <item>
      <title>Euler 049</title>
      <link>http://samskivert.com/blog/2008/08/euler-049/</link>
      <pubDate>Mon, 11 Aug 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/08/euler-049/</guid>
      <description>Problem 049:
object Euler49 extends EulerApp { def sort (n :Int) = n.toString.toList.sort(_&amp;lt;_).mkString.toInt def isterm (n :Int, nn :Int) = isprime(nn) &amp;amp;&amp;amp; sort(nn) == sort(n) def isseq (n :Int) = isterm(n, n+3330) &amp;amp;&amp;amp; isterm(n, n+6660) def mkseq (n :Int) = List(n, n+3330, n+6660).mkString println(mkseq(1488.to(10000-6660).filter(isprime).filter(isseq).first)) } This one&amp;rsquo;s been somewhat deconstructed. I originally just wrote a for loop, but then I wanted to make it a bit more functional. Then I wanted to make it a bit shorter.</description>
    </item>
    
    <item>
      <title>Euler 046</title>
      <link>http://samskivert.com/blog/2008/08/euler-046/</link>
      <pubDate>Sun, 10 Aug 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/08/euler-046/</guid>
      <description>Problem 046:
object Euler46 extends EulerApp { def isgold (n :Int) = 1.to(Math.sqrt(n/2)).exists(s =&amp;gt; isprime(n-2*s*s)) def check (n :Int) :Int = if (isprime(n) || isgold(n)) check(n+2) else n println(check(3)) } Fortunately this one is easier to disprove than Goldbach&amp;rsquo;s other conjecture. If n = p + 2ss, we can simply try all values of s from 1 to the square root of n/2 and check whether n - 2ss is prime.</description>
    </item>
    
    <item>
      <title>Euler 047</title>
      <link>http://samskivert.com/blog/2008/08/euler-047/</link>
      <pubDate>Sun, 10 Aug 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/08/euler-047/</guid>
      <description>Problem 047:
object Euler47 extends Application { val factors = Array.make(150000, 0) var idx = 2 while (idx &amp;lt; factors.length) { for (midx &amp;lt;- List.range(idx+idx, factors.length, idx)) factors(midx) += 1 do idx = idx+1 while (idx &amp;lt; factors.length &amp;amp;&amp;amp; factors(idx) != 0) } println(1.to(factors.length-3).find(n =&amp;gt; factors.slice(n, n+4).mkString == &amp;#34;4444&amp;#34;)) } Here we do two things: first, use a modified Sieve of Eratosthenes to count up the unique factors of all numbers up to some maximum value (which cheat and choose to be “large enough&amp;quot;).</description>
    </item>
    
    <item>
      <title>The Trans-Siberian Express</title>
      <link>http://samskivert.com/blog/2008/08/the-transsiberian-express/</link>
      <pubDate>Thu, 07 Aug 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/08/the-transsiberian-express/</guid>
      <description>Erin and I traveled across Russia on the Golden Eagle Trans-Siberian Express this June and we have the pictures to prove it. At the time of this posting, they’re not fully annotated, but I can’t imagine anyone will want to reexperience all 360 hours of travel across Russia in picto-narrative form anyway, so just look at the thumbnails and see if anything jumps out at you.
  Vladivostok   Khabarovsk   Ulan Bataar   Along the Way   Ulan Ude   Lake Baikal   Port Baikal + Listvyanka   Irkutsk   Krasnoyarsk   Novosibirsk   Yekaterinburg   Kazan’   Steam Engine   Moscow   Russia is a big country.</description>
    </item>
    
    <item>
      <title>Euler 044</title>
      <link>http://samskivert.com/blog/2008/07/euler-044/</link>
      <pubDate>Sun, 20 Jul 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/07/euler-044/</guid>
      <description>Problem 044:
object Euler44 extends Application { def pent (n :Int) = n*(3*n-1)/2 val pents = Set() ++ List.range(1, 3000).map(pent) def find (a :Int, b :Int) :Int = { val pa = pent(a) val pb = pent(b) val d = pb-pa val s = pa+pb if (pents.contains(d) &amp;amp;&amp;amp; pents.contains(s)) d else if (a &amp;gt;= b) find(1, b+1) else find(a+1, b) } println(find(1, 2)) } This one&amp;rsquo;s not especially elegant or clever (but it is fast).</description>
    </item>
    
    <item>
      <title>Euler 045</title>
      <link>http://samskivert.com/blog/2008/07/euler-045/</link>
      <pubDate>Sun, 20 Jul 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/07/euler-045/</guid>
      <description>Problem 045:
object Euler45 extends Application { def findh (pent :Long, h :Long) :Long = { val hex = h*(2*h-1) if (hex &amp;gt; pent) findh(pent, h-1) else if (hex &amp;lt; pent) 0 else hex } def findp (tri :Long, p :Long) :Long = { val pent = p*(3*p-1)/2 if (pent &amp;gt; tri) findp(tri, p-1) else if (pent &amp;lt; tri) 0 else findh(pent, p-1) } def find (t :Long) :Long = { val n = findp(t*(t+1)/2, t-1) if (n !</description>
    </item>
    
    <item>
      <title>Hail Caesar</title>
      <link>http://samskivert.com/blog/2008/07/hail-caesar/</link>
      <pubDate>Sun, 20 Jul 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/07/hail-caesar/</guid>
      <description>Went to see a performance of Verdi’s Requiem last night at the Roman Theater in Orange. We arrived just as the show was starting and had to do battle at the ticket office and again at the gate to actually get in, but the trouble was worth it as the (unfortunately blurry) picture shows:</description>
    </item>
    
    <item>
      <title>Euler 043</title>
      <link>http://samskivert.com/blog/2008/07/euler-043/</link>
      <pubDate>Sat, 19 Jul 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/07/euler-043/</guid>
      <description>Problem 043:
object Euler43 extends Application { def compsum (n :Long, digits :List[Int], divs :List[Int], sum :Long) :Long = { if (digits.isEmpty) n + sum else (for { d &amp;lt;- digits; val nn = n*10 + d; if ((nn%1000) % divs.head == 0) } yield compsum(nn, digits-d, divs.tail, sum)).foldLeft(0L)(_+_) } def digits (n :Int) = n.toString.toList.map(_-&amp;#39;0&amp;#39;) def norepeats (n :Int) = digits(n).removeDuplicates == digits(n) def compute (s :Int) = compsum(s, 0.</description>
    </item>
    
    <item>
      <title>Le Tour</title>
      <link>http://samskivert.com/blog/2008/07/le-tour/</link>
      <pubDate>Sat, 19 Jul 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/07/le-tour/</guid>
      <description>The Tour de France happened to be passing about 5km from where I’m staying (near Les Baux des Provence), so naturally a viewing was in order. The first group came and went in the span of about two seconds:
Then maybe half a minute later the second, much larger, group whizzed by. They were a bit more spread out, turning to single file after this short red clump at the head:</description>
    </item>
    
    <item>
      <title>Euler 039</title>
      <link>http://samskivert.com/blog/2008/06/euler-039/</link>
      <pubDate>Sun, 01 Jun 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/06/euler-039/</guid>
      <description>Problem 039:
object Euler39 extends Application { def sols (perim :Int) = perim + 1000 * (for { a &amp;lt;- List.range(1, perim/2); b &amp;lt;- List.range(1, (perim-a)/2+1); c &amp;lt;- List(perim-a-b); if (a*a + b*b == c*c) } yield 1).length; println(List.range(3, 1000).map(sols).foldLeft(0)(Math.max) % 1000); } Nothing fancy here, just a moderately brute force search.</description>
    </item>
    
    <item>
      <title>Euler 040</title>
      <link>http://samskivert.com/blog/2008/06/euler-040/</link>
      <pubDate>Sun, 01 Jun 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/06/euler-040/</guid>
      <description>Problem 040:
object Euler40 extends Application { val digits = List.range(1, 200000).flatMap(n =&amp;gt; n.toString.toList).map(_-&amp;#39;0&amp;#39;); println(List(0, 9, 99, 999, 9999, 99999, 999999).foldRight(1)((idx, b) =&amp;gt; b * digits(idx))); } Another straightforward solution that&amp;rsquo;s nicely accommodated by our basic tools. Generate a list of the first 200,000 integers, split those into lists of each individual integer&amp;rsquo;s digits and flatmap them into one contiguous list. Then extract the digits at our desired indices and multiply them.</description>
    </item>
    
    <item>
      <title>Euler 041</title>
      <link>http://samskivert.com/blog/2008/06/euler-041/</link>
      <pubDate>Sun, 01 Jun 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/06/euler-041/</guid>
      <description>Problem 041:
object Euler41 extends EulerApp { def perms (d :List[Char], n :List[Char]) :List[Int] = d match { case Nil =&amp;gt; n.mkString.toInt :: Nil; case _ =&amp;gt; d.flatMap(digit =&amp;gt; perms(d.filter(digit.!=), digit :: n)) } println(perms(&amp;#34;1234567″.toList, Nil).filter(isprime).foldLeft(0)(Math.max)); } We save ourselves many CPU cycles by noticing that a pandigital number with 1 through 9 will always have digits that sum to 45, and similarly one with 1 through 8 will always have digits that sum to 36.</description>
    </item>
    
    <item>
      <title>Euler 042</title>
      <link>http://samskivert.com/blog/2008/06/euler-042/</link>
      <pubDate>Sun, 01 Jun 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/06/euler-042/</guid>
      <description>Problem 042:
object Euler42 extends EulerApp { def wvalue (word :Seq[Char]) = word.foldLeft(0)((s, l) =&amp;gt; (s + (l - &amp;#39;A&amp;#39; + 1))) def tri (n :Int) = (n*(n+1))/2 println(readwords(&amp;#34;words.txt&amp;#34;).map(wvalue).filter(v =&amp;gt; (v == tri(Math.sqrt(2*v)))).length); } This one is kind of cheating. I discovered (using the terminology tri = (n * (n+1))/2) that floor(sqrt(2*tri)) == n for at least the first 10,000 values of n. This isn&amp;rsquo;t hugely surprising because 2*tri = (n*n + n), so the square root of that is always going to be a bit bigger than n, and floor of that could well take us right to the integer we need.</description>
    </item>
    
    <item>
      <title>What in the Whirled?</title>
      <link>http://samskivert.com/blog/2008/03/what-in-the-whirled/</link>
      <pubDate>Tue, 25 Mar 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/03/what-in-the-whirled/</guid>
      <description>Hey, here’s the crazy project that’s been consuming the last year and a half of my life:
 How handy that it can be embedded right into my blog. At some point we’ll fix the URL clicking, but for now you can check it out for reals at www.whirled.com.</description>
    </item>
    
    <item>
      <title>Euler 033</title>
      <link>http://samskivert.com/blog/2008/02/euler-033/</link>
      <pubDate>Mon, 25 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-033/</guid>
      <description>Problem 033:
object Euler33 extends Application { def equal (ratio :Double, rnum :Int, rdenom :Int) :Boolean = { (rdenom &amp;gt; 0) &amp;amp;&amp;amp; (ratio == rnum/rdenom.doubleValue()); } val fracs = for { denom &amp;lt;- List.range(10,100) num &amp;lt;- List.range(10,denom) if ((num%10 == denom/10 &amp;amp;&amp;amp; equal(num/denom.doubleValue(), num/10, denom%10)) || (num/10 == denom%10 &amp;amp;&amp;amp; equal(num/denom.doubleValue(), num%10, denom/10))) } yield Pair(num, denom); val prod = fracs.foldRight(Pair(1,1))((b, a) =&amp;gt; (Pair(b._1 * a._1, b._2 * a._2))); println(prod._2 / prod.</description>
    </item>
    
    <item>
      <title>Euler 034</title>
      <link>http://samskivert.com/blog/2008/02/euler-034/</link>
      <pubDate>Mon, 25 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-034/</guid>
      <description>Problem 034:
object Euler34 extends Application { val facts = Array(1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880); def digfact (sum :Int, n :Int) :Int = if (n == 0) sum else digfact(facts(n % 10) + sum, n/10); def check (sum :Int, n :Int) :Int = if (n == 2000000) sum; else if (digfact(0, n) == n) check(sum+n, n+1); else check(sum, n+1); println(check(0, 10)); } Since we&amp;rsquo;re only computing factorial for single digit numbers, we pre-compute the values of 0 through 9 factorial and then breeze up through the positive integers accumulating all numbers that meet our criterion.</description>
    </item>
    
    <item>
      <title>Euler 035</title>
      <link>http://samskivert.com/blog/2008/02/euler-035/</link>
      <pubDate>Mon, 25 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-035/</guid>
      <description>Problem 035:
object Euler35 extends EulerApp { val primes = genprimes(1000000); def digits (value :Int) :Int = if (value == 0) 0 else 1 + digits(value/10); def rotate (value :Int, turns :Int) :Int = { val mod = Math.pow(10, digits(value)-turns).intValue() (value % mod) * Math.pow(10, turns).intValue() + (value / mod) } def circprime (n :Int) :Boolean = { List.range(0, digits(n)).foldRight(true)((t, b) =&amp;gt; (b &amp;amp;&amp;amp; (primes(rotate(n, t)) != 0))) } println(primes.filter(0.!=).filter(circprime).length); } Coming up with rotate() was fun and the rest was pretty straightforward.</description>
    </item>
    
    <item>
      <title>Euler 036</title>
      <link>http://samskivert.com/blog/2008/02/euler-036/</link>
      <pubDate>Mon, 25 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-036/</guid>
      <description>Problem 036:
object Euler36 extends Application { def ispal (n :String) = n.reverse.sameElements(n) def bothpal (n :Int) = ispal(n.toString) &amp;amp;&amp;amp; ispal(n.toBinaryString) println(List.range(1, 1000000, 2).filter(bothpal).foldRight(0)(_+_)); } Brief, readable and reasonably efficient, yay for Scala. The only cleverness here is to realize that binary palindromes must be odd.</description>
    </item>
    
    <item>
      <title>Euler 037</title>
      <link>http://samskivert.com/blog/2008/02/euler-037/</link>
      <pubDate>Mon, 25 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-037/</guid>
      <description>Problem 037:
object Euler37 extends EulerApp { val primes = genprimes(1000000); def isrtrunc (prime :Int) :Boolean = (prime == 0) || ((primes(prime) != 0) &amp;amp;&amp;amp; isrtrunc(prime/10)); def isltrunc (prime :String) :Boolean = prime.isEmpty || ((primes(prime.toInt) != 0) &amp;amp;&amp;amp; isltrunc(prime.substring(1))); def istrunc (prime :Int) = isrtrunc(prime) &amp;amp;&amp;amp; isltrunc(prime.toString) println(primes.drop(10).filter(0.!=).filter(istrunc).foldRight(0)(_+_)); } I cheated a little and turned the integer into a string in order to easily truncate it from the left, it would perhaps have been more elegant to take the value modulo 10digits-1 but the code would have been longer and I feel an irrational desire for brevity in these solutions.</description>
    </item>
    
    <item>
      <title>Euler 038</title>
      <link>http://samskivert.com/blog/2008/02/euler-038/</link>
      <pubDate>Mon, 25 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-038/</guid>
      <description>Problem 038:
object Euler38 extends Application { def ispan (n :String) = n.toList.sort(_&amp;lt;_).mkString == &amp;#34;123456789&amp;#34;; def catprod (n :Int, r :Int) = List.range(1, r+1).flatMap(p =&amp;gt; (n*p).toString.toList) def find (n :Int, r :Int, max :Int) :Int = { val cp = catprod(n, r); if (cp.length &amp;gt; 9) if (r == 2) max else find(n, r-1, max); else if (ispan(cp)) find(n+1, r, Math.max(cp.mkString.toInt, max)) else find(n+1, r, max); } println(find(1, 5, 0)); } I wrote the above general solution which computes the concatenated product with (1, 2, 3, 4, 5) for increasing values of n until the product exceeds 9 digits, then moves down to (1, 2, 3, 4) and so on.</description>
    </item>
    
    <item>
      <title>Euler 028</title>
      <link>http://samskivert.com/blog/2008/02/euler-028/</link>
      <pubDate>Sat, 23 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-028/</guid>
      <description>Problem 028:
object Euler28 extends Application { def spiral (size :Int) :Int = { if (size == 1) return 1; val smaller = size-2; spiral(smaller) + 4*(smaller*smaller) + (1+2+3+4)*(smaller+1); } println(spiral(1001)); } This is a slightly brevified version of my original solution which is a bit clearer:
val smaller = size-2; val start = smaller*smaller; val step = smaller+1; return spiral(smaller) + ((start + 1*step) + (start + 2*step) + (start + 3*step) + (start + 4*step)); Looking at the grid:</description>
    </item>
    
    <item>
      <title>Euler 029</title>
      <link>http://samskivert.com/blog/2008/02/euler-029/</link>
      <pubDate>Sat, 23 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-029/</guid>
      <description>Problem 029:
object Euler29 extends Application { println((for { a &amp;lt;- List.range(2, 101) b &amp;lt;- List.range(2, 101) } yield BigInt(a).pow(b)).removeDuplicates.length); } This one&amp;rsquo;s pretty easy thanks to BigInt.</description>
    </item>
    
    <item>
      <title>Euler 030</title>
      <link>http://samskivert.com/blog/2008/02/euler-030/</link>
      <pubDate>Sat, 23 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-030/</guid>
      <description>Problem 030:
object Euler30 extends Application { def digits (n :Int) = n.toString.toList.map(c =&amp;gt; c - &amp;#39;0&amp;#39;); def issum5 (n :Int) = digits(n).map(a =&amp;gt; Math.pow(a, 5).intValue()).foldRight(0)(_+_) == n; println(List.range(2, 200000).filter(issum5).foldRight(0)(_+_)); } A decent balance of compactness and readability, IMHO. I would like to do away with the 200,000 upper limit which I came to via some preparatory noodling.</description>
    </item>
    
    <item>
      <title>Euler 031</title>
      <link>http://samskivert.com/blog/2008/02/euler-031/</link>
      <pubDate>Sat, 23 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-031/</guid>
      <description>Problem 031:
object Euler31 extends Application { def perms (remain :Int, coins :List[Int]) :Int = { if (remain == 0) return 1; else if (coins == Nil) return 0; else List.range(0, remain/coins.head+1).map( q =&amp;gt; perms(remain - q*coins.head, coins.tail)).foldRight(0)(_+_); } println(perms(200, List(200, 100, 50, 20, 10, 5, 2, 1))); } Nothing too fancy here, just enumerate all legal quantities of the first coin in the list (including zero), then recurse with that coin removed from the list and its value times the number chosen removed from the sum.</description>
    </item>
    
    <item>
      <title>Euler 032</title>
      <link>http://samskivert.com/blog/2008/02/euler-032/</link>
      <pubDate>Sat, 23 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-032/</guid>
      <description>Problem 032:
object Euler32 extends Application { def digits (n :Int) = n.toString.toList.map(c =&amp;gt; c - &amp;#39;0&amp;#39;); def ispan (a :Int, b :Int, n :Int) :Boolean = (digits(a) ::: digits(n) ::: digits(b)).sort(_&amp;lt;_).equals(List.range(1,10)); def haspanfact (n :Int) :Boolean = List.range(2, 100).find((a) =&amp;gt; (n % a == 0 &amp;amp;&amp;amp; ispan(a, n/a, n))) != None; println(List.range(1000, 10000).filter(haspanfact).foldRight(0)(_+_)); } We want a factorization of a four digit number (which will be either two digits times three or one digit times four), so we enumerate all 4 digit numbers from 1000 to 9999, filter them by checking all possible one and two digit divisors first for divisibility and second for pandigitality, then sum the matches.</description>
    </item>
    
    <item>
      <title>Euler 024</title>
      <link>http://samskivert.com/blog/2008/02/euler-024/</link>
      <pubDate>Sun, 03 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-024/</guid>
      <description>Problem 024:
object Euler24 extends Application { def fact (n: Int): Int = if (n == 0) 1 else n * fact(n - 1) def nthperm (target :Int, nums :List[Int]) :String = { if (nums.length == 1) return nums(0).toString; val nfact = fact(nums.length-1) val idx = (target / nfact).intValue; val digit = nums(idx); return digit + nthperm(target - nfact*idx, nums.filter(digit.!=)); } println(nthperm(1000000, List.range(0, 10))); } We know there are 362880 (9!</description>
    </item>
    
    <item>
      <title>Euler 025</title>
      <link>http://samskivert.com/blog/2008/02/euler-025/</link>
      <pubDate>Sun, 03 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-025/</guid>
      <description>Problem 025:
object Euler25 extends Application { var prev2 :BigInt = 1; var prev1 :BigInt = 1; var value :BigInt = prev2 + prev1; var term = 3; while (value.toString.length &amp;lt; 1000) { prev2 = prev1; prev1 = value; value = prev1 + prev2; term += 1; } println(term); } Another unglamorous solution wherein all the hard work is done by BigInt.</description>
    </item>
    
    <item>
      <title>Euler 026</title>
      <link>http://samskivert.com/blog/2008/02/euler-026/</link>
      <pubDate>Sun, 03 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-026/</guid>
      <description>Problem 026:
object Euler26 extends Application { def divcycle (numer :Int, denom :Int, rlist :List[Int]) :Int = { val remain = numer % denom; if (remain == 0) return 0; val ridx = rlist.indexOf(remain); if (ridx &amp;gt;= 0) ridx+1 else divcycle(remain * 10, denom, remain :: rlist); } var cycles = List.range(1, 1000).map(v =&amp;gt; divcycle(1, v, Nil)); println(cycles.indexOf(cycles.foldRight(0)(Math.max))+1); } This one turned out to be easy once I realized that the key was looking at the remainder after each step in the long division process.</description>
    </item>
    
    <item>
      <title>Euler 027</title>
      <link>http://samskivert.com/blog/2008/02/euler-027/</link>
      <pubDate>Sun, 03 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/02/euler-027/</guid>
      <description>Problem 027:
object Euler27 extends EulerApp { val MAX_N = 80; val primes = genprimes(MAX_N*MAX_N + MAX_N*1000 + 1000); def polyprimes (primes :Array[Int], a :Int, b :Int, n :Int) :Int = if (primes(Math.abs(n*n + a*n + b)) == 0) 0 else 1 + polyprimes(primes, a, b, n+1); val polys = for { a &amp;lt;- List.range(-1000, 1000) b &amp;lt;- List.range(-1000, 1000) p &amp;lt;- List(polyprimes(primes, a, b, 0)) if (p &amp;gt; 0) } yield Pair(a * b, p); println(polys.</description>
    </item>
    
    <item>
      <title>Euler 023</title>
      <link>http://samskivert.com/blog/2008/01/euler-023/</link>
      <pubDate>Sat, 19 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-023/</guid>
      <description>Problem 023:
import scala.collection.mutable.Set; object Euler23 extends Application { def sumdiv (x :Int) :Int = (1 :: List.flatten(for { divis &amp;lt;- List.range(2, Math.sqrt(x)+1) if x % divis == 0 } yield List(divis, x / divis).removeDuplicates)).foldLeft(0)(_+_); val max = 28123; val abundant = List.range(1, max+1).filter(a =&amp;gt; (a &amp;lt; sumdiv(a))).toArray; def filter (abund :Array[Int], ints :Set[Int], a :Int, b :Int) :Set[Int] = { ints -= (abund(a) + abund(b)); if (b == abund.length-1) if (a == abund.</description>
    </item>
    
    <item>
      <title>Euler 017</title>
      <link>http://samskivert.com/blog/2008/01/euler-017/</link>
      <pubDate>Fri, 18 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-017/</guid>
      <description>Problem 017:
object Euler17 extends Application { val ones = Array(&amp;#34;&amp;#34;, &amp;#34;one&amp;#34;, &amp;#34;two&amp;#34;, &amp;#34;three&amp;#34;, &amp;#34;four&amp;#34;, &amp;#34;five&amp;#34;, &amp;#34;six&amp;#34;, &amp;#34;seven&amp;#34;, &amp;#34;eight&amp;#34;, &amp;#34;nine&amp;#34;); val tens = Array(&amp;#34;ten&amp;#34;, &amp;#34;twenty&amp;#34;, &amp;#34;thirty&amp;#34;, &amp;#34;forty&amp;#34;, &amp;#34;fifty&amp;#34;, &amp;#34;sixty&amp;#34;, &amp;#34;seventy&amp;#34;, &amp;#34;eighty&amp;#34;, &amp;#34;ninety&amp;#34;); val teens = Array(&amp;#34;ten&amp;#34;, &amp;#34;eleven&amp;#34;, &amp;#34;twelve&amp;#34;, &amp;#34;thirteen&amp;#34;, &amp;#34;fourteen&amp;#34;, &amp;#34;fifteen&amp;#34;, &amp;#34;sixteen&amp;#34;, &amp;#34;seventeen&amp;#34;, &amp;#34;eighteen&amp;#34;, &amp;#34;nineteen&amp;#34;); def speak (number :Int) :String = { if (number &amp;gt;= 1000) { return &amp;#34;onethousand&amp;#34;; } else if (number &amp;gt;= 100) { if (number % 100 == 0) { return speak(number/100) + &amp;#34;hundred&amp;#34;; } else { return speak(number/100) + &amp;#34;hundredand&amp;#34; + speak(number%100); } } else if (number &amp;gt;= 20) { if (number % 10 == 0) { return tens(number/10-1); } else { return tens(number/10-1) + speak(number%10); } } else if (number &amp;gt;= 10) { return teens(number-10); } else { return ones(number); } } println(List.</description>
    </item>
    
    <item>
      <title>Euler 018</title>
      <link>http://samskivert.com/blog/2008/01/euler-018/</link>
      <pubDate>Fri, 18 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-018/</guid>
      <description>Problem 018:
object Euler18 extends Application { val triangle = List( 4, 62, 98, 27, 23, 9, 70, 98, 73, 93, 38, 53, 60, 4, 23, 63, 66, 4, 68, 89, 53, 67, 30, 73, 16, 69, 87, 40, 31, 91, 71, 52, 38, 17, 14, 91, 43, 58, 50, 27, 29, 48, 70, 11, 33, 28, 77, 73, 17, 78, 39, 68, 17, 57, 53, 71, 44, 65, 25, 43, 91, 52, 97, 51, 14, 41, 48, 72, 33, 47, 32, 37, 16, 94, 29, 41, 41, 26, 56, 83, 40, 80, 70, 33, 99, 65, 4, 28, 6, 16, 70, 92, 88, 2, 77, 73, 7, 63, 67, 19, 1, 23, 75, 3, 34, 20, 4, 82, 47, 65, 18, 35, 87, 10, 17, 47, 82, 95, 64, 75 ); def fold (triangle :List[Int], max :List[Int]) :Int = { if (max.</description>
    </item>
    
    <item>
      <title>Euler 019</title>
      <link>http://samskivert.com/blog/2008/01/euler-019/</link>
      <pubDate>Fri, 18 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-019/</guid>
      <description>Problem 019:
object Euler19 extends Application { def norm (days :Int) :Function1[Int,Int] = ((year :Int) =&amp;gt; (days)); def leap (days :Int) :Function1[Int,Int] = ((year :Int) =&amp;gt; { if ((year % 4 == 0) &amp;amp;&amp;amp; (year % 100 != 0 || year % 400 == 0)) days+1; else days; }); val length = Array(norm(31), leap(28), norm(31), norm(30), norm(31), norm(30), norm(31), norm(31), norm(30), norm(31), norm(30), norm(31)); println((for (year &amp;lt;- List.range(1900, 2001); month &amp;lt;- List.</description>
    </item>
    
    <item>
      <title>Euler 020</title>
      <link>http://samskivert.com/blog/2008/01/euler-020/</link>
      <pubDate>Fri, 18 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-020/</guid>
      <description>Problem 020:
object Euler20 extends Application { def fact (n: BigInt): BigInt = if (n == 0) 1 else n * fact(n - 1) println(fact(100).toString().foldRight(0)((a, b) =&amp;gt; (b + (a - &amp;#39;0&amp;#39;)))); } Another one where BigInt does all the heavy lifting.</description>
    </item>
    
    <item>
      <title>Euler 021</title>
      <link>http://samskivert.com/blog/2008/01/euler-021/</link>
      <pubDate>Fri, 18 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-021/</guid>
      <description>Problem 021:
object Euler21 extends Application { def sumdiv (n :Int) = List.range(1, n/2+1).filter(div =&amp;gt; n % div == 0).foldLeft(0)(_+_) println(List.range(1, 10000).filter(n =&amp;gt; { val sdn = sumdiv(n); (n == sumdiv(sdn) &amp;amp;&amp;amp; n != sdn &amp;amp;&amp;amp; sdn &amp;lt; 10000) }).foldLeft(0)(_+_)); } This one is almost readable — if you&amp;rsquo;ve been staring at a lot of Scala recently. It also uses a less efficient method for computing divisors because it fits on one line.</description>
    </item>
    
    <item>
      <title>Euler 022</title>
      <link>http://samskivert.com/blog/2008/01/euler-022/</link>
      <pubDate>Fri, 18 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-022/</guid>
      <description>Problem 022:
import scala.io.Source; object Euler22 extends Application { def trim (name :String) = name.slice(1, name.length-1); val names = Source.fromFile(&amp;#34;names.txt&amp;#34;).getLine(0).split(&amp;#39;,&amp;#39;).map(trim).toList.sort(_&amp;lt;_); def score (name :String) = name.foldLeft(0)((s, l) =&amp;gt; (s + (l - &amp;#39;A&amp;#39; + 1))) println(List.range(0, names.length).map(i =&amp;gt; ((i+1) * score(names(i)))).foldLeft(0)(_+_)); } Another reasonably legible solution. I resisted the urge to do it all in a single expression.
I can see how language designers might succumb to the urge to expose a loop counter in their iteration functions because it would be nice to do:</description>
    </item>
    
    <item>
      <title>Euler 015</title>
      <link>http://samskivert.com/blog/2008/01/euler015/</link>
      <pubDate>Thu, 17 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler015/</guid>
      <description>Problem 015:
object Euler15 extends Application { val size = 20; def fact (n: BigInt): BigInt = if (n == 0) 1 else n * fact(n - 1) println(fact(size * 2) / (fact(size) * fact(size))) } I first started thinking about this as a caching problem, having just finished problem 14 which was reduced to a reasonable runtime by caching. At any coordinate in the grid, there are some number of unique paths from that position to the destination, so one could start in the bottom right and traverse the graph breadth first from the end to the start, caching the number of paths at each intersection and using that to efficiently compute the number of paths as you made your way to the start.</description>
    </item>
    
    <item>
      <title>Euler 016</title>
      <link>http://samskivert.com/blog/2008/01/euler016/</link>
      <pubDate>Thu, 17 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler016/</guid>
      <description>Problem 016:
object Euler16 extends Application { println(BigInt(2).pow(1000).toString().foldRight(0) {(a, b) =&amp;gt; (b + (a - &amp;#39;0&amp;#39;))}); } This one almost seemed like cheating, since BigInt takes care of all the hard work for me.</description>
    </item>
    
    <item>
      <title>Euler 013</title>
      <link>http://samskivert.com/blog/2008/01/euler-013/</link>
      <pubDate>Wed, 16 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-013/</guid>
      <description>Problem 013:
object Euler13 extends Application { val data = List(&amp;#34;37107287533902102798797998220837590246510135740250&amp;#34;, &amp;#34;46376937677490009712648124896970078050417018260538&amp;#34;, &amp;#34;74324986199524741059474233309513058123726617309629&amp;#34;, &amp;#34;91942213363574161572522430563301811072406154908250&amp;#34;, &amp;#34;23067588207539346171171980310421047513778063246676&amp;#34;, &amp;#34;89261670696623633820136378418383684178734361726757&amp;#34;, &amp;#34;28112879812849979408065481931592621691275889832738&amp;#34;, &amp;#34;44274228917432520321923589422876796487670272189318&amp;#34;, &amp;#34;47451445736001306439091167216856844588711603153276&amp;#34;, &amp;#34;70386486105843025439939619828917593665686757934951&amp;#34;, &amp;#34;62176457141856560629502157223196586755079324193331&amp;#34;, &amp;#34;64906352462741904929101432445813822663347944758178&amp;#34;, &amp;#34;92575867718337217661963751590579239728245598838407&amp;#34;, &amp;#34;58203565325359399008402633568948830189458628227828&amp;#34;, &amp;#34;80181199384826282014278194139940567587151170094390&amp;#34;, &amp;#34;35398664372827112653829987240784473053190104293586&amp;#34;, &amp;#34;86515506006295864861532075273371959191420517255829&amp;#34;, &amp;#34;71693888707715466499115593487603532921714970056938&amp;#34;, &amp;#34;54370070576826684624621495650076471787294438377604&amp;#34;, &amp;#34;53282654108756828443191190634694037855217779295145&amp;#34;, &amp;#34;36123272525000296071075082563815656710885258350721&amp;#34;, &amp;#34;45876576172410976447339110607218265236877223636045&amp;#34;, &amp;#34;17423706905851860660448207621209813287860733969412&amp;#34;, &amp;#34;81142660418086830619328460811191061556940512689692&amp;#34;, &amp;#34;51934325451728388641918047049293215058642563049483&amp;#34;, &amp;#34;62467221648435076201727918039944693004732956340691&amp;#34;, &amp;#34;15732444386908125794514089057706229429197107928209&amp;#34;, &amp;#34;55037687525678773091862540744969844508330393682126&amp;#34;, &amp;#34;18336384825330154686196124348767681297534375946515&amp;#34;, &amp;#34;80386287592878490201521685554828717201219257766954&amp;#34;, &amp;#34;78182833757993103614740356856449095527097864797581&amp;#34;, &amp;#34;16726320100436897842553539920931837441497806860984&amp;#34;, &amp;#34;48403098129077791799088218795327364475675590848030&amp;#34;, &amp;#34;87086987551392711854517078544161852424320693150332&amp;#34;, &amp;#34;59959406895756536782107074926966537676326235447210&amp;#34;, &amp;#34;69793950679652694742597709739166693763042633987085&amp;#34;, &amp;#34;41052684708299085211399427365734116182760315001271&amp;#34;, &amp;#34;65378607361501080857009149939512557028198746004375&amp;#34;, &amp;#34;35829035317434717326932123578154982629742552737307&amp;#34;, &amp;#34;94953759765105305946966067683156574377167401875275&amp;#34;, &amp;#34;88902802571733229619176668713819931811048770190271&amp;#34;, &amp;#34;25267680276078003013678680992525463401061632866526&amp;#34;, &amp;#34;36270218540497705585629946580636237993140746255962&amp;#34;, &amp;#34;24074486908231174977792365466257246923322810917141&amp;#34;, &amp;#34;91430288197103288597806669760892938638285025333403&amp;#34;, &amp;#34;34413065578016127815921815005561868836468420090470&amp;#34;, &amp;#34;23053081172816430487623791969842487255036638784583&amp;#34;, &amp;#34;11487696932154902810424020138335124462181441773470&amp;#34;, &amp;#34;63783299490636259666498587618221225225512486764533&amp;#34;, &amp;#34;67720186971698544312419572409913959008952310058822&amp;#34;, &amp;#34;95548255300263520781532296796249481641953868218774&amp;#34;, &amp;#34;76085327132285723110424803456124867697064507995236&amp;#34;, &amp;#34;37774242535411291684276865538926205024910326572967&amp;#34;, &amp;#34;23701913275725675285653248258265463092207058596522&amp;#34;, &amp;#34;29798860272258331913126375147341994889534765745501&amp;#34;, &amp;#34;18495701454879288984856827726077713721403798879715&amp;#34;, &amp;#34;38298203783031473527721580348144513491373226651381&amp;#34;, &amp;#34;34829543829199918180278916522431027392251122869539&amp;#34;, &amp;#34;40957953066405232632538044100059654939159879593635&amp;#34;, &amp;#34;29746152185502371307642255121183693803580388584903&amp;#34;, &amp;#34;41698116222072977186158236678424689157993532961922&amp;#34;, &amp;#34;62467957194401269043877107275048102390895523597457&amp;#34;, &amp;#34;23189706772547915061505504953922979530901129967519&amp;#34;, &amp;#34;86188088225875314529584099251203829009407770775672&amp;#34;, &amp;#34;11306739708304724483816533873502340845647058077308&amp;#34;, &amp;#34;82959174767140363198008187129011875491310547126581&amp;#34;, &amp;#34;97623331044818386269515456334926366572897563400500&amp;#34;, &amp;#34;42846280183517070527831839425882145521227251250327&amp;#34;, &amp;#34;55121603546981200581762165212827652751691296897789&amp;#34;, &amp;#34;32238195734329339946437501907836945765883352399886&amp;#34;, &amp;#34;75506164965184775180738168837861091527357929701337&amp;#34;, &amp;#34;62177842752192623401942399639168044983993173312731&amp;#34;, &amp;#34;32924185707147349566916674687634660915035914677504&amp;#34;, &amp;#34;99518671430235219628894890102423325116913619626622&amp;#34;, &amp;#34;73267460800591547471830798392868535206946944540724&amp;#34;, &amp;#34;76841822524674417161514036427982273348055556214818&amp;#34;, &amp;#34;97142617910342598647204516893989422179826088076852&amp;#34;, &amp;#34;87783646182799346313767754307809363333018982642090&amp;#34;, &amp;#34;10848802521674670883215120185883543223812876952786&amp;#34;, &amp;#34;71329612474782464538636993009049310363619763878039&amp;#34;, &amp;#34;62184073572399794223406235393808339651327408011116&amp;#34;, &amp;#34;66627891981488087797941876876144230030984490851411&amp;#34;, &amp;#34;60661826293682836764744779239180335110989069790714&amp;#34;, &amp;#34;85786944089552990653640447425576083659976645795096&amp;#34;, &amp;#34;66024396409905389607120198219976047599490197230297&amp;#34;, &amp;#34;64913982680032973156037120041377903785566085089252&amp;#34;, &amp;#34;16730939319872750275468906903707539413042652315011&amp;#34;, &amp;#34;94809377245048795150954100921645863754710598436791&amp;#34;, &amp;#34;78639167021187492431995700641917969777599028300699&amp;#34;, &amp;#34;15368713711936614952811305876380278410754449733078&amp;#34;, &amp;#34;40789923115535562561142322423255033685442488917353&amp;#34;, &amp;#34;44889911501440648020369068063960672322193204149535&amp;#34;, &amp;#34;41503128880339536053299340368006977710650566631954&amp;#34;, &amp;#34;81234880673210146739058568557934581403627822703280&amp;#34;, &amp;#34;82616570773948327592232845941706525094512325230608&amp;#34;, &amp;#34;22918802058777319719839450180888072429661980811197&amp;#34;, &amp;#34;77158542502016545090413245809786882778948721859617&amp;#34;, &amp;#34;72107838435069186155435662884062257473692284509516&amp;#34;, &amp;#34;20849603980134001723930671666823555245252804609722&amp;#34;, &amp;#34;53503534226472524250874054075591789781264330331690&amp;#34;); def toList (number :String) :List[Int] = { number.</description>
    </item>
    
    <item>
      <title>Euler 014</title>
      <link>http://samskivert.com/blog/2008/01/euler-014/</link>
      <pubDate>Wed, 16 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-014/</guid>
      <description>Problem 014:
import scala.collection.mutable.Map; object Euler14 extends Application { var seen :Map[Long,Int] = Map(); def iterate (value :Long) :Int = { val seenlen :Option[Int] = seen.get(value); if (seenlen != None) { return seenlen.get; } else if (value == 1) { return 1; } else if (value % 2 == 0) { val newlen = iterate(value/2)+1; seen.put(value, newlen); return newlen; } else { val newlen = iterate(3*value+1)+1; seen.put(value, newlen); return newlen; } } var longest = List.</description>
    </item>
    
    <item>
      <title>Euler 009</title>
      <link>http://samskivert.com/blog/2008/01/euler-009/</link>
      <pubDate>Sat, 12 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-009/</guid>
      <description>Problem 009:
object Euler9 extends Application { for (a &amp;lt;- List.range(1, 1000); b &amp;lt;- List.range(a, 1000); c &amp;lt;- List.range(b, 1000); if (a*a + b*b == c*c &amp;amp;&amp;amp; a+b+c == 1000)) println(a*b*c); } Sequence comprehensions coming in handy here.</description>
    </item>
    
    <item>
      <title>Euler 010</title>
      <link>http://samskivert.com/blog/2008/01/euler-010/</link>
      <pubDate>Sat, 12 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-010/</guid>
      <description>Problem 010:
object Euler10 extends Application { var numbers = List.range(2,1000000).toArray; def sumprimes (idx :Int, sum :Long) :Long = { var prime = numbers(idx); for (midx &amp;lt;- List.range(idx, numbers.length, prime)) { numbers(midx) = 0; } val nidx = numbers.slice(idx, numbers.length).findIndexOf((a) =&amp;gt; (a != 0)); if (nidx == -1) return sum + prime; else return sumprimes(idx + nidx, sum + prime); } println(sumprimes(0, 0)); } This one felt like it could have been solved more concisely given more thought.</description>
    </item>
    
    <item>
      <title>Euler 011</title>
      <link>http://samskivert.com/blog/2008/01/euler-011/</link>
      <pubDate>Sat, 12 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-011/</guid>
      <description>Problem 011:
object Euler11 extends Application { val data = Array( 8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8, 49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0, 81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65, 52, 70, 95, 23, 4, 60, 11, 42, 69, 24, 68, 56, 1, 32, 56, 71, 37, 2, 36, 91, 22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80, 24, 47, 32, 60, 99, 3, 45, 2, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50, 32, 98, 81, 28, 64, 23, 67, 10, 26, 38, 40, 67, 59, 54, 70, 66, 18, 38, 64, 70, 67, 26, 20, 68, 2, 62, 12, 20, 95, 63, 94, 39, 63, 8, 40, 91, 66, 49, 94, 21, 24, 55, 58, 5, 66, 73, 99, 26, 97, 17, 78, 78, 96, 83, 14, 88, 34, 89, 63, 72, 21, 36, 23, 9, 75, 0, 76, 44, 20, 45, 35, 14, 0, 61, 33, 97, 34, 31, 33, 95, 78, 17, 53, 28, 22, 75, 31, 67, 15, 94, 3, 80, 4, 62, 16, 14, 9, 53, 56, 92, 16, 39, 5, 42, 96, 35, 31, 47, 55, 58, 88, 24, 0, 17, 54, 24, 36, 29, 85, 57, 86, 56, 0, 48, 35, 71, 89, 7, 5, 44, 44, 37, 44, 60, 21, 58, 51, 54, 17, 58, 19, 80, 81, 68, 5, 94, 47, 69, 28, 73, 92, 13, 86, 52, 17, 77, 4, 89, 55, 40, 4, 52, 8, 83, 97, 35, 99, 16, 7, 97, 57, 32, 16, 26, 26, 79, 33, 27, 98, 66, 88, 36, 68, 87, 57, 62, 20, 72, 3, 46, 33, 67, 46, 55, 12, 32, 63, 93, 53, 69, 4, 42, 16, 73, 38, 25, 39, 11, 24, 94, 72, 18, 8, 46, 29, 32, 40, 62, 76, 36, 20, 69, 36, 41, 72, 30, 23, 88, 34, 62, 99, 69, 82, 67, 59, 85, 74, 4, 36, 16, 20, 73, 35, 29, 78, 31, 90, 1, 74, 31, 49, 71, 48, 86, 81, 16, 23, 57, 5, 54, 1, 70, 54, 71, 83, 51, 54, 69, 16, 92, 33, 48, 61, 43, 52, 1, 89, 19, 67, 48); val side = Math.</description>
    </item>
    
    <item>
      <title>Euler 012</title>
      <link>http://samskivert.com/blog/2008/01/euler-012/</link>
      <pubDate>Sat, 12 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-012/</guid>
      <description>Problem 012:
object Euler12 extends Application { def findnum (i :Int, x :Int) :Int = { var divs = List.flatten(for { div &amp;lt;- List.range(1, Math.sqrt(x)+1) if x % div == 0 } yield List(div, x / div).removeDuplicates); if (divs.length &amp;gt; 500) return x; else return findnum(i+1, x+i); } println(findnum(1, 0)); } Pretty straightforward, just compute the triangle numbers incrementally and stop when we find one with over 500 divisors.</description>
    </item>
    
    <item>
      <title>Euler 001</title>
      <link>http://samskivert.com/blog/2008/01/euler-001/</link>
      <pubDate>Wed, 09 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-001/</guid>
      <description>I&amp;rsquo;ve been doing the Project Euler problems in Scala both because they&amp;rsquo;re fun and as an excuse to play more with Scala and to remind myself of how much fun it is to write functional programs.
I figured it would be fun to post my solutions, inelegant as they may be. Anyone also doing the problems will have to avert their eyes if they see a solution to a problem they&amp;rsquo;ve not yet solved.</description>
    </item>
    
    <item>
      <title>Euler 002</title>
      <link>http://samskivert.com/blog/2008/01/euler-002/</link>
      <pubDate>Wed, 09 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-002/</guid>
      <description>Problem 002:
object Euler2 extends Application { def fibby (a :Int, b :Int) :Int = { val next = a + b; return (if (b % 2 == 0) b else 0) + (if (next &amp;gt; 1000000) 0 else fibby(b, next)); } println(fibby(1, 2)); } </description>
    </item>
    
    <item>
      <title>Euler 003</title>
      <link>http://samskivert.com/blog/2008/01/euler-003/</link>
      <pubDate>Wed, 09 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-003/</guid>
      <description>Problem 003:
object Euler3 extends Application { def lpf (divis :Long, divid :Long) :Long = { if (divid % divis == 0) lpf(2, divid/divis) else if (divis &amp;gt; Math.sqrt(divid)) divid else lpf(divis+1, divid) } println(lpf(2l, 317584931803l)); } </description>
    </item>
    
    <item>
      <title>Euler 004</title>
      <link>http://samskivert.com/blog/2008/01/euler-004/</link>
      <pubDate>Wed, 09 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-004/</guid>
      <description>Problem 004:
object Euler4 extends Application { def palindrome (value :String) :Boolean = { val half :Int = value.length()/2; return value.substring(0, half) == value.substring(half).reverse.mkString(&amp;#34;&amp;#34;,&amp;#34;&amp;#34;,&amp;#34;&amp;#34;); } var palindromes :List[Int] = for { a &amp;lt;- List.range(100, 999) b &amp;lt;- List.range(100, 999) if palindrome(String.valueOf(a * b)) } yield a*b; println(palindromes.sort((a, b) =&amp;gt; a&amp;lt;b )); } </description>
    </item>
    
    <item>
      <title>Euler 005</title>
      <link>http://samskivert.com/blog/2008/01/euler-005/</link>
      <pubDate>Wed, 09 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-005/</guid>
      <description>Problem 005:
object Euler5 extends Application { val divisors = List(20, 19, 18, 17, 16, 15, 14, 13, 12, 11); def check (value :Int) :Int = { if (divisors.exists((a) =&amp;gt; (value % a != 0))) return check(20+value) else return value } println(check(20)); } Interestingly the tail recursive version above runs in ~1500ms whereas this iterative version takes ~37000ms:
object Euler5 extends Application { val divisors = List(20, 19, 18, 17, 16, 15, 14, 13, 12, 11); def notDivisible (value :Int) :Boolean = { return divisors.</description>
    </item>
    
    <item>
      <title>Euler 006</title>
      <link>http://samskivert.com/blog/2008/01/euler-006/</link>
      <pubDate>Wed, 09 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-006/</guid>
      <description>Problem 006:
object Euler6 extends Application { val first100sum = List.range(1,101).foldLeft(0)(_+_); val first100sumsq = List.range(1,101).foldLeft(0)((b, a) =&amp;gt; (b + a*a)); println(first100sum * first100sum - first100sumsq); } </description>
    </item>
    
    <item>
      <title>Euler 007</title>
      <link>http://samskivert.com/blog/2008/01/euler-007/</link>
      <pubDate>Wed, 09 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-007/</guid>
      <description>Problem 007:
object Euler7 extends Application { var numbers = List.range(2,110000); var primes = List(2); while (primes.length &amp;lt; 10001) { val prime = primes.head; numbers = numbers.filter((b) =&amp;gt; (b%prime != 0)); primes = numbers.head :: primes; } println(primes.head); } My numbering system encouraged the incorporation of a certain British Secret Service Agent into my solution, but imagination failed me.</description>
    </item>
    
    <item>
      <title>Euler 008</title>
      <link>http://samskivert.com/blog/2008/01/euler-008/</link>
      <pubDate>Wed, 09 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2008/01/euler-008/</guid>
      <description>Problem 008:
object Euler8 extends Application { val number = (&amp;#34;73167176531330624919225119674426574742355349194934&amp;#34; + &amp;#34;96983520312774506326239578318016984801869478851843&amp;#34; + &amp;#34;85861560789112949495459501737958331952853208805511&amp;#34; + &amp;#34;12540698747158523863050715693290963295227443043557&amp;#34; + &amp;#34;66896648950445244523161731856403098711121722383113&amp;#34; + &amp;#34;62229893423380308135336276614282806444486645238749&amp;#34; + &amp;#34;30358907296290491560440772390713810515859307960866&amp;#34; + &amp;#34;70172427121883998797908792274921901699720888093776&amp;#34; + &amp;#34;65727333001053367881220235421809751254540594752243&amp;#34; + &amp;#34;52584907711670556013604839586446706324415722155397&amp;#34; + &amp;#34;53697817977846174064955149290862569321978468622482&amp;#34; + &amp;#34;83972241375657056057490261407972968652414535100474&amp;#34; + &amp;#34;82166370484403199890008895243450658541227588666881&amp;#34; + &amp;#34;16427171479924442928230863465674813919123162824586&amp;#34; + &amp;#34;17866458359124566529476545682848912883142607690042&amp;#34; + &amp;#34;24219022671055626321111109370544217506941658960408&amp;#34; + &amp;#34;07198403850962455444362981230987879927244284909188&amp;#34; + &amp;#34;84580156166097919133875499200524063689912560717606&amp;#34; + &amp;#34;05886116467109405077541002256983155200055935729725&amp;#34; + &amp;#34;71636269561882670428252483600823257530420752963450&amp;#34;); val WINDOW = 5; def prod5 (offset :Int) :Int = { number.slice(offset, offset+WINDOW).toList.map((c) =&amp;gt; (c - &amp;#39;0&amp;#39;)).foldLeft(1)(_*_) } println(List.range(0, number.length-WINDOW).foldRight(0)((o, g) =&amp;gt; (Math.</description>
    </item>
    
    <item>
      <title>Burning Map</title>
      <link>http://samskivert.com/blog/2007/09/burning-map/</link>
      <pubDate>Mon, 17 Sep 2007 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2007/09/burning-map/</guid>
      <description> My friend Chad sent me an awesome image of Burning Man, so I located myself on the map for all the world to see:

Click the image for larger versions of the image and for the full photo. </description>
    </item>
    
    <item>
      <title>Web Client Development</title>
      <link>http://samskivert.com/blog/2007/09/web-client-development/</link>
      <pubDate>Thu, 06 Sep 2007 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2007/09/web-client-development/</guid>
      <description> I gave a presentation at the Austin Games Conference with Michael Grundvig on the subject of using web technologies to create clients for MMOs and other multiplayer online games. The slides, for interested or insomniac parties, are available in PDF form. </description>
    </item>
    
    <item>
      <title>The Great Rosenfeld</title>
      <link>http://samskivert.com/blog/2007/06/the-great-rosenfeld/</link>
      <pubDate>Sun, 17 Jun 2007 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2007/06/the-great-rosenfeld/</guid>
      <description> I pitched in on a madcap effort to create a film in 48 Hours over this weekend which was absurdly fun, not least because our genre was Superhero, which necessitated running around dressed in ridiculous costumes.
Thanks to the miracle of YouTube, you can see the fruits of our labor:
 
And Hillary took a bunch of awesome pictures along the way. </description>
    </item>
    
    <item>
      <title>Cowboys versus Ninjas versus Whirlpools</title>
      <link>http://samskivert.com/blog/2007/03/cowboys-versus-ninjas-versus-whirlpools/</link>
      <pubDate>Sun, 11 Mar 2007 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2007/03/cowboys-versus-ninjas-versus-whirlpools/</guid>
      <description> Daniel and I gave a talk at the GDC again this year (well, Daniel gave about half a dozen of them, but I don’t share his enthusiasm for public speaking). We divulged the juicy details on OOO’s financial performance, Bang!’s early metrics and gave a demo of our new project Whirled. Have a look at the slides if you go for that sort of thing. </description>
    </item>
    
    <item>
      <title>iConcertCal</title>
      <link>http://samskivert.com/blog/2007/02/iconcertcal/</link>
      <pubDate>Sat, 03 Feb 2007 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2007/02/iconcertcal/</guid>
      <description>This thing is so awesome! It’s a plugin for iTunes (a visualizer) that scans your music library and then looks for upcoming shows by anyone whose music you own. Within seconds of installing it, I found out about four great shows that I would have never thought to look for. I didn’t even have to tell it I was in San Francisco. It magically figured that out from my IP address.</description>
    </item>
    
    <item>
      <title>Shipped It!</title>
      <link>http://samskivert.com/blog/2006/12/shipped-it/</link>
      <pubDate>Wed, 06 Dec 2006 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2006/12/shipped-it/</guid>
      <description>After almost two years of taking enthusiastic liberties with the themes of the Wild West, we’ve finally shipped Bang! Howdy. Since it’s an online game this doesn’t mean something wonderful like we’re done working on it, just that we have to be more careful when we ship new features as a bunch of people will be annoyed if we break anything. But it is nice to be reminded of why it is that we toil long and hard when we see people playing and enjoying the game.</description>
    </item>
    
    <item>
      <title>Scala</title>
      <link>http://samskivert.com/blog/2006/08/scala/</link>
      <pubDate>Sun, 06 Aug 2006 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2006/08/scala/</guid>
      <description>Scala has piqued my interest more than any language to come down the pike in a long time. Type inference makes me cry out with joy, Java-compatibility, sensible mix-in support (made all the more useful by their very sophisticated type system), first-class functions, continuations (mostly), very SML-like type pattern matching, list comprehensions. One could get into some serious trouble with this language.
I was then even more excited when I saw a paper by the language designer describing how he was able to easily implement an elegant stackless threads system as a library using only the functionality provided by the language (and the small compromise of requiring a continuation passing style, but the elegance of the language construct being used makes that hardly noticable).</description>
    </item>
    
    <item>
      <title>Bang! Howdy Pardner</title>
      <link>http://samskivert.com/blog/2006/03/bang-howdy-pardner/</link>
      <pubDate>Sat, 25 Mar 2006 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2006/03/bang-howdy-pardner/</guid>
      <description> I finally put up screenshots on the Bang! Howdy website, ain’t they purdy:

Daniel and I also gave a talk about Bang and Yohoho at the GDC. I’ll get the slides up for that shortly. </description>
    </item>
    
    <item>
      <title>A new way to remap your keys</title>
      <link>http://samskivert.com/blog/2005/07/a-new-way-to-remap-your-keys/</link>
      <pubDate>Fri, 15 Jul 2005 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2005/07/a-new-way-to-remap-your-keys/</guid>
      <description> This keyboard is mind-bogglingly cool. </description>
    </item>
    
    <item>
      <title>Where has the decade gone?</title>
      <link>http://samskivert.com/blog/2005/03/where-has-the-decade-gone/</link>
      <pubDate>Tue, 22 Mar 2005 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2005/03/where-has-the-decade-gone/</guid>
      <description>While making non-narcissistic use of the Wayback Machine, I couldn&amp;#8217;t resist finding out what it had to say about go2net, an Internet company for which I must admittedly take a certain responsibility. They go as far back as December 1996, the proverbial damned long time ago.
How we managed to go from jabbering about a wacky idea in a brew pub in San Diego to fully operational Internet site with five major products in little more than five months still boggles my mind &amp;mdash; though it does lend credence to my bitching about working &amp;#8220;18 hours a day, 7 days a week&amp;#8221;.</description>
    </item>
    
    <item>
      <title>GDC 2005</title>
      <link>http://samskivert.com/blog/2005/03/gdc-2005/</link>
      <pubDate>Sun, 13 Mar 2005 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2005/03/gdc-2005/</guid>
      <description>I surived another GDC. Daniel and I gave a presentation on Puzzle Pirates, the slides for which are available for perusal. There are lots of pretty pictures and graphs in there, but the words alas disappeared into the ether after we spoke them. The Burning Down the House talk was inspiring, but it didn&amp;#8217;t usurp my all-time favorite GDC talk, Professor Moriarty&amp;#8217;s Secret of Psalm 46, given back in 2001.</description>
    </item>
    
    <item>
      <title>Gardening for Fun</title>
      <link>http://samskivert.com/blog/2005/03/gardening-for-fun/</link>
      <pubDate>Sat, 12 Mar 2005 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2005/03/gardening-for-fun/</guid>
      <description>The proverbial side project has emerged to see the light of day: http://www.gamegardens.com/.</description>
    </item>
    
    <item>
      <title>The Centiscopic World</title>
      <link>http://samskivert.com/blog/2005/02/the-centiscopic-world/</link>
      <pubDate>Mon, 07 Feb 2005 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2005/02/the-centiscopic-world/</guid>
      <description>I finally dug out and plugged in this Intel Play microscope that I picked up on a lark a while back. At 200x it&amp;#8217;s damned near impossible to adjust the cheap plastic platform in increments small enough to get good focus and without decent lighting, it&amp;#8217;s hard to get a good image, but it is pretty neat. After looking at the collection of dog hair and honeybee wings they included in the box, I looked around for something else to jam under there.</description>
    </item>
    
    <item>
      <title>Favorite Games of 2004</title>
      <link>http://samskivert.com/blog/2005/01/favorite-games-of-2004/</link>
      <pubDate>Wed, 05 Jan 2005 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2005/01/favorite-games-of-2004/</guid>
      <description>The games I enjoyed playing most this year (in some vague order of enjoyment quotient):
  Pikmin 2 &amp;#8211; GC  Paper Mario &amp;#8211; GC  塊魂 [Katamari Damacy] &amp;#8211; PS2  Sly 2 &amp;#8211; PS2  Hot Shots Golf: Fore! &amp;#8211; PS2  I also played a few wacky indy games that I really enjoyed:
  Samorost &amp;#8211; Flash  Zep&amp;#8217;s Dreamland &amp;#8211; Vinders  N &amp;#8211; Flash   As I generally don&amp;#8217;t review games that I don&amp;#8217;t finish, it may be hard to gauge what I played based on my somewhat sporadic review output.</description>
    </item>
    
    <item>
      <title>I ate the purple berries…</title>
      <link>http://samskivert.com/blog/2004/09/i-ate-the-purple-berries/</link>
      <pubDate>Wed, 08 Sep 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/09/i-ate-the-purple-berries/</guid>
      <description>Yes kids, it was that time of year again, the time when we gather up our craziest costumes, dream up projects with no practical value and spend a week in the desert doing our best to help everyone else have a good time. It&amp;#8217;s a bird, it&amp;#8217;s a plane, it&amp;#8217;s Burning Man!</description>
    </item>
    
    <item>
      <title>People creating interesting works right now</title>
      <link>http://samskivert.com/blog/2004/08/people-creating-interesting-works-right-now/</link>
      <pubDate>Sun, 08 Aug 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/08/people-creating-interesting-works-right-now/</guid>
      <description>I was recently thinking about how the sum total of people in history who had the ability to create works of art that might impact my life compares to the sum total of people alive today that have the ability to create works of art that might impact my life. I think the former is indeed a much smaller group and yet they are so much more well known. Thus I decided that I should do my part to spread the word about people that I think are achieving greatness in this very day and age.</description>
    </item>
    
    <item>
      <title>A soft, rich and beautiful fabric</title>
      <link>http://samskivert.com/blog/2004/08/a-soft-rich-and-beautiful-fabric/</link>
      <pubDate>Wed, 04 Aug 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/08/a-soft-rich-and-beautiful-fabric/</guid>
      <description>There is a huge billboard in Shibuya with a digital display counting down to this inscrutable EXPO thing, the nature of which remained a mystery to me until now.
Leave it to Japan to blow untold quantities of cash on something so touchy feely as giving everyone a &amp;#8220;global perspective&amp;#8221; to work toward solving the environmental problems that have reared their ugly heads during the 20th century. Indeed, more likely the insatiable construction industry in Japan ran out of places to erect new buildings in Tokyo and needed something to satisfy their craving for government funds.</description>
    </item>
    
    <item>
      <title>アボカドの和</title>
      <link>http://samskivert.com/blog/2004/07/%e3%82%a2%e3%83%9c%e3%82%ab%e3%83%89%e3%81%ae%e5%92%8c/</link>
      <pubDate>Tue, 13 Jul 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/07/%e3%82%a2%e3%83%9c%e3%82%ab%e3%83%89%e3%81%ae%e5%92%8c/</guid>
      <description>Through some deeply fortunate happenstance of international shipping, the avocados at my local supermarket arrive daily with a ripeness so sublime as to bring a tear to your eye. My relationship to avocados in their native California was one of frustration. Invariably, I would bring home an inedibly firm specimen and resolve to remember to make use of it during the short window one or two days hence when it would achieve peak deliciosity, only to suffer a bout of culinary neglect that left me scraping the oxidized brown chunks from the edible remains and resolving to strengthen my resolve the next time.</description>
    </item>
    
    <item>
      <title>Random bitching</title>
      <link>http://samskivert.com/blog/2004/07/random-bitching/</link>
      <pubDate>Wed, 07 Jul 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/07/random-bitching/</guid>
      <description>What kind of error message is this?
 [11:20pm] baltic:~  java -jar foo.jar Exception in thread &#34;main&#34; java.util.zip.ZipException: No such file or directory at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.(ZipFile.java:112) at java.util.jar.JarFile.(JarFile.java:127) at java.util.jar.JarFile.(JarFile.java:65)  It doesn&amp;#8217;t even tell me what file or directory is missing. You might think it&amp;#8217;s obvious because I just ran the command, but frequently java is run from a shell script and all I see is this baffling crap about zip files.</description>
    </item>
    
    <item>
      <title>二番目の印</title>
      <link>http://samskivert.com/blog/2004/06/%e4%ba%8c%e7%95%aa%e7%9b%ae%e3%81%ae%e5%8d%b0/</link>
      <pubDate>Sun, 06 Jun 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/06/%e4%ba%8c%e7%95%aa%e7%9b%ae%e3%81%ae%e5%8d%b0/</guid>
      <description>I wish Mark Twain would have studied Japanese so that I could read his keen insights on how it could be made more scrutable to native English speakers.</description>
    </item>
    
    <item>
      <title>Fucking Japanese (Language)</title>
      <link>http://samskivert.com/blog/2004/06/fucking-japanese/</link>
      <pubDate>Wed, 02 Jun 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/06/fucking-japanese/</guid>
      <description>So my friend writes in an email: どうしてかって？ A reasonably innocuous statement, except I&amp;#8217;m not exactly sure which verb かって is. So I consult my trusty dictionary:
 欠く (かく) (v5k) to lack; to break; to crack; to chip; (P);
書く (かく) (v5k) to write; (P);
掻く (かく) (v5k) (1) (uk) to scratch; (2) to perspire; (3) to shovel; to paddle; (P);
描く (かく) (v5k) to draw; to paint; to sketch; to depict; to describe;</description>
    </item>
    
    <item>
      <title>The terrorists have already won the browser wars</title>
      <link>http://samskivert.com/blog/2004/06/the-terrorists-have-already-won-the-browser-wars/</link>
      <pubDate>Wed, 02 Jun 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/06/the-terrorists-have-already-won-the-browser-wars/</guid>
      <description>I ask myself why it&amp;#8217;s not trivially easy for me to share bookmarks between browsers on the same and different machines, why I can&amp;#8217;t even share my remembered password database between various incarnations of Mozilla on the same machine, why my addressbook is a scattered mess of overlapping collections in any number of incompatible formats. How have these basic needs been going unmet for now well over a decade?</description>
    </item>
    
    <item>
      <title>女の太鼓</title>
      <link>http://samskivert.com/blog/2004/05/%e5%a5%b3%e3%81%ae%e5%a4%aa%e9%bc%93/</link>
      <pubDate>Sun, 16 May 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/05/%e5%a5%b3%e3%81%ae%e5%a4%aa%e9%bc%93/</guid>
      <description>We happened upon this all women taiko drumming group at Yoyogi park, maybe as part of some massive celabratory business in Tokyo this weekend called the Sanja Matsuri or maybe they just like to show off their big drum. Regardless of their motives, I was impressed.</description>
    </item>
    
    <item>
      <title>I 愛 Hatsudai</title>
      <link>http://samskivert.com/blog/2004/05/i-hatsudai/</link>
      <pubDate>Sat, 08 May 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/05/i-hatsudai/</guid>
      <description>Have I mentioned how much I love my neighborhood? The kids walking home from school are always blurting out funny things. There are lots of old people sitting around on benches smiling. The station is five minutes away. They are even so kind as to put up banners everywhere expressing my feelings to the world in my native language. What a great place!</description>
    </item>
    
    <item>
      <title>Oh Mom, not temples again!</title>
      <link>http://samskivert.com/blog/2004/05/oh-mom-not-temples-again/</link>
      <pubDate>Wed, 05 May 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/05/oh-mom-not-temples-again/</guid>
      <description>I recently learned how to complain about something in Japanese (お寺なんて、なん回も見に行ったよ), so I thought I&amp;#8217;d celebrate with yet another temple picture. This one being in the middle of Tokyo and thus easy to get to assuming two million Tokyoites aren&amp;#8217;t making the rounds at the time.</description>
    </item>
    
    <item>
      <title>Yaks!</title>
      <link>http://samskivert.com/blog/2004/05/yaks/</link>
      <pubDate>Mon, 03 May 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/05/yaks/</guid>
      <description>This is one of my many new bovine friends from Nepal. The whole story is even available for those of you with too much time on your hands or an uncommonly keen interest in mountain mammals.</description>
    </item>
    
    <item>
      <title>咲きましょう！</title>
      <link>http://samskivert.com/blog/2004/04/%e5%92%b2%e3%81%8d%e3%81%be%e3%81%97%e3%82%87%e3%81%86%ef%bc%81/</link>
      <pubDate>Sat, 03 Apr 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/04/%e5%92%b2%e3%81%8d%e3%81%be%e3%81%97%e3%82%87%e3%81%86%ef%bc%81/</guid>
      <description>My new apartment came with its very own set of sakura and they are simply lovely.
 I&amp;#8217;ll refrain from gushing about how much better my new place is than my old one. Quality of life has vastly improved.</description>
    </item>
    
    <item>
      <title>Cavorting in Kamakura (鎌倉)</title>
      <link>http://samskivert.com/blog/2004/03/cavorting-in-kamakura/</link>
      <pubDate>Sat, 20 Mar 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/03/cavorting-in-kamakura/</guid>
      <description>Another fascinating weekend trip has been photo-documented for your mildly vicarious pleasure. Fate brings us this time to the time worn hamlet on the coast of central Japan that they call Kamakura.</description>
    </item>
    
    <item>
      <title>お酒 anyone?</title>
      <link>http://samskivert.com/blog/2004/02/anyone/</link>
      <pubDate>Sat, 28 Feb 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/02/anyone/</guid>
      <description>I was wandering through Yoyogi park and came upon this massive wall of sake casks. The sign explaining them was filled with 分からない漢字 so I have no idea why it was there, but it looked cool.</description>
    </item>
    
    <item>
      <title>そんな体をカイリのは</title>
      <link>http://samskivert.com/blog/2004/02/%e3%81%9d%e3%82%93%e3%81%aa%e4%bd%93%e3%82%92%e3%82%ab%e3%82%a4%e3%83%aa%e3%81%ae%e3%81%af/</link>
      <pubDate>Fri, 20 Feb 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/02/%e3%81%9d%e3%82%93%e3%81%aa%e4%bd%93%e3%82%92%e3%82%ab%e3%82%a4%e3%83%aa%e3%81%ae%e3%81%af/</guid>
      <description>As my local supermarket is on my way home from school, I actually go there about twice a week &amp;#8212; a vast improvement from my San Francisco schedule which was more like once every two months.
For the last four weeks or so, next to the checkout stands, a little TV has been playing this ad for a new drink. Over, and over, and over again. The ad isn&amp;#8217;t more than twenty seconds long and it&amp;#8217;s a catchy little tune sung while a man with a little frog hat on hops up some stairs.</description>
    </item>
    
    <item>
      <title>Meandering up Mitake-san</title>
      <link>http://samskivert.com/blog/2004/02/meandering-up-mitake-san/</link>
      <pubDate>Thu, 12 Feb 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/02/meandering-up-mitake-san/</guid>
      <description>One of my friends invited me on a little excursion up a mountain not too far outside of Tokyo. Since my mother has been pestering me for pictures of Japan, I&amp;#8217;ll go ahead and share them with the whole class.</description>
    </item>
    
    <item>
      <title>Clever spammers</title>
      <link>http://samskivert.com/blog/2004/02/clever-spammers/</link>
      <pubDate>Mon, 09 Feb 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/02/clever-spammers/</guid>
      <description>I happened to notice there were comments on some of my posts. Rather surprised that anyone I knew would bother to spend words on this solipsistic enterprise, I curiously investigated. I was right in a totally unexpected way. Spammers are apparently now posting to blogs with semantically ambiguous content, presumably in hopes that people will click on the link provided to the &amp;#8220;poster&amp;#8217;s&amp;#8221; home page. They leave no stone unturned.</description>
    </item>
    
    <item>
      <title>Gnomespotting in Ebisu</title>
      <link>http://samskivert.com/blog/2004/02/gnomespotting-in-ebisu/</link>
      <pubDate>Sun, 01 Feb 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/02/gnomespotting-in-ebisu/</guid>
      <description> </description>
    </item>
    
    <item>
      <title>iMac rebranded for Japanese audience</title>
      <link>http://samskivert.com/blog/2004/01/imac-rebranded-for-japanese-audience/</link>
      <pubDate>Wed, 21 Jan 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/01/imac-rebranded-for-japanese-audience/</guid>
      <description> </description>
    </item>
    
    <item>
      <title>Fratricide!</title>
      <link>http://samskivert.com/blog/2004/01/fratricide/</link>
      <pubDate>Sat, 17 Jan 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/01/fratricide/</guid>
      <description>Cute as he may be, the little chicken mascot on my Nissin ramen package seems to be making dastardly work of his unborn little brother. He does look pretty happy about the whole business. Perhaps he&amp;#8217;s relieved that he won&amp;#8217;t have to vie for mommy&amp;#8217;s attention.
Unrelatedly, it snowed today! I haven&amp;#8217;t been sprinkled with those falling flakes in a mighty long time. Alas it&amp;#8217;s unlikely that I&amp;#8217;ll be dreaming of a white Tokyo.</description>
    </item>
    
    <item>
      <title>ヨガ</title>
      <link>http://samskivert.com/blog/2004/01/%e3%83%a8%e3%82%ac/</link>
      <pubDate>Sat, 17 Jan 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/01/%e3%83%a8%e3%82%ac/</guid>
      <description>I went to my first yoga class today. How fascinating it was to reverse engineer the instructor&amp;#8217;s running commentary from only a knowledge of the grammatical structure and the things we were supposed to be doing with our bodies. I learned so many new nouns and verbs! I did get a little lost when he started talking about India and energy flow but at least I now know how tell people to bring their gaze to their nose in Japanese.</description>
    </item>
    
    <item>
      <title>Zoom zip!</title>
      <link>http://samskivert.com/blog/2004/01/zoom-zip/</link>
      <pubDate>Fri, 16 Jan 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/01/zoom-zip/</guid>
      <description>I&amp;#8217;m not sure how things are elsewhere in Asia, but in Japan, people ride their bikes on the sidewalks at very high speeds. Not a day passes when I don&amp;#8217;t have a near-fatal collision with a speeding bicyclist on my way to class. The sidewalks are crowded with people, mind you. I have a hard enough time not bumping into other pedestrians without the zooming chariots of death screaming by periodically.</description>
    </item>
    
    <item>
      <title>Flippy flippy</title>
      <link>http://samskivert.com/blog/2004/01/flippy-flippy/</link>
      <pubDate>Sun, 11 Jan 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/01/flippy-flippy/</guid>
      <description>Nearly every store clerk from whom I&amp;#8217;ve had the pleasure of receiving change in bills has done this really cool flippy thing where they swing the bills around with their pinky and snap them one by one in a very blatant counting process. It&amp;#8217;s like Vegas!
I&amp;#8217;ll have to find out if that&amp;#8217;s part of the job training or if it&amp;#8217;s just something one learns in the wily course of adolescence.</description>
    </item>
    
    <item>
      <title>ゴジラxモスラxメカゴジラ 東京SOS</title>
      <link>http://samskivert.com/blog/2004/01/xx-sos/</link>
      <pubDate>Sat, 10 Jan 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/01/xx-sos/</guid>
      <description>You might think that campy, low-tech special effect having Godzilla movies were relegated to the land of cult following. But you&amp;#8217;d be wrong. Second only to Finding Nemo in screen count is this cinematic masterpiece: Godzilla vs. Mothra vs. Mecha-Godzilla: Tokyo S.O.S.
I bet my meager Japanese skills won&amp;#8217;t even stand in the way of my enjoyment of this film. La langue du cin&amp;#233;ma est universelle.</description>
    </item>
    
    <item>
      <title>Savage Beasts!</title>
      <link>http://samskivert.com/blog/2004/01/savage-beasts/</link>
      <pubDate>Mon, 05 Jan 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/01/savage-beasts/</guid>
      <description>In perusing the text of my new lease, I couldn&amp;#8217;t help but dwell on this particular subsection:
3. When using Object, Borrower must not do what are written below.
  To produce or possess firearms, swords, explosive or ignitable substances.  To bring in or fix up heavy and large equipment such as a large-scaled safe.  To use TV, stereo set and other appliances at full blast and to play the instrument such as piano.</description>
    </item>
    
    <item>
      <title>Automatic!</title>
      <link>http://samskivert.com/blog/2004/01/automatic/</link>
      <pubDate>Sun, 04 Jan 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/01/automatic/</guid>
      <description>There&amp;#8217;s simply a lot more automation going on in this country. Automatic doors abound. My toilet activates some sort of fan when I close the lid, but only if I&amp;#8217;ve actually used it. It can tell. Even the little clock built into the bed in my hotel room detects when there&amp;#8217;s been no motion in the room and dims its LCD display so as to provide a more soothing sleeping environment.</description>
    </item>
    
    <item>
      <title>Joining the club</title>
      <link>http://samskivert.com/blog/2004/01/joining-the-club/</link>
      <pubDate>Thu, 01 Jan 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/01/joining-the-club/</guid>
      <description>I can&amp;#8217;t say that I have a strong feeling about blogs one way or the other. I had a short lived fling with LiveJournal, but we parted ways amicably many months back as I was feeling guilty for being so neglectful.
Given the arrival of the New Year and my own arrival in Tokyo just two days past, I figured it was time to rekindle the flame with self-indulgence, lacking style and banal commentary.</description>
    </item>
    
    <item>
      <title>Tokyo NYE</title>
      <link>http://samskivert.com/blog/2004/01/tokyo-nye/</link>
      <pubDate>Thu, 01 Jan 2004 00:00:00 +0000</pubDate>
      
      <guid>http://samskivert.com/blog/2004/01/tokyo-nye/</guid>
      <description>Having arrived in Tokyo but 36 hours before year&amp;#8217;s end, I felt something of a sense of urgency with regard to my New Year&amp;#8217;s Eve plans. Forunately, the Tokyo club scene is even better documented (via the Internet) than San Francisco.
A few minute&amp;#8217;s perusal turned up the Jungle Calendar and a promising party in my vicinity at a club called Aoyama Hachi. Another couple of hours of research left me with a vastly better grasp on the nightlife resources at my disposal, but with nary a better alternative than my first lucky find.</description>
    </item>
    
  </channel>
</rss>
