Graffiti
Saturday, May 24th, 2008
Seen in Meguro.

Seen in Meguro.

家でやろう。
Please do it at home
Please refrain from putting on make-up in the train.
Seen on the Hibiya-line.
I’ve re-enabled comments on this blog. I had to disable them a while ago because the spam was getting out of control. This time the comments will be hosted by Disqus.
What I like about Disqus so far:
What I don’t like:
So, why don’t you give it a try, I’m looking forward to your comments!

Yakatabune (roofed pleasure boats) on Tokyo Bay, near Odaiba.
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!
I made a typo while trying to reach the home page of Richard Dawkins and landed on this amusing typosquatting page:

Seen at a supermarket in Osaki, Tokyo.

From the JAL in-flight entertainment guide.

Tian Tan Buddha near Po Lin Monastery, Lantau Island, Hong Kong.
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…”
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?

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

Seen at an interior design shop in Marunouchi.

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.


Seen in Akihabara.
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.
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?