Wednesday, April 2, 2008

Adding a type sysm to Ruby

An interesting post on adding a type system to ruby.
http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby

Wednesday, March 12, 2008

My groups on Scoodi.com

Just found this new feature on www.scoodi.com where I can create a link to the items I'm selling/giving away on scoodi. All I need to do is follow the steps on the my groups page which you can get to from the quick links box. Here are my items on scoodi. A nice little addition to the scoodi site.

Just as an extra I think it would be nice to be able to embed your items into another website as well, like how youtube does it. As an example with the following embed code from youtube can see a video from without the whole youtube site.

<object height=\"355\" width=\"425\"><param name=\"movie\" value=\"http://www.youtube.com/v/_Cael8grlw8&amp;hl=en\"><param name=\"wmode\" value=\"transparent\"><embed src=\"http://www.youtube.com/v/_Cael8grlw8&amp;hl=en\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" height=\"355\" width=\"425\"></embed></object>


Sunday, January 27, 2008

Lift (scala web framework) vs Ruby on Rails

I found this little comparison between the scala lift framework and ruby on rails quite interesting. The points that stood out were that using lift was a using far less CPU usage than rails and that the defects in scala were far less. I would expect scala to have mush less defects due to the type safety but it is good to see a real world comparison.

Though I do wonder how much longer it took him to write the scala code over the ruby code.

Good Post for Explaining the Java Hashtable

My brain had seemed to have forgotten the underlying details of a hashtable. So I went out looking for an article that could explain how the java hashtable works and how it links to hashcode() method. I found this nice article that explained what I need quite nicely - link.

Saturday, January 26, 2008

My Toowong unit renovation Photos

Here is a link to my unit renovation photos that I have been renovating since may 2007. I hope to get it finished well actually I will get it finished my may 14 th so I can go and renovate my girlfriends unit.

Tuesday, January 22, 2008

Configure window placement in Ubuntu

I have been trying to figure out how to configure my start up applications to display in a certain workspace. The following thread shows how to do this with a tool called Devilspie
http://ubuntuforums.org/showthread.php?t=75749t

I'll be playing with this during the week and I'll blog how easy/hard it was to use.

Monday, January 21, 2008

Scala exercises

Though I would post up some of the exercises I have been working on to help me understand functional programming in Scala. These exercies were given to me by tony Morris to help me get my head around function programing.

1. Create a flat map using a foldRight
solution:
def myFlatMap[I, J](l : List[I], f: I => List[J] ) : List[J] = {
l.foldRight(Nil : List[J])((a,b) => (f(a) ::: b ) )
}

2. Create concatenation for a cons list (:::) using a foldRight
solution:
def append[X](xs: List[X], ys: List[X]): List[X] = {
xs.foldRight(ys)(_ :: _)
}

3. Create concatenation using matcher and recursion
solution:
def append2[X](xs: List[X], ys: List[X]): List[X] = xs match {
case Nil => ys
case x :: xs => {
x :: append2(xs, ys)
}
}

4. Find the max int in a list
solution :
def getMaxInt(xs : List[int]) : int = xs match {
case Nil => error("error")
case x :: xs =>
xs.foldLeft(x)((b,a) => if ( a > b) a else b )
}