Archive for March, 2007

h1

Why Ruby Matters ?

March 22, 2007

Last week Alexis was wondering about Haskell becoming the future of Rubyists. Reginald Braithwaite, one of the ex-JProbe suite leader, re-read Why Functional Programming matters ? from John Hugues. Although this paper is 23 years old, it is still up-to-date, and the functional paradigms it describes are still applicable. Reginald found out that there were insights that apply to programming language in general :

In a very real sense, the design of a programming language is a strong expression of the opinions of the designer about good programs. When I first read WhyFP, I thought the author was expressing an opinion about the design of good programming languages. Whereas on the second reading, I realized he was expressing an opinion about the design of good programs.

Then Reginald defines what makes a language better or more powerful.

Any feature (or removal of an [harmful] feature) which makes the programs written in the language better makes the language better.

Making an analogy with Mathematics, Reginald compares factoring with the the act of dividing a program into smaller part. The process of breaking a program into distinct features overlapping as little as possible in functionalities is called Separate of Concern (SoC). Programs that separate their concern are well factored. From this fact, Reginald defines the power of programming language :

One thing that makes a programming language “more powerful” in my opinion is the provision of more ways to factor programs. Or if you prefer, more axes of composition. The more different ways you can compose programs out of subprograms, the more powerful a language is.

Structured programming is a way to promote this.

Reginald illustrates his talk with Ruby examples where you can clearly distinguish the separation of concern between the how and the what.

In the end even if Ruby cannot be called a pure functional language, Reginald showed us notably Why… Ruby Matters.

Advertisements
h1

ScreenCast on Linux

March 17, 2007

I needed to do some screencast on my PC. After reading around the net I found vnc2swf and Istanbul. I decided to give a try first to Istanbul as it had a deb package ready. I am a bit reluctant to installing gnome based software and their lib on my KDE but well…
So well, the usual :
sudo apt-get install istanbul
But at launch I would end with :
Traceback (most recent call last):
File "/usr/bin/istanbul", line 30, in ?
from istanbul.main import main
File "/var/lib/python-support/python2.4/istanbul/main/main.py", line 33, in ?
from istanbul.main.gconf_client import GConfClient
File "/var/lib/python-support/python2.4/istanbul/main/gconf_client.py", line 19, in ?
import gconf
ImportError: No module named gconf

I read that it was fixed with later version of Istanbul, So I went to install the new version. But first you’ll need newer libxml2 library aswell (here link for amd64) :
wget http://http.us.debian.org/debian/pool/main/libx/libxml2/libxml2_2.6.27.dfsg-1_amd64.deb
sudo dpkg -i libxml2_2.6.27.dfsg-1_amd64.deb

wget http://http.us.debian.org/debian/pool/main/i/istanbul/istanbul_0.2.1-3_amd64.deb
sudo dpkg -i istanbul_0.2.1-3_amd64.deb

Later if a software require older version of libxml2, you can overwrite the newer you installed with the previous ubuntu version, istanbul should continue to work correctly.
You’re done, you can launch and record through the icon in tray bar.

It’s really easy to use but the output is only OGG Theora and unfortunately web browsers don’t all handle that format.

That’s why I switched to vnc2swf which produces directly flash format.
Couldn’t be easier to install, you need a vnc server, ie :
sudo apt-get install x11vnc
Then install vnc2swf. I installed pyvnc2swf as it’s the one under development and maintained contrary to the C older version.
sudo apt-get install python-tk
sudo apt-get install python-pygame
wget http://www.unixuser.org/~euske/vnc2swf/pyvnc2swf-0.9.1.tar.gz
tar xzvf pyvnc2swf-0.9.1.tar.gz
cd pyvnc2swf-0.9.1/

Now you can launch vnc server :
x11vnc -localhost -viewonly -wait 10 -defer 10 &
And you can launch vnc2swf :
python vnc2swf.py
You might land on this message :
open /dev/sequencer: No such file or directory
You should install kernel module : kernel/sound/pci/emu10k1 as stated here.

h1

Upgrading to Beryl 0.2.0

March 17, 2007

Beryl 0.2.0 is out with many cool features and fixes :

    New Plugins :

  • Thumbnail: Thumbnails on the taskbar (window list) which show a mini view of the actual window
  • Snap: Allows windows to “snap” to each other, or provide edge resistance
  • Opacify: Makes windows behind the active window transparent
  • Group: Allows windows to be group, to easily switch between a set of windows
    New system requirements check :

  • The improved check has much better accuracy
  • The check is a lot faster
    New Window Decorators :

  • Since 0.1, we have two new window decorators
  • Heliodor: Uses metacity themes
  • Aquamarine: Uses Kwin themes.
    Newly Rewritten Beryl-Settings :

  • Written in Python
  • More user-friendly UI
  • Better profile support
    New Translations :

  • Thanks to all of our foreign speaking users, we’ve had a much better time getting translations

Now how to upgrade your version (mine used to be 0.1.4) on your kubuntu edgy ?
Edit your /etc/apt/sources.list and add the following lines :
deb http://ubuntu.beryl-project.org edgy main
deb-src http://ubuntu.beryl-project.org edgy main

Update the list :
sudo apt-get update
And upgrade the following packages :
sudo apt-get install beryl
sudo apt-get install beryl-core
sudo apt-get install beryl-manager
sudo apt-get install beryl-plugins
sudo apt-get install beryl-plugins-data
sudo apt-get install beryl-settings
sudo apt-get install emerald
sudo apt-get install emerald-themes
sudo apt-get install libberylsettings0
sudo apt-get install libberylsettings-dev
sudo apt-get install libemeraldengine0
sudo apt-get install libemeraldengine-dev

Reboot and enjoy!