Skip to main content

Posts

Showing posts from September, 2009

Scala and idioms

From the article : Is Scala really more complicated than Java? The same program can be written in Scala with different idioms:

Easy way:
val name = "Dick Wall"
println("""
Happy Birthday to you
Happy Birthday to you
Happy Birthday dear """ + name + """
Happy Birthday do you
""")

Procedural:
for (n <- 1 to 4) {
print("Happy Birthday")
if (n == 3)
print(" dear XXX")
else
print(" to you")
println
}


Mixed:
(1 to 4).map {
i => "Happy Birthday %s".format(if (i == 3) "Dear XXX" else "To You")
}.foreach println

Functional:
(List.make(4, "Happy birthday ")
zip (List.tabulate(4, {
case 2 => "dear friend"
case _ => "to you"}))
) map (Function.tupled(_+_)) mkString ("\n")

More freedom ? hope Scala will avoid to be like Perl ! Not everybody will be able to maintain a Scala program. But that…

Nice way to describe Kerberos: a Dialogue in Four Scenes

As I needed to refresh my knowledge about Kerberos, I found a nice theater-like Dialogue in Four Scenes. Kerberos is really complex and hard to follow. It is revealing that its authors found theater more efficient than traditional technical docs and schema to explain their ideas.
It remember me of the comics used by Google to describe Chrome. Only it was done in 1988 !!
Also the best theater reference for me is always Ralph K├Ânig's Lysistrata, his prologue really strikes me.

MDSD: UML or DSL ?

This blog is a lot about Linux, because I use it as a reminder. I want to remember how I solved some problems or some great applications or short cut.
But it doesn't reflect my main interest that is development, design and creation. My Google Reader Shared post gives a better view of this part.
Also how I shifted my interest from Semantic web to Model Driven Development and DSL.
So I will just notice that I didn't realize how UML and DSL can be antagonist.

Sound and iPod with Awesome Windows Manager

Just a short note about the great Awesome window manager.
There was no sound with some applications. There are 2 programs to know about sound control : alsamixer (command line) and pavucontrol (manage PulseAudio with a simple GTK interface).

For the iPod, I am using RockBox, gtkPod and gpodder. Nothing fancy, but it does the job quickly.

Just have to remember to manually mount the iPod, by adding this in /etc/fstab:
/dev/disk/by-label/IPOD /media/IPOD vfat defaults,umask=000,auto,rw,user 0 0

Also a simple trick to eject the iPod : eject /media/IPOD