Saturday, November 7, 2009

Schedule of RubyKaigi2010 is unveiled.

Today is NOT April fool. In fact, both schedule and venue of RubyKaigi2010 are now unveiled.

RubyKaigi2010
Schedule: Augast 27 ~ 29, 2010
Venue:

Thursday, November 5, 2009

Qt is ready for mobile OS

From Qt 4.6, Symbian and Maemo are supported.
Nokia announces official Qt port to Maemo 5
Nokia releases Qt 4.6 and Qt Creator 1.3 betas, including support for Symbian

And, from Qt 4.7 (still planned!), Windows Mobile 6.5 will be full-supported.
Windows Mobile 6.5 support

Monday, November 2, 2009

Ruby initialize puzzle (more exercises)

(continued from phosphorescence: Ruby initialize puzzle (answer part))

If you want to call both initialize methods, you should write initialize method of Bar module like below:
module Bar
  def initialize(b)
    super
    puts "#{b} World"
  end
end

irb(main):018:0> Sample.new('qux')
Hello qux
qux World
=> #<Sample:0x256e918>

Saturday, October 31, 2009

Ruby initialize puzzle (answer part)

(continued from phosphorescence: Ruby initialize puzzle (question part))

The answer is:
irb(main):017:0> Sample.new('qux')
qux World
=> #<Sample:0x246f508>

The Ruby method super doesn't mean calling same method of super class, it means calling same method defined in last class.

For example, if same method is defined in super class only, it behaves to rewrite super class's one. But if same method is defined in included module like as this question, it behaves to rewrite included module's one because it's last defined method.

Thursday, October 29, 2009

Ruby initialize puzzle (question part)

There are classes and module like below:
class Foo
  def initialize(a)
    puts "Hello #{a}"
  end
end
module Bar
  def initialize(b)
    puts "#{b} World"
  end
end
class Sample < Foo
  include Bar
  def initialize(c)
    super
  end
end

When you call Sample.new('qux'), what standard output will you see?