Thursday, December 09, 2010

Derecho de la madre tierra

I think that's what the president of Bolivia said, meaning the right of the mother earth.

Wednesday, December 08, 2010

Derecho de naturalesa

I think it means the right of the species - all the species on the planet have the right.

The president of Ecuador said it in Spanish at Cancun Climate Change Conference.
I listened to his speech in Spanish.

IT company Climate Leadership Ranking

Greenpeace International: Release of IT company Climate Leadership Ranking

It's interesting to know about Greenpeace's engagement in corporate space.

Wednesday, September 29, 2010

I am my connectome

The images of neurons give a different perspective.
They make me use this wonderful organ "brain" positively, even more.

Wednesday, September 22, 2010

Tuesday, September 21, 2010

How social networks predict epidemics

It was interesting to watch this talk.

Tuesday, August 31, 2010

What stops population growth?

This is what I understand for a long time about population growth. It's just that this video explains it visually very clearly.

What stops population growth? from Gapminder Foundation on Vimeo.

Tuesday, August 24, 2010

Friday, August 20, 2010

Ruby 1.9.2 is released

Ruby 1.9.2 was released two days ago.
I don't know why I missed it for two days...

Tuesday, August 17, 2010

Population growth and sustainability

It was amazing.

Jason Clay: How big brands can help save biodiversity

Friday, August 13, 2010

Thursday, July 15, 2010

Soutenance au doctrat - c'était formidable

J'ai eu de la chance d'assister à la soutenance au doctorat à l'université.

Le candidat, les professeurs, les étudiants, les familles et les amies – tout le monde était très gentil et poli à moi. Je vous remercie tout le monde.

C'était une experience merveilleuse.

Cette soutenance me rappelait des souvenirs du temps ou j'était dans le domaine universitaire. Ça me manque beaucoup. Je voudrais y retourner.

--------------------------------------------------------------------------

I had a chance to attend a doctoral defense at a university.

The candidate, the professors, the students, the families and friends, everybody was very kind and polite to me. I would like to express my appreciation to everybody.

It was a great experience.

This doctoral defense reminded me of the time when I was in academic. I miss it very much. I would like to go back there.

--------------------------------------------------------------------------

大学の博士論文発表を見る機会に恵まれた。

発表者も、教授も、学生も、家族も、友人も、みんなとても親切で丁重だった。心から感謝している。

すばらしい経験だった。

学生だったころを思い出し、そのように考え、そのように話すことができたことを、本当に懐かしく思う。 できれば、戻りたいものだ。

Richard Feynman talks about light

Thursday, June 24, 2010

Problem with restarting MySQL server installed through aptitude on Ubuntu Lucid Lynx

I thought this would be useful for other people, too.

I would like to express my gratitude to the people who kindly answered my questions.

Problem with restarting MySQL server installed through aptitude on Ubuntu Lucid Lynx

Monday, April 05, 2010

Friday, February 26, 2010

Installing Ruby 1.9.1 with Ruby Version Manager (RVM) on Mac OS X Snow Leopard

For some reason, Ruby 1.9.1 didn't install on my Mac OS X Snow Leopard because of an error:


Error running 'make ', please check /Users/home_dir/.rvm/log/ruby-1.9.1-p378/make*.log


The error in ~/.rvm/log/ruby-1.9.1-p378/make*.log:


compiling readline



readline.c: In function ‘username_completion_proc_call’:
readline.c:1159: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:1159: error: (Each undeclared identifier is reported only once
readline.c:1159: error: for each function it appears in.)
make[1]: *** [readline.o] Error 1
make: *** [mkmain.sh] Error 1


So compiling Ruby 1.9.1 with the default readline installed on Snow Leopard didn't work.

By looking at "rvm --help" or ~/.rvm/README, there is an option to specify custom configure options, i.e. -C|--configure. Also there is a flag to force ./configure on install even if Makefile already exists, i.e. --reconfigure.

So I installed readline with MacPorts and installed Ruby 1.9.1 with the option and the flag:


$ sudo port install readline

$ rvm install 1.9.1 --reconfigure --configure --with-readline-dir=/opt/local


Then installation succeeded.

Saturday, December 19, 2009

United Nations Press Conference in Copenhagen Climate Change Conference

The most interesting press conference I have ever seen in the conference.

Press Conference by United Nations on December 19, 2009.

Copenhagen Climate Change Conference

First of all, I have a great respect to all the people, delegates and leaders of the countries, who worked so hard for long hours day and night, staying overnight into late in the morning. Many of them haven't slept for 48 hours.

I have been following it watching the webcast.

At around 3am in the local time, the draft of what is called Copenhagen Accord was presented in front of the Plenary, asking the parties to consider in one hour, after only small number of countries in the closed door spent many hours to draft it, leaving majority of delegates waiting. It was good that the one hour timeline approach was soon dropped.

Basically majority of the parties were forced to swallow what was created by small number of countries (it seems to me, possibly even before the beginning of the conference). The draft should have been created in the Plenary involving all the parties. All the parties were working hard and willing to do whatever takes to solve this difficult problem of climate change all two weeks.

I have been following the last Plenary overnight taking a break here and there and after almost 12 hours later, I couldn't continue any more unfortunately, so I could not see how it was ended. But the those hours saw the involvement of all the parties and that should have been the way all throughout the two weeks. I think that may have brought a better result.

Friday, December 18, 2009

United States' attitude in Copenhagen Climate Change Conference

Since the beginning of the Conference, there have been many informal consultations involving only a small number of countries despite the fact that the delegates from many countries were there to work in the plenaries. And many countries expressed their concern about "transparency".

Now the United States is using the same word, "transparency", for a different context.

First of all, if "transparency" is important, they should ratify the Kyoto Protocol, instead of just announcing what they do about clean energy technology in their country.

Second, while they used the word, "transparency", they formed a closed door meeting with only handful of countries, despite the fact that great majority of the head of states and the leaders are there in the Conference. What they are doing doesn't have any "transparency".

It almost sounds like to me that they took advantage of the situation where many countries are upset about "transparency" in the Conference and used the same word in a different context to diffuse people's attention away from their own responsibilities. In other words, the perception of the majority of parties have been that the United States and China are the blocker of the deal and the United States manipulated to make it look as if China is the only problem.

Wednesday, December 16, 2009

Tokyo Cabinet (rufus-tokyo) - TableQuery :stroreq and :numoreq

Quick note about what I found.

The documentation for Rufus::Tokyo::TableQuery says "string/number which is equal to at least one token" for :stroreq and :numoreq, respectively. But this collection of tokens cannot be an array. It must be a string with tokens separated by comma.

How did I find that array doesn't work?

First, it didn't return the expected result.

Then I looked at the code for the add method by clicking on "View source" and found that to_s is called immediately on the passed val (in this case, a collection of tokens). So if array is passed, to_s is called on it, which only returns a string concatenating all the array elements. So how the code following it can distinguish the tokens for the string, e.g. "123"? - (1 and 23) or (1 and 2 and 3), etc?

So I simply tried passing a string with tokens separated by comma, e.g. "1,2,3". Then it worked.

Ruby on Rails: background job for uploading file

Quick note.

Running the work of uploading file in the background using Delayed Job doesn't work well because it has a problem with serializing the data into YAML::Object that it uses.

Workling with Spawn works well.

Wednesday, December 09, 2009

Very informative webcast about climate change

It was very informative.

COP 15 Media Training Workshop

Bolivia's position on the climate crisis

I think what they say hits the points.

(The embedded video below doesn't seem to work well. So I put a link, too)








Saturday, December 05, 2009

Musique Jazz - Sadao Watanabe "Rendez-vous"

Un saxophoniste, Sadao Watanabe (渡辺貞夫).

Parce que je l'écoute souvent à YouTube parce que je ne le trouve pas encore dans iTune ou autre, j'ai décidé de le mettre ici.

Friday, November 27, 2009

Une pièce de musique traditionnelle du japon « Sakura »

Mon professeur du cours de musique m'a demandé de trouver une vidéo de la pièce de musique japonaise qui s'appelle « Sakura » qui veut dire fleurs de cerise. J'en ai trouvé une. C'est belle.



Monday, November 23, 2009

World Wildlife Fund: Oil and Ice Tour: Are we giving up ice for oil?

I attended an event by World Wildlife Fund the other day.

It is incredible that one barrel of oil (natural gas) is used par three barrels of oil produced being extracted from tar sand. What a waste of natural gas!

The speaker said that in order to sustain civilization, the ratio of the energy used and the energy generated must be at least 1:5.

Saturday, November 21, 2009

Tokyo Cabient and rufus/tokyo table locking

This may be obvious but I just write it anyway.

It is from http://rufus.rubyforge.org/rufus-tokyo/Rufus/Tokyo/Table.html and what I tried out based on the information there.

1. When you instantiate Rufus::Tokyo::Table, it gets the default mode of :write and :create, which locks the table.

-> So instantiating another fails with "Rufus::Tokyo::TokyoError: (err 16) lock error".

2. If the mode is :read and 'f' (non blocking lock), multiple instances can be created and each can read.

-> But when one is with the mode :write and 'f' (non blocking lock), instantiating another with the mode :read and 'f' fails with "Rufus::Tokyo::TokyoError: (err 16) lock error".

3. When one is instantiated with the mode :write and 'f' (non blocking lock), instantiating another with the mode :read and 'e' (non locking) succeeds.

-> And you can read from either instances.

-> When you write a value with that first instance with the mode :write and 'f', you can read the value from that first instance. But in order to read the value from the other second instance with the mode :read and 'e', you have to first close it and instantiate a new one with the mode :read and 'e'. Otherwise, that second instance doesn't read the newly added value.

4. When multiple instances are instantiated in the same thread (e.g same Rails console), thread occurs with "Rufus::Tokyo::TokyoError: (err 1) threading error".

5. If table file is never created, the mode :create must be specified.

20th Anniversary of the fall of Berlin Wall

I wanted to write what I felt at that time but have been busy.

November 9, 2009 was the 20th anniversary of the fall of Berlin Wall.

20 years ago, I was thinking of visiting East Europe to be in the middle of the change. But I didn't because the only experience of traveling abroad that far was China and I wasn't sure if I could go around. Instead, I traveled to Malaysia, Singapore, and Australia.
That itself was a good experience. But I regret that I didn't go to East Europe at that time.

Looking back, after gaining lots of experience traveling abroad, I think I was able to go around there without a problem, finding a hotel, etc.

During these 20 years, what have I done?
Surely, my intention in my mind has been always doing something good, contributing to protect human rights and democracy, etc. But in reality, I haven't achieved anything in those long 20 years, caught up with unimportant things.

Tuesday, September 15, 2009

Upgrade to Mac OS X Snow Leopard (as a development machine for Ruby on Rails) 2

All I was trying to do was to switch to MySQL 64bit. That led to changing the whole thing. Installed MySQL 5.1 64bit. I had to switch to the preinstalled Ruby 1.8.7 instead of the one I had installed using MacPorts before because mysql gem installation failed. And that led to installing the gems under /usr and uninstalling the ones that are not 64bit and reinstalling them. There were much more.

Usually, I write what I did to make it work. But it's too long. So I just leave it to say that I'm happy that it's finally all set.

Sunday, September 06, 2009

Upgrade to Mac OS X Snow Leopard (as a development machine for Ruby on Rails)

I have upgraded from OS X 10.5 Leopard to 10.6 Snow Leopard recently.

Then I couldn't access MySQL any more.

After many trials such as installing 64 bit MySQL, etc, I found that all the directories and files except for data and lib had been deleted under MySQL directory and also symbolic link to it when the Snow Leopard upgrade was done. In my case, I had mysql-5.0.45-osx10.4-i686 under /usr/local and I used to have the symbolic link called mysql under /usr/local pointing to it. I found the problem by looking at Time Machine.

So I restored the /usr/local/mysql-5.0.45-osx10.4-i686 directory from the backup using Time Machine and then restored mysql symbolic link.

MySQL setup GUI under "System Preferences..." (under Apple mark menu) didn't work. i.e. MySQL server didn't either start or stop by clicking on the button there. So I restarted Mac OS X in order to start MySQL server.

Then I was able to access to MySQL as before.

The next step is installing 64 bit MySQL to take advantage of OS X Snow Leopard.

(By the way, I'm using MySQL 5.0 because I learned from a local MySQL user group, it's not worth upgrading to 5.1. But I hope it's worth upgrading OS X to Snow Leopard.)

Wednesday, May 27, 2009

Steve Nash and his contribution toward environmental issues

Steve Nash, a professional basketball (NBA) player for Phoenix Suns wears basketball shoes made out of recycled materials. He initiated to put solar panel at the roof of the stadium. He advocates many practices such as riding a bike or skateboard and actually practices them.

I like him very much.
For many years, it has been because of his basketball skills and smart plays.
Now I admire him.
That's because I have learned his initiatives.

Wednesday, April 08, 2009

Cucumber and restful_authentication

I have started to use Cucumber.
But I'm using restful_authentication for the Ruby on Rails application I'm working on and I had to deal with it.
It turned out that all I have to do was to add a step like the following (My actual code has a role parameter - e.g. admin - but I omitted it here for simplicity):

Given /^I am logged in$/ do
User.create!( :first_name => 'quire',
:last_name => 'smith',
:login => 'quire',
:email => 'quire@example.com',
:password => 'test',
:password_confirmation => 'test' )
post "/login", :login => 'quire', :password => 'test'
end


By the way, in routes.rb, I'm setting the following as described in restful_authentication:

map.login '/login', :controller => 'sessions', :action => 'new'


P.S. Actually, it didn't work quite well in the steps later on. I will do more investigation.

Sunday, March 22, 2009

What I did when upgrading from Ruby on Rails 2.2.2 to 2.3.2

I write what I had to do to upgrade Ruby on Rails from 2.2.2 to 2.3.2.
Development machine is Mac OS X Leopard and production server is Ubuntu Hardy.

1. (development machine) Update Ruby on Rails.

$ sudo gem update rails


2. (development machine) Update all the gems.
(Note: 1. above can be done in one shot in here. But I'm just writing following the order I did as much as possible.)

$ sudo gem update


3. (development machine) Under RAILS_ROOT for the Ruby on Rails application, execute rake to update Rails.

$ rake rails:update

This updates the following files:

config/boot.rb
public/javascripts/controls.js
public/javascripts/dragdrop.js
public/javascripts/effects.js
public/javascripts/prototype.js


4. (development machine) In the Ruby on Rails application, rename application.rb to application_controller.rb.

5. (development machine) In the Ruby on Rails application, in environment.rb, change the version to 2.3.2.

6. (development machine) Installe system_timer gem.

$ sudo gem install system_timer

This is because of a warning when script/server:

[memcache-client] Could not load SystemTimer gem, falling back to Ruby's slower/unsafe timeout library: no such file to load -- system_timer


7. (development machine) In ApplicationController, comment out:

session :session_key => '_session_id'

because of the warning in script/server:

DEPRECATION WARNING: Disabling sessions for a single controller has been deprecated. Sessions are now lazy loaded. So if you don't access them, consider them off. You can still modify the session cookie options with request.session_options.


8. (development machine) In environment.rb, change as following based on what's written in release note (http://guides.rubyonrails.org/2_3_release_notes.html):

from

config.action_controller.session = { :session_key => '_some_session',

to

config.action_controller.session = { :key => '_some_session',



I use RedCloth and followed what is written here (http://sudothinker.com/2009%2F3%2F2%2Frails-2-3-upgrade-problems-and-solutions) to make it work.
But after the fact, only the steps 1 to 5 above should allow the application to start with script/server.


The following are the steps to make RSpec work.

9. (development machine) In routes specs, change :id => 1 to :id => '1'.
Also for nested routes, do the same thing e.g. :register_id => 1 to :register_id => "1"

10. (development machine) For the controller method that takes care of javascript, which doesn't have a corresponding .html.erb file, add:

:format => 'js'

for get in spec. e.g.

get :index, :format => 'js', :topic_id => "1",
:selected_sub_topic_id => "2"

This is because even though controller spec is separate from view, RSpec couldn't catch up with the change in Ruby on Rails, and the existence of the corresponding .html.erb is required.

11. (development machine) RSpec correctly detects OrderedHash instead of array of array. Ruby on Rails returns OrderedHash for group_by. So change such as following:

[ [ mock_jurisdiction, [ mock_bulletin ] ] ]

to

{ mock_jurisdiction => [ mock_bulletin ] }

Note: As far as I observed, Ruby on Rails itself was already using OrderedHash in 2.2.2 but RSpec was failing if I use the Hash format. Now it fails with array format.


The following is a step to make CruiseControl.rb (fork with GIT support) work.

12. (continuous integration server) Delete all the unpacked gems in .cruise/projects/RAILS_ROOT/work/vendor/gems because CruiseControl complains such as

config.gem: Unpacked gem RedCloth-4.0.1 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.

even after unpacked gem is removed from the Ruby on Rails application itself.


The following is a step to make Capistrano work.

13. (production server) Update all the gems. (Actually this had already been done as a part of Ruby on Rails upgrade in production server.)

$ sudo gem update


14. (development machine) Under RAILS_ROOT for the Ruby on Rails application,

$ script/plugin install
git://github.com/rails/irs_process_scripts.git

because commands/process/spawner that is used Mongrel is deprecated. (http://github.com/rails/irs_process_scripts/tree/master)

Saturday, March 14, 2009

Language can be understood even when it's not totally correct

I have attended a Japanese Language Speech Contest because I wanted to know how I feel from the opposite side after struggling to communicate well naturally in English and putting an effort to learn French.
I have found that the language can be understood even when it was not spoken 100% correctly.
I even thought that that's how language evolves.
So it's OK and I don't have to worry about speaking a foreign language even when I accidentally make a mistake.
Native speaker of the language can understand what I'm trying to say.

With that confidence, I write this blog in French as well, even though I will make mistakes.

J'ai assisté au concours d'élocution japonaise parce que j'ai voulu savoir comment j'aurai senti en écoutant de la parole en ma langue maternelle par les gens avec les langues maternelles que j'avais essayé d'apprendre et avec lesquelles j'avais essayé de survivre.
J'ai trouvé que c'est facile de comprendre une parole malgré elle n'est pas tellement correct.
J'ai imaginé que ce soit comment le langage change.
Alors, c'est pas grave si je parle l'autre langue et fais erreur.

長く外国語を使ったり、最近では新しい言葉を習ったりして、いつもうまく通じているか気にかかっていたので、日本語弁論大会があると知ってから、逆の立場になったらどう感じるか、興味がわいてきました。
実際に弁論を聞いてみると、結構間違いがあっても、わかるものだなあ、と思いました。
多分、英語とかフランス語とか、こんなふうにして、少しずつ、世界中で地域によって違いが出てきたんだろうなあ、と想像をめぐらせました。
ネイテイブの人にどうせわかるんだったら、外国語をしゃべって間違いをしても、別に問題はないんだ、と思うようになりました。

Poco a poco. Yo hablo otro idioma. Poquito de Español (Castellano).

Monday, March 09, 2009

Continuous Deployment

One of the Kent Beck's talks I watched quite a while ago said that there was a trend of more frequent deployment.

Also a developer I talked to about two months ago mentioned that his team was going into that approach.

And there was an InfoQ article about it today:
"Beyond Continuous Integration: Continuous Deployment"

Wednesday, February 25, 2009

Make successful mistakes

I have watched a talk about business and I just write in here because it was interesting and is important.

Saturday, February 21, 2009

Snowboard Geek

About almost a year ago, I wrote a blog, "Healthy Snowboarding Brand".

Along the same line, some words have come up to my mind today, out of nowhere.

I'm a "Snowboard Geek".

And I like it a lot.

Sunday, February 01, 2009

Outliers

I have listened to the audio book of Malcolm Gladwell's "Outliers".

It was very interesting and I liked it.
It has already changed the way I go on with my life.

By the way, it's true that numbering system in East Asian language is logical - at least I know about my native language, Japanese. It's strictly Base 10 (Decimal). After 13 years of counting in English (and the last one year in French as well), I have started counting numbers in Japanese in my head in the last few days after I listened to the audio book. Works very well.

It's a side issue but I'm glad that I have an advantage of choosing only a good thing from English and Japanese (and French a little) not being stuck with a handicap in one particular language.

Tuesday, January 20, 2009

Saturday, January 03, 2009

Ruby on Rails 2.2 and Spawn

Spawn was updated to work with Ruby on Rails 2.2 very recently.
(Spawn GITHUB commit history)

Ruby on Rails 2.2 and will_paginate

will_paginate 2.2.2 doesn't work with Ruby on Rails 2.2.

You have to have mislav-will_paginate 2.2.3. (will_paginate wiki)

Monday, December 29, 2008

Monday, November 17, 2008

Malcolm Gladwell's articles

Someone gave me the links to interesting articles by Malcolm Gladwell.

All of them were very interesting.
But I list them in the order of the one that made me feel like putting on this blog the most to the one the least.

Million-Dollar Murray (Why problems like homelessness may be easier to solve than to manage.)

What we can learn from spaghetti sauce

The Uses of Adversity

The reason why I wanted to put the first one in this blog was the last section about air pollution. That gave me a new perspective and made me realize that by retrospective, in the past, I have observed a similar phenomenon.

The part of the second article, actually a talk, "people don't know what they want" is related to how we develop software in Agile way. It is based on a notion that the users don't know what they want. So we build software incrementally, showing it to the users as we go and deciding what to do next based on their reactions. That's all I wanted to say in this blog. The main theme of the talk is much beyond that, however, and that will heavily influence the way I view things from now on.

The third one gave me a new important perspective as well. I'm glad that I read it. But most probably it would have stayed as a bookmark instead of putting it in this blog if I didn't get its link with the other two.

Wednesday, November 05, 2008

Reflection on my life, of the result of the presidential election in United States

I felt the enthusiasm of the people while I was following the presidential election in United States last night.

I view Barack Obama as a human and his being a black person doesn't come to my mind. And following the election yesterday and listening to his speech after he became the next president of the United States, I felt that the people chose a person with a positive choice, not a compromise of choosing a person less evil than the other.

Despite of these facts, while I was in the bed afterward, I was reminded of my high school English class.

It was in a small city in a rather rural area of Japan and the majority of the people there spend their entire lives never seeing any foreigner and only speaking their dialect even only speaking the standard Japanese only occasionally. While I was a student very aware of human rights and social issues, those issues rarely came to people's mind.

One day, in one of the English classes, the teacher played a tape of Martin Luther Kings Jr.'s speech, "I have a dream". And he had a sincere conscience.

I am very graceful that he played the speech.

Sunday, November 02, 2008

Quick note about Workling

I have found that when using Starling, setting "Workling::Remote.dispatcher = Workling::Remote::Runners::StarlingRunner.new" in environment.rb is not necessary because Workling checks the existence of Starling before any other gems or plugins such as Spawn.

I've found this by looking at the code vendor/plugins/workling/lib/workling.rb, self.default_runner, which was a point of failure at one execution.

self.default_runner takes care of setting it automatically.

The problem was that when it is set in environment.rb or even only in environments/development.rb, "rake spec" fails reading the setting for development environment in config/starling.yml. (Even when I explicitly set ENV["RAILS_ENV"] = "test".)

If another background process gem or plugin is used such as Spawn while Starling gem is still installed, Starling is still picked up. I think we can specify Spawn in environment.rb.

Or it would be ideal if only one background process gem/plugin installed out of Starling, Spawn, and Backgroundjob.

Wednesday, October 15, 2008

Election

I just write this quickly.

I have always been a supporter of proportional representation (I think that's what's called in English. I'm writing this quickly so I'm not verifying it because I'm extremely busy these days.).

By that way, the seats for the legislative (such as parliament) are allocated based on the percentage of the votes each party gets.

First of all, every vote counts.

Second, these days in much modern society, geographic location doesn't say much. People living in geographically distant places share the same opinion and concerns. People living in the same location don't share anything in common. That's common. Majority of the people live where they live because they found an apartment or a house there. Could have been just any other place. In a few kilometers apart, in one electoral district, the party you voted for wins and in another district, another party wins. Is there anything different between two districts? Not really.

If keeping representative from each district is important, at least have two houses in the parliament. One consists of the members of parliament elected from electoral districts and the other consists of the members of parliament elected by proportional representation.

I know many countries have been using proportional representation for a long time. So writing this blog entry doesn't mean to criticize anything anywhere. I'm just writing this to say that I'm supporting proportional representation. Also specifying any country doesn't go well with my blog's underlying philosophy of keeping it geographically neutral. (My blog is only for expressing my opinions or informing what I found.)

I will try to find a time in the future to elaborate this more, using more correct words. But I think the readers can get an idea by replacing words appropriately such as "member of parliament" to "senator", etc. Right now, I just wrote it very quickly because I don't have a time.

Tuesday, October 07, 2008

Basics of fundamentals

It is pathetic that I have to even write this in my blog.
And I have been certainly assuming that any reader of this blog understands this.
What I wrote in the past reflects it.

Here, I write it using simplest possible words.

--- Explanation that explains most what is observed is what is accepted.

-> There is an observed behaviour or phenomenon or artifact that exists. In order to explain it - why it happens or why it exists -, there is a theory. The theory that explains the behaviour or the phenomenon or the artifact best is what is widely accepted to be true. There is a verification process to back it up, often using statistics.

-> The main reason why there are many people who don't believe in religion is that what religion says conflict with what is observed. Simply being ignorant with what is observed or the facts doesn't justify that what a religion says is correct.

--- Separation of public affairs and religion.

-> It is essential and fundamental that politics and education are separate from religion. Any one religion shouldn't control or influence politics and education. It is essential in order to keep the civilization functional for all the human beings.

-> By knowing why and how a certain religion spread in a certain part of the world in the course of human history, we know that there is no reason why one religion should be allowed to control other people.

--- Basic human rights.

-> Nobody has a right to be over anybody else based on his/her belief. Every human being is equal and believing a certain religion doesn't give a person to be superior to other people.

-> Nobody should be discriminated based on his/her belief.

In addition to the above, I write some more regarding what I observed today at a public language school today.

--- Religion is created by human being as a part of its history.

-> Over the course of human activities in different regions of the world, a certain beliefs emerged with an influence from the environment where the people in the region were surrounded.

--- Religion was often spread for political reasons and what it says was often created because of the political reason as a part of human history.

--- It is not true that all the religions have a god.

--- It is not true that all the religions believe in the same god.

-> Many religions have multiple gods and the idea of the unique god is actually a minority. The reason why that idea is so well-known is that the group of people who believed in it conquered other parts of the world with force, military power, discrimination, and manipulations. For example, The majority of North and South America were conquered by military power and it was injustice. And early 20th century, the majority of the world was colonies of European countries. Simply conquering other countries doesn't justify that the god of conqueror's religion is same as the ones of other religions.

-> Many religions don't accept a notion that all the religions believe in the same god. It's simply a cultural insult. The culture is influenced by the environment where the people live in and there is no justification that a person in one culture says that his/her culture is better than the other.

At the end, I just write some of my opinions.

--- Believing in a religion doesn't make a person morally better.

-> It only gives an illusion to the person that he/she is superior.

After writing this, I still think that it's pathetic and sad that I have to even write this. I thought that these days, everybody understood human rights and democracy and that everybody understood basic human history.

Thursday, September 04, 2008

Awareness of recycling

Yesterday, I had a chance to bring awareness of recycling without causing other people defensive.
But I missed the chance.
I regret it very much.

At a language course I'm taking, the teacher asked me what I never do as a part of an exercise to explain it in the language we are learning.
I could have said that I never throw metal cans in the garbage because it's important to recycle them.

I have been noticing that many students there are throwing them in the garbage can instead of in the box for recycling metal cans, probably because majority of the students are immigrants and they are not aware of the importance of recycling.
That bothers me a lot.

One day, I mentioned to one student that there is a box for recycling metal cans. She was very upset taking it as an accusation.
Because the box for recycling them is not located in that floor and it's only on the first floor, I made a proposal to the school to put one in each floor at least to make it easier for the students to recycle metal cans.

The school seems to be doing the best to recycle materials as much as they can.
With the constrain that the company working for them who collects papers collects only papers in the recycling bin in each class room enforcing us to put only papers in the recycling box and that the company working for them who collects metal cans only collects them from the box in downstairs, I noticed that a cleaning person picks metal cans from the garbage cans and separate them for recycling.
I appreciate the cleaning person's work very much.

At the same time, what I concern most is that those students recycle in other part of their lives outside the school settings. If they continue to throw recycling materials in the garbage, it is a huge amount of recycling materials thrown away, which is not good for environment.

So I want them to have an awareness of the importance of recycling.
And yesterday presented me a good chance to initiate to achieve it.
I hope there will be another chance.

Sunday, July 13, 2008

Setting up GIT public repository

I found setting up GIT public repository by copying the Rail application to the origin server doesn't allow tags to be pushed.

This lists the steps I took to set up GIT public repository that allows tags (or all GIT objects, I think) to be pushed.

1. Create bare GIT repository from the Rails app I want to create a repository for.

$ git clone --bare rails_app rails_app.git

2. Make the repository to be sharable by GIT daemon just in case I want to do so.

$ touch rails_app.git/git-daemon-export-ok

3. Tar it and scp to the server where I want to have the public repository, which becomes the origin server.

$ tar cvfjp rails_app.git.tar.bz2 rails_app.git

$ scp rails_app.git.tar.bz2 @:~

4. In the origin server, add a new user called "git".

$ sudo adduser git

5. Change the shell for "git" to git-shell.

$ sudo vim /etc/passwd

git:x:1001:1001:,,,:/home/git:/usr/bin/git-shell

6. In the origin server, create git directory under /var.

$ sudo mkdir git

$ cd git

7. Untar the tar file.

$ sudo tar xvfjp ~/rails_app.git.tar.bz2

8. Change the owner of "git" directory to "git".

$ cd ..

$ sudo chown -R git:git git

Tuesday, June 24, 2008

Installing RMagick Ruby gem

Just for a record (because I forgot how when I had to do it again on another server):

* On Ubuntu Hardy:

1. Install ImageMagick.

$ sudo aptitude install libmagick9-dev

$ sudo aptitude install imagemagick

2. Install RMagick gem.

$ sudo gem install rmagick

* On Mac OS X Leopard (with MacPort):

1. Install ImageMagick.

$ sudo port install ImageMagick

2. Install RMagick gem.

$ sudo gem install rmagick

Sunday, June 22, 2008

RubyGems 1.2.0 is released

Just yesterday.
(Announce: RubyGems Release 1.2.0)

Get it by:

wget http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz

Sunday, June 01, 2008

The Wisdom of Crowds

There was an occasion that I mentioned "The Wisdom of Crowds" responding to the other person during a conversation today. I promised him to send a link to it. And this is what I found instead of just sending him a description in a bookstore site.

"The Wisdom of Crowds"

Sunday, May 18, 2008

"Skinny Controller, Fat Model" best practice

My first impression about reading about it ("Skinny Controller, Fat Model") was that it is a basic of Object-Oriented Programming. If you are familiar with Object-Oriented Programming practices such as small method, refactoring, Design Patterns, your code naturally becomes what this article is proposing. Especially, my impression is that if you are doing Test/Behaviour-Driven Development, it is even difficult NOT to become as proposed.

What I liked about "Skinny Controller, Fat Model" is that it is explaining the best practice from the different perspective and with the simpler expression. You can reach the same code either following the basic Object-Oriented Programming practices or following "Skinny Controller, Fat Model".

Ultrasphinx setup part2

Regarding what I wrote about test database in section "4. Build index" in my previous post "Ultrasphinx setup", RSpec code would become like below.

I put this under spec/models accessing database. But for controller spec under spec/controllers, I mocked Ultrasphinx::Search so that the controller spec is not accessing database.

(Note: The line with "system(..)" is one line.
It is shown to be multiple lines because of the space.)

require File.dirname(__FILE__) + '/../spec_helper'

describe "Ultrasphinx sample" do
fixtures :overviews

before(:each) do
system("cd #{RAILS_ROOT};
rake ultrasphinx:index RAILS_ENV=\"test\"")
system("cd #{RAILS_ROOT};
rake ultrasphinx:daemon:start RAILS_ENV=\"test\"
&> /dev/null")
end

after(:each) do
system("cd #{RAILS_ROOT};
rake ultrasphinx:daemon:stop RAILS_ENV=\"test\"
&> /dev/null")
end

it "should find text with 'test'" do

@search = Ultrasphinx::Search.new(:query => "test")
@search.run

@search.results.size.should == 2

end

end

Thursday, May 15, 2008

Ultrasphinx setup

It was more straightforward to figure it out than other things I have done in the past. But I just write the whole thing I did to set up Ultrasphinx.

1. Sphinx installation

$ wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8-rc2.tar.gz

$ tar xvfzp sphinx-0.9.8-rc2.tar.gz

$ cd sphinx-0.9.8-rc2/

$ ./configure --prefix=/usr/local

$ make

$ sudo make install

2. Install Chronic
(Chronic is a natural language date/time parser written
in pure Ruby.)

$ sudo gem install chronic

3. Install Ultrasphinx plugin

$ cd RAILS_ROOT

$ svn export svn://rubyforge.org/var/svn/fauna/ultrasphinx
/trunk/vendor/plugins/ultrasphinx
(if GIT or other version control system is used.)

(Or if Subversion is used,
$ script/plugin install -x svn://rubyforge.org/var/svn/fauna/ultrasphinx
/trunk/vendor/plugins/ultrasphinx)

$ cp RAILS_ROOT/examples/default.base RAILS_ROOT/config/ultrasphinx/

Add is_indexed to the model: e.g.

class Overview
is_indexed :fields => [ 'title', 'description' ]
end
4. Build index

$ rake ultrasphinx:configure <= Generates development.conf

($ rake ultrasphinx:configure RAILS_ENV="test" <= Generates test.conf)

$ sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
(Because "rake ultrasphinx:index" has an incorrect path "/usr/local/mysql/lib/mysql".
Otherwise, "rake ultrasphinx:index" fails.)

$ rake ultrasphinx:index <= For development database

($ rake ultrasphinx:index RAILS_ENV="test" <= For test database)
(Of course, in the Test::Unit or RSpec, test database is cleaned up every time so this has to be put inside Test or Spec.
i.e.
system("cd #{RAILS_ROOT}; rake ultrasphinx:index RAILS_ENV=\"test\"") )

5. Start/Stop daemon

$ rake ultrasphinx:daemon:start <= For development database

($ rake ultrasphinx:daemon:start RAILS_ENV="test" <= For test database)

- How to stop Ultrasphinx

$ rake ultrasphinx:daemon:stop

Saturday, May 03, 2008

GIT

I have started using GIT recently. I like it very much.
In fact, within a day of starting using it, I switched all the current projects to it.

Friday, April 18, 2008

Tuesday, April 15, 2008

Nginx and Ruby on Rails ssl_requirement

ssl_requirement plugin was causing infinitive loop.
It was because request.ssl? was always returning false in ensure_proper_protocol method inside SslRequirement.
Actually, request.ssl? method is checking the value of X-FORWARDED_PROTO.

So it turned out that you have to set X-FORWARDED_PROTO in Nginx's configuation file.
i.e.
server {
location / {
proxy_set_header X-FORWARDED_PROTO https;
}
}

Thursday, April 10, 2008

Growth hormone release in pulsatile pattern

I've just learned that the effect of growth hormone is bigger with the existence of the periods when it is not released. In that case the hormone release has a pattern of pulse.

Also I learned that it is more intertwined with other hormones than I had known before. But it makes sense.

Human body or any mammal's body is amazing in how it's functioning. On the way back home, I was looking at other people on the bus and thought that at each moment, inside their body, hormones and other chemicals are highly balanced. Of course, it has been one of the reasons why I respect each individual human and creature. I was reminded of that feeling strongly again today. I just wish all the individuals can achieve the best they can achieve.

Sunday, March 30, 2008

Great Team Basketball

In NCAA Men's basketball tournament, Davidson University played great team basketball games. I just loved the way they played basketball.

Wednesday, March 26, 2008

Healthy snowboarding brand

After an "Event to build entrepreneurial software in 48 hours over a weekend", I got into a mindset to come up with a new brand a little bit.

That led me to come up with a way of snowboarding in a healthy athletic way.

Often times, many snowboarders are rude and aggressive and do stuff like smoking and drinking excessively.

But if you take snowboarding itself, it's a good sport requires whole body muscles. It has variety of movements - free riding, free styling in snow park, etc. It's challenging, which gives you positive attitude overcoming fear. It's outdoor, often breathing fresh air in the mountains. And on the top of the ski hills, you can see magnificent views, which refreshes your mind.

So I would package all these good features together and brand it as a healthy snowboarding. The image of that brand is like working out in the gym. You eat well with nutritious food and in the daily life, work out and tone up the muscles, in order to give you the best snowboarding performance. A friendly attitude toward other people has the high value. And you progressively improve various snowboarding skills, including free style moves.

Possibility of hydrogen production for hydrogen vehicle

After I wrote a blog entry, "Wind-powered generator on the top of the ski hills - Éoliennes sur le sommet des centres de ski", I was reminded that I live in a place with abundant electricity by hydroelectric energy production.

Then I thought of hydrogen vehicles. As far as I remember Iceland is the only country that can produce hydrogen from water by electrolysis using clean natural energy source, enough to support almost all the vehicles in the country. Maybe we can be next. With the combination with the electricity by wind-powered generator, maybe we have enough electricity needed to produce hydrogen.

Thursday, March 20, 2008

REST for various scenarios

The purpose of the article is different but I read it in such a way to learn more about REST.

"Addressing Doubts about REST"

Also the comments are interesting.
And one of them "Resource transformations" is what I'm concerned with most now.

Wednesday, March 05, 2008

How to set up to access LDAP from Ruby on Rails

Note: This is for Mac OS X 10.5 Leopard. For other system, change the directory path appropriately.

1. Install OpenLDAP.

1-1. Install Berkeley DB.
(OpenLDAP requires this.)

1-1-1. Download the source. db-4.5.20.tar.gz
(OpenLDAP only works with the version up to 4.5.
Don't download 4.6.)
("Berkeley DB 4.5.20.tar.gz, with AES encryption(8.9M)"
in
http://www.oracle.com/technology/software
/products/berkeley-db/db/index.html)

1-1-2. Unpack the tar.gz file. And build it.
$ cd build_unix
$ ../dist/make

1-1-3. Install it.
$ sudo make install

1-2. Install OpenLDAP

1-2-1. Set the environment variables.
(See the message with "configure --help")
$ export CPPFLAGS="-I/usr/local/include"
$ export LDFLAGS="-L/usr/local/lib"
$ export LDFLAGS="-L/usr/local/BerkeleyDB.4.5/lib/"
$ export CPPFLAGS="-I/usr/local/BerkeleyDB.4.5/include/"

1-2-2. Build it.
$ make depend
$ sudo make
(make has to be executed as root
otherwise a permission error occurs.)

1-2-3. Install it.
$ sudo make install

1-2-4. See doc/guide/admin/guide.html for how to use it.
Especially, "2. A Quick-Start Guide".

e.g How to start it.
$ su root -c /usr/local/libexec/slapd

2. Install ruby-activeldap Rails Plugin.
(http://code.google.com/p/ruby-activeldap/)
$ script/plugin install \
http://ruby-activeldap.googlecode.com \
/svn/trunk/rails/plugin/active_ldap

3. Install activeldap Ruby Gem.
(ruby-activeldap Rails Plugin only generates
scaffold model to access this gem.)

$ sudo gem install activeldap

4. Install Ruby/LDAP.
(activeldap is a wrapper for this.)

4-1. Download the source. ruby-ldap-0.9.7.tar.gz
(http://sourceforge.net/projects/ruby-ldap/)

4-2. Unpack the tar.gz file. And build it.
(See README file under the unpacked directory.)
$ ruby extconf.rb --with-openldap2
$ make

4-3. Install it.
$ sudo make install
(It's installed under /Library/Ruby/Site/1.8)

Event to build entrepreneurial software in 48 hours over a weekend

Over the last weekend, I participated in an event to build software product in two days and present it to investors at the end.

My goal of participating the event was to work on Ruby on Rails development and to get familiar with local start-up scene because they are the ones who are using Ruby on Rails most.

Our team lead was very professional in skills, knowledge and the manner he conducted business throughout the project. I was able to enjoy the development fully.

During the event, series of experts in business, entrepreneurship, and technology visited each team and gave us advices. It was very interesting to see how the project was being shaped as a result of this interaction and how the direction changed along the way.

The presentations by investors and accounting professional, etc. at the beginning of the event were very informative also. And I was able to meet various technical people during the event.

My goal was more than fulfilled.

Sunday, February 24, 2008

RSpec Stories resources

I just put it in here because I refer to it often.

RSpec Stories resources.

By the way, one comment in David Chelimsky's blog entry in there has a link to a Story Editor using Prototype.

Friday, February 22, 2008

Éoliennes sur le sommet des centres de ski

Since I'm learning French, I try to write a blog entry in French as well.
This is about the idea of Wind-powered generator on the top of the ski hills, which I wrote on February 5th. Please correct it if you are familiar with French. My French is not good yet:

J'ai une idée de mettre des vent générateurs sur le sommet des centres de ski parce que souvent il vente très fort là. L'électrcité générée est utilizé pour l'ascenseurs.
(Corrigez les erreurs, SVP. Ça ne fait pas longtemps que j'apprends français.)



Mon ami a corrigé les fautes (Merci!):

J'ai eu une idée d'installer des éoliennes sur le somment des centres de ski car il vente très fort a ces endroits. L'électricité générée serait utilisées pour les remonte pente.

Friday, February 15, 2008

RSpec Stories

I like RSpec's new feature, RSpec Stories.
In the past, I saw Acceptance Test Cases written in plain text and the approach worked very well.

By the way, RSpec Stories is in English. And of course, all the programming languages use English for their keywords as far as I know. But I'm learning French now. And French speaking customers writing Stories in English doesn't seem to work well. And developers translating French to English introduces one more layer of indirection, which we want to avoid. I wonder if there is a solution to this problem. Maybe we can make a translator. It will be simple because it contains only RSpec stories keywords.

Monday, February 11, 2008

Experiment on Evolution

I have attended very interesting lecture at a local university.
I wish I had enough time to write down the verbs the speaker used to describe what three key figures in the lecture did.
But using my words instead, it was about - Darwin provoked the idea, Dallinger attempted to verify it experimentally, and D'Herelle established the way to experiment it.
Of course, not to mention, that uses life form whose reproduction cycle is very short so that you can observe its evolution.

D'Herelle is the start of Evolutionary medicine.
Evolutionary medicine is very interesting. Bacteriophage therapy makes sense though I acknowledge the points the speaker mentioned - it's alive so you don't necessarily know what would happen after the treatment is completed.

Thursday, February 07, 2008

RSpec Rails screencast

"Story Runner top to bottom screencast"

It's very good and at the same time entertaining to follow as well.

Tuesday, February 05, 2008

Wind-powered generator on the top of the ski hills

Many times at the top of the ski hills and mountains, especially in the high mountains, wind blows very hard.

I have come up with the idea of putting a wind-powered generator on the top of a ski hill. It provides electricity for the lifts. And when the lifts are not used, the generated electricity can be put back to the power grid.

Friday, February 01, 2008

The Psychology of Risks

This is an article in "Communications of the ACM" magazine - January 2008 Volume 51, Number 1.

I just quote.

"The big difference seems to be this: In their personal lives, people tend to consciously and deliberately take risks - though often unaware of possibly serious consequences. When dealing with computer technology, people tend to take risks unconsciously and in some cases unwillingly."

Tuesday, January 29, 2008

Kent Beck on Implementation Patterns

"Kent Beck on Implementation Patterns"

I want to be in the environment where people understand what Kent says in this interview, where I can talk about it and where we can thrive for better together.

Sunday, January 27, 2008

I like Spec::Rails from a different perspective as well

I like Behaviour-Driven Development very much. And that's my primary reason why I like RSpec.

I have another perspective as well about why I like Spec::Rails (RSpec for Rails). The specifications of Views are completely isolated from the Controllers and vice versa. This makes isolating and finding a problem much easier.

Also with the built-in Mock framework, Controller specifications and View specifications become more like Unit Tests (or Unit Specifications, I should say).

With stories to verify the interactions between two components acting as integration test/acceptance test, this approach is much closer to an effective software development dealing with the reality of software development such as frequent changes.

Saturday, January 19, 2008

Bio-diesel hybrid car

I was listening to a radio and it was saying that electric cars were coming out.

I always thought that the next car I would buy is a hybrid car. But after hearing it, I felt like getting electric car instead when it comes out.

Also I have been wondering if they can produce hybrid car using bio-diesel. That is much cleaner than gasoline hybrid car. The source of fuel is clean because it's a plant. And the fuel itself is cleaner.

I want to work on contributing for cleaner energy source.

Thursday, January 10, 2008

Installing MySQL driver gem

I have upgraded MySQL from 5.0.27, which I installed about a year ago when I bought MacBook, to 5.0.45 yesterday. The reason is that I learned from a MySQL users group meeting that there are lots of important fixes in the versions above 5.0.30.

In Ruby on Rails 2.0, it is recommended to install MySQL driver gem because the one that comes with Rails is not for production use. The gem command is described in config/database.yml.
i.e. On Mac OS X 10.5 Leopard,
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Previously, installing MySQL driver gem had failed. I tried it again today now that I have the latest 5.0 version of MySQL. Then the installation was successful.

Monday, January 07, 2008

Ruby on Rails: Symbol#to_proc defined in ActiveSupport

I found it in a blog entry "An Introduction to Ruby's Enumerable Module"

It is interesting and I think I can describe it as very powerful.

Tuesday, January 01, 2008

Ruby on Rails 2.0: link_to for nested resources

If you specify nested resources in routes.rb such as

map.resources :daily_contents do |daily_content|
daily_content.resources :vocabularies
end

you have to specify a parameter for link_to like this:

<% for vocabulary in @daily_content.vocabularies %>
..
<%= link_to 'Show', [@daily_content, vocabulary] %>
<% end %>

The generated URL is like this:

http://localhost:3000/daily_contents/5/vocabularies/2

Moreover, if @daily_content.entities is just an array, which happens to contain an object of type, Vocabulary, the following works as well:

<% for entity in @daily_content.entities %>
..
<%= link_to 'Show', [@daily_content, entity] %>
<% end %>

Again the generated URL is same as above like:

http://localhost:3000/daily_contents/5/vocabularies/2

Wednesday, December 26, 2007

Problem with installing Ruby 1.9 on Mac OS X 10.5 Leopard

I have tried to install Ruby 1.9 from tar ball. But so far, there is a problem and it's not successful.

I borrowed the ideas from the following sites:

"Building Ruby, Rails, Subversion, Mongrel, and MySQL on Mac OS X"

"Ruby on Rails install on 10.5 OS X"

"Trouble with Readline and Building Ruby 1.9"

(Also the same post under ruby-forum: "Trouble with Readline and Building Ruby 1.9")

Still Ruby make is failing with regard to readline.


By the way, I miss Linux package managers. It was easy to see which version of what is installed. MacPort is trying to achieve the same thing. But so far, it was not successful to install it. When it comes to package management, I think Linux is better.

Ruby 1.9 Released

You can download it from Ruby Programming Language site.

Sunday, December 23, 2007

Location of Ruby gems for the preinstalled Ruby on Mac OS X 10.5 Leopard

It's /Library/Ruby/Gems/1.8/gems/

The preinstalled Ruby is /usr/bin/ruby (note: execute "which ruby" from command line), which is a symbolic link to

/System/Library/Frameworks/Ruby.framework/Versions/
Current/usr/bin/ruby


So you would think that the location of the gems is under

/System/Library/Frameworks/Ruby.framework/Versions/
Current/usr/lib/ruby/gems/1.8/gems


just like when you install Ruby manually.
But when I looked at the Rails gem under the directory, it was rails-1.2.3.

I performed a search for "rails" gem under each directory under the path as a root user but all the searches found only the same rails-1.2.3.
So finally I performed a search for the entire directory tree, i.e. executed

find / -name "rails" -print

as a root user. And here it is, it found

/Library/Ruby/Gems/1.8/gems/rails-2.0.1/bin/rails

By the way, as a side note, I wanted to see if "/Library/Ruby/Gems/1.8/gems/rails-2.0.1/bin/rails" is sym-linked from /usr/bin/rails (by executing "ls -alFh /usr/bin/rails"). But it isn't. /usr/bin/rails is not a symbolic link of anything. It's an executable file.

This whole thing is very confusing to me.
All I wanted to do was to look at the Rails 2.0.1 source code.

Thursday, December 20, 2007

Ruby on Rails 2.0 configuration files, etc.

I have read through the files in the Rails project generated with Ruby on Rails 2.0, such as the configuration files, etc. e.g. /config/boot.rb, /config/environment.rb.

I've found that they are more well-written and well-structured.

Ruby gem install error with Mac OS X 10.5 Leopard

I attempted to install ruby-debug gem but it failed with a message:

ERROR: Error installing ruby-debug:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install ruby-debug can't find header files for ruby.


This was because the installed Mac OS X Xcode Tools was old, specifically, GCC was old. I had to install Xcode Tools 3.0, which is actually shipped with Mac OS X 10.5 Leopard DVD. You can also download it.

Thursday, December 13, 2007

Switched to TextMate

As I updated to Ruby on Rails 2.0, I decided to try out TextMate.

After getting used to it after reading its documents, I came to like it because its Ruby and Ruby on Rails Bundles seem to have lots of good features.

But I didn't necessarily like its Subversion Bundle. I had to do "svn import" from the command line, delete the local Rails directory (of course, after backing it up), and check out the directory from the Subversion. Otherwise, there is no .svn folder. With Subversion (Eclipse Subversion Plugin), you don't have to delete the local directory. Maybe there is a better way to make this work in TextMate and I would like to know it.

Sunday, December 09, 2007

Ruby MetaProgramming

Watch the video
"MetaProgramming - Extending Ruby for Fun and Profit"

Isn't this wonderful?

Updating to Ruby on Rails 2.0

Until today, I have been using Ruby I installed manually on /usr/local/ (/usr/local/bin/ruby) because that's how I installed it on Mac OS X 4 Tiger. When I purchased Mac OS X 5 Leopard several days after it was released, I noticed that Ruby was installed under /usr (/usr/bin/ruby) as a part of Mac OS X developer tools. But I kept my .profile with "export PATH=/usr/local/bin:/usr/local/sbin:$PATH" because I had lots of gems installed already under the Ruby under /usr/local (/usr/local/lib/ruby).

Today as a part of updating to Ruby on Rails 2.0, I switched to use the Ruby included with Mac OS X developer tools (under /usr). And updated Rails gem under that location (under /user):

1. Commented out "export PATH=/usr/local/bin:/usr/local/sbin:$PATH" in my .profile. Restarted the shell.

2. Executed "gem update rails".

Ruby on Rails 2.0 Released

See Ruby on Rails official site and Ruby on Rails weblog.

Tuesday, November 27, 2007

Uploading audio file and playing it on a web page using attachment_fu Ruby on Rails plugin

Basically used the information from "File Upload Fu" and "Demonstration of Different Ways to Play a Sound from a Web Page".

Uploaded audio file and stored it in file system just like image file using attachment_fu. Then in show.rhtml,
instead of:

<b>Audio:</b>
<%= link_to @vocabulary.public_filename %>

used:

<b>Audio:</b>
<embed src="<%=@vocabulary.public_filename %>" autostart="false" loop="false" height="20" width="200"></embed>

Of course, if there is a better way, I would like to know.

Monday, November 05, 2007

Ordering a service through a customer support by phone

I ordered satellite TV service by calling customer support by phone because I didn't have Internet access temporarily.
To make the story short, after all the communications, they put a wrong service and now I have to pay for the extra service I never requested for the next 30 days.

I am even more convinced that it's a better approach for a customer to order and select what he/she wants through web site.

Also I am even more a proponent of easy subscribe-unsubscribe model without long-term contract. There shouldn't be any 1-year contract or 2-year contract. The customer should be able to sign up anytime and cancel anytime without any penalty.

It is very unfair that the majority of my money has been lost throughout my life because I was charged for what I didn't ask for and what I was not supposed to be charged for.

I have lived both in a country with excellent customer support services and in countries/regions with customer support personnels doing whatever they feel like based on their emotion. I hope that the more web based approach would make this cultural difference irrelevant.