“Das Land ist schon wahnsinnig”

2008-03-09

Elmar Wepper in einem Spiegel Online Interview über Dreharbeiten in Japan zum Film “Kirschblüten”:

Da fällt mir zum Beispiel ein Besuch in einer Nudelküche ein. Dort trifft man nur Japaner an und man sitzt dichtgedrängt, Schulter an Schulter. Dein Nachbar rechts von dir liest Mangas und hört gleichzeitig Musik mit seinem MP3-Player, und der links vor dir telefoniert ununterbrochen, während er seine Suppe schlürft. Das Land ist schon wahnsinnig.

Wahnsinn!

Richard Dawkins and Christian Singles

2007-01-28

I made a typo while trying to reach the home page of Richard Dawkins and landed on this amusing typosquatting page:

Screen shot of a web site typosquatting on richarddawkins.net

Good Bye Friends…

2007-01-19

Cockroach

Seen at a supermarket in Osaki, Tokyo.

Key Moments in Japanese History

2006-11-05

Key Moments in Japanese History: The invention of the anpan bean-jam bun

From the JAL in-flight entertainment guide.

Tian Tan Buddha

2006-11-05

Tian Tan Buddha

Tian Tan Buddha near Po Lin Monastery, Lantau Island, Hong Kong.

SEO

2006-10-21

I just came accross this quote on Google’s help page about “search engine optimization” (SEO):

Amazingly, we get these spam emails too:

“Dear google.com,

I visited your website and noticed that you are not listed in most of the major search engines and directories…”

STL Sudoku

2006-10-15

Out of the (C++) loop: Great rant about using C++ STL iterators and algorithms instead of simple loops. My favorite quote:

If the C++ overlords believe that the construction of nearly every loop should be a sort of inline Sudoku puzzle, surely the problem must be that we are simply too stupid to use the language?

Shinjuku

2006-10-15

Tokyo Metropolitan Government Buildings

Tokyo Metropolitan Government buildings in Shinjuku.

Tokyo Damage Report is Back!

2006-10-06

Self-proclaimed “American jerk” Schultz writes that he is back in Japan and that he will resume his excellent Tokyo Damage Report. Okaerinasai!

Inspirational Trash Bins

2006-09-04

Inspirational Trash Bins

Seen at an interior design shop in Marunouchi.

Select our Swordfish

2006-03-18

Cool people with / The sence of /Mismatch who can / Enjoy mixed taste / And stylish joke / We wish these people / To select our/ SWORDFISH

Cool people with
The sence of
Mismatch who can
Enjoy mixed taste
And stylish joke
We wish these people
To select our
SWORDFISH

Billboard seen in Shibuya.

Mt Fuji

2006-03-18

Mt Fuji

Why Do My Feet Hurt?

2006-03-01

Why do my feet hurt?

Seen in Akihabara.

Erann Gat’s Benchmark in Ruby: 11 Lines

2006-01-21
codes = (words = File.new("words").read).downcase.gsub(/[^a-z\n]/, '');
%w{e jnq rwx dsy ft am civ bku lop ghz}.each_with_index { |g, i| codes.gsub!(/[#{g}]/, i.to_s) }
$dict = Hash.new { |hash, key| hash[key] = [] }
words.zip(codes) { |word, code| $dict[code.chomp] << " #{word.chomp}" }
def split(s) (1..s.length).each { |length| yield s[0...length], s[length..-1] } end
def match(number, out, digit = true)
  return puts(out) if number == ""
  split(number) { |pre, post| digit &= $dict[pre].each { |word| match(post, out+word) }.empty? }
  match(number[1..-1], "#{out} #{number[0..0]}", false) if digit
end
File.new("numbers").each { |number| match(number.gsub(/[^0-9]/, ''), "#{number.chomp}:") }

See here and here for the background.

11 lines of code, 1.5 hours to get a correct solution, 2 more hours to get an efficient solution, 1 more hour to minimize the number of lines.

It takes 16 seconds to crunch the sample data on a 1.67 GHz PowerPC G4.

Update:

This version drops all pretense of readability and aims for fewest lines of code (5 lines):

c=(w=IO.read("words")).upcase.delete("^A-Z\n");30.times{|i|c.gsub! "E--JNQR\
WXDSYFT-AM-CIVBKULOPGHZ"[i,1],"#{i/3}"};D=Hash.new{|h,k|h[k]=[]};w.zip(c){
|w,c|D[c.chop]<<w.chop};def m(n,o,d=true)puts o if n=="";n.size.times{|l|d&=
D[n[0..l]].each{|w|m(n[l+1..-1],o+" "+w)}==[]};m(n[1..-1],o+" "+n[0,1],nil
)if d&&n!=""end;IO.read("numbers").each{|n|m(n.delete("^0-9"),n.chop+":")}

Can you come up with a shorter version?

Very Brief Review of “Memoirs of a Geisha” Movie

2006-01-15

*Cringe*