09
Feb
12

Ruby CSV with CP932

Ruby is a good language. But little bit unuseful for japanese user include me.

I’ve got often invalid seqence error.

CSV.open(filename, 'r:cp932')

This code is bad.

I found a code in csv.rb below:

    @encoding ||= Encoding.default_internal || Encoding.default_external

This line from /usr/local/ruby-1.9.1/lib/ruby/1.9.1/csv.rb.
I tried use only “Encoding.default_external = ‘cp932′”.

Encoding.default_external = 'cp932'
CSV.open(filename, 'r')

It works.

13
Jan
12

Getting MacBook Pro

Now I’m in Japan. I had bought and setuped MacBook Pro 15″ in this new year holiday.

MacBook Pro 15"

MacBook Pro 15"

 

I am NOT Mac fan and Jobs believer. I just love UNIX envronments. Actually MacBook is good UNIX laptop.

But I got little trouble after I migrate from old MacBook white by Migration Assistant.

I just wrote and ran a ruby script as usual. I got error “nokogiri not found”. OMG!!

The Ruby 1.9.2 was compiled by me. Migration Assistant migrate compled ruby itself but don’t migrate libraries. sigh…

After setup, I bought 8GB RAM. I use many application, especially VMware use RAM much more.
4GB x2 RAMSet up RAM to MacBook Pro
Cool. I got 4 core CPU and 8GB RAM laptop. My first mobile UNIX has 486 compatible CPU and 2MB RAM. I couldn’t use Emacs 19 because it is too heavey. Thanks for Moore’s Law.
13
Jan
12

Hello world!

Welcome to WordPress.com. After you read this, you should delete and write your own post, with a new title above. Or hit Add New on the left (of the admin dashboard) to start a fresh post.

Here are some suggestions for your first post.

  1. You can find new ideas for what to blog about by reading the Daily Post.
  2. Add PressThis to your browser. It creates a new blog post for you about any interesting  page you read on the web.
  3. Make some changes to this page, and then hit preview on the right. You can always preview any post or edit it before you share it to the world.



About

I'm a Japanese programmer.
I have been trying to write technical notes in English on this blog.

Recent Tweet(en)

Recent Tweet(ja)

  • I'm at Bar Woodball (Soi Silom 6, Suriya Wong) http://t.co/DiIzgA67 7 hours ago
  • 倫理の考え方をちょっと変えると、コピーできないことが非倫理的になるしな。なんでいいものを独り占めしちゃうの? 隣でそのソフトがあれば解決する問題に悩んでる人がいるのに、なんでコピーを渡さないの? 11 hours ago
  • いいもの手に入れたら自分の好きな人達におすそ分けしたくなる。気に入ったものを見つけたら、人にも見せたくなる。そういう欲求とデジタルコンテンツは相性が良すぎるんだ。なんせ劣化もせずコピーを渡すだけで済んでしまうのだから 11 hours ago
  • 共有は人間の持つ本能なのかもな…… 11 hours ago
  • おまえのケダモノ扱いは意味が違うだろ('A`) RT @elim: @koshian おらみたいにケダモノ扱いよりええだ。 12 hours ago

Follow

Get every new post delivered to your Inbox.

Join 207 other followers