Yakatabune

May 5th, 2008

Yakatabune on Tokyo Bay

Yakatabune (roofed pleasure boats) on Tokyo Bay, near Odaiba.

“Das Land ist schon wahnsinnig”

March 9th, 2008

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

January 28th, 2007

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…

January 19th, 2007

Cockroach

Seen at a supermarket in Osaki, Tokyo.

Key Moments in Japanese History

November 5th, 2006

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

From the JAL in-flight entertainment guide.

Tian Tan Buddha

November 5th, 2006

Tian Tan Buddha

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

SEO

October 21st, 2006

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

October 15th, 2006

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

October 15th, 2006

Tokyo Metropolitan Government Buildings

Tokyo Metropolitan Government buildings in Shinjuku.

Tokyo Damage Report is Back!

October 6th, 2006

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

September 4th, 2006

Inspirational Trash Bins

Seen at an interior design shop in Marunouchi.

Select our Swordfish

March 18th, 2006

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

March 18th, 2006

Mt Fuji

Why Do My Feet Hurt?

March 1st, 2006

Why do my feet hurt?

Seen in Akihabara.

Erann Gat’s Benchmark in Ruby: 11 Lines

January 21st, 2006

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

January 15th, 2006

*Cringe*

Camouflage Kilt

January 14th, 2006

Camouflage Kilt

Camouflage Kilt.

;-)

January 7th, 2006

;-)

Seen in Naha airport.