Saturday, January 29, 2011

Next NetBeans is decided to omit RoR Support

NetBeans community decides to omit Ruby on Rails Support, unfortunately.

But, NetBeans community will continues only the support for ruby-lang.

Now is the time to switch my ruby IDE to redcar?

Thursday, January 27, 2011

LibreOffice repositories for openSUSE

A few days ago, LibreOffice 3.3.0 final has been released. And this release is equivalent with LibreOffice 3.3.0 RC4. openSUSE is already preparing LibreOffice repositories.

For instance, the repository of openSUSE 11.3 is here:
(Update on 2011/02/05)

Monday, January 24, 2011

"sqlite3-ruby" had been renamed to "sqlite3"

The library name "sqlite3-ruby" had been renamed to "sqlite3". We should replace from "sqlite3-ruby" to "sqlite3" on our own RubyGems.

If your platform is MinGW(Windows) like this enrty, please check below:
> gem uninstall sqlite3-ruby
> gem install sqlite3 --platform=ruby -- --with-sqlite3-dir=C:/sqlite3

Friday, January 21, 2011

Studying F# : Map

I wrote this post : phosphorescence: Studying F# : Dictionary (a.k.a. Hash or Map). But it is incorrect. Map is there! Map must be created by using List, Tuple and the function Map.ofList.

Microsoft (R) F# 2.0 Interactive build
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> let map_1 = Map.ofList[ (1, "one"); (2, "two"); (3, "three"); (4, "four") ];;

val map_1 : Map<int,string> =
  map [(1, "one"); (2, "two"); (3, "three"); (4, "four")]

Tuesday, January 18, 2011

Install F# PowerPack on Mac OS X

Operation below is obsolete. Please check phosphorescence: Easier way to install F# PowerPack both on Mac OS X and on Linux.

F# PowerPack is additional libraries for F#. If you are using F# on Windows, you just download and install with .msi installer. But if you are using F# on Mac OS X, let's check these instructions after phosphorescence: Install F# on Mac OS X:

Saturday, January 15, 2011

Studying F# : Sequence

F#'s Sequence (seq{ }) instantiates "The way to generate sequential values", not sequential values themselves. The corresponding paradigm in Ruby 1.9 can be implemented with Enumerator. Let's check each codes.

In F#

open System
let oneUptoTen = seq {
    for i = 1 to 10 do
        Console.WriteLine("{0} is generated", i)
        yield i
let oneUptoTenEnum = oneUptoTen.GetEnumerator()
while oneUptoTenEnum.MoveNext() do

In Ruby 1.9

one_upto_ten = proc { |yielder|
  1.upto(10) do |i|
    puts "#{i} is generated"
    yielder << i
one_upto_ten_enum =
loop do

Outputs are below:
1 is generated
2 is generated
3 is generated
4 is generated
5 is generated
6 is generated
7 is generated
8 is generated
9 is generated
10 is generated

Thursday, January 13, 2011

JRuby for Windows users or for Non-western languages

Three days ago, JRuby 1.6.0 RC1 has been released. IMHO, this release means "JRuby for the rest of the OSS-develop world". Where is the rest of the OSS-develop world? It's in two areas.
  • Windows users
  • Non-western languages

Monday, January 10, 2011

F#'s Option nearly equals with C#'s Nullable types

If you have a experience writing Java programs, you would have thought that you want to put null value into primitive variables, at least once. In C#, you can do it with "Nullable types":

// bool
bool? nb = true; // you can set true,
nb = false; // false,
nb = null; // and null

// int
int? ni; // You can set zero,
ni = -1; // non-zero,
ni = null; // and null

In F#, the language on the .NET, You can also deal with same paradigm as "Option".

$ fsharpi

Microsoft (R) F# 2.0 Interactive build
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> let nothing : string option = None;;

val nothing : string option = None

> let something : string option = Some "Hello World";;

val something : string option = Some "Hello World"

> let puts str = System.Console.WriteLine(str.ToString());;

val puts : 'a -> unit

> Option.iter puts something;;
Hello World
val it : unit = ()
> Option.iter puts nothing;;  
val it : unit = ()

Saturday, January 8, 2011

Ruby 1.9.2 p136 was released

In 2010/12/25, Ruby 1.9.2 p136 was released. So I download from here, and re-install it like this entry. Let's check.
> /opt/ruby-1.9.1/bin/ruby --version
ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux]

But, You should not upgrade RubyGems from this version (1.3.7) to upper version (1.4.0, 1.4.1, 1.4.2 and so forth) because of these reasons (reason 1, reason 2).