Saturday, October 30, 2010

Studying F# : Currying

In this article, there is a sample about the finction having more than one parameter:
val sum : int = 8

> printf "%d" sum;;
8val it : unit = ()

And now, we want to do Currying for this function. How should we do?

Thursday, October 28, 2010

Studying F# : Difference of List, Array and Tuple

Now I'm studying about F#. And I learned the difference of List, Array and Tuple.

List

A list in F# is an ordered, immutable series of elements of the same type.
Each elements are separated by semicolons.
> let integer_list = [1; 2; 3];;

val integer_list : int list = [1; 2; 3]

> let string_list = ["a"; "b"; "c"];;

val string_list : string list = ["a"; "b"; "c"]

Monday, October 25, 2010

IronRuby 1.1.1 is released

A few days ago, IronRuby 1.1.1 has been released. It is the first release compatible with Ruby 1.9.2. And now, non-English languages are recognized almost correctly.

Friday, October 22, 2010

If you want to use Mono 2.8 on openSUSE 11.3 immediately...

In default Mono repository for openSUSE 11.3 (http://download.opensuse.org/repositories/Mono/openSUSE_11.3/), there are packages of version 2.6, not 2.8. If you want to use Mono 2.8 on openSUSE 11.3 immediately, use the repository below:

http://ftp.novell.com/pub/mono/download-stable/openSUSE_11.3/

Tuesday, October 19, 2010

F# TIMTOWTDI : fibonacci

1st step

let defines function, and let rec defines recursive function.
> let rec fibonacci n = if n=0 then 0 elif n=1 then 1 else fibonacci(n-2) + fibonacci(n-1);;
> for i in [0..10] do
-     let fibn = fibonacci i
-     printfn "%d" fibn
- done;;
0
1
1
2
3
5
8
13
21
34
55
val it : unit = ()

Saturday, October 16, 2010

Install F# on Mac OS X

This article is for Mono 2.8.x and older. Mono 2.10.x and newer contain F# out-of-the-box.
Since Mono 3.0.2, Our Mac can run F# 3.0. Please check F# 3.0 on Mac

F# is an object-oriented functional language by Microsoft. It's based on C#. I try to explain what technologies of Java-lang are corresponding to:
execution environmentobject-oriented languageobject-oriented functional language
Java technologiesJVMJavaScala
.NET technologiesCLRC#F#

And F# is also available on Mono, not only .NET . Let's install F# on Mac OS X from scratch!

Thursday, October 14, 2010

memcached for Windows had been expired

Until few days before, Memcached binaries for Windows were in http://labs.northscale.com/memcached-packages/. But now, no more in there because Northscale has moved to Membase and Membase.org since 4 days ago. And, if we still use memcached on Windows, we should to install Membase Server Enterprise Edition or Membase Community Edition. memcached is included in there.

For instance, I try to install Membase Community Edition on my Windows. This product has administration web pages like below:

Monday, October 11, 2010

Qt 4.7 for openSUSE is available

Qt 4.7 for each openSUSE versions is available. For instance, the repository of Qt 4.7 for openSUSE 11.3 is below:
http://download.opensuse.org/repositories/KDE:/Qt47/openSUSE_11.3/

Install with Yast2, restart and launch QtCreator 2.0.1 for running QML sample application.

Friday, October 8, 2010

I've finished reading "Metaprogramming Ruby"

I've finished reading Metaprogramming Ruby. This book is great book for:
  • What metaprogramming is in Ruby
  • Why do we do metaprogramming with Ruby
  • How do we do metaprogramming by Ruby

But not only that, this is also great book for leaning what safe level is in Ruby. There are simple and lucid examples for leaning safe level. And, this book have taught me about nested irb.
irb(main):001:0> s = 'hello world'
=> "hello world"
irb(main):002:0> irb s
irb#1(hello world):001:0> upcase
=> "HELLO WORLD"
irb#1(hello world):002:0> exit
=> #<IRB::Irb: @context=#<IRB::Context:0x00000100849a30>, @signal_status=:IN_EVAL, @scanner=#<RubyLex:0x000001008454f8>>
irb(main):003:0> exit
I did not know at all until reading this book.

Tuesday, October 5, 2010

Install RMagick on MinGW and MSYS

Currently, Windows Rubyist is installing RMagick from here. But there are 3 problems.
  1. Not latest RMagick version
  2. Not latest Ruby version
  3. Not latest bundled ImageMagick

But we are already having Ruby Devkit (MinGW). So let's get latest RMagick on Windows.

Saturday, October 2, 2010

Testing ActiceRecord-JDBC with DB2 on Mac OS X

(continued from phosphorescence: Install DB2 on Mac OS X)

I helped to testing ActiveRecord-JDBC with DB2 on my Macmini. But there are two big traps. In this article, I write about the second trap : Testing ActiceRecord-JDBC with DB2 on Mac OS X.

Clone sources and tests from repository

$ git clone http://github.com/nicksieger/activerecord-jdbc-adapter.git