recover a few more stragglers

This commit is contained in:
Sami Samhuri 2011-12-11 02:23:55 -08:00
parent 70e985886c
commit a52beb54f8
41 changed files with 10724 additions and 8 deletions

View file

@ -0,0 +1,81 @@
diff -Nupr mephisto_converters/lib/converters/typo/article.rb mephisto_converters-schema_61/lib/converters/typo/article.rb
--- mephisto_converters/lib/converters/typo/article.rb 2006-11-23 10:57:06.000000000 -0800
+++ mephisto_converters-schema_61/lib/converters/typo/article.rb 2007-05-26 01:54:19.000000000 -0700
@@ -1,7 +1,8 @@
module Typo
class Article < Content
- has_many :comments, :dependent => true, :order => "created_at ASC", :class_name => 'Typo::Comment'
+ has_many :comments, :dependent => :destroy, :order => "created_at ASC", :class_name => 'Typo::Comment'
has_and_belongs_to_many :tags, :class_name => 'Typo::Tag'
- has_and_belongs_to_many :categories, :class_name => 'Typo::Category'
+ has_many :categorizations, :class_name => 'Typo::Categorization'
+ has_many :categories, :class_name => 'Typo::Category', :through => :categorizations
end
end
diff -Nupr mephisto_converters/lib/converters/typo/categorization.rb mephisto_converters-schema_61/lib/converters/typo/categorization.rb
--- mephisto_converters/lib/converters/typo/categorization.rb 1969-12-31 16:00:00.000000000 -0800
+++ mephisto_converters-schema_61/lib/converters/typo/categorization.rb 2007-05-26 01:44:19.000000000 -0700
@@ -0,0 +1,7 @@
+module Typo
+ class Categorization < ActiveRecord::Base
+ establish_connection configurations['typo']
+ belongs_to :article, :class_name => 'Typo::Article'
+ belongs_to :category, :class_name => 'Typo::Category'
+ end
+end
diff -Nupr mephisto_converters/lib/converters/typo/category.rb mephisto_converters-schema_61/lib/converters/typo/category.rb
--- mephisto_converters/lib/converters/typo/category.rb 2006-11-23 10:57:06.000000000 -0800
+++ mephisto_converters-schema_61/lib/converters/typo/category.rb 2007-05-26 01:42:02.000000000 -0700
@@ -1,6 +1,7 @@
module Typo
class Category < ActiveRecord::Base
establish_connection configurations['typo']
- has_and_belongs_to_many :articles, :class_name => 'Typo::Article'
+ has_many :categorizations, :class_name => 'Typo::Categorization'
+ has_many :articles, :class_name => 'Typo::Article', :through => :categorizations
end
end
diff -Nupr mephisto_converters/lib/converters/typo/comment.rb mephisto_converters-schema_61/lib/converters/typo/comment.rb
--- mephisto_converters/lib/converters/typo/comment.rb 2006-11-23 10:57:06.000000000 -0800
+++ mephisto_converters-schema_61/lib/converters/typo/comment.rb 2007-05-26 01:54:30.000000000 -0700
@@ -1,5 +1,7 @@
module Typo
- class Comment < Content
-# belongs_to :article, :foreign_key => 'parentid', :class_name => 'Typo::Comment'
+ class Comment < Feedback
+ establish_connection configurations['typo']
+ belongs_to :article, :class_name => 'Typo::Article'
+ belongs_to :user, :class_name => 'Typo::User'
end
end
diff -Nupr mephisto_converters/lib/converters/typo/feedback.rb mephisto_converters-schema_61/lib/converters/typo/feedback.rb
--- mephisto_converters/lib/converters/typo/feedback.rb 1969-12-31 16:00:00.000000000 -0800
+++ mephisto_converters-schema_61/lib/converters/typo/feedback.rb 2007-05-26 01:55:28.000000000 -0700
@@ -0,0 +1,6 @@
+module Typo
+ class Feedback < Content
+ set_table_name 'feedback'
+ establish_connection configurations['typo']
+ end
+end
diff -Nupr mephisto_converters/lib/converters/typo.rb mephisto_converters-schema_61/lib/converters/typo.rb
--- mephisto_converters/lib/converters/typo.rb 2006-11-23 10:57:06.000000000 -0800
+++ mephisto_converters-schema_61/lib/converters/typo.rb 2007-05-26 01:53:14.000000000 -0700
@@ -1,8 +1,10 @@
require 'converters/typo/content'
require 'converters/typo/page'
require 'converters/typo/article'
+require 'converters/typo/feedback'
require 'converters/typo/comment'
require 'converters/typo/category'
+require 'converters/typo/categorization'
require 'converters/typo/user'
require 'converters/typo/tag'
@@ -77,4 +79,4 @@ class TypoConverter < BaseConverter
memo << (sections[::Section.permalink_for(cat.name)] || site.sections.create(:name => cat.name)).id
end
end
-end
\ No newline at end of file
+end

BIN
images/ch1-Z-G-4.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

View file

@ -0,0 +1,31 @@
Title: SJ's Rails Bundle 0.2 for TextMate
Date: February 23, 2006
Timestamp: 1140743880
Author: sjs
Tags: textmate, rails, coding, bundle, macros, rails, snippets, textmate
Styles: typocode
----
Everything that you've seen posted on my blog is now available in one bundle. Snippets for Rails database migrations and assertions are all included in this bundle.
There are 2 macros for class-end and def-end blocks, bound to <strong>⌃C</strong> and <strong>⌃D</strong> respectively. Type the class or method definition, except for <code>class</code> or <code>def</code>, and then type the keyboard shortcut and the rest is filled in for you.
I use an underscore to denote the position of the cursor in the following example:
<div class="typocode"><pre><code class="typocode_ruby "><span class="ident">method</span><span class="punct">(</span><span class="ident">arg1</span><span class="punct">,</span> <span class="ident">arg2_</span><span class="punct">)</span></code></pre></div>
Typing <strong>⌃D</strong> at this point results in this code:
<div class="typocode"><pre><code class="typocode_ruby "><span class="keyword">def </span><span class="method">method</span><span class="punct">(</span><span class="ident">arg1</span><span class="punct">,</span> <span class="ident">arg2</span><span class="punct">)</span>
<span class="ident">_</span>
<span class="keyword">end</span></code></pre></div>
There is a list of the snippets in Features.rtf, which is included in the disk image. Of course you can also browse them in the Snippets Editor built into TextMate.
Without further ado, here is the bundle:
<p style="text-align: center;"><img src="/images/blog/download.png" title="Download" alt="Download"> <a href="/f/SJRailsBundle-0.2.dmg">Download SJ's Rails Bundle 0.2</a></p>
This is a work in progress, so any feedback you have is very helpful in making the next release better.

View file

@ -0,0 +1,22 @@
Title: I don't mind FairPlay either
Date: March 3, 2006
Timestamp: 1141451760
Author: sjs
Tags: apple, mac os x, life, drm, fairplay, ipod, itunes
----
I think that <a href="http://jim.roepcke.com/2006/03/02#item7471">Jim is right</a> about Apple's DRM not being all that evil.
I buy music from the iTunes Music Store *because* I bought an iPod. The fact I can't play them on another device doesn't matter to me. With my purchased songs I can:
* listen to the songs I buy all I want
* burn them to CD
* stream them to my amplifier via AirPort Express
I don't buy a ton of music from the iTMS, but I can't tell the difference between any of those songs and the songs I ripped from CDs and they're all mixed in one collection. That's good enough for me.
I dislike DRM as much as the next guy, but like CSS encryption on DVDs, FairPlay is something I can live with.
It reminds me of how here in North America I have to live with the crappy cell phone companies that lock their phones to their networks. If it's something I need or want, sometimes I'll live with restrictions because there are no alternatives yet.
*__Update:__ It's almost settled. The pope <a href="http://www.catholicnews.com/data/stories/cns/0601282.htm">got an iPod</a> so all that's left is to see if he buys any music off of iTunes. If he does, then it can't be evil. heh...*

View file

@ -0,0 +1,10 @@
Title: Spore
Date: March 3, 2006
Timestamp: 1141450980
Author: sjs
Tags: amusement, technology, cool, fun, games
----
<a href="http://video.google.com/videoplay?docid=8372603330420559198&amp;q=spore">This game</a> that <a href="http://jim.roepcke.com/">Jim</a> <a href="http://jim.roepcke.com/2006/03/01#item7470">blogged about</a> is probably the coolest game I've seen.
You really just have to watch the video, I won't bother explaining it here. I don't really play games much, but this I would play.

View file

@ -0,0 +1,8 @@
Title: OS X and Fitt's law
Date: May 7, 2006
Timestamp: 1147059780
Author: sjs
Tags: mac os x, apple, mac, os, usability, x
----
I've realized that OS X really does obey Fitt's law in all 4 corners now. Apple menu in the top left, Spotlight top right, and the bottom 2 are always accessible for drag n drop, unless the dock is hidden. I rarely ever use it because I usually have pretty good chunks of the desktop showing, but it is useful.

View file

@ -0,0 +1,10 @@
Title: WikipediaFS on Linux, in Python
Date: May 7, 2006
Timestamp: 1147060140
Author: sjs
Tags: hacking, python, linux, fuse, linux, mediawiki, python, wikipediafs
----
Till now I've been using my own version of <a href="http://meta.wikimedia.org/wiki/Pywikipedia">pywikipedia</a> for scripting MediaWiki, and it works well. But I read about <a href="http://wikipediafs.sourceforge.net/">WikipediaFS</a> and had to check it out. It's a user space filesystem for Linux that's built using the <a href="http://fuse.sourceforge.net/wiki/index.php/LanguageBindings">Python bindings</a> for <a href="http://fuse.sourceforge.net/">FUSE</a>. What it does is mounts a filesystem that represents your wiki, with articles as text files. You can use them just like any other files with mv, cp, ls, vim, and so on.
There hasen't been any action on that project for 13 months though, and it doesn't work on my wiki (MediaWiki 1.4.15) so I'm going to try and make it work after I upgrade to MediaWiki 1.6.3 tonight. This will be pretty cool when it works. I haven't looked at the code yet but it's only 650 lines.

View file

@ -0,0 +1,8 @@
Title: Apple pays attention to detail
Date: June 11, 2006
Timestamp: 1150014600
Author: sjs
Tags: technology, mac os x, apple
----
I think this has to be one of the big reasons why people who love their Mac, love their Mac (or other Apple product). I usually just have cheap PC speakers plugged into my Mac mini, but I didn't bring any with me to Munich and the internal Mac mini speaker isn't very loud, so I'm using headphones to watch movies. My Mac remembers the volume setting when the headphones ore plugged in, and when they're not, so I don't accidentally blow my ears. It's like my iPod pausing when the headphones are unplugged. It's excruciating attention to the smallest, (seemingly) most unimportant detail. I love it, and I'm hooked.

View file

@ -0,0 +1,16 @@
Title: Ruby and Rails have spoiled me rotten
Date: July 17, 2006
Timestamp: 1153140000
Author: sjs
Tags: rails, ruby, php, coding, framework, php, rails, ruby, zend
----
It's true. I'm sitting here coding in PHP using the <a href="http://framework.zend.com/">Zend Framework</a> and all I can think about is how much nicer Rails is, or how much easier it is to do [x] in Ruby. It's not that the Zend Framework is bad or anything, it's quite nice, but you just can't match Ruby's expressiveness in a language like PHP. Add the amazing convenience Rails builds on top of Ruby and that's a really hard combo to compete with.
I'd love to be using mixins instead of mucking around with abstract classes and interfaces, neither of which will just let you share a method between different classes. Writing proxy methods in these tiny in-between classes is annoying. (ie. inherit from Zend_class, then my real classes inherit from the middle-man class) I *could* add things to Zend's classes, but then upgrades are a bitch. I miss Ruby. I could use something like <a href="http://www.advogato.org/article/470.html">whytheluckystiff's PHP mixins</a>, which is a clever hack, but still a hack.
I keep looking at Rails code to see how things are done there, and I already coded a nearly complete prototype in Rails as a reference. I could have finished the thing in Rails by now, seriously. I'm still playing catch-up writing validations and model classes for all my objects, stuff I could've had for free using Rails, with an extra 10 mins to add validations and make sure they're all working nicely.
It's no wonder <a href="http://www.loudthinking.com/">David H. Hansson</a> wasn't able to write a framework he was happy with in PHP. After using Rails everything seems like a chore. I'm just coding solved problems over again in an inferior language.
But hey, I'm learning things and I still got to use Ruby even if the code won't be used later. I guess this experience will just make me appreciate the richness of Ruby and Rails even more.

View file

@ -0,0 +1,47 @@
Title: Late static binding
Date: July 19, 2006
Timestamp: 1153329780
Author: sjs
Tags: php, coding, coding, php
----
*Update: This has <a href="http://www.php.net/~derick/meeting-notes.html#late-static-binding-using-this-without-or-perhaps-with-a-different-name">been discussed</a> and will be uh, sort of fixed, in PHP6. You'll be able to use static::my_method() to get the real reference to self in class methods. Not optimal, but still a solution I guess.*
As colder on ##php (freenode) told me today, class methods in PHP don't have what they call late static binding. What's that? It means that this code:
<pre>
<code>
class Foo
{
public static function my_method()
{
echo "I'm a " . get_class() . "!\n";
}
}
class Bar extends Foo
{}
Bar::my_method();
</code>
</pre>
outputs "I'm a Foo!", instead of "I'm a Bar!". That's not fun.
Using <code>__CLASS__</code> in place of <code>get_class()</code> makes zero difference. You end up with proxy methods in each subclass of Foo that pass in the real name of the calling class, which sucks.
<pre>
<code>
class Bar extends Foo
{
public static function my_method()
{
return parent::my_method( get_class() );
}
}
</code>
</pre>
I was told that they had a discussion about this on the internal PHP list, so at least they're thinking about this stuff. Too bad PHP5 doesn't have it. I guess I should just be glad I won't be maintaining this code.
The resident PHP coder said "just make your code simpler", which is what I was trying to do by removing duplication. Too bad that plan sort of backfired. I guess odd things like this are where PHP starts to show that OO was tacked on as an after-thought.

View file

@ -0,0 +1,56 @@
Title: Class method? Instance method? It doesn't matter to PHP
Date: July 21, 2006
Timestamp: 1153493760
Author: sjs
Tags: php, coding
----
*Update: This has <a href="http://www.php.net/~derick/meeting-notes.html#method-calls">been discussed</a> for PHP6. A little late, but I guess better than never.*
I made a mistake while I was coding, for shame! Anyway this particular mistake was that I invoked a class method on the wrong class. The funny part was that this method was an instance method in the class which I typed by mistake. In the error log I saw something like "Invalid use of $this in class function."
I knew for a fact I hadn't used $this in a class method, so it was kind of a confusing error. I went to the file in question and found out that it was calling an instance method as a class method. Now that is some crazy shit.
I would fully expect the PHP parser to give me an error like "No class method [foo] in class [blah]", rather than try and execute it as a class method. The syntax is completely different; you use :: to call a class method and -&gt; to call an instance method. And you use the name of a <em>class</em> when you call a class method.
This code:
<pre><code>
class Foo {
public static function static_fun()
{
return "This is a class method!\n";
}
public function not_static()
{
return "This is an instance method!\n";
}
}
echo '&lt;pre&gt;';
echo "From Foo:\n";
echo Foo::static_fun();
echo Foo::not_static();
echo "\n";
echo "From \$foo = new Foo():\n";
$foo = new Foo();
echo $foo-&gt;static_fun();
echo $foo-&gt;not_static();
echo '&lt;/pre&gt;';
</code></pre>
Produces:
<pre><code>
From Foo:
This is a class method!
This is an instance method!
From $foo = new Foo():
This is a class method!
This is an instance method!
</code></pre>
What the fuck?! <a href="http://www.php.net/manual/en/language.oop5.static.php">http://www.php.net/manual/en/language.oop5.static.php</a> is lying to everyone.

View file

@ -0,0 +1,8 @@
Title: Where are my headphones?
Date: August 22, 2006
Timestamp: 1156257060
Author: sjs
Tags: life, seekport
----
Some people left Seekport this month and 2 of the remaining employees moved into the office Im working in. Thats fine, and Im leaving at the end of the week, but man Im going crazy. This guys pounding on his keyboard like its a fucking whack-a-mole game! I dont know what kind of keyboard he learned to type on but it mustve been horrible. It sounds like he must go through at least 10 of those things in a year. I dont know if Ill make it till Friday without yelling "AGH! STOP THE MADNESS YOU CRAZY BASTARD YOU JUST HAVE TO TOUCH THE KEYS!"

View file

@ -0,0 +1,10 @@
Title: Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo
Date: September 16, 2006
Timestamp: 1158469860
Author: sjs
Tags: amusement, buffalo
----
Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips?
<a href="http://en.wikipedia.org/wiki/Buffalo_buffalo_buffalo_buffalo_buffalo_buffalo_buffalo_buffalo">Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo</a>

View file

@ -0,0 +1,37 @@
Title: A triple-booting, schizophrenic MacBook
Date: April 4, 2007
Timestamp: 1175754600
Author: sjs
Tags: linux, mac os x, windows
----
The steps are well documented so I wont get into detail here but if you have a backup and can wipe your disk all you do is:
* Install OS X to a single partition filling your disk (optionally use your existing OS X intall)
* Install <a href="http://refit.sourceforge.net/">rEFIt</a> (no need to reboot just yet)
* Re-partition your disk into 3 partitions with <tt>diskutil resizeVolume</tt>, reboot and confirm it all works
* Boot the Vista install DVD and install to disk0s4 aka Partition 4
* Install Gentoo (or other distro) to disk0s3 aka /dev/sda3
With <a href="http://www.macports.org/">MacPorts</a> and <a href="http://www.metadistribution.org/macos/">Gentoo/MacOSX</a> the Gentoo install is superfluous but Ill spare 12G just to see Gentoo run on this fine machine. Setting up the hardware should be fun. Right now Im compiling X, (package 77 of 94) and the Core Duo is crunching code very nicely with 2G to work with, <strong>without any swap</strong>. I fully intend to put off creating a swap file unless I have to. Needless to say Ill be running fluxbox or Xfce, none of that Gnome or KDE stuff. If I ever need a swap file I will eat my keyboard.
*[edit: 25 minutes to compile X.org, not too shabby!]*
My initial experience with Vista is quite good. Sadly the <a href="http://www.manicai.net/comp/swap-caps-ctrl.html">same old registry hack</a> is required to swap Caps lock and Control but I was just glad it worked. I really like the new Start menu and the eye-candy is fairly pleasant for the most part. Till now Id only used RC2 on a machine incapable of running Aero Glass and it looked terrible. I switched to Windows Classic just like I do with XP. Not so with Aero at its finest though. Without thinking about the price Vista is a nice upgrade to Windows. But because of the price and uncertainty of running Aero Glass I still hesitate to urge non-geeks to upgrade.
OS X is OS X. Its my favourite desktop OS right now because of apps like LaunchBar/Quicksilver and TextMate, a generally excellent UI, good old *nix stability, zsh out of the box! When I need WireShark or the GIMP X11 is there waiting. Mac notebooks are great and tight integration with the hardware is a clear advantage for OS X.
Oh yeah, I also have a Parallels VM for Windows 3.11. It boots in about second to the <tt>C:\&gt;</tt> prompt and then another second to type <tt>win</tt> and Windows to start. Without TCP/IP theres not much to do though (Im not going to write a driver for Parallels ethernet adapter).
<ol>
<li><a id="fn1" name="fn1"></a>
<ul>
<li>Dual head setups are more work than plugging in a 2nd monitor, which is too much work.
<li>X requires a restart to enable or disable a 2nd display.
<li>Overall clunkiness such as displaying the houndstooth background before the WM starts,
<li>and/or going through a screwed up mode with a black &amp; white scrambled screen for a seconds before getting to the houndstooth.
</ul>
<a href="#fn1-ret">back up ↑</a>
</ol>
Like I said the X.org boys are doing amazing work. Hopefully soon after the current eye-candy craze is over theyll get to more important work that needs to be done.

View file

@ -0,0 +1,64 @@
Title: Getting to know Vista
Date: April 16, 2007
Timestamp: 1176746940
Author: sjs
Tags: windows
----
### It looks pretty good! ###
After figuring out how to minimise the translucency of the window decorations I think Aero looks ok. Window titles, on both windows and the taskbar, can be difficult to read at a glance which is really stupid if you ask me. But its better than Luna! They really lay the effects on thick but overall I find it pretty pleasant and it runs well on my MacBooks Intel 945 video chip.
Ah yes, the Sidebar is nowhere to be seen on my desktop. Its a nice-looking waste of space.
### But its not all useful ###
Sadly The new task switcher (Win-tab) is terrible. Before using it I wondered why they didnt replace Alt-tab completely. Now I know and I am grateful to MS for not replacing it. Alt-tab easily wins. Especially since it displays thumbnails of windows.
Three gripes with Win-tab fancy-shmanciness:
* Its too slow
* It responds even when I just tap Win-tab to quickly switch, then Im stuck until I hit the Windows key to choose a window
* Windows from all my monitors are gathered onto the main one, which is just lame
### Its stable (so far) ###
Besides the fact it is aesthetically pleasing [subjective] it also has just worked for me so far. Nothing has crashed or broken which is almost miraculous. Not that I had a terrible time with XP, but it was still frail old Windows at times. Im equally pleased with Apples drivers for Windows which probably adds to the experience. Ive used XP machines with proper drivers, and those without and the differenc is night &amp; day. Ive had uptimes in months on a stable XP notebook.
### Never thought this day would come... ###
But I actually like the Start menu. Really, I do. You hit the Windows key, type a few letters and boom you launch your app or search your computer, or the web (Google in Firefox, my default search). Its not QuickSilver or LaunchBar; its not supposed to be. For the average Joe this is cool, and for the average power user its very useful. For the casual Windows user its great. It even learns.
I dont love it though. I knew before using it that the new method of navigating through the All Programs menu would be weird. It is, but I guess it may be better than the previous fly-out scheme (which I dont care for either). I guess the All Programs menu is more or less legacy now though and I dont see myself using it often.
### Im a command line junkie ###
They fixed at least one glaring bug. I used the cmd.exe shell a little bit even though I hate it. I was happy to find that Tab completion works for more than the current directory now. Before Vista it would complete the same entries from PWD no matter how deep you tried to drill down into the filesystem. Other than that it seems to be the same crummy shell. *[edit—apparently this is fixed in XP as well, my mistake]*
I installed the Windows PowerShell (PoSH) but havent really put an effort to learn it yet. The syntax is unorthodox coming from *nix shells (zsh), but its sort of refreshing and it lives up to the Power part of its name. I really like the fact that collections of (say) files can be passed around and iterated over, filtered, etc. not as filenames but as real objects with corresponding methods and metadata. Built-in support for XML is pretty nifty too.
Ive often longed for a shell which acted like a normal shell for the most part, but allowed irb-like interpretation of arbitrary Ruby code as well. The PowerShell seems like it could be something similar to what Ive wanted. Too bad its proprietary and only runs on Windows. If I use Vista a lot this summer I could end up getting into it more though. Its quite interesting.
### Random ###
The good:
* Slideshow button in Explorer
* Doesnt look like a Fisher-Price design
* Restarts when I click Restart (after 3 clicks it damn well better)
* Seems stable, at least initially which means the installation &amp; driver situation really has improved
* I dont want to kill anyone while using it
The bad:
* Flicker while changing video modes, displaying UAC prompts, etc. (not so bad really, but stands out on an otherwise smooth desktop)
* Long black screen on boot after installing updates
* Disappearing / magical menu bar debacle
* The shell still sucks
* It tries to be too fancy, with the dynamic Start menu icon and the like
### My conclusion ###
Perhaps the scores of talented developers at Microsoft *can* save them despite their obvious shortcomings in management. .NET seems like a decent platform, but well have to see how I like it once I actually use it. So far I dont hate Vista and considering the previous versions of Windows thats a pretty good review coming from me. Im still recommending Macs to my family and friends, but who knows what the future holds. I dont hate Vista and by the end of the summer I may even [gasp] like it, and/or .NET. I havent used an IDE since VB6 and MS has always had a decent IDE (albeit with a crummy text editor). Im expecting to enjoy it. If theres one thing MS knows its the value of good dev tools and <a href="http://www.youtube.com/watch?v=d_AP3SGMxxM">developers</a>.

View file

@ -0,0 +1,52 @@
Title: Quickly inserting millions of rows with MySQL/InnoDB
Date: April 26, 2007
Timestamp: 1177596360
Author: sjs
Tags: linux, mysql
----
The absolute first thing you should do is check your MySQL configuration to make sure its sane for the system youre using. I kept getting a The table is too large error on my Gentoo box after inserting several million rows because the default config limits the InnoDB tablespace size to 128M. It was also tuned for a box with as little as 64M of RAM. Thats cool for a small VPS or your old Pentium in the corner collecting dust. For a modern server, workstation, or even notebook with gigs of RAM youll likely want to make some changes.
### Tweaking my.cnf ###
Here are the relevant settings you can tweak in order to work with large datasets efficiently. These are set in your <strong>my.cnf</strong> file, which varies in location.
On Gentoo it resides at <strong>/etc/mysql/my.cnf</strong>.
When MySQL 5.x is installed via DarwinPorts on Mac OS X you need to copy one of the defaults from <strong>/opt/local/share/mysql5/mysql/</strong> to <strong>/opt/local/etc/mysql5/my.cnf</strong> and then modify it accordingly.
If you use another system youre on your own. If you cant figure it out, please put down the text editor and leave the poor config file alone! Jokes aside this really is not difficult if youre used to configuring *nix programs.
### innodb_buffer_pool_size ###
This determines how much memory MySQL uses for table indexes and data. You can set it as low as 8-10M, or high as 50-80% of your memory on a dedicated MySQL server. I have RAM to burn[1] in my workstation so I set this to 200M, 20% of my 1GB.
[1] I run Fluxbox on Gentoo, I use 200-300M of my 1GB on average and with 200M for MySQL 409M are in use at this moment. Gotta love those lightweight window managers!
### innodb_additional_mem_pool_size ###
According to [a post on a MySQL mailing list](http://lists.mysql.com/mysql/129247), modern OSs have fast enough mallocs and this variable has little effect on performance. I set mine to 16M before reading that post, so Ill just leave it at that.
### innodb_data_file_path ###
On Gentoo this one bit me right in the ass, and I mentioned it above. It specifies how large the files used to store your data can be, and how many of them there are. The default setting is almost sane: <tt>ibdata1:10M:autoextend:<b>max:128M</b></tt>. Limiting the total size to 128M caused my test to fail after inserting several million rows.
Simply removing <tt>max:128M</tt> solves the problem. The resulting setting tells the InnoDB engine to use one file, named <b>ibdata1</b> which is initially 10M in size and grows as required.
### innodb_log_file_size ###
The default Gentoo config says they (whoever they are) keep this at 25% of <b>innodb_buffer_pool_size</b> so I did just that. 50M in my case.
### innodb_log_buffer_size ###
Again I only went as far as the Gentoo config to learn about this setting. They had it at 8M and recommend increasing it if you have large transactions. I cant think of any particularly large transactions I currently use but I doubled it to 16M anyway.
### Save my.cnf and restart mysqld ###
Thats it for the MySQL config. Restart mysqld however you do that on your platform. <tt>sudo /etc/init.d/mysql restart</tt> should look familiar to many *nix users.
Now you should be able to insert dozens and indeed hundreds of millions of rows into your InnoDB tables. Sadly this brought little performance gains to the table. MySQL wraps single queries in implicit transactions. Wrapping everything in a transaction may work, but inevitably something will go wrong and you may want the ability to resume inserting the rows instead of starting all over.
The solution now is to execute <tt>SET AUTOCOMMIT=0</tt> before inserting the data, and then issuing a <tt>COMMIT</tt> when youre done. With all that in place Im inserting 14,000,000 rows into both MyISAM and InnoDB tables in 30 minutes. MyISAM is still ~ 2 min faster, but as I said earlier this is adequate for now. Prior to all this it took several <b>hours</b> to insert 14,000,000 rows so I am happy.
Now you can enjoy the speed MyISAM is known for with your InnoDB tables. Consider the data integrity a bonus! ;-)

View file

@ -0,0 +1,25 @@
Title: Funny how code can be beautiful
Date: April 30, 2007
Timestamp: 1177942020
Author: sjs
Tags: haskell
----
While reading a <a href="http://www.haskell.org/tutorial/index.html">Haskell tutorial</a> I came across the following code for defining the <a href="http://en.wikipedia.org/wiki/Fibonacci_number">Fibonacci numbers</a>:
fib = 1 : 1 : [ a + b | (a, b) <- zip fib (tail fib) ]
After reading it a few times and understanding how it works I couldnt help but think how <strong>beautiful</strong> it is. I dont mean that its aesthetically pleasing to me; the beautiful part is the meaning and simplicity. Lazy evaluation is sweet.
<a href="http://www.haskell.org/">Haskell</a> is the most challenging <a href="http://en.wikipedia.org/wiki/Category:Esoteric_programming_languages"><em>real</em></a> language I have tried to wrap my head around. I havent done much with any functional languages yet but they are truly fascinating. Im beginning to understand monads[1] but Im quite sure I dont see the whole picture yet.
<a href="http://www.erlang.org/">Erlang</a> looks like it may be more suited to real world apps so I would like to learn that some time. The <a href="http://pragprog.com/">pragmatic</a> guys have a <a href="http://www.pragmaticprogrammer.com/titles/jaerlang/">book</a> on Erlang in the works, and I love every book of theirs which I have read.
Going deeper down the functional rabbit-hole youll find things like <a href="http://swik.net/Haskell/del.icio.us+tag%2Fhaskell/A+polyglot+quine+in+Haskell,+OCaml+and+Scheme/41zs">this polyglot quine</a>, which absolutely blows my mind. I used to be impressed by the <a href="http://en.wikipedia.org/wiki/Just_another_Perl_hacker">JAPH</a> sigs or some of the various <a href="http://en.wikipedia.org/wiki/Obfuscated_code">obfuscated</a> contest winners but that first one definitely cleans the rest up with a perfect 10 in geekiness.
[1] The following links have all been helpful while trying to wrap my head around monads.
* <a href="http://www.haskell.org/tutorial/monads.html">A Gentle Introduction to Haskell</a> (link is directly to chapter 9)
* <a href="http://web.cecs.pdx.edu/~antoy/Courses/TPFLP/lectures/MONADS/Noel/research/monads.html">What the hell are Monads?</a>
* <a href="http://en.wikibooks.org/wiki/Programming:Haskell_monads">Monads on WikiBooks</a>
* <a href="http://www.engr.mun.ca/~theo/Misc/haskell_and_monads.htm">Monads for the Working Haskell Programmer</a>

View file

@ -0,0 +1,14 @@
Title: Typo and I are friends again
Date: May 1, 2007
Timestamp: 1178081497
Author: sjs
Tags: typo
----
<p>I've been really frustrated with <a href="http://www.typosphere.org/">Typo</a> recently. For some reason changing my <a href="2007.04.30-funny-how-code-can-be-beautiful.html">last post</a> would cause MySQL to timeout and I'd have to kill the rogue ruby process manually before any other changes to the DB would work, instead of hanging for a minute or two then timing out. Luckily I was able to disable the post using the command line client, the bug only manifested itself when issuing an UPDATE with all the fields present. Presumably the body was tripping things up because most other fields are simple booleans, numbers, or very short strings.
Add to that the random HTTP 500 errors which were very noticeable while I was trying to fix that post and I was about to write my own blog or switch to WordPress.
I don't love WP so I decided to just upgrade Typo instead. I was using Typo 2.6, and the current stable version is 4.1. They skipped version 3 to preclude any confusion that may have ensued between Typo v3 and the CMS <a href="http://typo3.com/">Typo3</a>. So it really isn't a big upgrade and it went perfectly. I checked out a new copy of the repo because I had some difficulty getting <tt>svn switch --relocate</tt> to work, configured the database settings and issued a <tt>rake db:migrate</tt>, copied my theme over and it all just worked. Bravo Typo team, that's how an upgrade should work.
No more random 500 errors, things seem faster (better caching perhaps), and that troublesome post is troublesome no more. I am happy with Typo again.

View file

@ -0,0 +1,67 @@
Title: A Scheme parser in Haskell: Part 1
Date: May 3, 2007
Timestamp: 1178178470
Author: sjs
Tags: coding, haskell
----
From <a href="http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/firststeps.html">Write Yourself a Scheme in 48 hours</a>:
<blockquote>
<p>Basically, a monad is a way of saying "there's some extra information attached to this value, which most functions don't need to worry about". In this example, the "extra information" is the fact that this action performs IO, and the basic value is nothing, represented as "()". Monadic values are often called "actions", because the easiest way to think about the IO monad is a sequencing of actions that each might affect the outside world.</p>
</blockquote>
I really like this tutorial. I'm only on part 3.3 of 12, <a href="http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/parser.html">parsing</a>, but I'm new to Haskell so I'm learning left, right & centre. The exercises are taking me hours of reading and experimenting, and it's lots of fun! ghc's errors are usually quite helpful and of course ghci is a big help as well.
I'm going to explain one of the exercises because converting between the various syntax for dealing with monads wasn't plainly obvious to me. Perhaps I wasn't paying enough attention to the docs I read. In any case if you're interested in Haskell at all, I recommend the tutorial and if you're stuck on exercise 3.3.1 like I was then come on back here. Whether you're following the tutorial or not the point of this post should stand on its own with a basic knowledge of Haskell.
Last night I rewrote <code>parseNumber</code> using <code>do</code> and <code>&gt;&gt;=</code> (bind) notations (ex. 3.3.1). Here's <code>parseNumber</code> using the <code>liftM</code> method given in the tutorial:
<pre><code>parseNumber :: Parser LispVal
parseNumber :: liftM (Number . read) $ many1 digit
</code></pre>
Okay that's pretty simple right? Let's break it down, first looking at the right-hand side of the <code>$</code> operator, then the left.
* <tt>many1 digit</tt> reads as many decimal digits as it can.
* <code>Number . read</code> is a <a href="http://en.wikipedia.org/wiki/Function_composition_(computer_science%29">function composition</a> just like we're used to using in math. It applies <code>read</code> to its argument, then applies <code>Number</code> to that result.
* <tt>liftM</tt> is concisely and effectively defined <a href="http://members.chello.nl/hjgtuyl/tourdemonad.html#liftM">elsewhere</a>, and I'll borrow their description:
<blockquote>
<p><tt>liftM f m</tt> lets a non-monadic function <tt>f</tt> operate on the contents of monad <tt>m</tt></p>
</blockquote>
<code>liftM</code>'s type is also quite telling: <tt>liftM :: (Monad m) =&gt; (a -&gt; b) -&gt; (m a -&gt; m b)</tt>
In a nutshell <code>liftM</code> turns a function from <code>a</code> to <code>b</code> to a function from a monad containing <code>a</code> to a monad containing <code>b</code>.
That results in a function on the left-hand side of <code>$</code>, which operates on and outputs a monad. The content of the input monad is a <code>String</code>. The content of the output monad is a <tt>LispVal</tt> (defined earlier in the tutorial). Specifically it is a <code>Number</code>.
The <code>$</code> acts similar to a pipe in <code>$FAVOURITE_SHELL</code>, and is right associative which means the expression on the right is passed to the expression (function) on the left. It's exactly the same as <tt>(liftM (Number . read)) (many1 digit)</tt> except it looks cleaner. If you know LISP or Scheme (sadly I do not) then it's analogous to the <code>apply</code> function.
So how does a Haskell newbie go about re-writing that using other notations which haven't even been explained in the tutorial? Clearly one must search the web and read as much as they can until they understand enough to figure it out (which is one thing I like about the tutorial). If you're lazy like me, here are 3 equivalent pieces of code for you to chew on. <code>parseNumber</code>'s type is <code>Parser LispVal</code> (Parser is a monad).
Familiar <code>liftM</code> method:
<pre><code>parseNumber -&gt; liftM (Number . read) $ many1 digit
</code></pre>
Using <code>do</code> notation:
<pre><code>parseNumber -&gt; do digits &lt;- many1 digit
return $ (Number . read) digits
</code></pre>
If you're thinking "Hey a <code>return</code>, I know that one!" then the devious masterminds behind Haskell are certainly laughing evilly right now. <code>return</code> simply wraps up it's argument in a monad of some sort. In this case it's the <code>Parser</code> monad. The <code>return</code> part may seem strange at first. Since <code>many1 digit</code> yields a monad why do we need to wrap anything? The answer is that using <code>&lt;-</code> causes <code>digits</code> to contain a <code>String</code>, stripped out of the monad which resulted from <code>many1 digit</code>. Hence we no longer use <code>liftM</code> to make <code>(Number . read)</code> monads, and instead need to use <code>return</code> to properly wrap it back up in a monad.
In other words <code>liftM</code> eliminates the need to explicitly re-monadize the contents as is necessary using <code>do</code>.
Finally, using <code>&gt;&gt;=</code> (bind) notation:
<pre><code>parseNumber -&gt; many1 digit &gt;&gt;= \digits -&gt;
return $ (Number . read) digits
</code></pre>
At this point I don't think this warrants much of an explanation. The syntactic sugar provided by <code>do</code> should be pretty obvious. Just in case it's not, <code>&gt;&gt;=</code> passes the contents of its left argument (a monad) to the <em>function</em> on its right. Once again <code>return</code> is needed to wrap up the result and send it on its way.
When I first read about Haskell I was overwhelmed by not knowing anything, and not being able to apply my previous knowledge of programming to <em>anything</em> in Haskell. One piece of syntax at a time I am slowly able to understand more of the Haskell found <a href="http://www.google.com/url?sa=t&amp;ct=res&amp;cd=2&amp;url=http%3A%2F%2Fblog.moertel.com%2Farticles%2F2005%2F03%2F25%2Fwriting-a-simple-ruby-evaluator-in-haskell&amp;ei=Q1A6RtWPLZvYigGZsMjxAQ&amp;usg=AFrqEzdrRepwsuNaQqe1gHYjHvqdCDKfoA&amp;sig2=0qNTIOB9XxeZRqKR7J61Iw">in the wild</a>.
I'm currently working on ex. 3.3.4, which is parsing <a href="http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_sec_6.3.5">R5RS compliant numbers</a> <em>(e.g. #o12345670, #xff, #d987)</em>. I'll probably write something about that once I figure it out, but in the meantime if you have any hints I'm all ears.
*Update #1: I should do more proof-reading if I'm going to try and explain things. I made some changes in wording.*

View file

@ -7,7 +7,7 @@ Tags: mephisto, typo
Well for just over a year Typo ran the show. I thought I had worked out most of the kinks with Typo and Dreamhost but the latest problem I ran into was pretty major. I couldn't post new articles. If the stars aligned perfectly and I sacrificed baby animals and virgins, every now and then I could get it to work. Ok, all I really had to do was refresh several dozen times, waiting 1 minute for it to timeout every time, but it sucked nonetheless.
Recently I had looked at converting Typo to Mephisto and it seemed pretty painless. I installed Mephisto and followed whatever instructions I found via Google and it all just worked, with one caveat. The Typo converter for Mephisto only supports Typo's schema version 56, while my Typo schema was at version 61. Rather than migrate backwards I brought Mephisto's Typo converter up to date instead. If you're interested, <a href="http://sami.samhuri.net/files/mephisto_converters-typo-schema_version_61.patch">download the patch</a>. The patch is relative to vendor/plugins, so patch accordingly.
Recently I had looked at converting Typo to Mephisto and it seemed pretty painless. I installed Mephisto and followed whatever instructions I found via Google and it all just worked, with one caveat. The Typo converter for Mephisto only supports Typo's schema version 56, while my Typo schema was at version 61. Rather than migrate backwards I brought Mephisto's Typo converter up to date instead. If you're interested, <a href="/f/mephisto_converters-typo-schema_version_61.patch">download the patch</a>. The patch is relative to vendor/plugins, so patch accordingly.
After running that code snippet to fix my tags, I decided to completely ditch categories in favour of tags. I tagged each new Mephisto article with a tag for each Typo category it had previously belonged to. I fired up <code>RAILS_ENV=production script/console</code> and typed something similar to the following:

View file

@ -5,11 +5,11 @@ Author: sjs
Tags: english, life, pedantry
----
I'm currently reading <a href="http://mitpress.mit.edu/sicp/full-text/book/book.html">SICP</a> since it's highly recommended by many people, available for free, and interesting. The fact that I have a little <a href="http://sami.samhuri.net/2007/6/14/more-scheming-with-haskell">Scheme interpreter</a> to play with makes it much more fun since I can add missing functionality to it as I progress through the book, thereby learning more Haskell in the process. Yay!
I'm currently reading <a href="http://mitpress.mit.edu/sicp/full-text/book/book.html">SICP</a> since it's highly recommended by many people, available for free, and interesting. The fact that I have a little <a href="2007.06.14-more-scheming-with-haskell.html">Scheme interpreter</a> to play with makes it much more fun since I can add missing functionality to it as I progress through the book, thereby learning more Haskell in the process. Yay!
Anyway I was very pleased to see the only correct usage of the phrase "begs the question" I have seen in a while. It's a pet peeve of mine, but I have submitted myself to the fact that the phrase is so oft used to mean "begs for the following question to be asked..." that it may as well be re-defined. In its correct usage the sentence seems to hang there if you try to apply the commonly mistaken meaning to it. That's all very hazy so here's the usage in SICP (emphasis my own):
<blockquote> As a case in point, consider the problem of computing square roots. We can define the square-root function as <img src="http://sami.samhuri.net/files/ch1-Z-G-4.gif" alt="">
<blockquote> As a case in point, consider the problem of computing square roots. We can define the square-root function as <img src="/images/blog/ch1-Z-G-4.gif" alt="√x = the y such that y ≥ 0 and y² = x">
This describes a perfectly legitimate mathematical function. We could use it to recognize whether one number is the square root of another, or to derive facts about square roots in general. On the other hand, the definition does not describe a procedure. Indeed, it tells us almost nothing about how to actually find the square root of a given number. It will not help matters to rephrase this definition in pseudo-Lisp:

View file

@ -7,7 +7,7 @@ Tags: elschemo, haskell, scheme
I've been developing a Scheme
interpreter in Haskell called
<a href="http://sami.samhuri.net/2007/6/25/floating-point-in-elschemo">ElSchemo</a>.
<a href="2007.06.24-floating-point-in-elschemo.html">ElSchemo</a>.
It started from <a href="http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/overview.html">Jonathan's excellent Haskell
tutorial</a>
which I followed in order to learn both Haskell and Scheme. Basically

View file

@ -0,0 +1,542 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Apple pays attention to detail - samhuri.net</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta content="48.472,-123.3683" name="ICBM" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/xml/rsd" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/xml/rss20/article/426/feed.xml" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/xml/atom10/article/426/feed.xml" />
<script src="http://web.archive.org/web/20061018215037js_/http://sami.samhuri.net/javascripts/cookies.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215037js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215037js_/http://sami.samhuri.net/javascripts/effects.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215037js_/http://sami.samhuri.net/javascripts/typo.js" type="text/javascript"></script>
<script type="text/javascript"></script>
<link href="http://web.archive.org/web/20061018215037cs_/http://sami.samhuri.net/stylesheets/theme/island.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20061018215037cs_/http://sami.samhuri.net/stylesheets/user-styles.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20061018215037cs_/http://sami.samhuri.net/stylesheets/theme/print.css" media="print" rel="Stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/articles\/2006\/06\/11\/apple-pays-attention-to-detail";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "18";
var displayMonth = "Oct";
var displayYear = "2006";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/articles/2006/06/11/apple-pays-attention-to-detail" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20061018215037" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Sep
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 21:50:37 Oct 18, 2006">OCT</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20061229153422/http://sami.samhuri.net/articles/2006/06/11/apple-pays-attention-to-detail" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="29 Dec 2006"><strong>DEC</strong></a>
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" />
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 21:50:37 Oct 18, 2006">18</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20061229153422/http://sami.samhuri.net/articles/2006/06/11/apple-pays-attention-to-detail" title="15:34:22 Dec 29, 2006" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0"/></a>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2005
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 21:50:37 Oct 18, 2006">2006</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2007
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20061018215037*/http://sami.samhuri.net/articles/2006/06/11/apple-pays-attention-to-detail" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>4 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">18 Oct 06 - 5 Aug 07</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:9:000000000101_2007:-1:001000010000_2008:-1:000000000000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="content" class="clearfix">
<div id="main">
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping="http://sami.samhuri.net/articles/trackback/426"
dc:title="Apple pays attention to detail"
dc:identifier="http://sami.samhuri.net/articles/read/426"
dc:description="I think this has to be one of the big reasons why people who love their Mac, love their Mac (or other Apple product). I usually just have cheap PC speakers plugged into my Mac mini, but I didn&amp;#8217;t bring any with me to Munich and the internal Mac min"
dc:creator="sjs"
dc:date="2006-09-19T19:20:45-07:00" />
</rdf:RDF>
-->
<div class="post" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_article'); }" onmouseout="Element.hide('admin_article');" >
<a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/admin/content/edit/426" class="admintools" id="admin_article" style="display: none">edit</a>
<h2>Apple pays attention to detail</h2>
<p class="auth"><!-- Posted by <a href="mailto:sjs@uvic.ca">Sami Jensen Samhuri</a> -->
<span class="typo_date" title="Sun, 11 Jun 2006 08:30:00 GMT">Sun, 11 Jun 2006 08:30:00 GMT</span></p>
<p>I think this has to be one of the big reasons why people who love their Mac, love their Mac (or other Apple product). I usually just have cheap PC speakers plugged into my Mac mini, but I didn&#8217;t bring any with me to Munich and the internal Mac mini speaker isn&#8217;t very loud, so I&#8217;m using headphones to watch movies. My Mac remembers the volume setting when the headphones ore plugged in, and when they&#8217;re not, so I don&#8217;t accidentally blow my ears. It&#8217;s like my iPod pausing when the headphones are unplugged. It&#8217;s excruciating attention to the smallest, (seemingly) most unimportant detail. I love it, and I&#8217;m hooked.</p>
</div>
<p class="meta">
Posted in <a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/technology" rel="tag">technology</a>, <a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/mac-os-x" rel="tag">mac os x</a>, <a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/apple" rel="tag">apple</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/2006/06/11/apple-pays-attention-to-detail#comments">no comments</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/2006/06/11/apple-pays-attention-to-detail#trackbacks">no trackbacks</a>
</p>
<a name="comments"></a><h4 class="blueblk">Comments</h4>
<p class="postmetadata alt">
<small><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/2006/06/11/apple-pays-attention-to-detail#respond">Leave a response</a></small>
</p>
<ol class="comment-list" id="commentList">
<li id="dummy_comment" style="display: none"></li>
</ol>
<a name="trackbacks"></a><h4 class="blueblk">Trackbacks</h4>
<p>
Use the following link to trackback from your own site:<br/>
<span class="light-bg">http://sami.samhuri.net/articles/trackback/426</span>
</p>
<p class="postmetadata alt">
<small>
<a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/xml/rss20/article/426/feed.xml" title="RSS Feed">RSS feed for this post</a>
<a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/trackback/426" >trackback uri</a>
</small>
</p>
<form action="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/comment/426" class="commentform" id="commentform" method="post" onsubmit="new Ajax.Updater({success:'commentList'}, '/articles/comment/426', {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom, onComplete:function(request){complete(request)}, onFailure:function(request){failure(request)}, onLoading:function(request){loading()}, parameters:Form.serialize(this)}); return false;">
<div class="comment-box">
<div id="errors"></div>
<div id="preview" style="display: none"></div>
<a name="respond"></a>
<table cellpadding="4" cellspacing="0" class="frm-tbl">
<tr>
<td><p><label for="comment_author">Your name</label></p></td>
<td> <input id="comment_author" name="comment[author]" size="20" type="text" /> <small><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/2006/06/11/apple-pays-attention-to-detail#" onclick="Element.toggle('guest_url'); Element.toggle('guest_email'); return false;">(leave url/email &#187;)</a></small></td>
</tr>
<tr id="guest_url" style="display:none;">
<td><p><label for="comment_url">Your blog</label></p></td>
<td> <input id="comment_url" name="comment[url]" size="30" type="text" /></td>
</tr>
<tr id="guest_email" style="display:none;">
<td><p><label for="comment_email">Your email</label></p></td>
<td> <input id="comment_email" name="comment[email]" size="30" type="text" /></td>
</tr>
<tr>
<td><p><label for="comment_body">Your message</label></p></td>
<td valign="top" colspan="2">
<textarea cols="40" id="comment_body" name="comment[body]" rows="20"></textarea>
</td>
</tr>
<tr>
<td colspan="2" id="frm-btns">
<span id="comment_loading" style="display:none;"><img alt="Spinner" src="http://web.archive.org/web/20061018215037im_/http://sami.samhuri.net/images/spinner.gif" /></span>&nbsp;&nbsp;
<a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/2006/06/11/apple-pays-attention-to-detail#" onclick="new Ajax.Updater('preview', '/articles/comment_preview', {asynchronous:true, evalScripts:true, parameters:Form.serialize('commentform'), onComplete:function(request){Element.show('preview')}}); return false;">Preview comment</a>
<input type="submit" name="submit" id="form-submit-button" value="submit" class="button" />
</td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
show_dates_as_local_time()
//]]>
</script>
</div>
</div>
<div id="leftcolumn">
<div id="header">
<h1 id="sitename"><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/">sjs</a></h1>
<h2 id="subtitle">&nbsp;</h2>
</div>
<div id="sidebar">
<div id="search"><form action="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/search" id="sform" method="get">
<label for="q">Search: </label><input type="text" id="q" name="q" value="" size="15" />
<img alt="Spinner-blue" id="search_spinner" src="http://web.archive.org/web/20061018215037im_/http://sami.samhuri.net/images/spinner-blue.gif" style="display:none;" />
</form>
<script type="text/javascript">
//<![CDATA[
new Form.Element.Observer('q', 1, function(element, value) {new Ajax.Updater('search-results', '/live/search', {asynchronous:true, evalScripts:true, onComplete:function(request){Element.hide('search_spinner')}, onLoading:function(request){Element.show('search_spinner')}, parameters:'q=' + escape($F('q'))})})
//]]>
</script></div>
<div id="search-results"></div>
<div class="sidebar-node">
<h3>All about...</h3>
<ul>
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/pages/about">a bit about me</a></li>
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/pages/thunder">workstation</a></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Categories</h3>
<ul id="categories">
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/amusement">amusement</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/gentoo">gentoo</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/hacking">coding</a> <em>(16)</em></li>
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/life">life</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/linux">linux</a> <em>(2)</em></li>
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/mac-os-x">mac os x</a> <em>(6)</em></li>
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/python">python</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/rails">rails</a> <em>(12)</em></li>
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/ruby">ruby</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/technology">technology</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/textmate">textmate</a> <em>(10)</em></li>
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/apple">apple</a> <em>(6)</em></li>
<li><a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/category/php">php</a> <em>(4)</em></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Archives</h3>
<ul id="archives">
<li>
<a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/2006/09">September 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/2006/08">August 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/2006/07">July 2006</a>
<em>(5)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/2006/06">June 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/2006/05">May 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/2006/04">April 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/2006/03">March 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/articles/2006/02">February 2006</a>
<em>(15)</em>
</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Links</h3>
<ul>
<li><a href="http://web.archive.org/web/20061018215037/http://phox.ca/cswiki/Main_Page">CSWiki</a></li>
<li><a href="http://web.archive.org/web/20061018215037/http://jim.roepcke.com/">Have Browser, Will Travel</a></li>
<li><a href="http://web.archive.org/web/20061018215037/http://blog.inquirylabs.com/">Going Up</a></li>
<li><a href="http://web.archive.org/web/20061018215037/http://www.mirage.org/">encieno</a></li>
<li><a href="http://web.archive.org/web/20061018215037/http://www.nofxwiki.net/">nofxwiki.net</a></li>
<li>sami at samhuri dot net</li>
</ul>
</div>
<div class="sidebar-node">
<p><ul>
<li><a class="feed" href="http://web.archive.org/web/20061018215037/http://sami.samhuri.net/xml/rss20/feed.xml" title="Articles feed"><img src="http://web.archive.org/web/20061018215037im_/http://sami.samhuri.net/files/feed-icon-48x48.png" alt="RSS 2.0" width="48" height="48" /></a></li>
<!--
-->
</ul></p>
</div>
<br clear="all" />
</div>
</div>
<div id="footer">
<ul>
<li><a href="http://web.archive.org/web/20061018215037/http://typo.leetsoft.com/">Typo</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20061018215037/http://validator.w3.org/check?uri=referer">Valid XHTML</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20061018215037/http://jigsaw.w3.org/css-validator/validator?uri=http://sami.samhuri.net/">Valid CSS</a></li>
</ul>
</div>
<script src="http://web.archive.org/web/20061018215037js_/http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-214054-3";
urchinTracker();
</script>
</body>
</html>
<!--
FILE ARCHIVED ON 21:50:37 Oct 18, 2006 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 8:58:10 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,545 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo - samhuri.net</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta content="48.472,-123.3683" name="ICBM" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/xml/rsd" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/xml/rss20/article/437/feed.xml" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/xml/atom10/article/437/feed.xml" />
<script src="http://web.archive.org/web/20061018215201js_/http://sami.samhuri.net/javascripts/cookies.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215201js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215201js_/http://sami.samhuri.net/javascripts/effects.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215201js_/http://sami.samhuri.net/javascripts/typo.js" type="text/javascript"></script>
<script type="text/javascript"></script>
<link href="http://web.archive.org/web/20061018215201cs_/http://sami.samhuri.net/stylesheets/theme/island.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20061018215201cs_/http://sami.samhuri.net/stylesheets/user-styles.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20061018215201cs_/http://sami.samhuri.net/stylesheets/theme/print.css" media="print" rel="Stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/articles\/2006\/09\/16\/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "18";
var displayMonth = "Oct";
var displayYear = "2006";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/articles/2006/09/16/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20061018215201" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Sep
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 21:52:01 Oct 18, 2006">OCT</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20070313163046/http://sami.samhuri.net/articles/2006/09/16/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="13 Mar 2007"><strong>MAR</strong></a>
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" />
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 21:52:01 Oct 18, 2006">18</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20070313163046/http://sami.samhuri.net/articles/2006/09/16/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo" title="16:30:46 Mar 13, 2007" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0"/></a>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2005
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 21:52:01 Oct 18, 2006">2006</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2007
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20061018215201*/http://sami.samhuri.net/articles/2006/09/16/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>2 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">18 Oct 06 - 13 Mar 07</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:9:000000000100_2007:-1:001000000000_2008:-1:000000000000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="content" class="clearfix">
<div id="main">
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping="http://sami.samhuri.net/articles/trackback/437"
dc:title="Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo"
dc:identifier="http://sami.samhuri.net/articles/read/437"
dc:description="Wouldn&amp;#8217;t the sentence &amp;#8216;I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign&amp;#8217; have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and"
dc:creator="sjs"
dc:date="2006-09-19T19:20:45-07:00" />
</rdf:RDF>
-->
<div class="post" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_article'); }" onmouseout="Element.hide('admin_article');" >
<a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/admin/content/edit/437" class="admintools" id="admin_article" style="display: none">edit</a>
<h2>Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo</h2>
<p class="auth"><!-- Posted by <a href="mailto:sjs@uvic.ca">Sami Jensen Samhuri</a> -->
<span class="typo_date" title="Sun, 17 Sep 2006 05:11:00 GMT">Sun, 17 Sep 2006 05:11:00 GMT</span></p>
<p>Wouldn&#8217;t the sentence &#8216;I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign&#8217; have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips?</p>
<p>&rarr; <a href="http://web.archive.org/web/20061018215201/http://en.wikipedia.org/wiki/Buffalo_buffalo_buffalo_buffalo_buffalo_buffalo_buffalo_buffalo">Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo</a></p>
</div>
<p class="meta">
Posted in <a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/category/amusement" rel="tag">amusement</a>&nbsp;<strong>|</strong>&nbsp;Tags <a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/tag/buffalo" rel="tag">buffalo</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/2006/09/16/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo#comments">no comments</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/2006/09/16/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo#trackbacks">no trackbacks</a>
</p>
<a name="comments"></a><h4 class="blueblk">Comments</h4>
<p class="postmetadata alt">
<small><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/2006/09/16/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo#respond">Leave a response</a></small>
</p>
<ol class="comment-list" id="commentList">
<li id="dummy_comment" style="display: none"></li>
</ol>
<a name="trackbacks"></a><h4 class="blueblk">Trackbacks</h4>
<p>
Use the following link to trackback from your own site:<br/>
<span class="light-bg">http://sami.samhuri.net/articles/trackback/437</span>
</p>
<p class="postmetadata alt">
<small>
<a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/xml/rss20/article/437/feed.xml" title="RSS Feed">RSS feed for this post</a>
<a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/trackback/437" >trackback uri</a>
</small>
</p>
<form action="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/comment/437" class="commentform" id="commentform" method="post" onsubmit="new Ajax.Updater({success:'commentList'}, '/articles/comment/437', {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom, onComplete:function(request){complete(request)}, onFailure:function(request){failure(request)}, onLoading:function(request){loading()}, parameters:Form.serialize(this)}); return false;">
<div class="comment-box">
<div id="errors"></div>
<div id="preview" style="display: none"></div>
<a name="respond"></a>
<table cellpadding="4" cellspacing="0" class="frm-tbl">
<tr>
<td><p><label for="comment_author">Your name</label></p></td>
<td> <input id="comment_author" name="comment[author]" size="20" type="text" /> <small><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/2006/09/16/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo#" onclick="Element.toggle('guest_url'); Element.toggle('guest_email'); return false;">(leave url/email &#187;)</a></small></td>
</tr>
<tr id="guest_url" style="display:none;">
<td><p><label for="comment_url">Your blog</label></p></td>
<td> <input id="comment_url" name="comment[url]" size="30" type="text" /></td>
</tr>
<tr id="guest_email" style="display:none;">
<td><p><label for="comment_email">Your email</label></p></td>
<td> <input id="comment_email" name="comment[email]" size="30" type="text" /></td>
</tr>
<tr>
<td><p><label for="comment_body">Your message</label></p></td>
<td valign="top" colspan="2">
<textarea cols="40" id="comment_body" name="comment[body]" rows="20"></textarea>
</td>
</tr>
<tr>
<td colspan="2" id="frm-btns">
<span id="comment_loading" style="display:none;"><img alt="Spinner" src="http://web.archive.org/web/20061018215201im_/http://sami.samhuri.net/images/spinner.gif" /></span>&nbsp;&nbsp;
<a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/2006/09/16/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo#" onclick="new Ajax.Updater('preview', '/articles/comment_preview', {asynchronous:true, evalScripts:true, parameters:Form.serialize('commentform'), onComplete:function(request){Element.show('preview')}}); return false;">Preview comment</a>
<input type="submit" name="submit" id="form-submit-button" value="submit" class="button" />
</td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
show_dates_as_local_time()
//]]>
</script>
</div>
</div>
<div id="leftcolumn">
<div id="header">
<h1 id="sitename"><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/">sjs</a></h1>
<h2 id="subtitle">&nbsp;</h2>
</div>
<div id="sidebar">
<div id="search"><form action="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/search" id="sform" method="get">
<label for="q">Search: </label><input type="text" id="q" name="q" value="" size="15" />
<img alt="Spinner-blue" id="search_spinner" src="http://web.archive.org/web/20061018215201im_/http://sami.samhuri.net/images/spinner-blue.gif" style="display:none;" />
</form>
<script type="text/javascript">
//<![CDATA[
new Form.Element.Observer('q', 1, function(element, value) {new Ajax.Updater('search-results', '/live/search', {asynchronous:true, evalScripts:true, onComplete:function(request){Element.hide('search_spinner')}, onLoading:function(request){Element.show('search_spinner')}, parameters:'q=' + escape($F('q'))})})
//]]>
</script></div>
<div id="search-results"></div>
<div class="sidebar-node">
<h3>All about...</h3>
<ul>
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/pages/about">a bit about me</a></li>
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/pages/thunder">workstation</a></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Categories</h3>
<ul id="categories">
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/category/amusement">amusement</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/category/gentoo">gentoo</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/category/hacking">coding</a> <em>(16)</em></li>
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/category/life">life</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/category/linux">linux</a> <em>(2)</em></li>
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/category/mac-os-x">mac os x</a> <em>(6)</em></li>
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/category/python">python</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/category/rails">rails</a> <em>(12)</em></li>
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/category/ruby">ruby</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/category/technology">technology</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/category/textmate">textmate</a> <em>(10)</em></li>
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/category/apple">apple</a> <em>(6)</em></li>
<li><a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/category/php">php</a> <em>(4)</em></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Archives</h3>
<ul id="archives">
<li>
<a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/2006/09">September 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/2006/08">August 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/2006/07">July 2006</a>
<em>(5)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/2006/06">June 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/2006/05">May 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/2006/04">April 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/2006/03">March 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/articles/2006/02">February 2006</a>
<em>(15)</em>
</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Links</h3>
<ul>
<li><a href="http://web.archive.org/web/20061018215201/http://phox.ca/cswiki/Main_Page">CSWiki</a></li>
<li><a href="http://web.archive.org/web/20061018215201/http://jim.roepcke.com/">Have Browser, Will Travel</a></li>
<li><a href="http://web.archive.org/web/20061018215201/http://blog.inquirylabs.com/">Going Up</a></li>
<li><a href="http://web.archive.org/web/20061018215201/http://www.mirage.org/">encieno</a></li>
<li><a href="http://web.archive.org/web/20061018215201/http://www.nofxwiki.net/">nofxwiki.net</a></li>
<li>sami at samhuri dot net</li>
</ul>
</div>
<div class="sidebar-node">
<p><ul>
<li><a class="feed" href="http://web.archive.org/web/20061018215201/http://sami.samhuri.net/xml/rss20/feed.xml" title="Articles feed"><img src="http://web.archive.org/web/20061018215201im_/http://sami.samhuri.net/files/feed-icon-48x48.png" alt="RSS 2.0" width="48" height="48" /></a></li>
<!--
-->
</ul></p>
</div>
<br clear="all" />
</div>
</div>
<div id="footer">
<ul>
<li><a href="http://web.archive.org/web/20061018215201/http://typo.leetsoft.com/">Typo</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20061018215201/http://validator.w3.org/check?uri=referer">Valid XHTML</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20061018215201/http://jigsaw.w3.org/css-validator/validator?uri=http://sami.samhuri.net/">Valid CSS</a></li>
</ul>
</div>
<script src="http://web.archive.org/web/20061018215201js_/http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-214054-3";
urchinTracker();
</script>
</body>
</html>
<!--
FILE ARCHIVED ON 21:52:01 Oct 18, 2006 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 7:30:56 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,593 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class method? Instance method? It doesn't matter to PHP - samhuri.net</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta content="48.472,-123.3683" name="ICBM" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/xml/rsd" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/xml/rss20/article/431/feed.xml" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/xml/atom10/article/431/feed.xml" />
<script src="http://web.archive.org/web/20061018215149js_/http://sami.samhuri.net/javascripts/cookies.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215149js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215149js_/http://sami.samhuri.net/javascripts/effects.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215149js_/http://sami.samhuri.net/javascripts/typo.js" type="text/javascript"></script>
<script type="text/javascript"></script>
<link href="http://web.archive.org/web/20061018215149cs_/http://sami.samhuri.net/stylesheets/theme/island.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20061018215149cs_/http://sami.samhuri.net/stylesheets/user-styles.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20061018215149cs_/http://sami.samhuri.net/stylesheets/theme/print.css" media="print" rel="Stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/articles\/2006\/07\/21\/class-method-instance-method-it-doesnt-matter-to-php";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "18";
var displayMonth = "Oct";
var displayYear = "2006";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/articles/2006/07/21/class-method-instance-method-it-doesnt-matter-to-php" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20061018215149" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Sep
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 21:51:49 Oct 18, 2006">OCT</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20070313163036/http://sami.samhuri.net/articles/2006/07/21/class-method-instance-method-it-doesnt-matter-to-php" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="13 Mar 2007"><strong>MAR</strong></a>
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" />
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 21:51:49 Oct 18, 2006">18</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20070313163036/http://sami.samhuri.net/articles/2006/07/21/class-method-instance-method-it-doesnt-matter-to-php" title="16:30:36 Mar 13, 2007" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0"/></a>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2005
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 21:51:49 Oct 18, 2006">2006</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2007
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20061018215149*/http://sami.samhuri.net/articles/2006/07/21/class-method-instance-method-it-doesnt-matter-to-php" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>2 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">18 Oct 06 - 13 Mar 07</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:9:000000000100_2007:-1:001000000000_2008:-1:000000000000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="content" class="clearfix">
<div id="main">
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping="http://sami.samhuri.net/articles/trackback/431"
dc:title="Class method? Instance method? It doesn't matter to PHP"
dc:identifier="http://sami.samhuri.net/articles/read/431"
dc:description="Update: This has been discussed for PHP6. A little late, but I guess better than never. I made a mistake while I was coding, for shame!"
dc:creator="sjs"
dc:date="2006-09-19T19:20:44-07:00" />
</rdf:RDF>
-->
<div class="post" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_article'); }" onmouseout="Element.hide('admin_article');" >
<a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/admin/content/edit/431" class="admintools" id="admin_article" style="display: none">edit</a>
<h2>Class method? Instance method? It doesn't matter to PHP</h2>
<p class="auth"><!-- Posted by <a href="mailto:sjs@uvic.ca">Sami Jensen Samhuri</a> -->
<span class="typo_date" title="Fri, 21 Jul 2006 14:56:00 GMT">Fri, 21 Jul 2006 14:56:00 GMT</span></p>
<p><em>Update: This has <a href="http://web.archive.org/web/20061018215149/http://www.php.net/~derick/meeting-notes.html#method-calls">been discussed</a> for <span class="caps">PHP6</span>. A little late, but I guess better than never.</em></p>
<p>I made a mistake while I was coding, for shame! Anyway this particular mistake was that I invoked a class method on the wrong class. The funny part was that this method was an instance method in the class which I typed by mistake. In the error log I saw something like &#8220;Invalid use of $this in class function.&#8221;</p><p>I knew for a fact I hadn&#8217;t used $this in a class method, so it was kind of a confusing error. I went to the file in question and found out that it was calling an instance method as a class method. Now that is some crazy shit.</p>
<p>I would fully expect the <span class="caps">PHP</span> parser to give me an error like &#8220;No class method [foo] in class [blah]&#8221;, rather than try and execute it as a class method. The syntax is completely different; you use :: to call a class method and -&gt; to call an instance method. And you use the name of a <em>class</em> when you call a class method.</p>
<p>This code:</p>
<pre><code>
class Foo {
public static function static_fun()
{
return "This is a class method!\n";
}
public function not_static()
{
return "This is an instance method!\n";
}
}
echo '&lt;pre&gt;';
echo "From Foo:\n";
echo Foo::static_fun();
echo Foo::not_static();
echo "\n";
echo "From \$foo = new Foo():\n";
$foo = new Foo();
echo $foo-&gt;static_fun();
echo $foo-&gt;not_static();
echo '&lt;/pre&gt;';
</code></pre>
<p>Produces:</p>
<pre>
From Foo:
This is a class method!
This is an instance method!
From $foo = new Foo():
This is a class method!
This is an instance method!
</pre>
<p>What the fuck?! <a href="http://web.archive.org/web/20061018215149/http://www.php.net/manual/en/language.oop5.static.php">http://www.php.net/manual/en/language.oop5.static.php</a> is lying to everyone.</p>
</div>
<p class="meta">
Posted in <a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/php" rel="tag">php</a>, <a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/hacking" rel="tag">coding</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/2006/07/21/class-method-instance-method-it-doesnt-matter-to-php#comments">no comments</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/2006/07/21/class-method-instance-method-it-doesnt-matter-to-php#trackbacks">no trackbacks</a>
</p>
<a name="comments"></a><h4 class="blueblk">Comments</h4>
<p class="postmetadata alt">
<small><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/2006/07/21/class-method-instance-method-it-doesnt-matter-to-php#respond">Leave a response</a></small>
</p>
<ol class="comment-list" id="commentList">
<li id="dummy_comment" style="display: none"></li>
</ol>
<a name="trackbacks"></a><h4 class="blueblk">Trackbacks</h4>
<p>
Use the following link to trackback from your own site:<br/>
<span class="light-bg">http://sami.samhuri.net/articles/trackback/431</span>
</p>
<p class="postmetadata alt">
<small>
<a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/xml/rss20/article/431/feed.xml" title="RSS Feed">RSS feed for this post</a>
<a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/trackback/431" >trackback uri</a>
</small>
</p>
<form action="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/comment/431" class="commentform" id="commentform" method="post" onsubmit="new Ajax.Updater({success:'commentList'}, '/articles/comment/431', {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom, onComplete:function(request){complete(request)}, onFailure:function(request){failure(request)}, onLoading:function(request){loading()}, parameters:Form.serialize(this)}); return false;">
<div class="comment-box">
<div id="errors"></div>
<div id="preview" style="display: none"></div>
<a name="respond"></a>
<table cellpadding="4" cellspacing="0" class="frm-tbl">
<tr>
<td><p><label for="comment_author">Your name</label></p></td>
<td> <input id="comment_author" name="comment[author]" size="20" type="text" /> <small><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/2006/07/21/class-method-instance-method-it-doesnt-matter-to-php#" onclick="Element.toggle('guest_url'); Element.toggle('guest_email'); return false;">(leave url/email &#187;)</a></small></td>
</tr>
<tr id="guest_url" style="display:none;">
<td><p><label for="comment_url">Your blog</label></p></td>
<td> <input id="comment_url" name="comment[url]" size="30" type="text" /></td>
</tr>
<tr id="guest_email" style="display:none;">
<td><p><label for="comment_email">Your email</label></p></td>
<td> <input id="comment_email" name="comment[email]" size="30" type="text" /></td>
</tr>
<tr>
<td><p><label for="comment_body">Your message</label></p></td>
<td valign="top" colspan="2">
<textarea cols="40" id="comment_body" name="comment[body]" rows="20"></textarea>
</td>
</tr>
<tr>
<td colspan="2" id="frm-btns">
<span id="comment_loading" style="display:none;"><img alt="Spinner" src="http://web.archive.org/web/20061018215149im_/http://sami.samhuri.net/images/spinner.gif" /></span>&nbsp;&nbsp;
<a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/2006/07/21/class-method-instance-method-it-doesnt-matter-to-php#" onclick="new Ajax.Updater('preview', '/articles/comment_preview', {asynchronous:true, evalScripts:true, parameters:Form.serialize('commentform'), onComplete:function(request){Element.show('preview')}}); return false;">Preview comment</a>
<input type="submit" name="submit" id="form-submit-button" value="submit" class="button" />
</td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
show_dates_as_local_time()
//]]>
</script>
</div>
</div>
<div id="leftcolumn">
<div id="header">
<h1 id="sitename"><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/">sjs</a></h1>
<h2 id="subtitle">&nbsp;</h2>
</div>
<div id="sidebar">
<div id="search"><form action="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/search" id="sform" method="get">
<label for="q">Search: </label><input type="text" id="q" name="q" value="" size="15" />
<img alt="Spinner-blue" id="search_spinner" src="http://web.archive.org/web/20061018215149im_/http://sami.samhuri.net/images/spinner-blue.gif" style="display:none;" />
</form>
<script type="text/javascript">
//<![CDATA[
new Form.Element.Observer('q', 1, function(element, value) {new Ajax.Updater('search-results', '/live/search', {asynchronous:true, evalScripts:true, onComplete:function(request){Element.hide('search_spinner')}, onLoading:function(request){Element.show('search_spinner')}, parameters:'q=' + escape($F('q'))})})
//]]>
</script></div>
<div id="search-results"></div>
<div class="sidebar-node">
<h3>All about...</h3>
<ul>
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/pages/about">a bit about me</a></li>
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/pages/thunder">workstation</a></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Categories</h3>
<ul id="categories">
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/amusement">amusement</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/gentoo">gentoo</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/hacking">coding</a> <em>(16)</em></li>
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/life">life</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/linux">linux</a> <em>(2)</em></li>
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/mac-os-x">mac os x</a> <em>(6)</em></li>
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/python">python</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/rails">rails</a> <em>(12)</em></li>
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/ruby">ruby</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/technology">technology</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/textmate">textmate</a> <em>(10)</em></li>
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/apple">apple</a> <em>(6)</em></li>
<li><a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/category/php">php</a> <em>(4)</em></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Archives</h3>
<ul id="archives">
<li>
<a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/2006/09">September 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/2006/08">August 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/2006/07">July 2006</a>
<em>(5)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/2006/06">June 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/2006/05">May 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/2006/04">April 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/2006/03">March 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/articles/2006/02">February 2006</a>
<em>(15)</em>
</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Links</h3>
<ul>
<li><a href="http://web.archive.org/web/20061018215149/http://phox.ca/cswiki/Main_Page">CSWiki</a></li>
<li><a href="http://web.archive.org/web/20061018215149/http://jim.roepcke.com/">Have Browser, Will Travel</a></li>
<li><a href="http://web.archive.org/web/20061018215149/http://blog.inquirylabs.com/">Going Up</a></li>
<li><a href="http://web.archive.org/web/20061018215149/http://www.mirage.org/">encieno</a></li>
<li><a href="http://web.archive.org/web/20061018215149/http://www.nofxwiki.net/">nofxwiki.net</a></li>
<li>sami at samhuri dot net</li>
</ul>
</div>
<div class="sidebar-node">
<p><ul>
<li><a class="feed" href="http://web.archive.org/web/20061018215149/http://sami.samhuri.net/xml/rss20/feed.xml" title="Articles feed"><img src="http://web.archive.org/web/20061018215149im_/http://sami.samhuri.net/files/feed-icon-48x48.png" alt="RSS 2.0" width="48" height="48" /></a></li>
<!--
-->
</ul></p>
</div>
<br clear="all" />
</div>
</div>
<div id="footer">
<ul>
<li><a href="http://web.archive.org/web/20061018215149/http://typo.leetsoft.com/">Typo</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20061018215149/http://validator.w3.org/check?uri=referer">Valid XHTML</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20061018215149/http://jigsaw.w3.org/css-validator/validator?uri=http://sami.samhuri.net/">Valid CSS</a></li>
</ul>
</div>
<script src="http://web.archive.org/web/20061018215149js_/http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-214054-3";
urchinTracker();
</script>
</body>
</html>
<!--
FILE ARCHIVED ON 21:51:49 Oct 18, 2006 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 7:31:08 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,544 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>I don't mind FairPlay either - samhuri.net</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta content="48.472,-123.3683" name="ICBM" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/xml/rsd" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/xml/rss20/article/37/feed.xml" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/xml/atom10/article/37/feed.xml" />
<script src="http://web.archive.org/web/20060614130615js_/http://sami.samhuri.net/javascripts/cookies.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060614130615js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060614130615js_/http://sami.samhuri.net/javascripts/effects.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060614130615js_/http://sami.samhuri.net/javascripts/typo.js" type="text/javascript"></script>
<script type="text/javascript"></script>
<link href="http://web.archive.org/web/20060614130615cs_/http://sami.samhuri.net/stylesheets/theme/island.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20060614130615cs_/http://sami.samhuri.net/stylesheets/user-styles.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20060614130615cs_/http://sami.samhuri.net/stylesheets/theme/print.css" media="print" rel="Stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/articles\/2006\/03\/03\/i-dont-mind-fairplay-either";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "14";
var displayMonth = "Jun";
var displayYear = "2006";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/articles/2006/03/03/i-dont-mind-fairplay-either" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20060614130615" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
May
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 13:06:15 Jun 14, 2006">JUN</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20060927223554/http://sami.samhuri.net/articles/2006/03/03/i-dont-mind-fairplay-either" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="27 Sep 2006"><strong>SEP</strong></a>
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" />
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 13:06:15 Jun 14, 2006">14</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20060927223554/http://sami.samhuri.net/articles/2006/03/03/i-dont-mind-fairplay-either" title="22:35:54 Sep 27, 2006" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0"/></a>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2005
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 13:06:15 Jun 14, 2006">2006</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20071006110944/http://sami.samhuri.net/articles/2006/03/03/i-dont-mind-fairplay-either" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="6 Oct 2007"><strong>2007</strong></a>
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20060614130615*/http://sami.samhuri.net/articles/2006/03/03/i-dont-mind-fairplay-either" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>7 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">14 Jun 06 - 9 Oct 07</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:5:000001001010_2007:-1:001000000300_2008:-1:000000000000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="content" class="clearfix">
<div id="main">
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping="http://sami.samhuri.net/articles/trackback/37"
dc:title="I don't mind FairPlay either"
dc:identifier="http://sami.samhuri.net/articles/read/37"
dc:description="I think that Jim is right about Apple&amp;#8217;s DRM not being all that evil. I buy music from the iTunes Music Store because I bought an iPod. The fact I"
dc:creator="sjs"
dc:date="2006-04-10T16:47:28-07:00" />
</rdf:RDF>
-->
<div class="post" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_article'); }" onmouseout="Element.hide('admin_article');" >
<a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/admin/content/edit/37" class="admintools" id="admin_article" style="display: none">edit</a>
<h2>I don't mind FairPlay either</h2>
<p class="auth"><!-- Posted by <a href="mailto:sjs@uvic.ca">Sami Jensen Samhuri</a> -->
<span class="typo_date" title="Sat, 04 Mar 2006 05:56:00 GMT">Sat, 04 Mar 2006 05:56:00 GMT</span></p>
<p>I think that <a href="http://web.archive.org/web/20060614130615/http://jim.roepcke.com/2006/03/02#item7471">Jim is right</a> about Apple&#8217;s <span class="caps">DRM</span> not being all that evil.</p>
<p>I buy music from the iTunes Music Store <em>because</em> I bought an iPod. The fact I can&#8217;t play them on another device doesn&#8217;t matter to me. With my purchased songs I can:</p>
<ul>
<li>listen to the songs I buy all I want</li>
<li>burn them to CD</li>
<li>stream them to my amplifier via AirPort Express</li>
</ul>
<p>I don&#8217;t buy a ton of music from the iTMS, but I can&#8217;t tell the difference between any of those songs and the songs I ripped from CDs and they&#8217;re all mixed in one collection. That&#8217;s good enough for me.</p>
<p>I dislike <span class="caps">DRM</span> as much as the next guy, but like <span class="caps">CSS</span> encryption on DVDs, FairPlay is something I can live with.</p>
<p>It reminds me of how here in North America I have to live with the crappy cell phone companies that lock their phones to their networks. If it&#8217;s something I need or want, sometimes I&#8217;ll live with restrictions because there are no alternatives yet.</p>
<p><em><strong>Update:</strong> It&#8217;s almost settled. The pope <a href="http://web.archive.org/web/20060614130615/http://www.catholicnews.com/data/stories/cns/0601282.htm">got an iPod</a> so all that&#8217;s left is to see if he buys any music off of iTunes. If he does, then it can&#8217;t be evil. heh&#8230;</em></p>
</div>
<p class="meta">
Posted in <a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/category/apple" rel="tag">apple</a>, <a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/category/mac-os-x" rel="tag">mac os x</a>, <a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/category/life" rel="tag">life</a>&nbsp;<strong>|</strong>&nbsp;Tags <a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/tag/drm" rel="tag">drm</a>, <a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/tag/fairplay" rel="tag">fairplay</a>, <a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/tag/ipod" rel="tag">ipod</a>, <a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/tag/itunes" rel="tag">itunes</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/2006/03/03/i-dont-mind-fairplay-either#comments">no comments</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/2006/03/03/i-dont-mind-fairplay-either#trackbacks">no trackbacks</a>
</p>
<a name="comments"></a><h4 class="blueblk">Comments</h4>
<p class="postmetadata alt">
<small><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/2006/03/03/i-dont-mind-fairplay-either#respond">Leave a response</a></small>
</p>
<ol class="comment-list" id="commentList">
<li id="dummy_comment" style="display: none"></li>
</ol>
<a name="trackbacks"></a><h4 class="blueblk">Trackbacks</h4>
<p>
Use the following link to trackback from your own site:<br/>
<span class="light-bg">http://sami.samhuri.net/articles/trackback/37</span>
</p>
<p class="postmetadata alt">
<small>
<a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/xml/rss20/article/37/feed.xml" title="RSS Feed">RSS feed for this post</a>
<a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/trackback/37" >trackback uri</a>
</small>
</p>
<form action="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/comment/37" class="commentform" id="commentform" method="post" onsubmit="new Ajax.Updater({success:'commentList'}, '/articles/comment/37', {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom, onComplete:function(request){complete(request)}, onFailure:function(request){failure(request)}, onLoading:function(request){loading()}, parameters:Form.serialize(this)}); return false;">
<div class="comment-box">
<div id="errors"></div>
<div id="preview" style="display: none"></div>
<a name="respond"></a>
<table cellpadding="4" cellspacing="0" class="frm-tbl">
<tr>
<td><p><label for="comment_author">Your name</label></p></td>
<td> <input id="comment_author" name="comment[author]" size="20" type="text" /> <small><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/2006/03/03/i-dont-mind-fairplay-either#" onclick="Element.toggle('guest_url'); Element.toggle('guest_email'); return false;">(leave url/email &#187;)</a></small></td>
</tr>
<tr id="guest_url" style="display:none;">
<td><p><label for="comment_url">Your blog</label></p></td>
<td> <input id="comment_url" name="comment[url]" size="30" type="text" /></td>
</tr>
<tr id="guest_email" style="display:none;">
<td><p><label for="comment_email">Your email</label></p></td>
<td> <input id="comment_email" name="comment[email]" size="30" type="text" /></td>
</tr>
<tr>
<td><p><label for="comment_body">Your message</label></p></td>
<td valign="top" colspan="2">
<textarea cols="40" id="comment_body" name="comment[body]" rows="20"></textarea>
</td>
</tr>
<tr>
<td colspan="2" id="frm-btns">
<span id="comment_loading" style="display:none;"><img alt="Spinner" src="http://web.archive.org/web/20060614130615im_/http://sami.samhuri.net/images/spinner.gif" /></span>&nbsp;&nbsp;
<a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/2006/03/03/i-dont-mind-fairplay-either#" onclick="new Ajax.Updater('preview', '/articles/comment_preview', {asynchronous:true, evalScripts:true, parameters:Form.serialize('commentform'), onComplete:function(request){Element.show('preview')}}); return false;">Preview comment</a>
<input type="submit" name="submit" id="form-submit-button" value="submit" class="button" />
</td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
show_dates_as_local_time()
//]]>
</script>
</div>
</div>
<div id="leftcolumn">
<div id="header">
<h1 id="sitename"><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/">sjs</a></h1>
<h2 id="subtitle">&nbsp;</h2>
</div>
<div id="sidebar">
<div id="search"><form action="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/search" id="sform" method="get">
<label for="q">Search: </label><input type="text" id="q" name="q" value="" size="15" />
<img alt="Spinner-blue" id="search_spinner" src="http://web.archive.org/web/20060614130615im_/http://sami.samhuri.net/images/spinner-blue.gif" style="display:none;" />
</form>
<script type="text/javascript">
//<![CDATA[
new Form.Element.Observer('q', 1, function(element, value) {new Ajax.Updater('search-results', '/live/search', {asynchronous:true, evalScripts:true, onComplete:function(request){Element.hide('search_spinner')}, onLoading:function(request){Element.show('search_spinner')}, parameters:'q=' + escape($F('q'))})})
//]]>
</script></div>
<div id="search-results"></div>
<div class="sidebar-node">
<h3>All about...</h3>
<ul>
<li><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/pages/about">me in 3 paragraphs</a></li>
<li><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/pages/how-i-became-a-geek">geek background</a></li>
<li><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/pages/thunder">workstation</a></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Categories</h3>
<ul id="categories">
<li><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/category/amusement">amusement</a> <em>(4)</em></li>
<li><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/category/gentoo">gentoo</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/category/hacking">hacking</a> <em>(12)</em></li>
<li><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/category/life">life</a> <em>(4)</em></li>
<li><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/category/linux">linux</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/category/mac-os-x">mac os x</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/category/python">python</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/category/rails">rails</a> <em>(11)</em></li>
<li><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/category/technology">technology</a> <em>(2)</em></li>
<li><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/category/textmate">textmate</a> <em>(10)</em></li>
<li><a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/category/apple">apple</a> <em>(3)</em></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Archives</h3>
<ul id="archives">
<li>
<a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/2006/06">June 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/2006/05">May 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/2006/04">April 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/2006/03">March 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/articles/2006/02">February 2006</a>
<em>(15)</em>
</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Links</h3>
<ul>
<li><a href="http://web.archive.org/web/20060614130615/http://phox.ca/cswiki/Main_Page">CSWiki</a></li>
<li><a href="http://web.archive.org/web/20060614130615/http://jim.roepcke.com/">Have Browser, Will Travel</a></li>
<li><a href="http://web.archive.org/web/20060614130615/http://blog.inquirylabs.com/">Going Up</a></li>
<li><a href="http://web.archive.org/web/20060614130615/http://www.mirage.org/">encieno</a></li>
<li><a href="http://web.archive.org/web/20060614130615/http://www.nofxwiki.net/">nofxwiki.net</a></li>
</ul>
</div>
<div class="sidebar-node">
<p><ul>
<li><a class="feed" href="http://web.archive.org/web/20060614130615/http://sami.samhuri.net/xml/rss20/feed.xml" title="Articles feed"><img src="http://web.archive.org/web/20060614130615im_/http://sami.samhuri.net/files/feed-icon-48x48.png" alt="RSS 2.0" width="48" height="48" /></a></li>
<!--
-->
</ul></p>
</div>
<br clear="all" />
</div>
</div>
<div id="footer">
<ul>
<li><a href="http://web.archive.org/web/20060614130615/http://typo.leetsoft.com/">Typo</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20060614130615/http://validator.w3.org/check?uri=referer">Valid XHTML</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20060614130615/http://jigsaw.w3.org/css-validator/validator?uri=http://sami.samhuri.net/">Valid CSS</a></li>
</ul>
</div>
<script src="http://web.archive.org/web/20060614130615js_/http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-214054-3";
urchinTracker();
</script>
</body>
</html>
<!--
FILE ARCHIVED ON 13:06:15 Jun 14, 2006 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 7:29:52 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,601 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Late static binding - samhuri.net</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta content="48.472,-123.3683" name="ICBM" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/xml/rsd" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/xml/rss20/article/430/feed.xml" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/xml/atom10/article/430/feed.xml" />
<script src="http://web.archive.org/web/20061018215014js_/http://sami.samhuri.net/javascripts/cookies.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215014js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215014js_/http://sami.samhuri.net/javascripts/effects.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215014js_/http://sami.samhuri.net/javascripts/typo.js" type="text/javascript"></script>
<script type="text/javascript"></script>
<link href="http://web.archive.org/web/20061018215014cs_/http://sami.samhuri.net/stylesheets/theme/island.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20061018215014cs_/http://sami.samhuri.net/stylesheets/user-styles.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20061018215014cs_/http://sami.samhuri.net/stylesheets/theme/print.css" media="print" rel="Stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/articles\/2006\/07\/19\/late-static-binding";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "18";
var displayMonth = "Oct";
var displayYear = "2006";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/articles/2006/07/19/late-static-binding" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20061018215014" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Sep
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 21:50:14 Oct 18, 2006">OCT</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20070313163006/http://sami.samhuri.net/articles/2006/07/19/late-static-binding" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="13 Mar 2007"><strong>MAR</strong></a>
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" />
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 21:50:14 Oct 18, 2006">18</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20070313163006/http://sami.samhuri.net/articles/2006/07/19/late-static-binding" title="16:30:06 Mar 13, 2007" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0"/></a>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2005
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 21:50:14 Oct 18, 2006">2006</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2007
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20061018215014*/http://sami.samhuri.net/articles/2006/07/19/late-static-binding" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>2 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">18 Oct 06 - 13 Mar 07</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:9:000000000100_2007:-1:001000000000_2008:-1:000000000000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="content" class="clearfix">
<div id="main">
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping="http://sami.samhuri.net/articles/trackback/430"
dc:title="Late static binding"
dc:identifier="http://sami.samhuri.net/articles/read/430"
dc:description="Update: This has been discussed and will be uh, sort of fixed, in PHP6. You&amp;#8217;ll be abl"
dc:creator="sjs"
dc:date="2006-09-19T19:20:46-07:00" />
</rdf:RDF>
-->
<div class="post" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_article'); }" onmouseout="Element.hide('admin_article');" >
<a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/admin/content/edit/430" class="admintools" id="admin_article" style="display: none">edit</a>
<h2>Late static binding</h2>
<p class="auth"><!-- Posted by <a href="mailto:sjs@uvic.ca">Sami Jensen Samhuri</a> -->
<span class="typo_date" title="Wed, 19 Jul 2006 17:23:00 GMT">Wed, 19 Jul 2006 17:23:00 GMT</span></p>
<p><em>Update: This has <a href="http://web.archive.org/web/20061018215014/http://www.php.net/~derick/meeting-notes.html#late-static-binding-using-this-without-or-perhaps-with-a-different-name">been discussed</a> and will be uh, sort of fixed, in <span class="caps">PHP6</span>. You&#8217;ll be able to use static::my_method() to get the real reference to self in class methods. Not optimal, but still a solution I guess.</em></p>
<p>As colder on ##php (freenode) told me today, class methods in <span class="caps">PHP</span> don&#8217;t have what they call late static binding. What&#8217;s that? It means that this code:</p>
<pre>
<code>
class Foo
{
public static function my_method()
{
echo "I'm a " . get_class() . "!\n";
}
}
class Bar extends Foo
{}
Bar::my_method();
</code>
</pre>
<p>outputs &#8220;I&#8217;m a Foo!&#8221;, instead of &#8220;I&#8217;m a Bar!&#8221;. That&#8217;s not fun.</p><p>Using <code>__CLASS__</code> in place of <code>get_class()</code> makes zero difference. You end up with proxy methods in each subclass of Foo that pass in the real name of the calling class, which sucks.</p>
<pre>
<code>
class Bar extends Foo
{
public static function my_method()
{
return parent::my_method( get_class() );
}
}
</code>
</pre>
<p>I was told that they had a discussion about this on the internal <span class="caps">PHP</span> list, so at least they&#8217;re thinking about this stuff. Too bad <span class="caps">PHP5</span> doesn&#8217;t have it. I guess I should just be glad I won&#8217;t be maintaining this code.</p>
<p>The resident <span class="caps">PHP</span> coder said &#8220;just make your code simpler&#8221;, which is what I was trying to do by removing duplication. Too bad that plan sort of backfired. I guess odd things like this are where <span class="caps">PHP</span> starts to show that OO was tacked on as an after-thought.</p>
</div>
<p class="meta">
Posted in <a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/php" rel="tag">php</a>, <a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/hacking" rel="tag">coding</a>&nbsp;<strong>|</strong>&nbsp;Tags <a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/tag/coding" rel="tag">coding</a>, <a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/tag/php" rel="tag">php</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/07/19/late-static-binding#comments">2 comments</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/07/19/late-static-binding#trackbacks">no trackbacks</a>
</p>
<a name="comments"></a><h4 class="blueblk">Comments</h4>
<p class="postmetadata alt">
<small><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/07/19/late-static-binding#respond">Leave a response</a></small>
</p>
<ol class="comment-list" id="commentList">
<li id="comment-432" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_comment_432'); }" onmouseout="Element.hide('admin_comment_432');" >
<div id="admin_comment_432" style="display: none"><a class="admintools" href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/07/19/late-static-binding#" onclick="if (confirm('Are you sure you want to delete this comment?')) { new Ajax.Request('/articles/nuke_comment/432', {asynchronous:true, evalScripts:true, onComplete:function(request){new Effect.Puff('comment-432',{duration:0.6});}}); }; return false;">nuke</a><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/admin/comments/article/430/edit/432" class="admintools">edit</a></div>
<a name="comment-432"></a>
<img alt="Avatar" class="gravatar" src="http://web.archive.org/web/20061018215014im_/http://www.gravatar.com/avatar.php?gravatar_id=d41d8cd98f00b204e9800998ecf8427e&size=60" />
<cite><strong>Jim Roepcke</strong> </cite> said 25 days later:<br />
<p>That&#8217;s the worst of both worlds.</p>
<p>In Objective-C, that would work properly. In Java, it wouldn&#8217;t work at all because static methods (Java doesn&#8217;t have class methods) aren&#8217;t inherited by subclasses, so at least if you called the method on the superclass the result would be consistent&#8230;. but this, this crap (as <span class='caps'>PHP</span> always is), well, it isn&#8217;t consistent with anything. Doesn&#8217;t get any worse. But, I&#8217;m hardly surprised.</p>
</li><li id="comment-434" class="author_comment" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_comment_434'); }" onmouseout="Element.hide('admin_comment_434');" >
<div id="admin_comment_434" style="display: none"><a class="admintools" href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/07/19/late-static-binding#" onclick="if (confirm('Are you sure you want to delete this comment?')) { new Ajax.Request('/articles/nuke_comment/434', {asynchronous:true, evalScripts:true, onComplete:function(request){new Effect.Puff('comment-434',{duration:0.6});}}); }; return false;">nuke</a><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/admin/comments/article/430/edit/434" class="admintools">edit</a></div>
<a name="comment-434"></a>
<img alt="Avatar" class="gravatar" src="http://web.archive.org/web/20061018215014im_/http://www.gravatar.com/avatar.php?gravatar_id=d41d8cd98f00b204e9800998ecf8427e&size=60" />
<cite><strong>Sami</strong> </cite> said 34 days later:<br />
<p>Interesting about Java, I didn&#8217;t know static methods weren&#8217;t inherited.</p>
<p>I have to say that I don&#8217;t know if I can work another job using <span class='caps'>PHP</span> and keep my sanity. :)</p>
</li>
</ol>
<a name="trackbacks"></a><h4 class="blueblk">Trackbacks</h4>
<p>
Use the following link to trackback from your own site:<br/>
<span class="light-bg">http://sami.samhuri.net/articles/trackback/430</span>
</p>
<p class="postmetadata alt">
<small>
<a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/xml/rss20/article/430/feed.xml" title="RSS Feed">RSS feed for this post</a>
<a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/trackback/430" >trackback uri</a>
</small>
</p>
<form action="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/comment/430" class="commentform" id="commentform" method="post" onsubmit="new Ajax.Updater({success:'commentList'}, '/articles/comment/430', {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom, onComplete:function(request){complete(request)}, onFailure:function(request){failure(request)}, onLoading:function(request){loading()}, parameters:Form.serialize(this)}); return false;">
<div class="comment-box">
<div id="errors"></div>
<div id="preview" style="display: none"></div>
<a name="respond"></a>
<table cellpadding="4" cellspacing="0" class="frm-tbl">
<tr>
<td><p><label for="comment_author">Your name</label></p></td>
<td> <input id="comment_author" name="comment[author]" size="20" type="text" /> <small><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/07/19/late-static-binding#" onclick="Element.toggle('guest_url'); Element.toggle('guest_email'); return false;">(leave url/email &#187;)</a></small></td>
</tr>
<tr id="guest_url" style="display:none;">
<td><p><label for="comment_url">Your blog</label></p></td>
<td> <input id="comment_url" name="comment[url]" size="30" type="text" /></td>
</tr>
<tr id="guest_email" style="display:none;">
<td><p><label for="comment_email">Your email</label></p></td>
<td> <input id="comment_email" name="comment[email]" size="30" type="text" /></td>
</tr>
<tr>
<td><p><label for="comment_body">Your message</label></p></td>
<td valign="top" colspan="2">
<textarea cols="40" id="comment_body" name="comment[body]" rows="20"></textarea>
</td>
</tr>
<tr>
<td colspan="2" id="frm-btns">
<span id="comment_loading" style="display:none;"><img alt="Spinner" src="http://web.archive.org/web/20061018215014im_/http://sami.samhuri.net/images/spinner.gif" /></span>&nbsp;&nbsp;
<a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/07/19/late-static-binding#" onclick="new Ajax.Updater('preview', '/articles/comment_preview', {asynchronous:true, evalScripts:true, parameters:Form.serialize('commentform'), onComplete:function(request){Element.show('preview')}}); return false;">Preview comment</a>
<input type="submit" name="submit" id="form-submit-button" value="submit" class="button" />
</td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
show_dates_as_local_time()
//]]>
</script>
</div>
</div>
<div id="leftcolumn">
<div id="header">
<h1 id="sitename"><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/">sjs</a></h1>
<h2 id="subtitle">&nbsp;</h2>
</div>
<div id="sidebar">
<div id="search"><form action="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/search" id="sform" method="get">
<label for="q">Search: </label><input type="text" id="q" name="q" value="" size="15" />
<img alt="Spinner-blue" id="search_spinner" src="http://web.archive.org/web/20061018215014im_/http://sami.samhuri.net/images/spinner-blue.gif" style="display:none;" />
</form>
<script type="text/javascript">
//<![CDATA[
new Form.Element.Observer('q', 1, function(element, value) {new Ajax.Updater('search-results', '/live/search', {asynchronous:true, evalScripts:true, onComplete:function(request){Element.hide('search_spinner')}, onLoading:function(request){Element.show('search_spinner')}, parameters:'q=' + escape($F('q'))})})
//]]>
</script></div>
<div id="search-results"></div>
<div class="sidebar-node">
<h3>All about...</h3>
<ul>
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/pages/about">a bit about me</a></li>
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/pages/thunder">workstation</a></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Categories</h3>
<ul id="categories">
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/amusement">amusement</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/gentoo">gentoo</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/hacking">coding</a> <em>(16)</em></li>
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/life">life</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/linux">linux</a> <em>(2)</em></li>
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/mac-os-x">mac os x</a> <em>(6)</em></li>
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/python">python</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/rails">rails</a> <em>(12)</em></li>
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/ruby">ruby</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/technology">technology</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/textmate">textmate</a> <em>(10)</em></li>
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/apple">apple</a> <em>(6)</em></li>
<li><a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/category/php">php</a> <em>(4)</em></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Archives</h3>
<ul id="archives">
<li>
<a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/09">September 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/08">August 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/07">July 2006</a>
<em>(5)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/06">June 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/05">May 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/04">April 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/03">March 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/articles/2006/02">February 2006</a>
<em>(15)</em>
</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Links</h3>
<ul>
<li><a href="http://web.archive.org/web/20061018215014/http://phox.ca/cswiki/Main_Page">CSWiki</a></li>
<li><a href="http://web.archive.org/web/20061018215014/http://jim.roepcke.com/">Have Browser, Will Travel</a></li>
<li><a href="http://web.archive.org/web/20061018215014/http://blog.inquirylabs.com/">Going Up</a></li>
<li><a href="http://web.archive.org/web/20061018215014/http://www.mirage.org/">encieno</a></li>
<li><a href="http://web.archive.org/web/20061018215014/http://www.nofxwiki.net/">nofxwiki.net</a></li>
<li>sami at samhuri dot net</li>
</ul>
</div>
<div class="sidebar-node">
<p><ul>
<li><a class="feed" href="http://web.archive.org/web/20061018215014/http://sami.samhuri.net/xml/rss20/feed.xml" title="Articles feed"><img src="http://web.archive.org/web/20061018215014im_/http://sami.samhuri.net/files/feed-icon-48x48.png" alt="RSS 2.0" width="48" height="48" /></a></li>
<!--
-->
</ul></p>
</div>
<br clear="all" />
</div>
</div>
<div id="footer">
<ul>
<li><a href="http://web.archive.org/web/20061018215014/http://typo.leetsoft.com/">Typo</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20061018215014/http://validator.w3.org/check?uri=referer">Valid XHTML</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20061018215014/http://jigsaw.w3.org/css-validator/validator?uri=http://sami.samhuri.net/">Valid CSS</a></li>
</ul>
</div>
<script src="http://web.archive.org/web/20061018215014js_/http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-214054-3";
urchinTracker();
</script>
</body>
</html>
<!--
FILE ARCHIVED ON 21:50:14 Oct 18, 2006 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 7:31:10 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,522 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OS X and Fitt's law - samhuri.net</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta content="48.472,-123.3683" name="ICBM" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/xml/rsd" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/xml/rss20/article/65/feed.xml" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/xml/atom10/article/65/feed.xml" />
<script src="http://web.archive.org/web/20060614130552js_/http://sami.samhuri.net/javascripts/cookies.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060614130552js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060614130552js_/http://sami.samhuri.net/javascripts/effects.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060614130552js_/http://sami.samhuri.net/javascripts/typo.js" type="text/javascript"></script>
<script type="text/javascript"></script>
<link href="http://web.archive.org/web/20060614130552cs_/http://sami.samhuri.net/stylesheets/theme/island.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20060614130552cs_/http://sami.samhuri.net/stylesheets/user-styles.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20060614130552cs_/http://sami.samhuri.net/stylesheets/theme/print.css" media="print" rel="Stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/articles\/2006\/05\/07\/os-x-and-fitts-law";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "14";
var displayMonth = "Jun";
var displayYear = "2006";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/articles/2006/05/07/os-x-and-fitts-law" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20060614130552" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
May
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 13:05:52 Jun 14, 2006">JUN</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20061229153311/http://sami.samhuri.net/articles/2006/05/07/os-x-and-fitts-law" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="29 Dec 2006"><strong>DEC</strong></a>
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" />
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 13:05:52 Jun 14, 2006">14</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20061229153311/http://sami.samhuri.net/articles/2006/05/07/os-x-and-fitts-law" title="15:33:11 Dec 29, 2006" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0"/></a>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2005
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 13:05:52 Jun 14, 2006">2006</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20070805211623/http://sami.samhuri.net/articles/2006/05/07/os-x-and-fitts-law" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="5 Aug 2007"><strong>2007</strong></a>
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20060614130552*/http://sami.samhuri.net/articles/2006/05/07/os-x-and-fitts-law" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>4 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">14 Jun 06 - 5 Aug 07</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:5:000001000001_2007:-1:001000010000_2008:-1:000000000000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="content" class="clearfix">
<div id="main">
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping="http://sami.samhuri.net/articles/trackback/65"
dc:title="OS X and Fitt's law"
dc:identifier="http://sami.samhuri.net/articles/read/65"
dc:description="I&amp;#8217;ve realized that OS X really does obey Fitt&amp;#8217;s law in all 4 corners now. Apple menu in the top left, Spotlight top right, and the bottom 2 are always accessible for drag n drop, unless the dock is hidden. I rarely"
dc:creator="sjs"
dc:date="2006-05-07T20:48:53-07:00" />
</rdf:RDF>
-->
<div class="post" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_article'); }" onmouseout="Element.hide('admin_article');" >
<a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/admin/content/edit/65" class="admintools" id="admin_article" style="display: none">edit</a>
<h2>OS X and Fitt's law</h2>
<p class="auth"><!-- Posted by <a href="mailto:sjs@uvic.ca">Sami Jensen Samhuri</a> -->
<span class="typo_date" title="Mon, 08 May 2006 03:43:00 GMT">Mon, 08 May 2006 03:43:00 GMT</span></p>
<p>I&#8217;ve realized that <span class="caps">OS X</span> really does obey Fitt&#8217;s law in all 4 corners now. Apple menu in the top left, Spotlight top right, and the bottom 2 are always accessible for drag n drop, unless the dock is hidden. I rarely ever use it because I usually have pretty good chunks of the desktop showing, but it is useful.</p>
</div>
<p class="meta">
Posted in <a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/category/mac-os-x" rel="tag">mac os x</a>, <a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/category/apple" rel="tag">apple</a>&nbsp;<strong>|</strong>&nbsp;Tags <a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/tag/mac" rel="tag">mac</a>, <a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/tag/os" rel="tag">os</a>, <a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/tag/usability" rel="tag">usability</a>, <a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/tag/x" rel="tag">x</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/2006/05/07/os-x-and-fitts-law#comments">no comments</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/2006/05/07/os-x-and-fitts-law#trackbacks">no trackbacks</a>
</p>
<a name="comments"></a><h4 class="blueblk">Comments</h4>
<p class="postmetadata alt">
<small><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/2006/05/07/os-x-and-fitts-law#respond">Leave a response</a></small>
</p>
<ol class="comment-list" id="commentList">
<li id="dummy_comment" style="display: none"></li>
</ol>
<a name="trackbacks"></a><h4 class="blueblk">Trackbacks</h4>
<p>
Use the following link to trackback from your own site:<br/>
<span class="light-bg">http://sami.samhuri.net/articles/trackback/65</span>
</p>
<p class="postmetadata alt">
<small>
<a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/xml/rss20/article/65/feed.xml" title="RSS Feed">RSS feed for this post</a>
<a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/trackback/65" >trackback uri</a>
</small>
</p>
<form action="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/comment/65" class="commentform" id="commentform" method="post" onsubmit="new Ajax.Updater({success:'commentList'}, '/articles/comment/65', {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom, onComplete:function(request){complete(request)}, onFailure:function(request){failure(request)}, onLoading:function(request){loading()}, parameters:Form.serialize(this)}); return false;">
<div class="comment-box">
<div id="errors"></div>
<div id="preview" style="display: none"></div>
<a name="respond"></a>
<table cellpadding="4" cellspacing="0" class="frm-tbl">
<tr>
<td><p><label for="comment_author">Your name</label></p></td>
<td> <input id="comment_author" name="comment[author]" size="20" type="text" /> <small><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/2006/05/07/os-x-and-fitts-law#" onclick="Element.toggle('guest_url'); Element.toggle('guest_email'); return false;">(leave url/email &#187;)</a></small></td>
</tr>
<tr id="guest_url" style="display:none;">
<td><p><label for="comment_url">Your blog</label></p></td>
<td> <input id="comment_url" name="comment[url]" size="30" type="text" /></td>
</tr>
<tr id="guest_email" style="display:none;">
<td><p><label for="comment_email">Your email</label></p></td>
<td> <input id="comment_email" name="comment[email]" size="30" type="text" /></td>
</tr>
<tr>
<td><p><label for="comment_body">Your message</label></p></td>
<td valign="top" colspan="2">
<textarea cols="40" id="comment_body" name="comment[body]" rows="20"></textarea>
</td>
</tr>
<tr>
<td colspan="2" id="frm-btns">
<span id="comment_loading" style="display:none;"><img alt="Spinner" src="http://web.archive.org/web/20060614130552im_/http://sami.samhuri.net/images/spinner.gif" /></span>&nbsp;&nbsp;
<a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/2006/05/07/os-x-and-fitts-law#" onclick="new Ajax.Updater('preview', '/articles/comment_preview', {asynchronous:true, evalScripts:true, parameters:Form.serialize('commentform'), onComplete:function(request){Element.show('preview')}}); return false;">Preview comment</a>
<input type="submit" name="submit" id="form-submit-button" value="submit" class="button" />
</td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
show_dates_as_local_time()
//]]>
</script>
</div>
</div>
<div id="leftcolumn">
<div id="header">
<h1 id="sitename"><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/">sjs</a></h1>
<h2 id="subtitle">&nbsp;</h2>
</div>
<div id="sidebar">
<div id="search"><form action="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/search" id="sform" method="get">
<label for="q">Search: </label><input type="text" id="q" name="q" value="" size="15" />
<img alt="Spinner-blue" id="search_spinner" src="http://web.archive.org/web/20060614130552im_/http://sami.samhuri.net/images/spinner-blue.gif" style="display:none;" />
</form>
<script type="text/javascript">
//<![CDATA[
new Form.Element.Observer('q', 1, function(element, value) {new Ajax.Updater('search-results', '/live/search', {asynchronous:true, evalScripts:true, onComplete:function(request){Element.hide('search_spinner')}, onLoading:function(request){Element.show('search_spinner')}, parameters:'q=' + escape($F('q'))})})
//]]>
</script></div>
<div id="search-results"></div>
<div class="sidebar-node">
<h3>All about...</h3>
<ul>
<li><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/pages/about">me in 3 paragraphs</a></li>
<li><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/pages/how-i-became-a-geek">geek background</a></li>
<li><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/pages/thunder">workstation</a></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Categories</h3>
<ul id="categories">
<li><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/category/amusement">amusement</a> <em>(4)</em></li>
<li><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/category/gentoo">gentoo</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/category/hacking">hacking</a> <em>(12)</em></li>
<li><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/category/life">life</a> <em>(4)</em></li>
<li><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/category/linux">linux</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/category/mac-os-x">mac os x</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/category/python">python</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/category/rails">rails</a> <em>(11)</em></li>
<li><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/category/technology">technology</a> <em>(2)</em></li>
<li><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/category/textmate">textmate</a> <em>(10)</em></li>
<li><a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/category/apple">apple</a> <em>(3)</em></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Archives</h3>
<ul id="archives">
<li>
<a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/2006/06">June 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/2006/05">May 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/2006/04">April 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/2006/03">March 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/articles/2006/02">February 2006</a>
<em>(15)</em>
</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Links</h3>
<ul>
<li><a href="http://web.archive.org/web/20060614130552/http://phox.ca/cswiki/Main_Page">CSWiki</a></li>
<li><a href="http://web.archive.org/web/20060614130552/http://jim.roepcke.com/">Have Browser, Will Travel</a></li>
<li><a href="http://web.archive.org/web/20060614130552/http://blog.inquirylabs.com/">Going Up</a></li>
<li><a href="http://web.archive.org/web/20060614130552/http://www.mirage.org/">encieno</a></li>
<li><a href="http://web.archive.org/web/20060614130552/http://www.nofxwiki.net/">nofxwiki.net</a></li>
</ul>
</div>
<div class="sidebar-node">
<p><ul>
<li><a class="feed" href="http://web.archive.org/web/20060614130552/http://sami.samhuri.net/xml/rss20/feed.xml" title="Articles feed"><img src="http://web.archive.org/web/20060614130552im_/http://sami.samhuri.net/files/feed-icon-48x48.png" alt="RSS 2.0" width="48" height="48" /></a></li>
<!--
-->
</ul></p>
</div>
<br clear="all" />
</div>
</div>
<div id="footer">
<ul>
<li><a href="http://web.archive.org/web/20060614130552/http://typo.leetsoft.com/">Typo</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20060614130552/http://validator.w3.org/check?uri=referer">Valid XHTML</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20060614130552/http://jigsaw.w3.org/css-validator/validator?uri=http://sami.samhuri.net/">Valid CSS</a></li>
</ul>
</div>
<script src="http://web.archive.org/web/20060614130552js_/http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-214054-3";
urchinTracker();
</script>
</body>
</html>
<!--
FILE ARCHIVED ON 13:05:52 Jun 14, 2006 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 7:29:30 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,551 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Ruby and Rails have spoiled me rotten - samhuri.net</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta content="48.472,-123.3683" name="ICBM" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/xml/rsd" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/xml/rss20/article/429/feed.xml" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/xml/atom10/article/429/feed.xml" />
<script src="http://web.archive.org/web/20061018215113js_/http://sami.samhuri.net/javascripts/cookies.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215113js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215113js_/http://sami.samhuri.net/javascripts/effects.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215113js_/http://sami.samhuri.net/javascripts/typo.js" type="text/javascript"></script>
<script type="text/javascript"></script>
<link href="http://web.archive.org/web/20061018215113cs_/http://sami.samhuri.net/stylesheets/theme/island.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20061018215113cs_/http://sami.samhuri.net/stylesheets/user-styles.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20061018215113cs_/http://sami.samhuri.net/stylesheets/theme/print.css" media="print" rel="Stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/articles\/2006\/07\/17\/ruby-and-rails-ave-spoiled-me-rotten";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "18";
var displayMonth = "Oct";
var displayYear = "2006";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/articles/2006/07/17/ruby-and-rails-ave-spoiled-me-rotten" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20061018215113" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Sep
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 21:51:13 Oct 18, 2006">OCT</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20070313163025/http://sami.samhuri.net/articles/2006/07/17/ruby-and-rails-ave-spoiled-me-rotten" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="13 Mar 2007"><strong>MAR</strong></a>
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" />
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 21:51:13 Oct 18, 2006">18</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20070313163025/http://sami.samhuri.net/articles/2006/07/17/ruby-and-rails-ave-spoiled-me-rotten" title="16:30:25 Mar 13, 2007" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0"/></a>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2005
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 21:51:13 Oct 18, 2006">2006</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2007
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20061018215113*/http://sami.samhuri.net/articles/2006/07/17/ruby-and-rails-ave-spoiled-me-rotten" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>2 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">18 Oct 06 - 13 Mar 07</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:9:000000000100_2007:-1:001000000000_2008:-1:000000000000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="content" class="clearfix">
<div id="main">
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping="http://sami.samhuri.net/articles/trackback/429"
dc:title="Ruby and Rails have spoiled me rotten"
dc:identifier="http://sami.samhuri.net/articles/read/429"
dc:description="It&amp;#8217;s true. I&amp;#8217;m sitting here coding in PHP using the Zend Framework and all I can think about is how much nicer Rails is, or how much easier it is to do [x] in Ruby. It&amp;#8217;s"
dc:creator="sjs"
dc:date="2006-09-19T19:20:46-07:00" />
</rdf:RDF>
-->
<div class="post" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_article'); }" onmouseout="Element.hide('admin_article');" >
<a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/admin/content/edit/429" class="admintools" id="admin_article" style="display: none">edit</a>
<h2>Ruby and Rails have spoiled me rotten</h2>
<p class="auth"><!-- Posted by <a href="mailto:sjs@uvic.ca">Sami Jensen Samhuri</a> -->
<span class="typo_date" title="Mon, 17 Jul 2006 12:40:00 GMT">Mon, 17 Jul 2006 12:40:00 GMT</span></p>
<p>It&#8217;s true. I&#8217;m sitting here coding in <span class="caps">PHP</span> using the <a href="http://web.archive.org/web/20061018215113/http://framework.zend.com/">Zend Framework</a> and all I can think about is how much nicer Rails is, or how much easier it is to do [x] in Ruby. It&#8217;s not that the Zend Framework is bad or anything, it&#8217;s quite nice, but you just can&#8217;t match Ruby&#8217;s expressiveness in a language like <span class="caps">PHP</span>. Add the amazing convenience Rails builds on top of Ruby and that&#8217;s a really hard combo to compete with.</p><p>I&#8217;d love to be using mixins instead of mucking around with abstract classes and interfaces, neither of which will just let you share a method between different classes. Writing proxy methods in these tiny in-between classes is annoying. (ie. inherit from Zend_class, then my real classes inherit from the middle-man class) I <em>could</em> add things to Zend&#8217;s classes, but then upgrades are a bitch. I miss Ruby. I could use something like <a href="http://web.archive.org/web/20061018215113/http://www.advogato.org/article/470.html">whytheluckystiff&#8217;s <span class="caps">PHP</span> mixins</a>, which is a clever hack, but still a hack.</p>
<p>I keep looking at Rails code to see how things are done there, and I already coded a nearly complete prototype in Rails as a reference. I could have finished the thing in Rails by now, seriously. I&#8217;m still playing catch-up writing validations and model classes for all my objects, stuff I could&#8217;ve had for free using Rails, with an extra 10 mins to add validations and make sure they&#8217;re all working nicely.</p>
<p>It&#8217;s no wonder <a href="http://web.archive.org/web/20061018215113/http://www.loudthinking.com/">David H. Hansson</a> wasn&#8217;t able to write a framework he was happy with in <span class="caps">PHP</span>. After using Rails everything seems like a chore. I&#8217;m just coding solved problems over again in an inferior language.</p>
<p>But hey, I&#8217;m learning things and I still got to use Ruby even if the code won&#8217;t be used later. I guess this experience will just make me appreciate the richness of Ruby and Rails even more.</p>
</div>
<p class="meta">
Posted in <a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/rails" rel="tag">rails</a>, <a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/ruby" rel="tag">ruby</a>, <a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/php" rel="tag">php</a>, <a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/hacking" rel="tag">coding</a>&nbsp;<strong>|</strong>&nbsp;Tags <a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/tag/framework" rel="tag">framework</a>, <a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/tag/php" rel="tag">php</a>, <a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/tag/rails" rel="tag">rails</a>, <a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/tag/ruby" rel="tag">ruby</a>, <a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/tag/zend" rel="tag">zend</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/2006/07/17/ruby-and-rails-ave-spoiled-me-rotten#comments">no comments</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/2006/07/17/ruby-and-rails-ave-spoiled-me-rotten#trackbacks">no trackbacks</a>
</p>
<a name="comments"></a><h4 class="blueblk">Comments</h4>
<p class="postmetadata alt">
<small><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/2006/07/17/ruby-and-rails-ave-spoiled-me-rotten#respond">Leave a response</a></small>
</p>
<ol class="comment-list" id="commentList">
<li id="dummy_comment" style="display: none"></li>
</ol>
<a name="trackbacks"></a><h4 class="blueblk">Trackbacks</h4>
<p>
Use the following link to trackback from your own site:<br/>
<span class="light-bg">http://sami.samhuri.net/articles/trackback/429</span>
</p>
<p class="postmetadata alt">
<small>
<a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/xml/rss20/article/429/feed.xml" title="RSS Feed">RSS feed for this post</a>
<a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/trackback/429" >trackback uri</a>
</small>
</p>
<form action="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/comment/429" class="commentform" id="commentform" method="post" onsubmit="new Ajax.Updater({success:'commentList'}, '/articles/comment/429', {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom, onComplete:function(request){complete(request)}, onFailure:function(request){failure(request)}, onLoading:function(request){loading()}, parameters:Form.serialize(this)}); return false;">
<div class="comment-box">
<div id="errors"></div>
<div id="preview" style="display: none"></div>
<a name="respond"></a>
<table cellpadding="4" cellspacing="0" class="frm-tbl">
<tr>
<td><p><label for="comment_author">Your name</label></p></td>
<td> <input id="comment_author" name="comment[author]" size="20" type="text" /> <small><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/2006/07/17/ruby-and-rails-ave-spoiled-me-rotten#" onclick="Element.toggle('guest_url'); Element.toggle('guest_email'); return false;">(leave url/email &#187;)</a></small></td>
</tr>
<tr id="guest_url" style="display:none;">
<td><p><label for="comment_url">Your blog</label></p></td>
<td> <input id="comment_url" name="comment[url]" size="30" type="text" /></td>
</tr>
<tr id="guest_email" style="display:none;">
<td><p><label for="comment_email">Your email</label></p></td>
<td> <input id="comment_email" name="comment[email]" size="30" type="text" /></td>
</tr>
<tr>
<td><p><label for="comment_body">Your message</label></p></td>
<td valign="top" colspan="2">
<textarea cols="40" id="comment_body" name="comment[body]" rows="20"></textarea>
</td>
</tr>
<tr>
<td colspan="2" id="frm-btns">
<span id="comment_loading" style="display:none;"><img alt="Spinner" src="http://web.archive.org/web/20061018215113im_/http://sami.samhuri.net/images/spinner.gif" /></span>&nbsp;&nbsp;
<a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/2006/07/17/ruby-and-rails-ave-spoiled-me-rotten#" onclick="new Ajax.Updater('preview', '/articles/comment_preview', {asynchronous:true, evalScripts:true, parameters:Form.serialize('commentform'), onComplete:function(request){Element.show('preview')}}); return false;">Preview comment</a>
<input type="submit" name="submit" id="form-submit-button" value="submit" class="button" />
</td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
show_dates_as_local_time()
//]]>
</script>
</div>
</div>
<div id="leftcolumn">
<div id="header">
<h1 id="sitename"><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/">sjs</a></h1>
<h2 id="subtitle">&nbsp;</h2>
</div>
<div id="sidebar">
<div id="search"><form action="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/search" id="sform" method="get">
<label for="q">Search: </label><input type="text" id="q" name="q" value="" size="15" />
<img alt="Spinner-blue" id="search_spinner" src="http://web.archive.org/web/20061018215113im_/http://sami.samhuri.net/images/spinner-blue.gif" style="display:none;" />
</form>
<script type="text/javascript">
//<![CDATA[
new Form.Element.Observer('q', 1, function(element, value) {new Ajax.Updater('search-results', '/live/search', {asynchronous:true, evalScripts:true, onComplete:function(request){Element.hide('search_spinner')}, onLoading:function(request){Element.show('search_spinner')}, parameters:'q=' + escape($F('q'))})})
//]]>
</script></div>
<div id="search-results"></div>
<div class="sidebar-node">
<h3>All about...</h3>
<ul>
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/pages/about">a bit about me</a></li>
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/pages/thunder">workstation</a></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Categories</h3>
<ul id="categories">
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/amusement">amusement</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/gentoo">gentoo</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/hacking">coding</a> <em>(16)</em></li>
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/life">life</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/linux">linux</a> <em>(2)</em></li>
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/mac-os-x">mac os x</a> <em>(6)</em></li>
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/python">python</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/rails">rails</a> <em>(12)</em></li>
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/ruby">ruby</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/technology">technology</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/textmate">textmate</a> <em>(10)</em></li>
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/apple">apple</a> <em>(6)</em></li>
<li><a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/category/php">php</a> <em>(4)</em></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Archives</h3>
<ul id="archives">
<li>
<a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/2006/09">September 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/2006/08">August 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/2006/07">July 2006</a>
<em>(5)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/2006/06">June 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/2006/05">May 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/2006/04">April 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/2006/03">March 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/articles/2006/02">February 2006</a>
<em>(15)</em>
</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Links</h3>
<ul>
<li><a href="http://web.archive.org/web/20061018215113/http://phox.ca/cswiki/Main_Page">CSWiki</a></li>
<li><a href="http://web.archive.org/web/20061018215113/http://jim.roepcke.com/">Have Browser, Will Travel</a></li>
<li><a href="http://web.archive.org/web/20061018215113/http://blog.inquirylabs.com/">Going Up</a></li>
<li><a href="http://web.archive.org/web/20061018215113/http://www.mirage.org/">encieno</a></li>
<li><a href="http://web.archive.org/web/20061018215113/http://www.nofxwiki.net/">nofxwiki.net</a></li>
<li>sami at samhuri dot net</li>
</ul>
</div>
<div class="sidebar-node">
<p><ul>
<li><a class="feed" href="http://web.archive.org/web/20061018215113/http://sami.samhuri.net/xml/rss20/feed.xml" title="Articles feed"><img src="http://web.archive.org/web/20061018215113im_/http://sami.samhuri.net/files/feed-icon-48x48.png" alt="RSS 2.0" width="48" height="48" /></a></li>
<!--
-->
</ul></p>
</div>
<br clear="all" />
</div>
</div>
<div id="footer">
<ul>
<li><a href="http://web.archive.org/web/20061018215113/http://typo.leetsoft.com/">Typo</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20061018215113/http://validator.w3.org/check?uri=referer">Valid XHTML</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20061018215113/http://jigsaw.w3.org/css-validator/validator?uri=http://sami.samhuri.net/">Valid CSS</a></li>
</ul>
</div>
<script src="http://web.archive.org/web/20061018215113js_/http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-214054-3";
urchinTracker();
</script>
</body>
</html>
<!--
FILE ARCHIVED ON 21:51:13 Oct 18, 2006 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 7:31:28 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,594 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SJ's Rails Bundle 0.2 for TextMate - samhuri.net</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta content="48.472,-123.3683" name="ICBM" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/xml/rsd" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/xml/rss20/article/29/feed.xml" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/xml/atom10/article/29/feed.xml" />
<script src="http://web.archive.org/web/20060926180334js_/http://sami.samhuri.net/javascripts/cookies.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060926180334js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060926180334js_/http://sami.samhuri.net/javascripts/effects.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060926180334js_/http://sami.samhuri.net/javascripts/typo.js" type="text/javascript"></script>
<script type="text/javascript"></script>
<link href="http://web.archive.org/web/20060926180334cs_/http://sami.samhuri.net/stylesheets/theme/island.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20060926180334cs_/http://sami.samhuri.net/stylesheets/user-styles.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20060926180334cs_/http://sami.samhuri.net/stylesheets/theme/print.css" media="print" rel="Stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/articles\/2006\/02\/23\/sjs-rails-bundle-0-2-for-textmate";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "26";
var displayMonth = "Sep";
var displayYear = "2006";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/articles/2006/02/23/sjs-rails-bundle-0-2-for-textmate" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20060926180334" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Aug
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 18:03:34 Sep 26, 2006">SEP</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20061101142419/http://sami.samhuri.net/articles/2006/02/23/sjs-rails-bundle-0-2-for-textmate" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="1 Nov 2006"><strong>NOV</strong></a>
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" />
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 18:03:34 Sep 26, 2006">26</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20061101142419/http://sami.samhuri.net/articles/2006/02/23/sjs-rails-bundle-0-2-for-textmate" title="14:24:19 Nov 1, 2006" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0"/></a>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2005
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 18:03:34 Sep 26, 2006">2006</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20071002063653/http://sami.samhuri.net/articles/2006/02/23/sjs-rails-bundle-0-2-for-textmate" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="2 Oct 2007"><strong>2007</strong></a>
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20060926180334*/http://sami.samhuri.net/articles/2006/02/23/sjs-rails-bundle-0-2-for-textmate" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>7 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">26 Sep 06 - 9 Oct 07</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:8:000000001010_2007:-1:001000000400_2008:-1:000000000000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="content" class="clearfix">
<div id="main">
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping="http://sami.samhuri.net/articles/trackback/29"
dc:title="SJ's Rails Bundle 0.2 for TextMate"
dc:identifier="http://sami.samhuri.net/articles/read/29"
dc:description="Everything that you&amp;#8217;ve seen posted on my blog is now available in one bundle. Snippets for Rails database migrations and assertions are all included in this bundle. There are 2 macros for class-end and def-end blocks, bound to &amp;#"
dc:creator="sjs"
dc:date="2006-09-19T19:22:20-07:00" />
</rdf:RDF>
-->
<div class="post" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_article'); }" onmouseout="Element.hide('admin_article');" >
<a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/admin/content/edit/29" class="admintools" id="admin_article" style="display: none">edit</a>
<h2>SJ's Rails Bundle 0.2 for TextMate</h2>
<p class="auth"><!-- Posted by <a href="mailto:sjs@uvic.ca">Sami Jensen Samhuri</a> -->
<span class="typo_date" title="Fri, 24 Feb 2006 01:18:00 GMT">Fri, 24 Feb 2006 01:18:00 GMT</span></p>
<p>Everything that you&#8217;ve seen posted on my blog is now available in one bundle. Snippets for Rails database migrations and assertions are all included in this bundle.</p>
<p>There are 2 macros for class-end and def-end blocks, bound to <strong>&#8963;C</strong> and <strong>&#8963;D</strong> respectively. Type the class or method definition, except for <code>class</code> or <code>def</code>, and then type the keyboard shortcut and the rest is filled in for you.</p>
<p>I use an underscore to denote the position of the cursor in the following example:</p>
<div class="typocode"><pre><code class="typocode_ruby "><span class="ident">method</span><span class="punct">(</span><span class="ident">arg1</span><span class="punct">,</span> <span class="ident">arg2_</span><span class="punct">)</span></code></pre></div>
<p>Typing <strong>&#8963;D</strong> at this point results in this code:</p>
<div class="typocode"><pre><code class="typocode_ruby "><span class="keyword">def </span><span class="method">method</span><span class="punct">(</span><span class="ident">arg1</span><span class="punct">,</span> <span class="ident">arg2</span><span class="punct">)</span>
<span class="ident">_</span>
<span class="keyword">end</span></code></pre></div>
<p>There is a list of the snippets in Features.rtf, which is included in the disk image. Of course you can also browse them in the Snippets Editor built into TextMate.</p>
<p>Without further ado, here is the bundle:</p>
<p style="text-align:center;"><img src="http://web.archive.org/web/20060926180334im_/http://sami.samhuri.net/files/download.png" title="Download" alt="Download" /> <a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/files/SJRailsBundle-0.2.dmg">Download SJ&#8217;s Rails Bundle 0.2</a></p>
<p>This is a work in progress, so any feedback you have is very helpful in making the next release better.</p>
</div>
<p class="meta">
Posted in <a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/textmate" rel="tag">textmate</a>, <a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/rails" rel="tag">rails</a>, <a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/hacking" rel="tag">coding</a>&nbsp;<strong>|</strong>&nbsp;Tags <a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/tag/bundle" rel="tag">bundle</a>, <a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/tag/macros" rel="tag">macros</a>, <a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/tag/rails" rel="tag">rails</a>, <a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/tag/snippets" rel="tag">snippets</a>, <a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/tag/textmate" rel="tag">textmate</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/02/23/sjs-rails-bundle-0-2-for-textmate#comments">3 comments</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/02/23/sjs-rails-bundle-0-2-for-textmate#trackbacks">no trackbacks</a>
</p>
<a name="comments"></a><h4 class="blueblk">Comments</h4>
<p class="postmetadata alt">
<small><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/02/23/sjs-rails-bundle-0-2-for-textmate#respond">Leave a response</a></small>
</p>
<ol class="comment-list" id="commentList">
<li id="comment-30" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_comment_30'); }" onmouseout="Element.hide('admin_comment_30');" >
<div id="admin_comment_30" style="display: none"><a class="admintools" href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/02/23/sjs-rails-bundle-0-2-for-textmate#" onclick="if (confirm('Are you sure you want to delete this comment?')) { new Ajax.Request('/articles/nuke_comment/30', {asynchronous:true, evalScripts:true, onComplete:function(request){new Effect.Puff('comment-30',{duration:0.6});}}); }; return false;">nuke</a><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/admin/comments/article/29/edit/30" class="admintools">edit</a></div>
<a name="comment-30"></a>
<img alt="Avatar" class="gravatar" src="http://web.archive.org/web/20060926180334im_/http://www.gravatar.com/avatar.php?gravatar_id=d8cb8c8cd40ddf0cd05241443a591868&size=60" />
<cite><strong><a href="http://web.archive.org/web/20060926180334/http://blog.inquirylabs.com/">Duane Johnson</a></strong> </cite> said 3 days later:<br />
<p>Hi Sami! I&#8217;ve added your superb work to the Rails bundle itself. I love it! Thanks again.</p>
<p>Release candidate 4:
<a href='http://web.archive.org/web/20060926180334/http://blog.inquirylabs.com/' rel="nofollow">http://blog.inquirylabs.com/</a></p>
</li><li id="comment-32" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_comment_32'); }" onmouseout="Element.hide('admin_comment_32');" >
<div id="admin_comment_32" style="display: none"><a class="admintools" href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/02/23/sjs-rails-bundle-0-2-for-textmate#" onclick="if (confirm('Are you sure you want to delete this comment?')) { new Ajax.Request('/articles/nuke_comment/32', {asynchronous:true, evalScripts:true, onComplete:function(request){new Effect.Puff('comment-32',{duration:0.6});}}); }; return false;">nuke</a><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/admin/comments/article/29/edit/32" class="admintools">edit</a></div>
<a name="comment-32"></a>
<img alt="Avatar" class="gravatar" src="http://web.archive.org/web/20060926180334im_/http://www.gravatar.com/avatar.php?gravatar_id=d8cb8c8cd40ddf0cd05241443a591868&size=60" />
<cite><strong><a href="http://web.archive.org/web/20060926180334/http://blog.inquirylabs.com/">Duane Johnson</a></strong> </cite> said 8 days later:<br />
<p>With the inspiration of Scott Barron (and a tip from Kyle Maxwell) I&#8217;ve added the <strong>reverse migration</strong> to the Rails bundle also. You can now use the &#8220;mdct&#8221; snippet and it will create the corresponding table for the drop_table, using your db/schema.rb as source material. Only in <span class='caps'>SVN</span> at this point.</p>
</li><li id="comment-33" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_comment_33'); }" onmouseout="Element.hide('admin_comment_33');" >
<div id="admin_comment_33" style="display: none"><a class="admintools" href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/02/23/sjs-rails-bundle-0-2-for-textmate#" onclick="if (confirm('Are you sure you want to delete this comment?')) { new Ajax.Request('/articles/nuke_comment/33', {asynchronous:true, evalScripts:true, onComplete:function(request){new Effect.Puff('comment-33',{duration:0.6});}}); }; return false;">nuke</a><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/admin/comments/article/29/edit/33" class="admintools">edit</a></div>
<a name="comment-33"></a>
<img alt="Avatar" class="gravatar" src="http://web.archive.org/web/20060926180334im_/http://www.gravatar.com/avatar.php?gravatar_id=70b7942e15e54f78ddba25a216f3034e&size=60" />
<cite><strong><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/">Sami</a></strong> </cite> said 8 days later:<br />
<p>That&#8217;s excellent! I added the ability to reverse the snippets just yesterday, but I never thought to get data from schema.rb to do it in that clever way.</p>
<p>I&#8217;ll have to take a look at it. Thanks. :)</p>
</li>
</ol>
<a name="trackbacks"></a><h4 class="blueblk">Trackbacks</h4>
<p>
Use the following link to trackback from your own site:<br/>
<span class="light-bg">http://sami.samhuri.net/articles/trackback/29</span>
</p>
<p class="postmetadata alt">
<small>
<a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/xml/rss20/article/29/feed.xml" title="RSS Feed">RSS feed for this post</a>
<a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/trackback/29" >trackback uri</a>
</small>
</p>
<form action="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/comment/29" class="commentform" id="commentform" method="post" onsubmit="new Ajax.Updater({success:'commentList'}, '/articles/comment/29', {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom, onComplete:function(request){complete(request)}, onFailure:function(request){failure(request)}, onLoading:function(request){loading()}, parameters:Form.serialize(this)}); return false;">
<div class="comment-box">
<div id="errors"></div>
<div id="preview" style="display: none"></div>
<a name="respond"></a>
<table cellpadding="4" cellspacing="0" class="frm-tbl">
<tr>
<td><p><label for="comment_author">Your name</label></p></td>
<td> <input id="comment_author" name="comment[author]" size="20" type="text" /> <small><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/02/23/sjs-rails-bundle-0-2-for-textmate#" onclick="Element.toggle('guest_url'); Element.toggle('guest_email'); return false;">(leave url/email &#187;)</a></small></td>
</tr>
<tr id="guest_url" style="display:none;">
<td><p><label for="comment_url">Your blog</label></p></td>
<td> <input id="comment_url" name="comment[url]" size="30" type="text" /></td>
</tr>
<tr id="guest_email" style="display:none;">
<td><p><label for="comment_email">Your email</label></p></td>
<td> <input id="comment_email" name="comment[email]" size="30" type="text" /></td>
</tr>
<tr>
<td><p><label for="comment_body">Your message</label></p></td>
<td valign="top" colspan="2">
<textarea cols="40" id="comment_body" name="comment[body]" rows="20"></textarea>
</td>
</tr>
<tr>
<td colspan="2" id="frm-btns">
<span id="comment_loading" style="display:none;"><img alt="Spinner" src="http://web.archive.org/web/20060926180334im_/http://sami.samhuri.net/images/spinner.gif" /></span>&nbsp;&nbsp;
<a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/02/23/sjs-rails-bundle-0-2-for-textmate#" onclick="new Ajax.Updater('preview', '/articles/comment_preview', {asynchronous:true, evalScripts:true, parameters:Form.serialize('commentform'), onComplete:function(request){Element.show('preview')}}); return false;">Preview comment</a>
<input type="submit" name="submit" id="form-submit-button" value="submit" class="button" />
</td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
show_dates_as_local_time()
//]]>
</script>
</div>
</div>
<div id="leftcolumn">
<div id="header">
<h1 id="sitename"><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/">sjs</a></h1>
<h2 id="subtitle">&nbsp;</h2>
</div>
<div id="sidebar">
<div id="search"><form action="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/search" id="sform" method="get">
<label for="q">Search: </label><input type="text" id="q" name="q" value="" size="15" />
<img alt="Spinner-blue" id="search_spinner" src="http://web.archive.org/web/20060926180334im_/http://sami.samhuri.net/images/spinner-blue.gif" style="display:none;" />
</form>
<script type="text/javascript">
//<![CDATA[
new Form.Element.Observer('q', 1, function(element, value) {new Ajax.Updater('search-results', '/live/search', {asynchronous:true, evalScripts:true, onComplete:function(request){Element.hide('search_spinner')}, onLoading:function(request){Element.show('search_spinner')}, parameters:'q=' + escape($F('q'))})})
//]]>
</script></div>
<div id="search-results"></div>
<div class="sidebar-node">
<h3>All about...</h3>
<ul>
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/pages/about">a bit about me</a></li>
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/pages/thunder">workstation</a></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Categories</h3>
<ul id="categories">
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/amusement">amusement</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/gentoo">gentoo</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/hacking">coding</a> <em>(16)</em></li>
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/life">life</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/linux">linux</a> <em>(2)</em></li>
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/mac-os-x">mac os x</a> <em>(6)</em></li>
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/python">python</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/rails">rails</a> <em>(12)</em></li>
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/ruby">ruby</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/technology">technology</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/textmate">textmate</a> <em>(10)</em></li>
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/apple">apple</a> <em>(6)</em></li>
<li><a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/category/php">php</a> <em>(4)</em></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Archives</h3>
<ul id="archives">
<li>
<a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/09">September 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/08">August 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/07">July 2006</a>
<em>(5)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/06">June 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/05">May 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/04">April 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/03">March 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/articles/2006/02">February 2006</a>
<em>(15)</em>
</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Links</h3>
<ul>
<li><a href="http://web.archive.org/web/20060926180334/http://phox.ca/cswiki/Main_Page">CSWiki</a></li>
<li><a href="http://web.archive.org/web/20060926180334/http://jim.roepcke.com/">Have Browser, Will Travel</a></li>
<li><a href="http://web.archive.org/web/20060926180334/http://blog.inquirylabs.com/">Going Up</a></li>
<li><a href="http://web.archive.org/web/20060926180334/http://www.mirage.org/">encieno</a></li>
<li><a href="http://web.archive.org/web/20060926180334/http://www.nofxwiki.net/">nofxwiki.net</a></li>
<li>sami at samhuri dot net</li>
</ul>
</div>
<div class="sidebar-node">
<p><ul>
<li><a class="feed" href="http://web.archive.org/web/20060926180334/http://sami.samhuri.net/xml/rss20/feed.xml" title="Articles feed"><img src="http://web.archive.org/web/20060926180334im_/http://sami.samhuri.net/files/feed-icon-48x48.png" alt="RSS 2.0" width="48" height="48" /></a></li>
<!--
-->
</ul></p>
</div>
<br clear="all" />
</div>
</div>
<div id="footer">
<ul>
<li><a href="http://web.archive.org/web/20060926180334/http://typo.leetsoft.com/">Typo</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20060926180334/http://validator.w3.org/check?uri=referer">Valid XHTML</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20060926180334/http://jigsaw.w3.org/css-validator/validator?uri=http://sami.samhuri.net/">Valid CSS</a></li>
</ul>
</div>
<script src="http://web.archive.org/web/20060926180334js_/http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-214054-3";
urchinTracker();
</script>
</body>
</html>
<!--
FILE ARCHIVED ON 18:03:34 Sep 26, 2006 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 7:32:07 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,525 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Spore - samhuri.net</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta content="48.472,-123.3683" name="ICBM" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/xml/rsd" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/xml/rss20/article/36/feed.xml" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/xml/atom10/article/36/feed.xml" />
<script src="http://web.archive.org/web/20060614130306js_/http://sami.samhuri.net/javascripts/cookies.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060614130306js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060614130306js_/http://sami.samhuri.net/javascripts/effects.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060614130306js_/http://sami.samhuri.net/javascripts/typo.js" type="text/javascript"></script>
<script type="text/javascript"></script>
<link href="http://web.archive.org/web/20060614130306cs_/http://sami.samhuri.net/stylesheets/theme/island.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20060614130306cs_/http://sami.samhuri.net/stylesheets/user-styles.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20060614130306cs_/http://sami.samhuri.net/stylesheets/theme/print.css" media="print" rel="Stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/articles\/2006\/03\/03\/spore";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "14";
var displayMonth = "Jun";
var displayYear = "2006";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/articles/2006/03/03/spore" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20060614130306" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
May
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 13:03:06 Jun 14, 2006">JUN</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20061101191028/http://sami.samhuri.net/articles/2006/03/03/spore" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="1 Nov 2006"><strong>NOV</strong></a>
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" />
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 13:03:06 Jun 14, 2006">14</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20061101191028/http://sami.samhuri.net/articles/2006/03/03/spore" title="19:10:28 Nov 1, 2006" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0"/></a>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2005
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 13:03:06 Jun 14, 2006">2006</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20070805211650/http://sami.samhuri.net/articles/2006/03/03/spore" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="5 Aug 2007"><strong>2007</strong></a>
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20060614130306*/http://sami.samhuri.net/articles/2006/03/03/spore" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>5 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">14 Jun 06 - 5 Aug 07</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:5:000001000011_2007:-1:001000010000_2008:-1:000000000000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="content" class="clearfix">
<div id="main">
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping="http://sami.samhuri.net/articles/trackback/36"
dc:title="Spore"
dc:identifier="http://sami.samhuri.net/articles/read/36"
dc:description="This game that Jim blogged about is probably the coolest game I&amp;#8217;ve"
dc:creator="sjs"
dc:date="2006-04-10T16:47:29-07:00" />
</rdf:RDF>
-->
<div class="post" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_article'); }" onmouseout="Element.hide('admin_article');" >
<a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/admin/content/edit/36" class="admintools" id="admin_article" style="display: none">edit</a>
<h2>Spore</h2>
<p class="auth"><!-- Posted by <a href="mailto:sjs@uvic.ca">Sami Jensen Samhuri</a> -->
<span class="typo_date" title="Sat, 04 Mar 2006 05:43:00 GMT">Sat, 04 Mar 2006 05:43:00 GMT</span></p>
<p><a href="http://web.archive.org/web/20060614130306/http://video.google.com/videoplay?docid=8372603330420559198&q=spore">This game</a> that <a href="http://web.archive.org/web/20060614130306/http://jim.roepcke.com/">Jim</a> <a href="http://web.archive.org/web/20060614130306/http://jim.roepcke.com/2006/03/01#item7470">blogged about</a> is probably the coolest game I&#8217;ve seen.</p>
<p>You really just have to watch the video, I won&#8217;t bother explaining it here. I don&#8217;t really play games much, but this I would play.</p>
</div>
<p class="meta">
Posted in <a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/category/amusement" rel="tag">amusement</a>, <a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/category/technology" rel="tag">technology</a>&nbsp;<strong>|</strong>&nbsp;Tags <a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/tag/cool" rel="tag">cool</a>, <a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/tag/fun" rel="tag">fun</a>, <a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/tag/games" rel="tag">games</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/2006/03/03/spore#comments">no comments</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/2006/03/03/spore#trackbacks">no trackbacks</a>
</p>
<a name="comments"></a><h4 class="blueblk">Comments</h4>
<p class="postmetadata alt">
<small><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/2006/03/03/spore#respond">Leave a response</a></small>
</p>
<ol class="comment-list" id="commentList">
<li id="dummy_comment" style="display: none"></li>
</ol>
<a name="trackbacks"></a><h4 class="blueblk">Trackbacks</h4>
<p>
Use the following link to trackback from your own site:<br/>
<span class="light-bg">http://sami.samhuri.net/articles/trackback/36</span>
</p>
<p class="postmetadata alt">
<small>
<a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/xml/rss20/article/36/feed.xml" title="RSS Feed">RSS feed for this post</a>
<a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/trackback/36" >trackback uri</a>
</small>
</p>
<form action="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/comment/36" class="commentform" id="commentform" method="post" onsubmit="new Ajax.Updater({success:'commentList'}, '/articles/comment/36', {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom, onComplete:function(request){complete(request)}, onFailure:function(request){failure(request)}, onLoading:function(request){loading()}, parameters:Form.serialize(this)}); return false;">
<div class="comment-box">
<div id="errors"></div>
<div id="preview" style="display: none"></div>
<a name="respond"></a>
<table cellpadding="4" cellspacing="0" class="frm-tbl">
<tr>
<td><p><label for="comment_author">Your name</label></p></td>
<td> <input id="comment_author" name="comment[author]" size="20" type="text" /> <small><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/2006/03/03/spore#" onclick="Element.toggle('guest_url'); Element.toggle('guest_email'); return false;">(leave url/email &#187;)</a></small></td>
</tr>
<tr id="guest_url" style="display:none;">
<td><p><label for="comment_url">Your blog</label></p></td>
<td> <input id="comment_url" name="comment[url]" size="30" type="text" /></td>
</tr>
<tr id="guest_email" style="display:none;">
<td><p><label for="comment_email">Your email</label></p></td>
<td> <input id="comment_email" name="comment[email]" size="30" type="text" /></td>
</tr>
<tr>
<td><p><label for="comment_body">Your message</label></p></td>
<td valign="top" colspan="2">
<textarea cols="40" id="comment_body" name="comment[body]" rows="20"></textarea>
</td>
</tr>
<tr>
<td colspan="2" id="frm-btns">
<span id="comment_loading" style="display:none;"><img alt="Spinner" src="http://web.archive.org/web/20060614130306im_/http://sami.samhuri.net/images/spinner.gif" /></span>&nbsp;&nbsp;
<a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/2006/03/03/spore#" onclick="new Ajax.Updater('preview', '/articles/comment_preview', {asynchronous:true, evalScripts:true, parameters:Form.serialize('commentform'), onComplete:function(request){Element.show('preview')}}); return false;">Preview comment</a>
<input type="submit" name="submit" id="form-submit-button" value="submit" class="button" />
</td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
show_dates_as_local_time()
//]]>
</script>
</div>
</div>
<div id="leftcolumn">
<div id="header">
<h1 id="sitename"><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/">sjs</a></h1>
<h2 id="subtitle">&nbsp;</h2>
</div>
<div id="sidebar">
<div id="search"><form action="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/search" id="sform" method="get">
<label for="q">Search: </label><input type="text" id="q" name="q" value="" size="15" />
<img alt="Spinner-blue" id="search_spinner" src="http://web.archive.org/web/20060614130306im_/http://sami.samhuri.net/images/spinner-blue.gif" style="display:none;" />
</form>
<script type="text/javascript">
//<![CDATA[
new Form.Element.Observer('q', 1, function(element, value) {new Ajax.Updater('search-results', '/live/search', {asynchronous:true, evalScripts:true, onComplete:function(request){Element.hide('search_spinner')}, onLoading:function(request){Element.show('search_spinner')}, parameters:'q=' + escape($F('q'))})})
//]]>
</script></div>
<div id="search-results"></div>
<div class="sidebar-node">
<h3>All about...</h3>
<ul>
<li><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/pages/about">me in 3 paragraphs</a></li>
<li><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/pages/how-i-became-a-geek">geek background</a></li>
<li><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/pages/thunder">workstation</a></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Categories</h3>
<ul id="categories">
<li><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/category/amusement">amusement</a> <em>(4)</em></li>
<li><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/category/gentoo">gentoo</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/category/hacking">hacking</a> <em>(12)</em></li>
<li><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/category/life">life</a> <em>(4)</em></li>
<li><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/category/linux">linux</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/category/mac-os-x">mac os x</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/category/python">python</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/category/rails">rails</a> <em>(11)</em></li>
<li><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/category/technology">technology</a> <em>(2)</em></li>
<li><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/category/textmate">textmate</a> <em>(10)</em></li>
<li><a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/category/apple">apple</a> <em>(3)</em></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Archives</h3>
<ul id="archives">
<li>
<a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/2006/06">June 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/2006/05">May 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/2006/04">April 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/2006/03">March 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/articles/2006/02">February 2006</a>
<em>(15)</em>
</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Links</h3>
<ul>
<li><a href="http://web.archive.org/web/20060614130306/http://phox.ca/cswiki/Main_Page">CSWiki</a></li>
<li><a href="http://web.archive.org/web/20060614130306/http://jim.roepcke.com/">Have Browser, Will Travel</a></li>
<li><a href="http://web.archive.org/web/20060614130306/http://blog.inquirylabs.com/">Going Up</a></li>
<li><a href="http://web.archive.org/web/20060614130306/http://www.mirage.org/">encieno</a></li>
<li><a href="http://web.archive.org/web/20060614130306/http://www.nofxwiki.net/">nofxwiki.net</a></li>
</ul>
</div>
<div class="sidebar-node">
<p><ul>
<li><a class="feed" href="http://web.archive.org/web/20060614130306/http://sami.samhuri.net/xml/rss20/feed.xml" title="Articles feed"><img src="http://web.archive.org/web/20060614130306im_/http://sami.samhuri.net/files/feed-icon-48x48.png" alt="RSS 2.0" width="48" height="48" /></a></li>
<!--
-->
</ul></p>
</div>
<br clear="all" />
</div>
</div>
<div id="footer">
<ul>
<li><a href="http://web.archive.org/web/20060614130306/http://typo.leetsoft.com/">Typo</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20060614130306/http://validator.w3.org/check?uri=referer">Valid XHTML</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20060614130306/http://jigsaw.w3.org/css-validator/validator?uri=http://sami.samhuri.net/">Valid CSS</a></li>
</ul>
</div>
<script src="http://web.archive.org/web/20060614130306js_/http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-214054-3";
urchinTracker();
</script>
</body>
</html>
<!--
FILE ARCHIVED ON 13:03:06 Jun 14, 2006 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 7:29:56 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,556 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Where are my headphones? - samhuri.net</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta content="48.472,-123.3683" name="ICBM" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/xml/rsd" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/xml/rss20/article/433/feed.xml" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/xml/atom10/article/433/feed.xml" />
<script src="http://web.archive.org/web/20061018215025js_/http://sami.samhuri.net/javascripts/cookies.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215025js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215025js_/http://sami.samhuri.net/javascripts/effects.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20061018215025js_/http://sami.samhuri.net/javascripts/typo.js" type="text/javascript"></script>
<script type="text/javascript"></script>
<link href="http://web.archive.org/web/20061018215025cs_/http://sami.samhuri.net/stylesheets/theme/island.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20061018215025cs_/http://sami.samhuri.net/stylesheets/user-styles.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20061018215025cs_/http://sami.samhuri.net/stylesheets/theme/print.css" media="print" rel="Stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/articles\/2006\/08\/22\/where-are-my-headphones";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "18";
var displayMonth = "Oct";
var displayYear = "2006";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/articles/2006/08/22/where-are-my-headphones" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20061018215025" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Sep
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 21:50:25 Oct 18, 2006">OCT</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20070313204832/http://sami.samhuri.net/articles/2006/08/22/where-are-my-headphones" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="13 Mar 2007"><strong>MAR</strong></a>
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" />
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 21:50:25 Oct 18, 2006">18</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20070313204832/http://sami.samhuri.net/articles/2006/08/22/where-are-my-headphones" title="20:48:32 Mar 13, 2007" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0"/></a>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2005
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 21:50:25 Oct 18, 2006">2006</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2007
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20061018215025*/http://sami.samhuri.net/articles/2006/08/22/where-are-my-headphones" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>2 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">18 Oct 06 - 13 Mar 07</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:9:000000000100_2007:-1:001000000000_2008:-1:000000000000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="content" class="clearfix">
<div id="main">
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping="http://sami.samhuri.net/articles/trackback/433"
dc:title="Where are my headphones?"
dc:identifier="http://sami.samhuri.net/articles/read/433"
dc:description="Some people left Seekport this month and 2 of the remaining employees moved into the office I&amp;#8217;m working in. That&amp;#8217;s fine, and I&amp;#8217;m leaving at the end of the week, but man I&amp;#8217;m going crazy. This guy&amp;#8217;s pounding on his keyboard l"
dc:creator="sjs"
dc:date="2006-09-19T19:20:44-07:00" />
</rdf:RDF>
-->
<div class="post" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_article'); }" onmouseout="Element.hide('admin_article');" >
<a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/admin/content/edit/433" class="admintools" id="admin_article" style="display: none">edit</a>
<h2>Where are my headphones?</h2>
<p class="auth"><!-- Posted by <a href="mailto:sjs@uvic.ca">Sami Jensen Samhuri</a> -->
<span class="typo_date" title="Tue, 22 Aug 2006 14:31:00 GMT">Tue, 22 Aug 2006 14:31:00 GMT</span></p>
<p>Some people left Seekport this month and 2 of the remaining employees moved into the office I&#8217;m working in. That&#8217;s fine, and I&#8217;m leaving at the end of the week, but man I&#8217;m going crazy. This guy&#8217;s pounding on his keyboard like it&#8217;s a fucking whack-a-mole game! I don&#8217;t know what kind of keyboard he learned to type on but it must&#8217;ve been horrible. It sounds like he must go through at least 10 of those things in a year. I don&#8217;t know if I&#8217;ll make it till Friday without yelling &#8220;AGH! <span class="caps">STOP THE MADNESS YOU CRAZY BASTARD YOU JUST HAVE TO TOUCH THE KEYS</span>!&#8221;</p>
</div>
<p class="meta">
Posted in <a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/category/life" rel="tag">life</a>&nbsp;<strong>|</strong>&nbsp;Tags <a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/tag/seekport" rel="tag">seekport</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/08/22/where-are-my-headphones#comments">2 comments</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/08/22/where-are-my-headphones#trackbacks">no trackbacks</a>
</p>
<a name="comments"></a><h4 class="blueblk">Comments</h4>
<p class="postmetadata alt">
<small><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/08/22/where-are-my-headphones#respond">Leave a response</a></small>
</p>
<ol class="comment-list" id="commentList">
<li id="comment-435" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_comment_435'); }" onmouseout="Element.hide('admin_comment_435');" >
<div id="admin_comment_435" style="display: none"><a class="admintools" href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/08/22/where-are-my-headphones#" onclick="if (confirm('Are you sure you want to delete this comment?')) { new Ajax.Request('/articles/nuke_comment/435', {asynchronous:true, evalScripts:true, onComplete:function(request){new Effect.Puff('comment-435',{duration:0.6});}}); }; return false;">nuke</a><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/admin/comments/article/433/edit/435" class="admintools">edit</a></div>
<a name="comment-435"></a>
<img alt="Avatar" class="gravatar" src="http://web.archive.org/web/20061018215025im_/http://www.gravatar.com/avatar.php?gravatar_id=d41d8cd98f00b204e9800998ecf8427e&size=60" />
<cite><strong>emil.eberhardt@amperegeruch.de</strong> </cite> said 1 day later:<br />
<p>Sami, obviously you are right, but I think you will survive the next few days. If you can&#8217;t withstand that noise you could pour some sweet and sticky drink into his keyboard, or just kick it out of the window ;-) I have to find a way to survive
much longer &#8230;
<br>Torsten</p>
</li><li id="comment-436" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_comment_436'); }" onmouseout="Element.hide('admin_comment_436');" >
<div id="admin_comment_436" style="display: none"><a class="admintools" href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/08/22/where-are-my-headphones#" onclick="if (confirm('Are you sure you want to delete this comment?')) { new Ajax.Request('/articles/nuke_comment/436', {asynchronous:true, evalScripts:true, onComplete:function(request){new Effect.Puff('comment-436',{duration:0.6});}}); }; return false;">nuke</a><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/admin/comments/article/433/edit/436" class="admintools">edit</a></div>
<a name="comment-436"></a>
<img alt="Avatar" class="gravatar" src="http://web.archive.org/web/20061018215025im_/http://www.gravatar.com/avatar.php?gravatar_id=d41d8cd98f00b204e9800998ecf8427e&size=60" />
<cite><strong>Sami</strong> </cite> said 3 days later:<br />
<p>I survived! :) It wasn&#8217;t all that bad really, but I do feel a little sorry for you.</p>
</li>
</ol>
<a name="trackbacks"></a><h4 class="blueblk">Trackbacks</h4>
<p>
Use the following link to trackback from your own site:<br/>
<span class="light-bg">http://sami.samhuri.net/articles/trackback/433</span>
</p>
<p class="postmetadata alt">
<small>
<a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/xml/rss20/article/433/feed.xml" title="RSS Feed">RSS feed for this post</a>
<a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/trackback/433" >trackback uri</a>
</small>
</p>
<form action="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/comment/433" class="commentform" id="commentform" method="post" onsubmit="new Ajax.Updater({success:'commentList'}, '/articles/comment/433', {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom, onComplete:function(request){complete(request)}, onFailure:function(request){failure(request)}, onLoading:function(request){loading()}, parameters:Form.serialize(this)}); return false;">
<div class="comment-box">
<div id="errors"></div>
<div id="preview" style="display: none"></div>
<a name="respond"></a>
<table cellpadding="4" cellspacing="0" class="frm-tbl">
<tr>
<td><p><label for="comment_author">Your name</label></p></td>
<td> <input id="comment_author" name="comment[author]" size="20" type="text" /> <small><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/08/22/where-are-my-headphones#" onclick="Element.toggle('guest_url'); Element.toggle('guest_email'); return false;">(leave url/email &#187;)</a></small></td>
</tr>
<tr id="guest_url" style="display:none;">
<td><p><label for="comment_url">Your blog</label></p></td>
<td> <input id="comment_url" name="comment[url]" size="30" type="text" /></td>
</tr>
<tr id="guest_email" style="display:none;">
<td><p><label for="comment_email">Your email</label></p></td>
<td> <input id="comment_email" name="comment[email]" size="30" type="text" /></td>
</tr>
<tr>
<td><p><label for="comment_body">Your message</label></p></td>
<td valign="top" colspan="2">
<textarea cols="40" id="comment_body" name="comment[body]" rows="20"></textarea>
</td>
</tr>
<tr>
<td colspan="2" id="frm-btns">
<span id="comment_loading" style="display:none;"><img alt="Spinner" src="http://web.archive.org/web/20061018215025im_/http://sami.samhuri.net/images/spinner.gif" /></span>&nbsp;&nbsp;
<a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/08/22/where-are-my-headphones#" onclick="new Ajax.Updater('preview', '/articles/comment_preview', {asynchronous:true, evalScripts:true, parameters:Form.serialize('commentform'), onComplete:function(request){Element.show('preview')}}); return false;">Preview comment</a>
<input type="submit" name="submit" id="form-submit-button" value="submit" class="button" />
</td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
show_dates_as_local_time()
//]]>
</script>
</div>
</div>
<div id="leftcolumn">
<div id="header">
<h1 id="sitename"><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/">sjs</a></h1>
<h2 id="subtitle">&nbsp;</h2>
</div>
<div id="sidebar">
<div id="search"><form action="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/search" id="sform" method="get">
<label for="q">Search: </label><input type="text" id="q" name="q" value="" size="15" />
<img alt="Spinner-blue" id="search_spinner" src="http://web.archive.org/web/20061018215025im_/http://sami.samhuri.net/images/spinner-blue.gif" style="display:none;" />
</form>
<script type="text/javascript">
//<![CDATA[
new Form.Element.Observer('q', 1, function(element, value) {new Ajax.Updater('search-results', '/live/search', {asynchronous:true, evalScripts:true, onComplete:function(request){Element.hide('search_spinner')}, onLoading:function(request){Element.show('search_spinner')}, parameters:'q=' + escape($F('q'))})})
//]]>
</script></div>
<div id="search-results"></div>
<div class="sidebar-node">
<h3>All about...</h3>
<ul>
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/pages/about">a bit about me</a></li>
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/pages/thunder">workstation</a></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Categories</h3>
<ul id="categories">
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/category/amusement">amusement</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/category/gentoo">gentoo</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/category/hacking">coding</a> <em>(16)</em></li>
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/category/life">life</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/category/linux">linux</a> <em>(2)</em></li>
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/category/mac-os-x">mac os x</a> <em>(6)</em></li>
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/category/python">python</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/category/rails">rails</a> <em>(12)</em></li>
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/category/ruby">ruby</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/category/technology">technology</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/category/textmate">textmate</a> <em>(10)</em></li>
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/category/apple">apple</a> <em>(6)</em></li>
<li><a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/category/php">php</a> <em>(4)</em></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Archives</h3>
<ul id="archives">
<li>
<a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/09">September 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/08">August 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/07">July 2006</a>
<em>(5)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/06">June 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/05">May 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/04">April 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/03">March 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/articles/2006/02">February 2006</a>
<em>(15)</em>
</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Links</h3>
<ul>
<li><a href="http://web.archive.org/web/20061018215025/http://phox.ca/cswiki/Main_Page">CSWiki</a></li>
<li><a href="http://web.archive.org/web/20061018215025/http://jim.roepcke.com/">Have Browser, Will Travel</a></li>
<li><a href="http://web.archive.org/web/20061018215025/http://blog.inquirylabs.com/">Going Up</a></li>
<li><a href="http://web.archive.org/web/20061018215025/http://www.mirage.org/">encieno</a></li>
<li><a href="http://web.archive.org/web/20061018215025/http://www.nofxwiki.net/">nofxwiki.net</a></li>
<li>sami at samhuri dot net</li>
</ul>
</div>
<div class="sidebar-node">
<p><ul>
<li><a class="feed" href="http://web.archive.org/web/20061018215025/http://sami.samhuri.net/xml/rss20/feed.xml" title="Articles feed"><img src="http://web.archive.org/web/20061018215025im_/http://sami.samhuri.net/files/feed-icon-48x48.png" alt="RSS 2.0" width="48" height="48" /></a></li>
<!--
-->
</ul></p>
</div>
<br clear="all" />
</div>
</div>
<div id="footer">
<ul>
<li><a href="http://web.archive.org/web/20061018215025/http://typo.leetsoft.com/">Typo</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20061018215025/http://validator.w3.org/check?uri=referer">Valid XHTML</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20061018215025/http://jigsaw.w3.org/css-validator/validator?uri=http://sami.samhuri.net/">Valid CSS</a></li>
</ul>
</div>
<script src="http://web.archive.org/web/20061018215025js_/http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-214054-3";
urchinTracker();
</script>
</body>
</html>
<!--
FILE ARCHIVED ON 21:50:25 Oct 18, 2006 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 7:31:00 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,525 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WikipediaFS on Linux, in Python - samhuri.net</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta content="48.472,-123.3683" name="ICBM" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/xml/rsd" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/xml/rss20/article/66/feed.xml" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/xml/atom10/article/66/feed.xml" />
<script src="http://web.archive.org/web/20060614130646js_/http://sami.samhuri.net/javascripts/cookies.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060614130646js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060614130646js_/http://sami.samhuri.net/javascripts/effects.js" type="text/javascript"></script>
<script src="http://web.archive.org/web/20060614130646js_/http://sami.samhuri.net/javascripts/typo.js" type="text/javascript"></script>
<script type="text/javascript"></script>
<link href="http://web.archive.org/web/20060614130646cs_/http://sami.samhuri.net/stylesheets/theme/island.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20060614130646cs_/http://sami.samhuri.net/stylesheets/user-styles.css" media="all" rel="Stylesheet" type="text/css" />
<link href="http://web.archive.org/web/20060614130646cs_/http://sami.samhuri.net/stylesheets/theme/print.css" media="print" rel="Stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/articles\/2006\/05\/07\/wikipediafs-on-linux-in-python";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "14";
var displayMonth = "Jun";
var displayYear = "2006";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/articles/2006/05/07/wikipediafs-on-linux-in-python" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20060614130646" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
May
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 13:06:46 Jun 14, 2006">JUN</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20060926030909/http://sami.samhuri.net/articles/2006/05/07/wikipediafs-on-linux-in-python" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="26 Sep 2006"><strong>SEP</strong></a>
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" />
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 13:06:46 Jun 14, 2006">14</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20060926030909/http://sami.samhuri.net/articles/2006/05/07/wikipediafs-on-linux-in-python" title="3:09:09 Sep 26, 2006" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0"/></a>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2005
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 13:06:46 Jun 14, 2006">2006</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20070805211714/http://sami.samhuri.net/articles/2006/05/07/wikipediafs-on-linux-in-python" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="5 Aug 2007"><strong>2007</strong></a>
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20060614130646*/http://sami.samhuri.net/articles/2006/05/07/wikipediafs-on-linux-in-python" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>7 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">14 Jun 06 - 7 Aug 07</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:5:000001001011_2007:-1:001000020000_2008:-1:000000000000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="content" class="clearfix">
<div id="main">
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping="http://sami.samhuri.net/articles/trackback/66"
dc:title="WikipediaFS on Linux, in Python"
dc:identifier="http://sami.samhuri.net/articles/read/66"
dc:description="Till now I&amp;#8217;ve been using my own version of pywikipedia for scripting MediaWiki, and it works well. But I read about WikipediaFS and had to c"
dc:creator="sjs"
dc:date="2006-05-07T21:08:34-07:00" />
</rdf:RDF>
-->
<div class="post" onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_article'); }" onmouseout="Element.hide('admin_article');" >
<a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/admin/content/edit/66" class="admintools" id="admin_article" style="display: none">edit</a>
<h2>WikipediaFS on Linux, in Python</h2>
<p class="auth"><!-- Posted by <a href="mailto:sjs@uvic.ca">Sami Jensen Samhuri</a> -->
<span class="typo_date" title="Mon, 08 May 2006 03:49:00 GMT">Mon, 08 May 2006 03:49:00 GMT</span></p>
<p>Till now I&#8217;ve been using my own version of <a href="http://web.archive.org/web/20060614130646/http://meta.wikimedia.org/wiki/Pywikipedia">pywikipedia</a> for scripting MediaWiki, and it works well. But I read about <a href="http://web.archive.org/web/20060614130646/http://wikipediafs.sourceforge.net/">WikipediaFS</a> and had to check it out. It&#8217;s a user space filesystem for Linux that&#8217;s built using the <a href="http://web.archive.org/web/20060614130646/http://fuse.sourceforge.net/wiki/index.php/LanguageBindings">Python bindings</a> for <a href="http://web.archive.org/web/20060614130646/http://fuse.sourceforge.net/"><span class="caps">FUSE</span></a>. What it does is mounts a filesystem that represents your wiki, with articles as text files. You can use them just like any other files with mv, cp, ls, vim, and so on.</p>
<p>There hasen&#8217;t been any action on that project for 13 months though, and it doesn&#8217;t work on my wiki (MediaWiki 1.4.15) so I&#8217;m going to try and make it work after I upgrade to MediaWiki 1.6.3 tonight. This will be pretty cool when it works. I haven&#8217;t looked at the code yet but it&#8217;s only 650 lines.</p>
</div>
<p class="meta">
Posted in <a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/category/hacking" rel="tag">hacking</a>, <a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/category/python" rel="tag">python</a>, <a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/category/linux" rel="tag">linux</a>&nbsp;<strong>|</strong>&nbsp;Tags <a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/tag/fuse" rel="tag">fuse</a>, <a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/tag/linux" rel="tag">linux</a>, <a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/tag/mediawiki" rel="tag">mediawiki</a>, <a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/tag/python" rel="tag">python</a>, <a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/tag/wikipediafs" rel="tag">wikipediafs</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/2006/05/07/wikipediafs-on-linux-in-python#comments">no comments</a>&nbsp;<strong>|</strong>&nbsp;<a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/2006/05/07/wikipediafs-on-linux-in-python#trackbacks">no trackbacks</a>
</p>
<a name="comments"></a><h4 class="blueblk">Comments</h4>
<p class="postmetadata alt">
<small><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/2006/05/07/wikipediafs-on-linux-in-python#respond">Leave a response</a></small>
</p>
<ol class="comment-list" id="commentList">
<li id="dummy_comment" style="display: none"></li>
</ol>
<a name="trackbacks"></a><h4 class="blueblk">Trackbacks</h4>
<p>
Use the following link to trackback from your own site:<br/>
<span class="light-bg">http://sami.samhuri.net/articles/trackback/66</span>
</p>
<p class="postmetadata alt">
<small>
<a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/xml/rss20/article/66/feed.xml" title="RSS Feed">RSS feed for this post</a>
<a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/trackback/66" >trackback uri</a>
</small>
</p>
<form action="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/comment/66" class="commentform" id="commentform" method="post" onsubmit="new Ajax.Updater({success:'commentList'}, '/articles/comment/66', {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom, onComplete:function(request){complete(request)}, onFailure:function(request){failure(request)}, onLoading:function(request){loading()}, parameters:Form.serialize(this)}); return false;">
<div class="comment-box">
<div id="errors"></div>
<div id="preview" style="display: none"></div>
<a name="respond"></a>
<table cellpadding="4" cellspacing="0" class="frm-tbl">
<tr>
<td><p><label for="comment_author">Your name</label></p></td>
<td> <input id="comment_author" name="comment[author]" size="20" type="text" /> <small><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/2006/05/07/wikipediafs-on-linux-in-python#" onclick="Element.toggle('guest_url'); Element.toggle('guest_email'); return false;">(leave url/email &#187;)</a></small></td>
</tr>
<tr id="guest_url" style="display:none;">
<td><p><label for="comment_url">Your blog</label></p></td>
<td> <input id="comment_url" name="comment[url]" size="30" type="text" /></td>
</tr>
<tr id="guest_email" style="display:none;">
<td><p><label for="comment_email">Your email</label></p></td>
<td> <input id="comment_email" name="comment[email]" size="30" type="text" /></td>
</tr>
<tr>
<td><p><label for="comment_body">Your message</label></p></td>
<td valign="top" colspan="2">
<textarea cols="40" id="comment_body" name="comment[body]" rows="20"></textarea>
</td>
</tr>
<tr>
<td colspan="2" id="frm-btns">
<span id="comment_loading" style="display:none;"><img alt="Spinner" src="http://web.archive.org/web/20060614130646im_/http://sami.samhuri.net/images/spinner.gif" /></span>&nbsp;&nbsp;
<a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/2006/05/07/wikipediafs-on-linux-in-python#" onclick="new Ajax.Updater('preview', '/articles/comment_preview', {asynchronous:true, evalScripts:true, parameters:Form.serialize('commentform'), onComplete:function(request){Element.show('preview')}}); return false;">Preview comment</a>
<input type="submit" name="submit" id="form-submit-button" value="submit" class="button" />
</td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
show_dates_as_local_time()
//]]>
</script>
</div>
</div>
<div id="leftcolumn">
<div id="header">
<h1 id="sitename"><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/">sjs</a></h1>
<h2 id="subtitle">&nbsp;</h2>
</div>
<div id="sidebar">
<div id="search"><form action="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/search" id="sform" method="get">
<label for="q">Search: </label><input type="text" id="q" name="q" value="" size="15" />
<img alt="Spinner-blue" id="search_spinner" src="http://web.archive.org/web/20060614130646im_/http://sami.samhuri.net/images/spinner-blue.gif" style="display:none;" />
</form>
<script type="text/javascript">
//<![CDATA[
new Form.Element.Observer('q', 1, function(element, value) {new Ajax.Updater('search-results', '/live/search', {asynchronous:true, evalScripts:true, onComplete:function(request){Element.hide('search_spinner')}, onLoading:function(request){Element.show('search_spinner')}, parameters:'q=' + escape($F('q'))})})
//]]>
</script></div>
<div id="search-results"></div>
<div class="sidebar-node">
<h3>All about...</h3>
<ul>
<li><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/pages/about">me in 3 paragraphs</a></li>
<li><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/pages/how-i-became-a-geek">geek background</a></li>
<li><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/pages/thunder">workstation</a></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Categories</h3>
<ul id="categories">
<li><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/category/amusement">amusement</a> <em>(4)</em></li>
<li><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/category/gentoo">gentoo</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/category/hacking">hacking</a> <em>(12)</em></li>
<li><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/category/life">life</a> <em>(4)</em></li>
<li><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/category/linux">linux</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/category/mac-os-x">mac os x</a> <em>(5)</em></li>
<li><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/category/python">python</a> <em>(1)</em></li>
<li><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/category/rails">rails</a> <em>(11)</em></li>
<li><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/category/technology">technology</a> <em>(2)</em></li>
<li><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/category/textmate">textmate</a> <em>(10)</em></li>
<li><a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/category/apple">apple</a> <em>(3)</em></li>
</ul>
</div>
<div class="sidebar-node">
<h3>Archives</h3>
<ul id="archives">
<li>
<a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/2006/06">June 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/2006/05">May 2006</a>
<em>(2)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/2006/04">April 2006</a>
<em>(1)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/2006/03">March 2006</a>
<em>(4)</em>
</li>
<li>
<a href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/articles/2006/02">February 2006</a>
<em>(15)</em>
</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Links</h3>
<ul>
<li><a href="http://web.archive.org/web/20060614130646/http://phox.ca/cswiki/Main_Page">CSWiki</a></li>
<li><a href="http://web.archive.org/web/20060614130646/http://jim.roepcke.com/">Have Browser, Will Travel</a></li>
<li><a href="http://web.archive.org/web/20060614130646/http://blog.inquirylabs.com/">Going Up</a></li>
<li><a href="http://web.archive.org/web/20060614130646/http://www.mirage.org/">encieno</a></li>
<li><a href="http://web.archive.org/web/20060614130646/http://www.nofxwiki.net/">nofxwiki.net</a></li>
</ul>
</div>
<div class="sidebar-node">
<p><ul>
<li><a class="feed" href="http://web.archive.org/web/20060614130646/http://sami.samhuri.net/xml/rss20/feed.xml" title="Articles feed"><img src="http://web.archive.org/web/20060614130646im_/http://sami.samhuri.net/files/feed-icon-48x48.png" alt="RSS 2.0" width="48" height="48" /></a></li>
<!--
-->
</ul></p>
</div>
<br clear="all" />
</div>
</div>
<div id="footer">
<ul>
<li><a href="http://web.archive.org/web/20060614130646/http://typo.leetsoft.com/">Typo</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20060614130646/http://validator.w3.org/check?uri=referer">Valid XHTML</a></li>
<li>&bull;</li>
<li><a href="http://web.archive.org/web/20060614130646/http://jigsaw.w3.org/css-validator/validator?uri=http://sami.samhuri.net/">Valid CSS</a></li>
</ul>
</div>
<script src="http://web.archive.org/web/20060614130646js_/http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-214054-3";
urchinTracker();
</script>
</body>
</html>
<!--
FILE ARCHIVED ON 13:06:46 Jun 14, 2006 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 7:29:26 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,760 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>sjs: A Scheme parser in Haskell: Part 1</title>
<link rel="openid.server" href="http://web.archive.org/web/20090215135823/http://www.myopenid.com/server" />
<link rel="openid.delegate" href="http://web.archive.org/web/20090215135823/http://sami-samhuri.myopenid.com/" />
<meta http-equiv="X-XRDS-Location" content="http://sami-samhuri.myopenid.com/xrds" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20090215135823/http://feeds.feedburner.com/sjs" />
<script src="http://web.archive.org/web/20090215135823js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<link href="http://web.archive.org/web/20090215135823cs_/http://sami.samhuri.net/stylesheets/application.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/2007\/5\/3\/a-scheme-parser-in-haskell-part-1\/";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "15";
var displayMonth = "Feb";
var displayYear = "2009";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/2007/5/3/a-scheme-parser-in-haskell-part-1/" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20090215135823" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Jan
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 13:58:23 Feb 15, 2009">FEB</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Mar
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" />
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 13:58:23 Feb 15, 2009">15</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20090218162506/http://sami.samhuri.net/2007/5/3/a-scheme-parser-in-haskell-part-1/" title="16:25:06 Feb 18, 2009" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0"/></a>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2008
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 13:58:23 Feb 15, 2009">2009</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2010
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20090215135823*/http://sami.samhuri.net/2007/5/3/a-scheme-parser-in-haskell-part-1/" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>2 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">15 Feb 09 - 18 Feb 09</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:-1:000000000000_2007:-1:000000000000_2008:-1:000000000000_2009:1:020000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="container">
<div id="header">
<h1><span><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/">sjs</a></span></h1>
<h2>geeky ramblings</h2>
</div>
<div id="page">
<div id="content">
<!--
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping=""
dc:title="A Scheme parser in Haskell: Part 1"
dc:identifier="/2007/5/3/a-scheme-parser-in-haskell-part-1"
dc:description="From <a href="http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/firststeps.html">Write Yourself a Scheme in 48 hours</a>:
<blockquote>
<p>Basically, a monad is a way of saying &#8220;there&#8217;s some extra information attached to ..."
dc:creator="sjs"
dc:date="May 03, 2007 07:47" />
</rdf:RDF>
-->
<div class="hentry" id="article-40">
<h2 class="entry-title">
<a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/2007/5/3/a-scheme-parser-in-haskell-part-1">A Scheme parser in Haskell: Part 1</a>
</h2>
<div class="vcard">
Posted by <span class="fn">sjs</span>
</div>
<abbr class="published" title="2007-05-03T07:47:50+00:00">on Thursday, May 03</abbr>
<br class="clear" />
<div class="entry-content">
From <a href="http://web.archive.org/web/20090215135823/http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/firststeps.html">Write Yourself a Scheme in 48 hours</a>:
<blockquote>
<p>Basically, a monad is a way of saying &#8220;there&#8217;s some extra information attached to this value, which most functions don&#8217;t need to worry about&#8221;. In this example, the &#8220;extra information&#8221; is the fact that this action performs IO, and the basic value is nothing, represented as &#8220;()&#8221;. Monadic values are often called &#8220;actions&#8221;, because the easiest way to think about the IO monad is a sequencing of actions that each might affect the outside world.</p>
</blockquote>
<p>I really like this tutorial. I&#8217;m only on part 3.3 of 12, <a href="http://web.archive.org/web/20090215135823/http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/parser.html">parsing</a>, but I&#8217;m new to Haskell so I&#8217;m learning left, right &#38; centre. The exercises are taking me hours of reading and experimenting, and it&#8217;s lots of fun! ghc&#8217;s errors are usually quite helpful and of course ghci is a big help as well.</p>
<p>I&#8217;m going to explain one of the exercises because converting between the various syntax for dealing with monads wasn&#8217;t plainly obvious to me. Perhaps I wasn&#8217;t paying enough attention to the docs I read. In any case if you&#8217;re interested in Haskell at all, I recommend the tutorial and if you&#8217;re stuck on exercise 3.3.1 like I was then come on back here. Whether you&#8217;re following the tutorial or not the point of this post should stand on its own with a basic knowledge of Haskell.</p>
<p>Last night I rewrote <code>parseNumber</code> using <code>do</code> and <code>&gt;&gt;=</code> (bind) notations (ex. 3.3.1). Here&#8217;s <code>parseNumber</code> using the <code>liftM</code> method given in the tutorial:</p>
<pre><code>parseNumber :: Parser LispVal
parseNumber :: liftM (Number . read) $ many1 digit
</code></pre>
<p>Okay that&#8217;s pretty simple right? Let&#8217;s break it down, first looking at the right-hand side of the <code>$</code> operator, then the left.</p>
<ul>
<li><tt>many1 digit</tt> reads as many decimal digits as it can.</li>
</ul>
<ul>
<li><code>Number . read</code> is a <a href="http://web.archive.org/web/20090215135823/http://en.wikipedia.org/wiki/Function_composition_(computer_science%29">function composition</a> just like we&#8217;re used to using in math. It applies <code>read</code> to its argument, then applies <code>Number</code> to that result.</li>
</ul>
<ul>
<li><tt>liftM</tt> is concisely and effectively defined <a href="http://web.archive.org/web/20090215135823/http://members.chello.nl/hjgtuyl/tourdemonad.html#liftM">elsewhere</a>, and I&#8217;ll borrow their description:</li>
</ul>
<blockquote>
<p><tt>liftM f m</tt> lets a non-monadic function <tt>f</tt> operate on the contents of monad <tt>m</tt></p>
</blockquote>
<p><code>liftM</code>&#8217;s type is also quite telling: <tt>liftM :: (Monad m) =&gt; (a -&gt; b) -&gt; (m a -&gt; m b)</tt></p>
<p>In a nutshell <code>liftM</code> turns a function from <code>a</code> to <code>b</code> to a function from a monad containing <code>a</code> to a monad containing <code>b</code>.</p>
<p>That results in a function on the left-hand side of <code>$</code>, which operates on and outputs a monad. The content of the input monad is a <code>String</code>. The content of the output monad is a <tt>LispVal</tt> (defined earlier in the tutorial). Specifically it is a <code>Number</code>.</p>
<p>The <code>$</code> acts similar to a pipe in <code>$FAVOURITE_SHELL</code>, and is right associative which means the expression on the right is passed to the expression (function) on the left. It&#8217;s exactly the same as <tt>(liftM (Number . read)) (many1 digit)</tt> except it looks cleaner. If you know <span class="caps">LISP</span> or Scheme (sadly I do not) then it&#8217;s analogous to the <code>apply</code> function.</p>
<p>So how does a Haskell newbie go about re-writing that using other notations which haven&#8217;t even been explained in the tutorial? Clearly one must search the web and read as much as they can until they understand enough to figure it out (which is one thing I like about the tutorial). If you&#8217;re lazy like me, here are 3 equivalent pieces of code for you to chew on. <code>parseNumber</code>&#8217;s type is <code>Parser LispVal</code> (Parser is a monad).</p>
Familiar <code>liftM</code> method:
<pre><code>parseNumber -&gt; liftM (Number . read) $ many1 digit
</code></pre>
Using <code>do</code> notation:
<pre><code>parseNumber -&gt; do digits &lt;- many1 digit
return $ (Number . read) digits
</code></pre>
<p>If you&#8217;re thinking &#8220;Hey a <code>return</code>, I know that one!&#8221; then the devious masterminds behind Haskell are certainly laughing evilly right now. <code>return</code> simply wraps up it&#8217;s argument in a monad of some sort. In this case it&#8217;s the <code>Parser</code> monad. The <code>return</code> part may seem strange at first. Since <code>many1 digit</code> yields a monad why do we need to wrap anything? The answer is that using <code>&lt;-</code> causes <code>digits</code> to contain a <code>String</code>, stripped out of the monad which resulted from <code>many1 digit</code>. Hence we no longer use <code>liftM</code> to make <code>(Number . read)</code> monads, and instead need to use <code>return</code> to properly wrap it back up in a monad.</p>
<p>In other words <code>liftM</code> eliminates the need to explicitly re-monadize the contents as is necessary using <code>do</code>.</p>
Finally, using <code>&gt;&gt;=</code> (bind) notation:
<pre><code>parseNumber -&gt; many1 digit &gt;&gt;= \digits -&gt;
return $ (Number . read) digits
</code></pre>
<p>At this point I don&#8217;t think this warrants much of an explanation. The syntactic sugar provided by <code>do</code> should be pretty obvious. Just in case it&#8217;s not, <code>&gt;&gt;=</code> passes the contents of its left argument (a monad) to the <em>function</em> on its right. Once again <code>return</code> is needed to wrap up the result and send it on its way.</p>
<p>When I first read about Haskell I was overwhelmed by not knowing anything, and not being able to apply my previous knowledge of programming to <em>anything</em> in Haskell. One piece of syntax at a time I am slowly able to understand more of the Haskell found <a href="http://web.archive.org/web/20090215135823/http://www.google.com/url?sa=t&ct=res&cd=2&url=http%3A%2F%2Fblog.moertel.com%2Farticles%2F2005%2F03%2F25%2Fwriting-a-simple-ruby-evaluator-in-haskell&ei=Q1A6RtWPLZvYigGZsMjxAQ&usg=AFrqEzdrRepwsuNaQqe1gHYjHvqdCDKfoA&sig2=0qNTIOB9XxeZRqKR7J61Iw">in the wild</a>.</p>
<p>I&#8217;m currently working on ex. 3.3.4, which is parsing <a href="http://web.archive.org/web/20090215135823/http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_sec_6.3.5"><span class="caps">R5RS</span> compliant numbers</a> <em>(e.g. #o12345670, #xff, #d987)</em>. I&#8217;ll probably write something about that once I figure it out, but in the meantime if you have any hints I&#8217;m all ears.</p>
<p><em>Update #1: I should do more proof-reading if I&#8217;m going to try and explain things. I made some changes in wording.</em></p>
</div>
<ul class="meta">
<li>
Tags: <a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/coding">coding</a>&nbsp;<a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/haskell">haskell</a>&nbsp;
</li>
<li>
Meta:
<a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/2007/5/3/a-scheme-parser-in-haskell-part-1">permalink</a>
</li>
</ul>
</div>
<h5><a name="comments">Comments</a></h5>
<p><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/2007/5/3/a-scheme-parser-in-haskell-part-1/#comment-form">Leave a response</a></p>
<div id="comments_div">
<ol id="comments" class="comments">
<li class="comment" id="comment-55">
<div class="author">
<cite><span class="author"><a href="http://web.archive.org/web/20090215135823/http://comonad.com/">Edward Kmett</a></span></cite> &#150;
<abbr title="May 11, 2007 10:26"><span class="date">May 11, 2007 @ 10:26 AM</span></abbr>
</div>
<div class="content">
In your above example, you can view return as another function in the chain of functions to apply, yielding:
parseNumber = many1 digit >>= return . Number . read
or
parseNumber = do digits &lt;- many1 digit; return . Number . read $ digits
of course, this is just unrolling the definition of liftM, so its not surprising.
</div>
</li>
<li class="comment" id="comment-56">
<div class="author">
<cite><span class="author"><span>sjs</span></span></cite> &#150;
<abbr title="May 11, 2007 10:26"><span class="date">May 11, 2007 @ 10:26 AM</span></abbr>
</div>
<div class="content">
Ah, that makes perfect sense. Thanks for that. Every little bit helps my understanding of monads.
</div>
</li>
<li class="comment" id="comment-64">
<div class="author">
<cite><span class="author"><span>anonymous</span></span></cite> &#150;
<abbr title="May 29, 2007 13:49"><span class="date">May 29, 2007 @ 01:49 PM</span></abbr>
</div>
<div class="content">
<p>You might also want to know that for monads,</p>
<pre><code>liftM = fmap</code></pre>
<p>This is useful (at least for me), because I have different intuitions for liftM and fmap:</p>
<p>I see liftM as a function lifting ordinary functions to monadic functions, while I think of (fmap f) as a function manipulating the &#8220;contents&#8221; of a monadic value using f, just like the ordinary map on lists manipulates the elements of lists.</p>
<p>(Depending on context, I use both liftM and fmap.)</p>
<p>In your case, I&#8217;d use fmap (this choice is completely subjective, of course), to stress that I just want to change the contents of the monadic return value of (many1 digits):</p>
<pre><code>fmap (Number . read) $ many1 digits</code></pre>
<p>Also, some prefer to write this using infix notation:</p>
<pre><code>Number . read `fmap` many1 digits</code></pre>
<p>This way you see that fmap can be tought of being ($), only modulo monadic stuff.</p>
<p><span class="caps">BTW</span>, fmap is useful on many other data structures, too:</p>
<pre><code>fmap f (Just x) = Just (f x)
fmap f Nothing = Nothing</code></pre>
<pre><code>fmap f (Left x) = Left x
fmap f (Right x) = Right (f x)
-- You need Control.Monad.Error for this one.</code></pre>
<pre><code>fmap f xs = map f xs
-- With xs :: [a]</code></pre>
<p>Happy Haskelling!</p>
</div>
</li>
</ol>
</div>
</div>
<div id="sidebar">
<div class="sidebar-node">
<div id="search" class="search">
<form action="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/search" id="sform" method="get" name="sform">
<p><input type="text" id="q" name="q" value="" /></p>
</form>
</div>
</div>
<div class="sidebar-node">
<h3>Sections</h3>
<ul>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/">geeky ramblings</a> (15)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/emacs">Emacs</a> (3)</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Tags</h3>
<ul>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/activerecord">activerecord</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/alsa">alsa</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/amusement">amusement</a> (6)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/apple">apple</a> (6)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/arc">arc</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/bdd">bdd</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/broken">broken</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/browsers">browsers</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/buffalo">buffalo</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/bundle">bundle</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/cheat">cheat</a> (3)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/coding">coding</a> (22)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/cool">cool</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/coverflow">coverflow</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/crazy">crazy</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/digg">digg</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/drm">drm</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/dtrace">dtrace</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/dubai">dubai</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/elschemo">elschemo</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/emacs">emacs</a> (11)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/english">english</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/extensions">extensions</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/firefox">firefox</a> (3)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/framework">framework</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/funny">funny</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/fuse">fuse</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/games">games</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/gentoo">gentoo</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/german">german</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/gtkpod">gtkpod</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/haskell">haskell</a> (7)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/humans">humans</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/injury">injury</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/inspirado">inspirado</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/iphone">iphone</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/itunes">itunes</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/i_laughed_i_cried">i_laughed_i_cried</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/keyboard">keyboard</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/keyboard%20shortcuts">keyboard shortcuts</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/lemmings">lemmings</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/life">life</a> (13)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/linux">linux</a> (8)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/lisp">lisp</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/lisp%20arc">lisp arc</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/mac%20os%20x">mac os x</a> (6)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/mediawiki">mediawiki</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/mephisto">mephisto</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/migrations">migrations</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/munich">munich</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/mysql">mysql</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/networking">networking</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/opera">opera</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/pedantry">pedantry</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/people">people</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/photo">photo</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/php">php</a> (4)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/programming">programming</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/project%20euler">project euler</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/propaganda">propaganda</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/python">python</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/quickcheck">quickcheck</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/rails">rails</a> (18)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/rails%20on%20rules">rails on rules</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/regex">regex</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/regular%20expressions">regular expressions</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/rest">rest</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/rtfm">rtfm</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/ruby">ruby</a> (14)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/rushcheck">rushcheck</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/sake">sake</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/scheme">scheme</a> (4)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/school">school</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/seaside">seaside</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/secure%20associations">secure associations</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/seekport">seekport</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/snippets">snippets</a> (3)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/ssh">ssh</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/tagify">tagify</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/technology">technology</a> (6)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/test/spec">test/spec</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/textmate">textmate</a> (7)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/tips">tips</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/typo">typo</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/ubuntu">ubuntu</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/usability">usability</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/userscript">userscript</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/vacation">vacation</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/vim">vim</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/volume">volume</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/web">web</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/web%20objects">web objects</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/wikipediafs">wikipediafs</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/windows">windows</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/work">work</a> (1)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/zend">zend</a> (2)</li>
<li><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/tags/zsh">zsh</a> (1)</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Friends &amp; cool blogs</h3>
<ul>
<li><a href="http://web.archive.org/web/20090215135823/http://jim.roepcke.com/">have browser, will travel</a></li>
<li><a href="http://web.archive.org/web/20090215135823/http://cassandrahill.blogspot.com/">cj's chatter</a></li>
</ul>
</div>
<div class="sidebar-node">
<p><a href="http://web.archive.org/web/20090215135823/http://twitter.com/_sjs">
<img src="http://web.archive.org/web/20090215135823im_/http://sami.samhuri.net/assets/2007/6/26/icon_twitter.png" alt="[t]" /> twitter</a></p>
</div>
<div class="sidebar-node">
<p><a href="http://web.archive.org/web/20090215135823/http://mephistoblog.com/" class="powered"><img alt="mephisto-badge-tiny" src="http://web.archive.org/web/20090215135823im_/http://sami.samhuri.net/images/mephisto-badge-tiny.png" /></a></p>
</div>
</div>
<br style="clear:both;" />
</div>
<div id="footer">
<hr />
<p><a href="http://web.archive.org/web/20090215135823/http://sami.samhuri.net/">sjs</a></p>
<ul>
<li>powered by <a href="http://web.archive.org/web/20090215135823/http://mephistoblog.com/">Mephisto</a> /
styled with <a href="http://web.archive.org/web/20090215135823/http://quotedprintable.com/pages/scribbish">scribbish</a></li>
</ul>
</div>
</div>
<script src="http://web.archive.org/web/20090215135823js_/http://www.google-analytics.com/urchin.js" type="text/javascript"> </script>
<script type="text/javascript"> _uacct = "UA-214054-3"; urchinTracker(); </script>
<script src="http://web.archive.org/web/20090215135823js_/http://feeds.feedburner.com/~s/sjs" type="text/javascript" charset="utf-8"></script>
</body>
</html>
<!--
FILE ARCHIVED ON 13:58:23 Feb 15, 2009 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 9:12:21 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,597 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>sjs: Typo and I are friends again</title>
<link rel="openid.server" href="http://web.archive.org/web/20080820114744/http://www.myopenid.com/server" />
<link rel="openid.delegate" href="http://web.archive.org/web/20080820114744/http://sami-samhuri.myopenid.com/" />
<meta http-equiv="X-XRDS-Location" content="http://sami-samhuri.myopenid.com/xrds" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20080820114744/http://feeds.feedburner.com/sjs" />
<script src="http://web.archive.org/web/20080820114744js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<link href="http://web.archive.org/web/20080820114744cs_/http://sami.samhuri.net/stylesheets/application.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/2007\/5\/2\/typo-and-i-are-friends-again";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "20";
var displayMonth = "Aug";
var displayYear = "2008";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/2007/5/2/typo-and-i-are-friends-again" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20080820114744" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Jul
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 11:47:44 Aug 20, 2008">AUG</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Sep
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" />
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 11:47:44 Aug 20, 2008">20</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_off.png" alt="Next capture" width="14" height="16" border="0"/>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2007
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 11:47:44 Aug 20, 2008">2008</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2009
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20080820114744*/http://sami.samhuri.net/2007/5/2/typo-and-i-are-friends-again" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>1 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">20 Aug 08 - 20 Aug 08</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:-1:000000000000_2007:-1:000000000000_2008:7:000000010000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="container">
<div id="header">
<h1><span><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/">sjs</a></span></h1>
<h2>geeky ramblings</h2>
</div>
<div id="page">
<div id="content">
<!--
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping=""
dc:title="Typo and I are friends again"
dc:identifier="/2007/5/2/typo-and-i-are-friends-again"
dc:description="<p>I&#8217;ve been really frustrated with <a href="http://www.typosphere.org">Typo</a> recently. For some reason changing my <a href="http://sami.samhuri.net/articles/2007/04/30/funny-how-code-can-be-beautiful">last post</a> would cause MySQL to t..."
dc:creator="sjs"
dc:date="May 02, 2007 04:51" />
</rdf:RDF>
-->
<div class="hentry" id="article-39">
<h2 class="entry-title">
<a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/2007/5/2/typo-and-i-are-friends-again">Typo and I are friends again</a>
</h2>
<div class="vcard">
Posted by <span class="fn">sjs</span>
</div>
<abbr class="published" title="2007-05-02T04:51:37+00:00">on Wednesday, May 02</abbr>
<br class="clear" />
<div class="entry-content">
<p>I&#8217;ve been really frustrated with <a href="http://web.archive.org/web/20080820114744/http://www.typosphere.org/">Typo</a> recently. For some reason changing my <a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/articles/2007/04/30/funny-how-code-can-be-beautiful">last post</a> would cause MySQL to timeout and I&#8217;d have to kill the rogue ruby process manually before any other changes to the DB would work, instead of hanging for a minute or two then timing out. Luckily I was able to disable the post using the command line client, the bug only manifested itself when issuing an <span class="caps">UPDATE</span> with all the fields present. Presumably the body was tripping things up because most other fields are simple booleans, numbers, or very short strings.</p>
<p>Add to that the random <span class="caps">HTTP 500</span> errors which were very noticeable while I was trying to fix that post and I was about to write my own blog or switch to WordPress.</p>
<p>I don&#8217;t love WP so I decided to just upgrade Typo instead. I was using Typo 2.6, and the current stable version is 4.1. They skipped version 3 to preclude any confusion that may have ensued between Typo v3 and the <span class="caps">CMS</span> <a href="http://web.archive.org/web/20080820114744/http://typo3.com/">Typo3</a>. So it really isn&#8217;t a big upgrade and it went perfectly. I checked out a new copy of the repo because I had some difficulty getting <tt>svn switch --relocate</tt> to work, configured the database settings and issued a <tt>rake db:migrate</tt>, copied my theme over and it all just worked. Bravo Typo team, that&#8217;s how an upgrade should work.</p>
<p>No more random 500 errors, things seem faster (better caching perhaps), and that troublesome post is troublesome no more. I am happy with Typo again.</p>
</div>
<ul class="meta">
<li>
Tags: <a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/typo">typo</a>&nbsp;
</li>
<li>
Meta:
<a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/2007/5/2/typo-and-i-are-friends-again">permalink</a>
</li>
</ul>
</div>
<h5><a name="comments">Comments</a></h5>
<p><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/2007/5/2/typo-and-i-are-friends-again#comment-form">Leave a response</a></p>
<div id="comments_div">
<ol id="comments" class="comments">
</ol>
</div>
</div>
<div id="sidebar">
<div class="sidebar-node">
<div id="search" class="search">
<form action="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/search" id="sform" method="get" name="sform">
<p><input type="text" id="q" name="q" value="" /></p>
</form>
</div>
</div>
<div class="sidebar-node">
<h3>Sections</h3>
<ul>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/">geeky ramblings</a> (15)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/emacs">Emacs</a> (3)</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Tags</h3>
<ul>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/activerecord">activerecord</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/alsa">alsa</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/amusement">amusement</a> (6)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/apple">apple</a> (6)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/arc">arc</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/bdd">bdd</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/broken">broken</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/browsers">browsers</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/buffalo">buffalo</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/bundle">bundle</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/cheat">cheat</a> (3)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/coding">coding</a> (22)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/cool">cool</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/coverflow">coverflow</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/crazy">crazy</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/digg">digg</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/drm">drm</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/dtrace">dtrace</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/dubai">dubai</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/elschemo">elschemo</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/emacs">emacs</a> (11)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/english">english</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/extensions">extensions</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/firefox">firefox</a> (3)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/framework">framework</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/funny">funny</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/fuse">fuse</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/games">games</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/gentoo">gentoo</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/german">german</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/gtkpod">gtkpod</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/haskell">haskell</a> (7)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/humans">humans</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/injury">injury</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/inspirado">inspirado</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/iphone">iphone</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/itunes">itunes</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/i_laughed_i_cried">i_laughed_i_cried</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/keyboard">keyboard</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/keyboard%20shortcuts">keyboard shortcuts</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/lemmings">lemmings</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/life">life</a> (13)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/linux">linux</a> (8)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/lisp">lisp</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/lisp%20arc">lisp arc</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/mac%20os%20x">mac os x</a> (6)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/mediawiki">mediawiki</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/mephisto">mephisto</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/migrations">migrations</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/munich">munich</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/mysql">mysql</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/networking">networking</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/opera">opera</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/pedantry">pedantry</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/people">people</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/photo">photo</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/php">php</a> (4)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/programming">programming</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/project%20euler">project euler</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/propaganda">propaganda</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/python">python</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/quickcheck">quickcheck</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/rails">rails</a> (18)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/rails%20on%20rules">rails on rules</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/regex">regex</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/regular%20expressions">regular expressions</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/rest">rest</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/rtfm">rtfm</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/ruby">ruby</a> (14)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/rushcheck">rushcheck</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/sake">sake</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/scheme">scheme</a> (4)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/school">school</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/seaside">seaside</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/secure%20associations">secure associations</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/seekport">seekport</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/snippets">snippets</a> (3)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/ssh">ssh</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/tagify">tagify</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/technology">technology</a> (6)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/test/spec">test/spec</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/textmate">textmate</a> (7)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/tips">tips</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/typo">typo</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/ubuntu">ubuntu</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/usability">usability</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/userscript">userscript</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/vacation">vacation</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/vim">vim</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/volume">volume</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/web">web</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/web%20objects">web objects</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/wikipediafs">wikipediafs</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/windows">windows</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/work">work</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/zend">zend</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/tags/zsh">zsh</a> (1)</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Friends &amp; cool blogs</h3>
<ul>
<li><a href="http://web.archive.org/web/20080820114744/http://jim.roepcke.com/">have browser, will travel</a></li>
<li><a href="http://web.archive.org/web/20080820114744/http://cassandrahill.blogspot.com/">cj's chatter</a></li>
</ul>
</div>
<div class="sidebar-node">
<p><a href="http://web.archive.org/web/20080820114744/http://twitter.com/_sjs">
<img src="http://web.archive.org/web/20080820114744im_/http://sami.samhuri.net/assets/2007/6/26/icon_twitter.png" alt="[t]" /> twitter</a></p>
</div>
<div class="sidebar-node">
<p><a href="http://web.archive.org/web/20080820114744/http://mephistoblog.com/" class="powered"><img alt="mephisto-badge-tiny" src="http://web.archive.org/web/20080820114744im_/http://sami.samhuri.net/images/mephisto-badge-tiny.png" /></a></p>
</div>
</div>
<br style="clear:both;" />
</div>
<div id="footer">
<hr />
<p><a href="http://web.archive.org/web/20080820114744/http://sami.samhuri.net/">sjs</a></p>
<ul>
<li>powered by <a href="http://web.archive.org/web/20080820114744/http://mephistoblog.com/">Mephisto</a> /
styled with <a href="http://web.archive.org/web/20080820114744/http://quotedprintable.com/pages/scribbish">scribbish</a></li>
</ul>
</div>
</div>
<script src="http://web.archive.org/web/20080820114744js_/http://www.google-analytics.com/urchin.js" type="text/javascript"> </script>
<script type="text/javascript"> _uacct = "UA-214054-3"; urchinTracker(); </script>
<script src="http://web.archive.org/web/20080820114744js_/http://feeds.feedburner.com/~s/sjs" type="text/javascript" charset="utf-8"></script>
</body>
</html>
<!--
FILE ARCHIVED ON 11:47:44 Aug 20, 2008 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 9:00:46 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,660 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>sjs: A triple-booting, schizophrenic MacBook</title>
<link rel="openid.server" href="http://web.archive.org/web/20080820115240/http://www.myopenid.com/server" />
<link rel="openid.delegate" href="http://web.archive.org/web/20080820115240/http://sami-samhuri.myopenid.com/" />
<meta http-equiv="X-XRDS-Location" content="http://sami-samhuri.myopenid.com/xrds" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20080820115240/http://feeds.feedburner.com/sjs" />
<script src="http://web.archive.org/web/20080820115240js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<link href="http://web.archive.org/web/20080820115240cs_/http://sami.samhuri.net/stylesheets/application.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/2007\/4\/5\/a-triple-booting-schizophrenic-macbook";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "20";
var displayMonth = "Aug";
var displayYear = "2008";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/2007/4/5/a-triple-booting-schizophrenic-macbook" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20080820115240" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20080313041230/http://sami.samhuri.net/2007/4/5/a-triple-booting-schizophrenic-macbook" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="13 Mar 2008"><strong>MAR</strong></a>
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 11:52:40 Aug 20, 2008">AUG</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Sep
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20080313041230/http://sami.samhuri.net/2007/4/5/a-triple-booting-schizophrenic-macbook" title="4:12:30 Mar 13, 2008" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_on.png" alt="Previous capture" width="14" height="16" border="0" /></a>
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 11:52:40 Aug 20, 2008">20</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_off.png" alt="Next capture" width="14" height="16" border="0"/>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2007
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 11:52:40 Aug 20, 2008">2008</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2009
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20080820115240*/http://sami.samhuri.net/2007/4/5/a-triple-booting-schizophrenic-macbook" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>4 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">13 Nov 07 - 20 Aug 08</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:-1:000000000000_2007:-1:000000000010_2008:7:101000010000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="container">
<div id="header">
<h1><span><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/">sjs</a></span></h1>
<h2>geeky ramblings</h2>
</div>
<div id="page">
<div id="content">
<!--
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping=""
dc:title="A triple-booting, schizophrenic MacBook"
dc:identifier="/2007/4/5/a-triple-booting-schizophrenic-macbook"
dc:description="The steps are well documented so I won&#8217;t get into detail here but if you have a backup and can wipe your disk all you do is:
<ul>
<li>Install <span class="caps">OS X</span> to a single partition filling your disk (optionally use your exist..."
dc:creator="sjs"
dc:date="April 05, 2007 06:30" />
</rdf:RDF>
-->
<div class="hentry" id="article-34">
<h2 class="entry-title">
<a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/2007/4/5/a-triple-booting-schizophrenic-macbook">A triple-booting, schizophrenic MacBook</a>
<span class="comment_count">0</span>
</h2>
<div class="vcard">
Posted by <span class="fn">sjs</span>
</div>
<abbr class="published" title="2007-04-05T06:30:00+00:00">on Thursday, April 05</abbr>
<br class="clear" />
<div class="entry-content">
The steps are well documented so I won&#8217;t get into detail here but if you have a backup and can wipe your disk all you do is:
<ul>
<li>Install <span class="caps">OS X</span> to a single partition filling your disk (optionally use your existing <span class="caps">OS X</span> intall)</li>
<li>Install <a href="http://web.archive.org/web/20080820115240/http://refit.sourceforge.net/">rEFIt</a> (no need to reboot just yet)</li>
<li>Re-partition your disk into 3 partitions with <tt>diskutil resizeVolume</tt>, reboot and confirm it all works</li>
<li>Boot the Vista install <span class="caps">DVD</span> and install to disk0s4 aka Partition 4</li>
<li>Install Gentoo (or other distro) to disk0s3 aka /dev/sda3</li>
</ul>
<p>With <a href="http://web.archive.org/web/20080820115240/http://www.macports.org/">MacPorts</a> and <a href="http://web.archive.org/web/20080820115240/http://www.metadistribution.org/macos/">Gentoo/MacOSX</a> the Gentoo install is superfluous but I&#8217;ll spare 12G just to see Gentoo run on this fine machine. Setting up the hardware should be fun. Right now I&#8217;m compiling X, (package 77 of 94) and the Core Duo is crunching code very nicely with 2G to work with, <strong>without any swap</strong>. I fully intend to put off creating a swap file unless I have to. Needless to say I&#8217;ll be running fluxbox or Xfce, none of that Gnome or <span class="caps">KDE</span> stuff. If I ever need a swap file I will eat my keyboard.</p>
<p><em>[edit: 25 minutes to compile X.org, not too shabby!]</em></p>
<p>My initial experience with Vista is quite good. Sadly the <a href="http://web.archive.org/web/20080820115240/http://www.manicai.net/comp/swap-caps-ctrl.html">same old registry hack</a> is required to swap Caps lock and Control but I was just glad it worked. I really like the new Start menu and the eye-candy is fairly pleasant for the most part. Till now I&#8217;d only used <span class="caps">RC2</span> on a machine incapable of running Aero Glass and it looked terrible. I switched to Windows Classic just like I do with XP. Not so with Aero at its finest though. Without thinking about the price Vista is a nice upgrade to Windows. But because of the price and uncertainty of running Aero Glass I still hesitate to urge non-geeks to upgrade.</p>
<p><span class="caps">OS X</span> is <span class="caps">OS X</span>. It&#8217;s my favourite desktop OS right now because of apps like LaunchBar/Quicksilver and TextMate, a generally excellent UI, good old *nix stability, zsh out of the box! When I need WireShark or the <span class="caps">GIMP X11</span> is there waiting. Mac notebooks are great and tight integration with the hardware is a clear advantage for <span class="caps">OS X</span>.</p>
<p>Oh yeah, I also have a Parallels VM for Windows 3.11. It boots in about second to the <tt>C:\&gt;</tt> prompt and then another second to type <tt>win</tt> and Windows to start. Without <span class="caps">TCP</span>/IP there&#8217;s not much to do though (I&#8217;m not going to write a driver for Parallels&#8217; ethernet adapter).</p>
<ol>
<li><a id="fn1" name="fn1"></a>
<ul>
<li>Dual head setups are more work than plugging in a 2nd monitor, which is too much work.</li>
<li>X requires a restart to enable or disable a 2nd display.</li>
<li>Overall clunkiness such as displaying the houndstooth background before the WM starts,</li>
<li>and/or going through a screwed up mode with a black &#38; white scrambled screen for a seconds before getting to the houndstooth.</li>
</ul>
<a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/2007/4/5/a-triple-booting-schizophrenic-macbook#fn1-ret">back up &uarr;</a>
</li>
</ol>
<p>Like I said the X.org boys are doing amazing work. Hopefully soon after the current eye-candy craze is over they&#8217;ll get to more important work that needs to be done.</p>
<div class="extended">
<p><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/2007/4/5/a-triple-booting-schizophrenic-macbook">Continue reading...</a></p>
</div>
</div>
<ul class="meta">
<li>
Tags: <a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/linux">linux</a>&nbsp;<a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/mac%20os%20x">mac os x</a>&nbsp;<a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/windows">windows</a>&nbsp;
</li>
<li>
Meta:
<a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/2007/4/5/a-triple-booting-schizophrenic-macbook">0 comments</a>,
<a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/2007/4/5/a-triple-booting-schizophrenic-macbook">permalink</a>
</li>
</ul>
</div>
<h5><a name="comments">Comments</a></h5>
<p><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/2007/4/5/a-triple-booting-schizophrenic-macbook#comment-form">Leave a response</a></p>
<div id="comments_div">
<ol id="comments" class="comments">
</ol>
</div>
<form id="comment-form" method="post" action="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/2007/4/5/a-triple-booting-schizophrenic-macbook/comments#comment-form">
<fieldset>
<legend>Comment</legend>
<p>
<label class="text" for="comment_author">Name:</label><br/>
<input type="text" id="comment_author" name="comment[author]" value="" />
</p>
<p>
<label class="text" for="comment_author_email">Email Address:</label><br />
<input type="text" id="comment_author_email" name="comment[author_email]" value="" />
</p>
<p>
<label class="text" for="comment_author_url">Website:</label><br />
<input type="text" id="comment_author_url" name="comment[author_url]" value="" />
</p>
<p>
<label class="text" for="comment_body">Comment:</label><br />
<textarea id="comment_body" name="comment[body]"></textarea>
</p>
<div class="formactions">
<input type="submit" value="Post comment" class="submit" />
</div>
</fieldset>
</form>
</div>
<div id="sidebar">
<div class="sidebar-node">
<div id="search" class="search">
<form action="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/search" id="sform" method="get" name="sform">
<p><input type="text" id="q" name="q" value="" /></p>
</form>
</div>
</div>
<div class="sidebar-node">
<h3>Sections</h3>
<ul>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/">geeky ramblings</a> (15)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/emacs">Emacs</a> (3)</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Tags</h3>
<ul>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/activerecord">activerecord</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/alsa">alsa</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/amusement">amusement</a> (6)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/apple">apple</a> (6)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/arc">arc</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/bdd">bdd</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/broken">broken</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/browsers">browsers</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/buffalo">buffalo</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/bundle">bundle</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/cheat">cheat</a> (3)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/coding">coding</a> (22)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/cool">cool</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/coverflow">coverflow</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/crazy">crazy</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/digg">digg</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/drm">drm</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/dtrace">dtrace</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/dubai">dubai</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/elschemo">elschemo</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/emacs">emacs</a> (11)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/english">english</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/extensions">extensions</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/firefox">firefox</a> (3)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/framework">framework</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/funny">funny</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/fuse">fuse</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/games">games</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/gentoo">gentoo</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/german">german</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/gtkpod">gtkpod</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/haskell">haskell</a> (7)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/humans">humans</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/injury">injury</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/inspirado">inspirado</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/iphone">iphone</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/itunes">itunes</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/i_laughed_i_cried">i_laughed_i_cried</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/keyboard">keyboard</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/keyboard%20shortcuts">keyboard shortcuts</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/lemmings">lemmings</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/life">life</a> (13)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/linux">linux</a> (8)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/lisp">lisp</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/lisp%20arc">lisp arc</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/mac%20os%20x">mac os x</a> (6)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/mediawiki">mediawiki</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/mephisto">mephisto</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/migrations">migrations</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/munich">munich</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/mysql">mysql</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/networking">networking</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/opera">opera</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/pedantry">pedantry</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/people">people</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/photo">photo</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/php">php</a> (4)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/programming">programming</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/project%20euler">project euler</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/propaganda">propaganda</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/python">python</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/quickcheck">quickcheck</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/rails">rails</a> (18)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/rails%20on%20rules">rails on rules</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/regex">regex</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/regular%20expressions">regular expressions</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/rest">rest</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/rtfm">rtfm</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/ruby">ruby</a> (14)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/rushcheck">rushcheck</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/sake">sake</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/scheme">scheme</a> (4)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/school">school</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/seaside">seaside</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/secure%20associations">secure associations</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/seekport">seekport</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/snippets">snippets</a> (3)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/ssh">ssh</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/tagify">tagify</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/technology">technology</a> (6)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/test/spec">test/spec</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/textmate">textmate</a> (7)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/tips">tips</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/typo">typo</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/ubuntu">ubuntu</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/usability">usability</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/userscript">userscript</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/vacation">vacation</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/vim">vim</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/volume">volume</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/web">web</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/web%20objects">web objects</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/wikipediafs">wikipediafs</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/windows">windows</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/work">work</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/zend">zend</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/tags/zsh">zsh</a> (1)</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Friends &amp; cool blogs</h3>
<ul>
<li><a href="http://web.archive.org/web/20080820115240/http://jim.roepcke.com/">have browser, will travel</a></li>
<li><a href="http://web.archive.org/web/20080820115240/http://cassandrahill.blogspot.com/">cj's chatter</a></li>
</ul>
</div>
<div class="sidebar-node">
<p><a href="http://web.archive.org/web/20080820115240/http://twitter.com/_sjs">
<img src="http://web.archive.org/web/20080820115240im_/http://sami.samhuri.net/assets/2007/6/26/icon_twitter.png" alt="[t]" /> twitter</a></p>
</div>
<div class="sidebar-node">
<p><a href="http://web.archive.org/web/20080820115240/http://mephistoblog.com/" class="powered"><img alt="mephisto-badge-tiny" src="http://web.archive.org/web/20080820115240im_/http://sami.samhuri.net/images/mephisto-badge-tiny.png" /></a></p>
</div>
</div>
<br style="clear:both;" />
</div>
<div id="footer">
<hr />
<p><a href="http://web.archive.org/web/20080820115240/http://sami.samhuri.net/">sjs</a></p>
<ul>
<li>powered by <a href="http://web.archive.org/web/20080820115240/http://mephistoblog.com/">Mephisto</a> /
styled with <a href="http://web.archive.org/web/20080820115240/http://quotedprintable.com/pages/scribbish">scribbish</a></li>
</ul>
</div>
</div>
<script src="http://web.archive.org/web/20080820115240js_/http://www.google-analytics.com/urchin.js" type="text/javascript"> </script>
<script type="text/javascript"> _uacct = "UA-214054-3"; urchinTracker(); </script>
<script src="http://web.archive.org/web/20080820115240js_/http://feeds.feedburner.com/~s/sjs" type="text/javascript" charset="utf-8"></script>
</body>
</html>
<!--
FILE ARCHIVED ON 11:52:40 Aug 20, 2008 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 10:04:43 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,645 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>sjs: Funny how code can be beautiful</title>
<link rel="openid.server" href="http://web.archive.org/web/20080820114442/http://www.myopenid.com/server" />
<link rel="openid.delegate" href="http://web.archive.org/web/20080820114442/http://sami-samhuri.myopenid.com/" />
<meta http-equiv="X-XRDS-Location" content="http://sami-samhuri.myopenid.com/xrds" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20080820114442/http://feeds.feedburner.com/sjs" />
<script src="http://web.archive.org/web/20080820114442js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<link href="http://web.archive.org/web/20080820114442cs_/http://sami.samhuri.net/stylesheets/application.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/2007\/4\/30\/funny-how-code-can-be-beautiful";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "20";
var displayMonth = "Aug";
var displayYear = "2008";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/2007/4/30/funny-how-code-can-be-beautiful" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20080820114442" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Jul
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 11:44:42 Aug 20, 2008">AUG</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Sep
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" />
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 11:44:42 Aug 20, 2008">20</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_off.png" alt="Next capture" width="14" height="16" border="0"/>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2007
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 11:44:42 Aug 20, 2008">2008</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2009
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20080820114442*/http://sami.samhuri.net/2007/4/30/funny-how-code-can-be-beautiful" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>1 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">20 Aug 08 - 20 Aug 08</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:-1:000000000000_2007:-1:000000000000_2008:7:000000010000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="container">
<div id="header">
<h1><span><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/">sjs</a></span></h1>
<h2>geeky ramblings</h2>
</div>
<div id="page">
<div id="content">
<!--
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping=""
dc:title="Funny how code can be beautiful"
dc:identifier="/2007/4/30/funny-how-code-can-be-beautiful"
dc:description="<p>While reading a <a href="http://www.haskell.org/tutorial/index.html">Haskell tutorial</a> I came across the following code for defining the <a href="http://en.wikipedia.org/wiki/Fibonacci_number">Fibonacci numbers</a>:</p>
<pre>fib = 1 : 1 : ..."
dc:creator="sjs"
dc:date="April 30, 2007 14:07" />
</rdf:RDF>
-->
<div class="hentry" id="article-38">
<h2 class="entry-title">
<a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/2007/4/30/funny-how-code-can-be-beautiful">Funny how code can be beautiful</a>
<span class="comment_count">0</span>
</h2>
<div class="vcard">
Posted by <span class="fn">sjs</span>
</div>
<abbr class="published" title="2007-04-30T14:07:00+00:00">on Monday, April 30</abbr>
<br class="clear" />
<div class="entry-content">
<p>While reading a <a href="http://web.archive.org/web/20080820114442/http://www.haskell.org/tutorial/index.html">Haskell tutorial</a> I came across the following code for defining the <a href="http://web.archive.org/web/20080820114442/http://en.wikipedia.org/wiki/Fibonacci_number">Fibonacci numbers</a>:</p>
<pre>fib = 1 : 1 : [ a + b | (a, b) &lt;- zip fib (tail fib) ]</pre>
<p>After reading it a few times and understanding how it works I couldn&#8217;t help but think how <strong>beautiful</strong> it is. I don&#8217;t mean that it&#8217;s aesthetically pleasing to me; the beautiful part is the meaning and simplicity. Lazy evaluation is sweet.</p>
<p><a href="http://web.archive.org/web/20080820114442/http://www.haskell.org/">Haskell</a> is the most challenging <a href="http://web.archive.org/web/20080820114442/http://en.wikipedia.org/wiki/Category:Esoteric_programming_languages"><em>real</em></a> language I have tried to wrap my head around. I haven&#8217;t done much with any functional languages yet but they are truly fascinating. I&#8217;m beginning to understand monads<sup><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/2007/4/30/funny-how-code-can-be-beautiful#fn1">1</a></sup> but I&#8217;m quite sure I don&#8217;t see the whole picture yet.</p>
<p><a href="http://web.archive.org/web/20080820114442/http://www.erlang.org/">Erlang</a> looks like it may be more suited to real world apps so I would like to learn that some time. The <a href="http://web.archive.org/web/20080820114442/http://pragprog.com/">pragmatic</a> guys have a <a href="http://web.archive.org/web/20080820114442/http://www.pragmaticprogrammer.com/titles/jaerlang/">book</a> on Erlang in the works, and I love every book of theirs which I have read.</p>
<p>Going deeper down the functional rabbit-hole you&#8217;ll find things like <a href="http://web.archive.org/web/20080820114442/http://swik.net/Haskell/del.icio.us+tag%2Fhaskell/A+polyglot+quine+in+Haskell,+OCaml+and+Scheme/41zs">this polyglot quine</a>, which absolutely blows my mind. I used to be impressed by the <a href="http://web.archive.org/web/20080820114442/http://en.wikipedia.org/wiki/Just_another_Perl_hacker"><span class="caps">JAPH</span></a> sigs or some of the various <a href="http://web.archive.org/web/20080820114442/http://en.wikipedia.org/wiki/Obfuscated_code">obfuscated</a> contest winners but that first one definitely cleans the rest up with a perfect 10 in geekiness.</p>
<p>[1] The following links have all been helpful while trying to wrap my head around monads.</p>
<ul>
<li><a href="http://web.archive.org/web/20080820114442/http://www.haskell.org/tutorial/monads.html">A Gentle Introduction to Haskell</a> (link is directly to chapter 9)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://web.cecs.pdx.edu/~antoy/Courses/TPFLP/lectures/MONADS/Noel/research/monads.html">What the hell are Monads?</a></li>
<li><a href="http://web.archive.org/web/20080820114442/http://en.wikibooks.org/wiki/Programming:Haskell_monads">Monads on WikiBooks</a></li>
<li><a href="http://web.archive.org/web/20080820114442/http://www.engr.mun.ca/~theo/Misc/haskell_and_monads.htm">Monads for the Working Haskell Programmer</a></li>
</ul>
</div>
<ul class="meta">
<li>
Tags: <a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/haskell">haskell</a>&nbsp;
</li>
<li>
Meta:
<a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/2007/4/30/funny-how-code-can-be-beautiful">0 comments</a>,
<a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/2007/4/30/funny-how-code-can-be-beautiful">permalink</a>
</li>
</ul>
</div>
<h5><a name="comments">Comments</a></h5>
<p><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/2007/4/30/funny-how-code-can-be-beautiful#comment-form">Leave a response</a></p>
<div id="comments_div">
<ol id="comments" class="comments">
</ol>
</div>
<form id="comment-form" method="post" action="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/2007/4/30/funny-how-code-can-be-beautiful/comments#comment-form">
<fieldset>
<legend>Comment</legend>
<p>
<label class="text" for="comment_author">Name:</label><br/>
<input type="text" id="comment_author" name="comment[author]" value="" />
</p>
<p>
<label class="text" for="comment_author_email">Email Address:</label><br />
<input type="text" id="comment_author_email" name="comment[author_email]" value="" />
</p>
<p>
<label class="text" for="comment_author_url">Website:</label><br />
<input type="text" id="comment_author_url" name="comment[author_url]" value="" />
</p>
<p>
<label class="text" for="comment_body">Comment:</label><br />
<textarea id="comment_body" name="comment[body]"></textarea>
</p>
<div class="formactions">
<input type="submit" value="Post comment" class="submit" />
</div>
</fieldset>
</form>
</div>
<div id="sidebar">
<div class="sidebar-node">
<div id="search" class="search">
<form action="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/search" id="sform" method="get" name="sform">
<p><input type="text" id="q" name="q" value="" /></p>
</form>
</div>
</div>
<div class="sidebar-node">
<h3>Sections</h3>
<ul>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/">geeky ramblings</a> (15)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/emacs">Emacs</a> (3)</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Tags</h3>
<ul>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/activerecord">activerecord</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/alsa">alsa</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/amusement">amusement</a> (6)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/apple">apple</a> (6)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/arc">arc</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/bdd">bdd</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/broken">broken</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/browsers">browsers</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/buffalo">buffalo</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/bundle">bundle</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/cheat">cheat</a> (3)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/coding">coding</a> (22)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/cool">cool</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/coverflow">coverflow</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/crazy">crazy</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/digg">digg</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/drm">drm</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/dtrace">dtrace</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/dubai">dubai</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/elschemo">elschemo</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/emacs">emacs</a> (11)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/english">english</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/extensions">extensions</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/firefox">firefox</a> (3)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/framework">framework</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/funny">funny</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/fuse">fuse</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/games">games</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/gentoo">gentoo</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/german">german</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/gtkpod">gtkpod</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/haskell">haskell</a> (7)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/humans">humans</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/injury">injury</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/inspirado">inspirado</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/iphone">iphone</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/itunes">itunes</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/i_laughed_i_cried">i_laughed_i_cried</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/keyboard">keyboard</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/keyboard%20shortcuts">keyboard shortcuts</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/lemmings">lemmings</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/life">life</a> (13)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/linux">linux</a> (8)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/lisp">lisp</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/lisp%20arc">lisp arc</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/mac%20os%20x">mac os x</a> (6)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/mediawiki">mediawiki</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/mephisto">mephisto</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/migrations">migrations</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/munich">munich</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/mysql">mysql</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/networking">networking</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/opera">opera</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/pedantry">pedantry</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/people">people</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/photo">photo</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/php">php</a> (4)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/programming">programming</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/project%20euler">project euler</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/propaganda">propaganda</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/python">python</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/quickcheck">quickcheck</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/rails">rails</a> (18)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/rails%20on%20rules">rails on rules</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/regex">regex</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/regular%20expressions">regular expressions</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/rest">rest</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/rtfm">rtfm</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/ruby">ruby</a> (14)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/rushcheck">rushcheck</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/sake">sake</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/scheme">scheme</a> (4)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/school">school</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/seaside">seaside</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/secure%20associations">secure associations</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/seekport">seekport</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/snippets">snippets</a> (3)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/ssh">ssh</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/tagify">tagify</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/technology">technology</a> (6)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/test/spec">test/spec</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/textmate">textmate</a> (7)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/tips">tips</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/typo">typo</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/ubuntu">ubuntu</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/usability">usability</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/userscript">userscript</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/vacation">vacation</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/vim">vim</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/volume">volume</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/web">web</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/web%20objects">web objects</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/wikipediafs">wikipediafs</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/windows">windows</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/work">work</a> (1)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/zend">zend</a> (2)</li>
<li><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/tags/zsh">zsh</a> (1)</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Friends &amp; cool blogs</h3>
<ul>
<li><a href="http://web.archive.org/web/20080820114442/http://jim.roepcke.com/">have browser, will travel</a></li>
<li><a href="http://web.archive.org/web/20080820114442/http://cassandrahill.blogspot.com/">cj's chatter</a></li>
</ul>
</div>
<div class="sidebar-node">
<p><a href="http://web.archive.org/web/20080820114442/http://twitter.com/_sjs">
<img src="http://web.archive.org/web/20080820114442im_/http://sami.samhuri.net/assets/2007/6/26/icon_twitter.png" alt="[t]" /> twitter</a></p>
</div>
<div class="sidebar-node">
<p><a href="http://web.archive.org/web/20080820114442/http://mephistoblog.com/" class="powered"><img alt="mephisto-badge-tiny" src="http://web.archive.org/web/20080820114442im_/http://sami.samhuri.net/images/mephisto-badge-tiny.png" /></a></p>
</div>
</div>
<br style="clear:both;" />
</div>
<div id="footer">
<hr />
<p><a href="http://web.archive.org/web/20080820114442/http://sami.samhuri.net/">sjs</a></p>
<ul>
<li>powered by <a href="http://web.archive.org/web/20080820114442/http://mephistoblog.com/">Mephisto</a> /
styled with <a href="http://web.archive.org/web/20080820114442/http://quotedprintable.com/pages/scribbish">scribbish</a></li>
</ul>
</div>
</div>
<script src="http://web.archive.org/web/20080820114442js_/http://www.google-analytics.com/urchin.js" type="text/javascript"> </script>
<script type="text/javascript"> _uacct = "UA-214054-3"; urchinTracker(); </script>
<script src="http://web.archive.org/web/20080820114442js_/http://feeds.feedburner.com/~s/sjs" type="text/javascript" charset="utf-8"></script>
</body>
</html>
<!--
FILE ARCHIVED ON 11:44:42 Aug 20, 2008 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 10:04:25 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,700 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>sjs: Getting to know Vista</title>
<link rel="openid.server" href="http://web.archive.org/web/20081121202139/http://www.myopenid.com/server" />
<link rel="openid.delegate" href="http://web.archive.org/web/20081121202139/http://sami-samhuri.myopenid.com/" />
<meta http-equiv="X-XRDS-Location" content="http://sami-samhuri.myopenid.com/xrds" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20081121202139/http://feeds.feedburner.com/sjs" />
<script src="http://web.archive.org/web/20081121202139js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<link href="http://web.archive.org/web/20081121202139cs_/http://sami.samhuri.net/stylesheets/application.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/2007\/4\/17\/getting-to-know-vista";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "21";
var displayMonth = "Nov";
var displayYear = "2008";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/2007/4/17/getting-to-know-vista" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20081121202139" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20080305111128/http://sami.samhuri.net/2007/4/17/getting-to-know-vista" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="5 Mar 2008"><strong>MAR</strong></a>
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 20:21:39 Nov 21, 2008">NOV</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Dec
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20080305111128/http://sami.samhuri.net/2007/4/17/getting-to-know-vista" title="11:11:28 Mar 5, 2008" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_on.png" alt="Previous capture" width="14" height="16" border="0" /></a>
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 20:21:39 Nov 21, 2008">21</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_off.png" alt="Next capture" width="14" height="16" border="0"/>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2007
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 20:21:39 Nov 21, 2008">2008</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2009
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20081121202139*/http://sami.samhuri.net/2007/4/17/getting-to-know-vista" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>3 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">1 Jan 08 - 21 Nov 08</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:-1:000000000000_2007:-1:000000000000_2008:10:101000000010_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="container">
<div id="header">
<h1><span><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/">sjs</a></span></h1>
<h2>geeky ramblings</h2>
</div>
<div id="page">
<div id="content">
<!--
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping=""
dc:title="Getting to know Vista"
dc:identifier="/2007/4/17/getting-to-know-vista"
dc:description="<h3>It looks pretty good!</h3>
<p>After figuring out how to minimise the translucency of the window decorations I think Aero looks ok. Window titles, on both windows and the taskbar, can be difficult to read at a glance which is really stupid i..."
dc:creator="sjs"
dc:date="April 16, 2007 18:09" />
</rdf:RDF>
-->
<div class="hentry" id="article-36">
<h2 class="entry-title">
<a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/2007/4/17/getting-to-know-vista">Getting to know Vista</a>
<span class="comment_count">0</span>
</h2>
<div class="vcard">
Posted by <span class="fn">sjs</span>
</div>
<abbr class="published" title="2007-04-16T18:09:00+00:00">on Monday, April 16</abbr>
<br class="clear" />
<div class="entry-content">
<h3>It looks pretty good!</h3>
<p>After figuring out how to minimise the translucency of the window decorations I think Aero looks ok. Window titles, on both windows and the taskbar, can be difficult to read at a glance which is really stupid if you ask me. But it&#8217;s better than Luna! They really lay the effects on thick but overall I find it pretty pleasant and it runs well on my MacBook&#8217;s Intel 945 video chip.</p>
<p>Ah yes, the Sidebar is nowhere to be seen on my desktop. It&#8217;s a nice-looking waste of space.</p>
<h3>But it&#8217;s not all useful</h3>
<p>Sadly The new task switcher (Win-tab) is terrible. Before using it I wondered why they didn&#8217;t replace Alt-tab completely. Now I know and I am grateful to MS for not replacing it. Alt-tab easily wins. Especially since it displays thumbnails of windows.</p>
Three gripes with Win-tab fancy-shmanciness:
<ul>
<li>It&#8217;s too slow</li>
<li>It responds even when I just tap Win-tab to quickly switch, then I&#8217;m stuck until I hit the Windows key to choose a window</li>
<li>Windows from all my monitors are gathered onto the main one, which is just lame</li>
</ul>
<h3>It&#8217;s stable (so far)</h3>
<p>Besides the fact it is aesthetically pleasing [subjective] it also has just worked for me so far. Nothing has crashed or broken which is almost miraculous. Not that I had a terrible time with XP, but it was still frail old Windows at times. I&#8217;m equally pleased with Apple&#8217;s drivers for Windows which probably adds to the experience. I&#8217;ve used XP machines with proper drivers, and those without and the differenc is night &#38; day. I&#8217;ve had uptimes in months on a stable XP notebook.</p>
<h3>Never thought this day would come&#8230;</h3>
<p>But I actually like the Start menu. Really, I do. You hit the Windows key, type a few letters and boom you launch your app or search your computer, or the web (Google in Firefox, my default search). It&#8217;s not QuickSilver or LaunchBar; it&#8217;s not supposed to be. For the average Joe this is cool, and for the average power user it&#8217;s very useful. For the casual Windows user it&#8217;s great. It even learns.</p>
<p>I don&#8217;t love it though. I knew before using it that the new method of navigating through the All Programs menu would be weird. It is, but I guess it may be better than the previous fly-out scheme (which I don&#8217;t care for either). I guess the All Programs menu is more or less legacy now though and I don&#8217;t see myself using it often.</p>
<h3>I&#8217;m a command line junkie</h3>
<p>They fixed at least one glaring bug. I used the cmd.exe shell a little bit even though I hate it. I was happy to find that Tab completion works for more than the current directory now. Before Vista it would complete the same entries from <span class="caps">PWD</span> no matter how deep you tried to drill down into the filesystem. Other than that it seems to be the same crummy shell. <em>[edit&#8212;apparently this is fixed in XP as well, my mistake]</em></p>
<p>I installed the Windows PowerShell (PoSH) but haven&#8217;t really put an effort to learn it yet. The syntax is unorthodox coming from *nix shells (zsh), but it&#8217;s sort of refreshing and it lives up to the Power part of its name. I really like the fact that collections of (say) files can be passed around and iterated over, filtered, etc. not as filenames but as real objects with corresponding methods and metadata. Built-in support for <span class="caps">XML</span> is pretty nifty too.</p>
<p>I&#8217;ve often longed for a shell which acted like a normal shell for the most part, but allowed irb-like interpretation of arbitrary Ruby code as well. The PowerShell seems like it could be something similar to what I&#8217;ve wanted. Too bad it&#8217;s proprietary and only runs on Windows. If I use Vista a lot this summer I could end up getting into it more though. It&#8217;s quite interesting.</p>
<h3>Random</h3>
The good:
<ul>
<li>Slideshow button in Explorer</li>
<li>Doesn&#8217;t look like a Fisher-Price design</li>
<li>Restarts when I click Restart (after 3 clicks it damn well better)</li>
<li>Seems stable, at least initially which means the installation &#38; driver situation really has improved</li>
<li>I don&#8217;t want to kill anyone while using it</li>
</ul>
The bad:
<ul>
<li>Flicker while changing video modes, displaying <span class="caps">UAC</span> prompts, etc. (not so bad really, but stands out on an otherwise smooth desktop)</li>
<li>Long black screen on boot after installing updates</li>
<li>Disappearing / magical menu bar debacle</li>
<li>The shell still sucks</li>
<li>It tries to be too fancy, with the dynamic Start menu icon and the like</li>
</ul>
<h3>My conclusion</h3>
<p>Perhaps the scores of talented developers at Microsoft <em>can</em> save them despite their obvious shortcomings in management. .NET seems like a decent platform, but we&#8217;ll have to see how I like it once I actually use it. So far I don&#8217;t hate Vista and considering the previous versions of Windows that&#8217;s a pretty good review coming from me. I&#8217;m still recommending Macs to my family and friends, but who knows what the future holds. I don&#8217;t hate Vista and by the end of the summer I may even [gasp] like it, and/or .NET. I haven&#8217;t used an <span class="caps">IDE</span> since <span class="caps">VB6</span> and MS has always had a decent <span class="caps">IDE</span> (albeit with a crummy text editor). I&#8217;m expecting to enjoy it. If there&#8217;s one thing MS knows it&#8217;s the value of good dev tools and <a href="http://web.archive.org/web/20081121202139/http://www.youtube.com/watch?v=d_AP3SGMxxM">developers</a>.</p>
<div class="extended">
<p><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/2007/4/17/getting-to-know-vista">Continue reading...</a></p>
</div>
</div>
<ul class="meta">
<li>
Tags: <a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/windows">windows</a>&nbsp;
</li>
<li>
Meta:
<a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/2007/4/17/getting-to-know-vista">0 comments</a>,
<a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/2007/4/17/getting-to-know-vista">permalink</a>
</li>
</ul>
</div>
<h5><a name="comments">Comments</a></h5>
<p><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/2007/4/17/getting-to-know-vista#comment-form">Leave a response</a></p>
<div id="comments_div">
<ol id="comments" class="comments">
</ol>
</div>
<form id="comment-form" method="post" action="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/2007/4/17/getting-to-know-vista/comments#comment-form">
<fieldset>
<legend>Comment</legend>
<p>
<label class="text" for="comment_author">Name:</label><br/>
<input type="text" id="comment_author" name="comment[author]" value="" />
</p>
<p>
<label class="text" for="comment_author_email">Email Address:</label><br />
<input type="text" id="comment_author_email" name="comment[author_email]" value="" />
</p>
<p>
<label class="text" for="comment_author_url">Website:</label><br />
<input type="text" id="comment_author_url" name="comment[author_url]" value="" />
</p>
<p>
<label class="text" for="comment_body">Comment:</label><br />
<textarea id="comment_body" name="comment[body]"></textarea>
</p>
<div class="formactions">
<input type="submit" value="Post comment" class="submit" />
</div>
</fieldset>
</form>
</div>
<div id="sidebar">
<div class="sidebar-node">
<div id="search" class="search">
<form action="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/search" id="sform" method="get" name="sform">
<p><input type="text" id="q" name="q" value="" /></p>
</form>
</div>
</div>
<div class="sidebar-node">
<h3>Sections</h3>
<ul>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/">geeky ramblings</a> (15)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/emacs">Emacs</a> (3)</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Tags</h3>
<ul>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/activerecord">activerecord</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/alsa">alsa</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/amusement">amusement</a> (6)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/apple">apple</a> (6)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/arc">arc</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/bdd">bdd</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/broken">broken</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/browsers">browsers</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/buffalo">buffalo</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/bundle">bundle</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/cheat">cheat</a> (3)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/coding">coding</a> (22)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/cool">cool</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/coverflow">coverflow</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/crazy">crazy</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/digg">digg</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/drm">drm</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/dtrace">dtrace</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/dubai">dubai</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/elschemo">elschemo</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/emacs">emacs</a> (11)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/english">english</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/extensions">extensions</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/firefox">firefox</a> (3)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/framework">framework</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/funny">funny</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/fuse">fuse</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/games">games</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/gentoo">gentoo</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/german">german</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/gtkpod">gtkpod</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/haskell">haskell</a> (7)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/humans">humans</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/injury">injury</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/inspirado">inspirado</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/iphone">iphone</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/itunes">itunes</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/i_laughed_i_cried">i_laughed_i_cried</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/keyboard">keyboard</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/keyboard%20shortcuts">keyboard shortcuts</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/lemmings">lemmings</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/life">life</a> (13)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/linux">linux</a> (8)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/lisp">lisp</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/lisp%20arc">lisp arc</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/mac%20os%20x">mac os x</a> (6)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/mediawiki">mediawiki</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/mephisto">mephisto</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/migrations">migrations</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/munich">munich</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/mysql">mysql</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/networking">networking</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/opera">opera</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/pedantry">pedantry</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/people">people</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/photo">photo</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/php">php</a> (4)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/programming">programming</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/project%20euler">project euler</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/propaganda">propaganda</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/python">python</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/quickcheck">quickcheck</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/rails">rails</a> (18)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/rails%20on%20rules">rails on rules</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/regex">regex</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/regular%20expressions">regular expressions</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/rest">rest</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/rtfm">rtfm</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/ruby">ruby</a> (14)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/rushcheck">rushcheck</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/sake">sake</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/scheme">scheme</a> (4)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/school">school</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/seaside">seaside</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/secure%20associations">secure associations</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/seekport">seekport</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/snippets">snippets</a> (3)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/ssh">ssh</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/tagify">tagify</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/technology">technology</a> (6)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/test/spec">test/spec</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/textmate">textmate</a> (7)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/tips">tips</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/typo">typo</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/ubuntu">ubuntu</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/usability">usability</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/userscript">userscript</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/vacation">vacation</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/vim">vim</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/volume">volume</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/web">web</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/web%20objects">web objects</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/wikipediafs">wikipediafs</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/windows">windows</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/work">work</a> (1)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/zend">zend</a> (2)</li>
<li><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/tags/zsh">zsh</a> (1)</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Friends &amp; cool blogs</h3>
<ul>
<li><a href="http://web.archive.org/web/20081121202139/http://jim.roepcke.com/">have browser, will travel</a></li>
<li><a href="http://web.archive.org/web/20081121202139/http://cassandrahill.blogspot.com/">cj's chatter</a></li>
</ul>
</div>
<div class="sidebar-node">
<p><a href="http://web.archive.org/web/20081121202139/http://twitter.com/_sjs">
<img src="http://web.archive.org/web/20081121202139im_/http://sami.samhuri.net/assets/2007/6/26/icon_twitter.png" alt="[t]" /> twitter</a></p>
</div>
<div class="sidebar-node">
<p><a href="http://web.archive.org/web/20081121202139/http://mephistoblog.com/" class="powered"><img alt="mephisto-badge-tiny" src="http://web.archive.org/web/20081121202139im_/http://sami.samhuri.net/images/mephisto-badge-tiny.png" /></a></p>
</div>
</div>
<br style="clear:both;" />
</div>
<div id="footer">
<hr />
<p><a href="http://web.archive.org/web/20081121202139/http://sami.samhuri.net/">sjs</a></p>
<ul>
<li>powered by <a href="http://web.archive.org/web/20081121202139/http://mephistoblog.com/">Mephisto</a> /
styled with <a href="http://web.archive.org/web/20081121202139/http://quotedprintable.com/pages/scribbish">scribbish</a></li>
</ul>
</div>
</div>
<script src="http://web.archive.org/web/20081121202139js_/http://www.google-analytics.com/urchin.js" type="text/javascript"> </script>
<script type="text/javascript"> _uacct = "UA-214054-3"; urchinTracker(); </script>
<script src="http://web.archive.org/web/20081121202139js_/http://feeds.feedburner.com/~s/sjs" type="text/javascript" charset="utf-8"></script>
</body>
</html>
<!--
FILE ARCHIVED ON 20:21:39 Nov 21, 2008 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 10:04:31 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -0,0 +1,690 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>sjs: Quickly inserting millions of rows with MySQL/InnoDB</title>
<link rel="openid.server" href="http://web.archive.org/web/20080929054218/http://www.myopenid.com/server" />
<link rel="openid.delegate" href="http://web.archive.org/web/20080929054218/http://sami-samhuri.myopenid.com/" />
<meta http-equiv="X-XRDS-Location" content="http://sami-samhuri.myopenid.com/xrds" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://web.archive.org/web/20080929054218/http://feeds.feedburner.com/sjs" />
<script src="http://web.archive.org/web/20080929054218js_/http://sami.samhuri.net/javascripts/prototype.js" type="text/javascript"></script>
<link href="http://web.archive.org/web/20080929054218cs_/http://sami.samhuri.net/stylesheets/application.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="http://staticweb.archive.org/js/disclaim-element.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/js/graph-calc.js" ></script>
<script type="text/javascript" src="http://staticweb.archive.org/jflot/jquery.min.js" ></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1325375999999;
var wbPrefix = "http://web.archive.org/web/";
var wbCurrentUrl = "http:\/\/sami.samhuri.net\/2007\/4\/26\/quickly-inserting-millions-of-rows-with-mysql-innodb";
var curYear = -1;
var curMonth = -1;
var yearCount = 16;
var firstYear = 1996;
var imgWidth=400;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "29";
var displayMonth = "Sep";
var displayYear = "2008";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<div id="wm-ipp" style="display:none; position:relative;padding:0 5px;min-height:70px;min-width:800px; z-index:9000;">
<div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(http://staticweb.archive.org/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://wayback.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"/></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://wayback.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://sami.samhuri.net/2007/4/26/quickly-inserting-millions-of-rows-with-mysql-innodb" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20080929054218" /><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;" /><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20080820114609/http://sami.samhuri.net/2007/4/26/quickly-inserting-millions-of-rows-with-mysql-innodb" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="20 Aug 2008"><strong>AUG</strong></a>
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 5:42:18 Sep 29, 2008">SEP</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
Oct
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20080820114609/http://sami.samhuri.net/2007/4/26/quickly-inserting-millions-of-rows-with-mysql-innodb" title="11:46:09 Aug 20, 2008" style="background-color:transparent;border:none;"><img src="http://staticweb.archive.org/images/toolbar/wm_tb_prv_on.png" alt="Previous capture" width="14" height="16" border="0" /></a>
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 5:42:18 Sep 29, 2008">29</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<img src="http://staticweb.archive.org/images/toolbar/wm_tb_nxt_off.png" alt="Next capture" width="14" height="16" border="0"/>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2007
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 5:42:18 Sep 29, 2008">2008</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2009
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://wayback.archive.org/web/20080929054218*/http://sami.samhuri.net/2007/4/26/quickly-inserting-millions-of-rows-with-mysql-innodb" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>7 captures</strong></a>
<div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">26 Nov 07 - 29 Sep 08</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:400px;height:27px;" href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:400px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;"
onmouseover="showTrackers('inline');"
onmouseout="showTrackers('none');"
onmousemove="trackMouseMove(event,this)"
alt="sparklines"
width="400"
height="27"
border="0"
src="http://wayback.archive.org/jsp/graph.jsp?graphdata=400_27_1996:-1:000000000000_1997:-1:000000000000_1998:-1:000000000000_1999:-1:000000000000_2000:-1:000000000000_2001:-1:000000000000_2002:-1:000000000000_2003:-1:000000000000_2004:-1:000000000000_2005:-1:000000000000_2006:-1:000000000000_2007:-1:000000000010_2008:8:011101011000_2009:-1:000000000000_2010:-1:000000000000_2011:-1:000000000000"></img>
<img id="wbMouseTrackYearImg"
style="display:none; position:absolute; z-index:9010;"
width="25"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-yellow-pixel.png"></img>
<img id="wbMouseTrackMonthImg"
style="display:none; position:absolute; z-index:9011; "
width="2"
height="27"
border="0"
src="http://staticweb.archive.org/images/toolbar/transp-red-pixel.png"></img>
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(http://staticweb.archive.org/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="container">
<div id="header">
<h1><span><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/">sjs</a></span></h1>
<h2>geeky ramblings</h2>
</div>
<div id="page">
<div id="content">
<!--
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about=""
trackback:ping=""
dc:title="Quickly inserting millions of rows with MySQL/InnoDB"
dc:identifier="/2007/4/26/quickly-inserting-millions-of-rows-with-mysql-innodb"
dc:description="<p>The absolute first thing you should do is check your MySQL configuration to make sure it&#8217;s sane for the system you&#8217;re using. I kept getting a &#8216;The table is too large&#8217; error on my Gentoo box after inserting several millio..."
dc:creator="sjs"
dc:date="April 26, 2007 14:06" />
</rdf:RDF>
-->
<div class="hentry" id="article-37">
<h2 class="entry-title">
<a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/2007/4/26/quickly-inserting-millions-of-rows-with-mysql-innodb">Quickly inserting millions of rows with MySQL/InnoDB</a>
<span class="comment_count">0</span>
</h2>
<div class="vcard">
Posted by <span class="fn">sjs</span>
</div>
<abbr class="published" title="2007-04-26T14:06:00+00:00">on Thursday, April 26</abbr>
<br class="clear" />
<div class="entry-content">
<p>The absolute first thing you should do is check your MySQL configuration to make sure it&#8217;s sane for the system you&#8217;re using. I kept getting a &#8216;The table is too large&#8217; error on my Gentoo box after inserting several million rows because the default config limits the InnoDB tablespace size to 128M. It was also tuned for a box with as little as 64M of <span class="caps">RAM</span>. That&#8217;s cool for a small <span class="caps">VPS</span> or your old Pentium in the corner collecting dust. For a modern server, workstation, or even notebook with gigs of <span class="caps">RAM</span> you&#8217;ll likely want to make some changes.</p>
<h3>Tweaking my.cnf</h3>
<p>Here are the relevant settings you can tweak in order to work with large datasets efficiently. These are set in your <strong>my.cnf</strong> file, which varies in location.</p>
<p>On Gentoo it resides at <strong>/etc/mysql/my.cnf</strong>.</p>
<p>When MySQL 5.x is installed via DarwinPorts on Mac <span class="caps">OS X</span> you need to copy one of the defaults from <strong>/opt/local/share/mysql5/mysql/</strong> to <strong>/opt/local/etc/mysql5/my.cnf</strong> and then modify it accordingly.</p>
<p>If you use another system you&#8217;re on your own. If you can&#8217;t figure it out, please put down the text editor and leave the poor config file alone! Jokes aside this really is not difficult if you&#8217;re used to configuring *nix programs.</p>
<h3>innodb_buffer_pool_size</h3>
<p>This determines how much memory MySQL uses for table indexes and data. You can set it as low as 8-10M, or high as 50-80% of your memory on a dedicated MySQL server. I have <span class="caps">RAM</span> to burn<sup><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/2007/4/26/quickly-inserting-millions-of-rows-with-mysql-innodb#fn1">1</a></sup> in my workstation so I set this to 200M, 20% of my 1GB.</p>
<p>[1] I run Fluxbox on Gentoo, I use 200-300M of my 1GB on average and with 200M for MySQL 409M are in use at this moment. Gotta love those lightweight window managers!</p>
<h3>innodb_additional_mem_pool_size</h3>
<p>According to a post<sup><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/2007/4/26/quickly-inserting-millions-of-rows-with-mysql-innodb#fn1">1</a></sup> on a MySQL mailing list, modern OSs have fast enough mallocs and this variable has little effect on performance. I set mine to 16M before reading that post, so I&#8217;ll just leave it at that.</p>
<p>[1] http://lists.mysql.com/mysql/129247</p>
<h3>innodb_data_file_path</h3>
<p>On Gentoo this one bit me right in the ass, and I mentioned it above. It specifies how large the files used to store your data can be, and how many of them there are. The default setting is almost sane: <tt>ibdata1:10M:autoextend:<b>max:128M</b></tt>. Limiting the total size to 128M caused my test to fail after inserting several million rows.</p>
<p>Simply removing <tt>max:128M</tt> solves the problem. The resulting setting tells the InnoDB engine to use one file, named <b>ibdata1</b> which is initially 10M in size and grows as required.</p>
<h3>innodb_log_file_size</h3>
<p>The default Gentoo config says they (whoever they are) keep this at 25% of <b>innodb_buffer_pool_size</b> so I did just that. 50M in my case.</p>
<h3>innodb_log_buffer_size</h3>
<p>Again I only went as far as the Gentoo config to learn about this setting. They had it at 8M and recommend increasing it if you have large transactions. I can&#8217;t think of any particularly large transactions I currently use but I doubled it to 16M anyway.</p>
<h3>Save my.cnf and restart mysqld</h3>
<p>That&#8217;s it for the MySQL config. Restart mysqld however you do that on your platform. <tt>sudo /etc/init.d/mysql restart</tt> should look familiar to many *nix users.</p>
<p>Now you should be able to insert dozens and indeed hundreds of millions of rows into your InnoDB tables. Sadly this brought little performance gains to the table. MySQL wraps single queries in implicit transactions. Wrapping everything in a transaction may work, but inevitably something will go wrong and you may want the ability to resume inserting the rows instead of starting all over.</p>
<p>The solution now is to execute <tt><span class="caps">SET AUTOCOMMIT</span>=0</tt> before inserting the data, and then issuing a <tt><span class="caps">COMMIT</span></tt> when you&#8217;re done. With all that in place I&#8217;m inserting 14,000,000 rows into both MyISAM and InnoDB tables in 30 minutes. MyISAM is still ~ 2 min faster, but as I said earlier this is adequate for now. Prior to all this it took several <b>hours</b> to insert 14,000,000 rows so I am happy.</p>
<p>Now you can enjoy the speed MyISAM is known for with your InnoDB tables. Consider the data integrity a bonus! ;-)</p>
<div class="extended">
<p><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/2007/4/26/quickly-inserting-millions-of-rows-with-mysql-innodb">Continue reading...</a></p>
</div>
</div>
<ul class="meta">
<li>
Tags: <a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/linux">linux</a>&nbsp;<a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/mysql">mysql</a>&nbsp;
</li>
<li>
Meta:
<a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/2007/4/26/quickly-inserting-millions-of-rows-with-mysql-innodb">0 comments</a>,
<a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/2007/4/26/quickly-inserting-millions-of-rows-with-mysql-innodb">permalink</a>
</li>
</ul>
</div>
<h5><a name="comments">Comments</a></h5>
<p><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/2007/4/26/quickly-inserting-millions-of-rows-with-mysql-innodb#comment-form">Leave a response</a></p>
<div id="comments_div">
<ol id="comments" class="comments">
</ol>
</div>
<form id="comment-form" method="post" action="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/2007/4/26/quickly-inserting-millions-of-rows-with-mysql-innodb/comments#comment-form">
<fieldset>
<legend>Comment</legend>
<p>
<label class="text" for="comment_author">Name:</label><br/>
<input type="text" id="comment_author" name="comment[author]" value="" />
</p>
<p>
<label class="text" for="comment_author_email">Email Address:</label><br />
<input type="text" id="comment_author_email" name="comment[author_email]" value="" />
</p>
<p>
<label class="text" for="comment_author_url">Website:</label><br />
<input type="text" id="comment_author_url" name="comment[author_url]" value="" />
</p>
<p>
<label class="text" for="comment_body">Comment:</label><br />
<textarea id="comment_body" name="comment[body]"></textarea>
</p>
<div class="formactions">
<input type="submit" value="Post comment" class="submit" />
</div>
</fieldset>
</form>
</div>
<div id="sidebar">
<div class="sidebar-node">
<div id="search" class="search">
<form action="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/search" id="sform" method="get" name="sform">
<p><input type="text" id="q" name="q" value="" /></p>
</form>
</div>
</div>
<div class="sidebar-node">
<h3>Sections</h3>
<ul>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/">geeky ramblings</a> (15)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/emacs">Emacs</a> (3)</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Tags</h3>
<ul>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/activerecord">activerecord</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/alsa">alsa</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/amusement">amusement</a> (6)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/apple">apple</a> (6)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/arc">arc</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/bdd">bdd</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/broken">broken</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/browsers">browsers</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/buffalo">buffalo</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/bundle">bundle</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/cheat">cheat</a> (3)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/coding">coding</a> (22)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/cool">cool</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/coverflow">coverflow</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/crazy">crazy</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/digg">digg</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/drm">drm</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/dtrace">dtrace</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/dubai">dubai</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/elschemo">elschemo</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/emacs">emacs</a> (11)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/english">english</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/extensions">extensions</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/firefox">firefox</a> (3)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/framework">framework</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/funny">funny</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/fuse">fuse</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/games">games</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/gentoo">gentoo</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/german">german</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/gtkpod">gtkpod</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/haskell">haskell</a> (7)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/humans">humans</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/injury">injury</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/inspirado">inspirado</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/iphone">iphone</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/itunes">itunes</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/i_laughed_i_cried">i_laughed_i_cried</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/keyboard">keyboard</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/keyboard%20shortcuts">keyboard shortcuts</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/lemmings">lemmings</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/life">life</a> (13)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/linux">linux</a> (8)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/lisp">lisp</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/lisp%20arc">lisp arc</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/mac%20os%20x">mac os x</a> (6)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/mediawiki">mediawiki</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/mephisto">mephisto</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/migrations">migrations</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/munich">munich</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/mysql">mysql</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/networking">networking</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/opera">opera</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/pedantry">pedantry</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/people">people</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/photo">photo</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/php">php</a> (4)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/programming">programming</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/project%20euler">project euler</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/propaganda">propaganda</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/python">python</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/quickcheck">quickcheck</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/rails">rails</a> (18)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/rails%20on%20rules">rails on rules</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/regex">regex</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/regular%20expressions">regular expressions</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/rest">rest</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/rtfm">rtfm</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/ruby">ruby</a> (14)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/rushcheck">rushcheck</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/sake">sake</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/scheme">scheme</a> (4)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/school">school</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/seaside">seaside</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/secure%20associations">secure associations</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/seekport">seekport</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/snippets">snippets</a> (3)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/ssh">ssh</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/tagify">tagify</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/technology">technology</a> (6)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/test/spec">test/spec</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/textmate">textmate</a> (7)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/tips">tips</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/typo">typo</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/ubuntu">ubuntu</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/usability">usability</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/userscript">userscript</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/vacation">vacation</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/vim">vim</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/volume">volume</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/web">web</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/web%20objects">web objects</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/wikipediafs">wikipediafs</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/windows">windows</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/work">work</a> (1)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/zend">zend</a> (2)</li>
<li><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/tags/zsh">zsh</a> (1)</li>
</ul>
</div>
<div class="sidebar-node">
<h3>Friends &amp; cool blogs</h3>
<ul>
<li><a href="http://web.archive.org/web/20080929054218/http://jim.roepcke.com/">have browser, will travel</a></li>
<li><a href="http://web.archive.org/web/20080929054218/http://cassandrahill.blogspot.com/">cj's chatter</a></li>
</ul>
</div>
<div class="sidebar-node">
<p><a href="http://web.archive.org/web/20080929054218/http://twitter.com/_sjs">
<img src="http://web.archive.org/web/20080929054218im_/http://sami.samhuri.net/assets/2007/6/26/icon_twitter.png" alt="[t]" /> twitter</a></p>
</div>
<div class="sidebar-node">
<p><a href="http://web.archive.org/web/20080929054218/http://mephistoblog.com/" class="powered"><img alt="mephisto-badge-tiny" src="http://web.archive.org/web/20080929054218im_/http://sami.samhuri.net/images/mephisto-badge-tiny.png" /></a></p>
</div>
</div>
<br style="clear:both;" />
</div>
<div id="footer">
<hr />
<p><a href="http://web.archive.org/web/20080929054218/http://sami.samhuri.net/">sjs</a></p>
<ul>
<li>powered by <a href="http://web.archive.org/web/20080929054218/http://mephistoblog.com/">Mephisto</a> /
styled with <a href="http://web.archive.org/web/20080929054218/http://quotedprintable.com/pages/scribbish">scribbish</a></li>
</ul>
</div>
</div>
<script src="http://web.archive.org/web/20080929054218js_/http://www.google-analytics.com/urchin.js" type="text/javascript"> </script>
<script type="text/javascript"> _uacct = "UA-214054-3"; urchinTracker(); </script>
<script src="http://web.archive.org/web/20080929054218js_/http://feeds.feedburner.com/~s/sjs" type="text/javascript" charset="utf-8"></script>
</body>
</html>
<!--
FILE ARCHIVED ON 5:42:18 Sep 29, 2008 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 10:04:24 Dec 11, 2011.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->

View file

@ -48,9 +48,9 @@ function onLoad(err, window) {
, post.body
, ''
].join('\n')
, slug = strftime('%Y-%m-%d_' + post.title
, slug = strftime('%Y.%m.%d-' + post.title
.toLowerCase()
.replace(/[^\sa-z0-9_-]/g, '')
.replace(/[^\sa-z0-9._-]/g, '')
.replace(/\s+/g, '-'), new Date(post.ISODate))
console.log('slug: ' + slug)
fs.writeFileSync('../recovered/' + slug + '.html', s, 'utf8')

View file

@ -48,9 +48,9 @@ function onLoad(err, window) {
, ''
].join('\n')
var slug = strftime('%Y-%m-%d_' + post.title
var slug = strftime('%Y.%m.%d-' + post.title
.toLowerCase()
.replace(/[^\sa-z0-9_-]/g, '')
.replace(/[^\sa-z0-9._-]/g, '')
.replace(/\s+/g, '-'), new Date(post.ISODate))
fs.writeFileSync('../recovered/' + slug + '.html', s, 'utf8')