Friday, December 26, 2008

Nokia 6630 and Internet Connection in Linux

Finally, I managed to connect to the Internet with my Nokia 6630 in Linux Kubuntu; it's not that I had troubles before: it's just that I had never had to connect with the cellphone, and I must admit that I quite appreciated that it was really easy and straightforward to this :-)

Actually, first I had tried with the bluetooth way and thanks to many documentation found on the web, I succeeded, though the procedure might not be trivial. However, in that case, I noticed that the connection was not reliable and not very fast. So I decided to buy a (quite expensive for what it does) USB cable (it's just a usb cable... why does it cost 20 euros?!).

Well, with USB the procedure is even more trivial: you just connect it and you'll see that dmesg happily reports this:

[ 149.162045] usb 3-2: new full speed USB device using uhci_hcd and address 2
[ 149.207194] usb 3-2: configuration #1 chosen from 1 choice
[ 149.461122] cdc_acm 3-2:1.8: ttyACM0: USB ACM device
[ 149.463589] usbcore: registered new interface driver cdc_acm
[ 149.463594] /build/buildd/linux-2.6.24/drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control Model driver for USB modems and ISDN adapters
Isn't it nice? It correctly detects the modem and creates a device for it!
ll /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 2008-12-24 17:28 /dev/ttyACM0
So you'll just have to configure your dialup tool using that specific modem. In particular I use kppp, and I have a TIM connection, so I created a new modem using /dev/ttyACM0 and setting as INIT 2 string the following one:
and as for the telephone number *99# (username and password are not used, so you can use dummy ones). Here are some screenshots:

And then you're online! Not as fast as an ADSL... but still faster than an old serial modem ;-)

Monday, December 22, 2008

PhpBibliography 0.6

The new release of PhpBibliography is out!

First of all, this release fixes a very bad bug, discovered by Ezio Bartocci: in the merge authors procedure, the system did not check whether the two authors were exactly the same (i.e., the same id), and this used to lead to the removal of the author as the final step of the procedure, which was really bad. This is now fixed in this new release.

Concerning new functionalities:

  • a procedure for trying to detect duplicate papers is now available (it can also use the SOUNDEX algorithm); this will present possible duplicate papers, and let the user select those that are actually duplicate ones;
  • as for the main page, it is now possible to group papers also according to the years (an example can be found at my home page);
  • by default, papers are ordered by descending year, so that the most recent papers are shown first (this should be the most common wanted behavior);
  • a modification timestamp is automatically added to papers, and this timestamp is used as a sorting criterion when showing papers (the papers most recently modified are shown first)
  • another desirable feature is now available: when listing papers in administration mode (i.e., when you're logged), a direct edit/delete link is always shown;
  • each paper can be now marked as private, meaning that that specific paper will be shown only to logged users;
  • as for the DBLP import procedure, this was improved: when there is a cross reference (typically concerning the proceeding book where the paper was published), which is separate from the paper's own bibitem, the system will merge the two bibitems, so that the resulting inserted paper will contain all the information.
Finally, in the previous release 0.5 announcement, I forgot to mention that phpbibliography makes use of AJAX technology to perform some checks during the insertion/modification of a paper through the HTML form; in particular, it shows some warning messages for possible duplicate fields (e.g., title, bibtex key, etc.) and error messages when the type of the field is not correct (e.g., non numeric years). These messages are shown right under the field, upon leaving that field, as shown in the following screenshots:

The user specifies a non-numeric year

and the system checks it as soon as it leaves that field.

The same holds for instance for the title, but this time it's just a warning (since you can have two papers with the same title, e.g., one can be an extended version):

Saturday, November 15, 2008

GNU Source-Highlight 2.11

Here's the new release of GNU Source-Highlight.

From the low level point of view, the algorithm for finding the best matching regular expression was optimized; The strategy used by source-highlight is to select the first matching rule

  • with empty prefix (or prefix containing only space characters, i.e., spaces or tabs) or
  • with the smallest prefix.
Thus, it does not inspect all the possible expressions, but it stops as soon as it finds one that satisfies the above conditions.

As for end-user stuff, in C++ and Java, types used in variable and parameter definitions are now highlighted, see the example below.

This is a classical Hello program
to test source-highlight with Java programs.

to have an html translation type

source-highlight -s java -f html --input --output Hello.html

source-highlight -s java -f html < > Hello.html

or type source-highlight --help for the list of options

written by
Lorenzo Bettini

package hello;

import* ;

* <p>
* A simple Hello World class, used to demonstrate some
* features of Java source highlighting.
* </p>

* TODO: nothing, just to show an highlighted TODO or FIXME
* @author Lorenzo Bettini

* @version 2.0
public class Hello {

int foo = 1998 ;
int hex_foo = 0xCAFEBABE;

boolean b = false;
Integer i = null ;

char c = '\'', d = 'n', e = '\\' ;

String xml = "<tag attr=\"value\">&auml;</tag>", foo2 = "\\" ;

public static void main( String args[] ) {

// just some greetings ;-) /*
System.out.println( "Hello from java2html :-)" ) ;

System.out.println( "\tby Lorenzo Bettini" ) ;
System.out.println( "\t" ) ;

if (argc > 0)
String param = argc[0];

//System.out.println( "bye bye... :-D" ) ; // see you soon

Probably the main novelty is the possibility of specifying a line range, or multiple line ranges: only the lines in the input source that are in that range are actually in the output (--line-range). It is also possible to specify the sorrounding "context", i.e., the number of lines not in range that are put in the output anyway (--range-context); the context itself can be formatted with its own style. Finally, a range separator string can be specified, e.g., "..." (--range-separator). For instance, the following command
source-highlight -s java -f html
--line-range="12-18","29-34" --line-number
--range-context=3 --range-separator="<...>"
-i -o test_linerange_sep.html
generates the following output (note the gray lines of context)

00010: or type source-highlight --help for the list of options
00012: written by
00013: Lorenzo Bettini
00016: */
00018: package hello;
00020: import* ;
00026: * </p>
00027: * TODO: nothing, just to show an highlighted TODO or FIXME
00028: *
00029: * @author Lorenzo Bettini
00030: * @version 2.0
00031: */
00032: public class Hello {
00033: int foo = 1998 ;
00034: int hex_foo = 0xCAFEBABE;
00035: boolean b = false;
00036: Integer i = null ;
00037: char c = '\'', d = 'n', e = '\\' ;

Tiziano Muller wrote a configuration file for bash_completion, for source-highlight (thank you Tiziano).

Finally, two new language definitions were added: one for xorg configuration files, and one for the Scala programming language (thanks to Dean Wampler), here are some examples:

Xorg file

# xorg.conf (xorg X Window System server configuration file)
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
Section "Files"
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "SHMConfig" "on"
Option "HorizEdgeScroll" "0"
Option "MinSpeed" "0.5" # touchpad speed when moving slowly
Option "MaxSpeed" "2.0" # touchpad speed when moving fast
Option "AccelFactor" "0.10"
Option "CircularScrolling" "on"
Option "EdgeMotionMinSpeed" "0.5"
Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/input/wacom"
Option "Type" "stylus"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
Section "Device"
Identifier "Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller"
Driver "intel"
BusID "PCI:0:2:0"
# Option "NoDRI"
Section "Screen"
Identifier "Default Screen"
Device "Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Modes "1440x900"
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
# Uncomment if you have a wacom tablet
# InputDevice "stylus" "SendCoreEvents"
# InputDevice "cursor" "SendCoreEvents"
# InputDevice "eraser" "SendCoreEvents"
InputDevice "Synaptics Touchpad"

Scala language

// Example Scala file for source-highlight.
case class Point(x: Double, y: Double)
abstract case class Shape { def draw(): Unit = println(this) }
case class Circle(center: Point, radius: Double) extends Shape
case class Rectangle(lowerLeft: Point, height: Double, width: Double) extends Shape
import scala.actors._
import scala.actors.Actor._
object ShapeDrawer extends Actor {
def act() {
loop {
receive {
case s: Shape => s.draw()
case "exit" => { println("exiting..."); exit }
case x: Any => println("Error: Unknown message! " + x)
ShapeDrawer ! Circle(Point(0.0,0.0), 1.0)
ShapeDrawer ! Rectangle(Point(0.0,0.0), 2, 5)
ShapeDrawer ! 3.14159
ShapeDrawer ! "exit"
// Output:
// => Circle(Point(0.0,0.0),1.0)
// => Rectangle(Point(0.0,0.0),2.0,5.0)
// => Error: Unknown message! 3.14159
// => exiting...

Thursday, October 30, 2008

Share your bookmarks with Foxmarks

I fell in love with foxmarks as soon as I started using it, as I had already said in this blog :-)

It looks like lately they've added some new cool features, in particular, what stroke me most was the possibility of sharing only specific folders of your bookmarks (actually, I've just discovered this feature, but it might have been around for some time now...)

If you go to your bookmarks in the foxmarks site, you can see the "Share" menu, and after you selected a specific folder you can share it (including subfolders):

Then you can provide your friend with the public link to see that specific bookmark folder (which, of course, will be kept up to date when you modify the bookmarks in that folder), and also an RSS link!

They also provide you with html or javascript code that you can add to your site or blog to show a nice widget with some of those bookmarks!

Isn't it nice? I find this feature delici... ehm... really amazing ;-)

Wednesday, October 29, 2008

Svn problems in Sabayon with https

On the new Sabayon installation (I guess the problem is in Gentoo too, though), I'm getting errors when accessing to an https repository which does not have a valid certificate (of course I trust that site):

svn checkout https://xxx svn: OPTIONS of 'https://xxx': SSL negotiation failed: SSL error: Key usage violation in certificate has been detected. (https://xxx)

I found this post on ubuntu forums which seems to be related to this very same problem: the neon library, which svn uses to access https sites, uses GNU TLS which does not like this kind of certificates (that's may be fine, but at least, I should give the possibility of choosing, shouldn't I?).

In Sabayon it's pretty easy to solve this problem because you can use emerge and use flags to rebuild the binaries as you wish :-)

In particular, you need to rebuild the neon package disabling the gnutls use option. I did this by changing (or adding) in /etc/portage/package.use this line:

net-misc/neon -gnutls

and then I emerged neon and subversion packages.

Hope this helps :-)

Sunday, October 26, 2008

Linux Mint

I happened to try the live version of this ubuntu-derived Linux distribution, on my laptop, a Dell D630: Linux Mint. I was quite impressed: the aspect is really elegant e beautiful, in a word, mint :-)

The main menu seems to be based on KDE 4, but I think it's better organized.

Then I tried to enable those cool compiz effects, and that's what you get :-)

Probably I'll go on with the installation in the future.
Posted by Picasa

Monday, October 20, 2008

KWin is not restored after removing Compiz

I tried Compiz on a desktop computer, but this made the system pretty slow, so I removed it with synaptic... after a restart, all the windows of the KDE desktop were shown without a frame (thus it was pretty useless). This seems to be a known bug in (k)ubuntu, but the solution

sudo aptitude reinstall kwin
did not work for me (all the windows were still frameless).

The only solution that worked for me was also to remove all the compiz configuration files in my home:
find ~/ -name "*compiz*" -exec rm -rf {} \;
hope this helps :-)

Friday, October 17, 2008

CVS, Eclipse and Sabayon

When I started to play with Sabayon I started to struggle with a problem using Eclipse and CVS (on a local repository).

I kept on getting this error (using extssh):

Problems reported while synchronizing CVS Workspace. 0 of 1 resources  were synchronized.
Unknown response received from cvs server:
On many parts on the web I had read that this is usually due to a "misbehaving" cvs client, typically under windows, or a misbehaving ssh client (again under windows), but since I'm using Linux...

Well, it turns out that the cvs binary that is shipped with Sabayon is not compiled with the --enable-server flag, which is the default for cvs program. Installing cvs using emerge does not solve the problem, because, again, that flag is not enabled by default.

Thus, you need to enable it, adding the line
dev-util/cvs server
to the file /etc/portage/package.use. I've also opened a bug report; hope this saves some headaches to eclipse users :-)

Monday, October 13, 2008

Xerox Phaser 4510 in Linux

I had struggled in the past already with a Xerox Phaser 4500; now a new printer, a Xerox Phaser 4510 was brought at work and so I was already worried about its installation with cups, in kubuntu, since no driver is provided by default by cups.

However, this time was quite easy, since the Xerox site provides some new drivers that can be downloaded freely here.

You just need to untar the package and use the right .ppd file, and in my case it is xrx4510dt.ppd.

I installed this printer with the CUPS web interface (with the configuration procedure of KDE it failed to correctly set this printer, don't know why), and when you come to select the model you provide the above ppd file.

Everything then worked like a charm!

Monday, October 06, 2008

Optiplex 330 won't reboot in Linux

My new desktop at work is a Dell Optiplex 330, where Linux made its way from the very beginning. I started with my beloved Kubuntu, and then tried also Sabayon. With both distributions I soon noticed a boring bug: the computer does not reboot. After terminating the reboot operations the system just hangs and the computer does not reboot. Fortunately, this is a known bug for many computers, and the solution was quite easy: add the option reboot=b to the kernel line in the grub configuration list. This worked for me both for Kubuntu and Sabayon :-)

Friday, October 03, 2008

Texlive (Latex) in Sabayon

I'm experimenting with Sabayon Linux 3.5, and now I was trying to compile some of my papers, which of course are written in LaTeX; however I found no preinstalled binary for latex. Thus I tried to install, with equo, using the package latex-base, but again, no latex binary.

Thus, I emerged it. First, however, you need to unmerge tetex (the previous latex distribution). After that, it's just a matter of emerging texlive, and wait for some time (due to the compilation of many packages).

Sunday, September 21, 2008

Sabayon: please read the help!

I've just started using Sabayon Linux (besides Kubuntu) and I'll blog some impressions about that, but first of all, I had to blog this. The command line package manager, equo, seems to be watching you: I was trying to run the upgrade without reading the help, and... well, equo seems to have gotten angry:

localhost ~ # equo --upgrade --pretend
>> You didn't run equo --help, did you?
localhost ~ # equo -upgrade --pretend
>> Did you even read equo --help??
localhost ~ # equo upgrade --pretend
>> I give up. Run that equo --help !!!!!!!
localhost ~ # equo upgrade
>> OH MY GOD. RUN equo --heeeeeeeeeeeeeelp
localhost ~ # equo --upgrade
>> Illiteracy is a huge problem in this world
localhost ~ # equo --upgrade
>> Ok i give up, you are hopeless
localhost ~ # equo --upgrade
>> Go to hell.
localhost ~ # equo --upgrade
>> Go to hell.
That's really too funny! :-)

Well done developers, you guys really rock! :-)

Wednesday, August 27, 2008

MyIpTrack: keep track of the IP addresses you use

I've just released a new program, which is actually a php script to install on a web site.

MyIpTrack is a php script that allows you to store the IP addresses with which you connect to the Internet. It stores such information on a text file. The information stored are: the IP address, date and time and some notes.

This is pretty useful if you connect to the Internet with many different providers (wireless networks, Internet cafe, etc.) and you want to keep track of all the IPs you've used (and date and time). You can also fill some notes for each such record.

MyIpTrack only needs a web server with PHP; it does not use any database: it stores the information in a text file. The archive consists of a record per line (thus records are separated by newline characters), and fields are separated by a tab character:

IP TAB date TAB address TAB notes

How it works

The idea is that when you connect to the Internet, you visit the page where you put MyIpTrack; at this point you'll be presented a web form already filled with the IP, the date (and time) and the address corresponding to the IP you are currently using. Then you'll be able to add some notes (e.g., that help you remember for what you used that IP).

If you're using an IP that you've used before, MyIpTrack will show a table with all the dates you used that specific IP.

It also shows a table with all the IP addresses used in the past. See the screenshot below.


MyIpTrack is Open Source, under the GPL license.


After you downloaded the .zip file and extracted its contents, all you need to do is copy the contents of the directory html into a directory of your web server. Make sure to give full write access to the text file where the information will be stored: archive.txt.

MyIpTrack is not thought to be part of a public web site: its web page is considered to be used only by the user who installed it, so it should be put in a private web directory. However, MyIpTrack provides also a basic authentication mechanism based on a user name and a password, specified in the file config.php. Just leave the user name empty if you're not interested in the authentication. If you want to use authentication, change the user name and password.

Sunday, August 24, 2008

PhpBibliography 0.5: RSS & DBLP import

It is with great pleasure that I announce this new release of PhpBibliography!

First of all, I really need to thank Ezio Bartocci, a PhD candidate of University of Camerino, Complex System Research Group, who did a wonderful job in implementing the two new main features of this release: RSS and DBLP import.


Basically, every query page now also generates an RSS link that can be used to subscribe to that specific result as an RSS feed. Of course, that feed is dynamic, so each time your RSS reader will look for updates, the system will actually run the query again. This is pretty useful to generate an RSS feed for a specific author's papers.

For instance, this is the output of my papers, and you can see the RSS link on the right that can be used to subscribe to my papers feed. As soon as a new paper of mine is added to the system, the RSS reader will catch that. And this is the direct RSS feed.

DBLP paper import

The other cool feature that Ezio implemented is the possibility of importing papers directly from DBLP, the Computer Science Bibliography, using the bibtexs of this site.

This feature is still experimental and we will have to twickle it a little bit, but it seems to work for most of the cases.

You'll be asked to insert your name and surname. After you inserted the author's name and surname,

the DBLP site will be queried and all the author's found papers will be presented to the user; the system will already check which papers are similar
to those already present in the database; if a similar paper is found in the database that entry will not be automatically selected for the import (and will be highlighted in red); the other papers will be automatically selected for import.

The user will then be able to further select all the papers to import, and
press the import button (it is also possible to select all the papers or all the papers of a specific year). Note that the procedure might require some time. Finally, you'll be able to edit each single paper imported through this procedure.

Note that the bib items of DBLP might not produce such nice paper records in phpbibliography, especially when they cross reference other bib items (also shown as a result, but not inserted in the data base); you'll probably need to modify such imported papers using the additional information in the cross referenced bib item. We are working on how to solve this little issue.

Again, let me thank Ezio once again! Not only he did a great job, but it was also very funny to work with him through instant messaging :-)

Monday, August 18, 2008

Accessing Ipod with Linux: GtkPod

The first attempt to access my ipod with Linux didn't go very well: I was able to access it with amarok and to upload some files and playlists, only to find out that then the ipod did not see any songs and I had to restore it with itunes under windows.

Then, after upgrading my ubuntu distributions, since I heard that this problem was due to an old version of the libgpod library, I decided to try again, but this time with gtkpod.

The Ipod was soon found upon connection, and I had to set the right model:

Then I was able to access the songs, upload new songs, and delete other songs

Don't forget to save the changes before disconnecting the ipod, otherwise its internal database won't be saved.

Then all the songs were still in the ipod and I could play them.

However, there still seem to be some problems: after this operation, the cover gallery which automatically shows under the menu does not show anymore (you can see only the number of the songs). Thus, I assume that the database is not updated correctly... after a restore with itunes the gallery showed up again.

So, for the moment, I still can't access and modify songs on my ipod in satisfactory way under linux :-(

Monday, August 11, 2008

Konqueror does not connect to hosts

I usually use the computer with a permanent connection to the Internet, so I hadn't noticed this problem. But lately, since I'm using also my laptop off line I started to struggle with this problem: when I use konqueror to connect to a local site, I get this error:

An error occurred while loading http://localhost:
Could not connect to host http://localhost.
The problem occurs also when I'm connected through a 56k modem: I cannot simply connect to web hosts with konqueror.

Luckily, I found this post,, whose solution seems to work fine: just disable the cache (i.e., uncheck "Use cache"):

But this looks like a serious bug :-(

Monday, August 04, 2008

Accessing NTFS from Linux in write mode

As I said in my previous post, I switched to NTFS partition on my external USB driver, since I can now access NTFS partitions also in write mode thanks to NTFS-3G:

The cool thing is that I didn't have to modify any configuration file, thanks to ntfs-config,, a very cool GUI application that does all the job and changes your fstab file.

Try it, really cool! :-)

Wednesday, July 30, 2008

From FAT32 to NTFS

I have an external usb drive which I use for backup and since I need to access it from Windows and Linux I kept it as it was when I bought it, i.e., FAT32 file system. However, FAT32 is not the best file system around :-) and since I now can access NTFS from Linux too, I wanted to convert it to NTFS.

Luckily the Windows utility convert.exe seems to work pretty well since it performs the conversion without destroying your data!

All I had to do was to run this command (the external hard disk has letter H:):

Convert H: /FS:NTFS /V /NoSecurity

and insert the current label of the disk, and everything went fine :-)

Thursday, July 24, 2008

Gengetopt Eclipse 1.1.0

Here's the new version of the eclipse plugin for editing gengetopt files:

I've fixed a bug that did not make gengetopt editor share the standard text editor features such as line and column numbers and quick diffs.

Code completion is now improved and double quoted strings are automatically completed.

Furthermore I've implemented the formatting strategy so that the gengetopt file contents can be automatically formatted (probably this feature needs some more tweaking :-)

Furthermore, now a small help is available (basically it's the same content of the web page).

The next step should be the (background) parsing of the contents of the ggo file.

Thursday, July 17, 2008

GNU Source-Highlight 2.10

Here's the new release of GNU Source-Highlight.

From the architectural point of view, I completely re-written the engine that uses regular expression, since it is now oriented towards a library (I'll try to extract a library from source-highlight as soon as possible, in order to provide, e.g., highlighting functionalities to qt text editors without the need to implement the qt highlighter yourself).

Here's the complete list of changes:

Version 2.10

* formatting is applied even when generating anchors and references
* noref is handled also for output languages using onestyle (e.g., xhtml)
* improved fortran highlighting
* improved python highlighting
* fixed title in docbook output
* language definition for ldap files (e.g., ldiff files)
* language definition for autoconf files
* improved m4 language definition
* improved logtalk language definition
* url.lang handles ~ in urls
* language definition for glsl.lang (provided by Cesare Tirabassi)

There are some new languages that are highlighted, in the following you will see some examples:


dnl this is only for developers who use double dispatch
dnl doublecpp can be found at

dnl this is for testing purpose and development

dnl this is only for developers who use change command line options
AM_CONDITIONAL(NO_HELP2MAN, test -z "$ac_cv_path_HELP2MAN" )

dnl this is for generating references
AC_PATH_PROGS(CTAGS, ctags exuberant-ctags)
if test -n "$ac_cv_path_CTAGS"; then
AM_CONDITIONAL(NO_CTAGS, test "$ac_ctags_flags" = "no" )
AM_CONDITIONAL(NO_CTAGS, test -z "$ac_cv_path_CTAGS" )


# comment line

dn: cn=Foo Bar,
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: mozillaAbPersonAlpha
givenName: Foo
sn: Bar
cn: Foo Bar
mozillaNickname: albe
modifytimestamp: 0Z
my_odifytimestamp: 0Z


#version 120
#pragma optimize off
#pragma debug on

uniform vec4 vSkyParams;
varying ivec4 vpos, lpos;
varying bvec2 wave0, wave1, wave2;
const float lambda = 2.0;

void main(void)
// Texture coordinates generation
vec2 vTexCoords = gl_Vertex.xz*vSkyParams.z;

// Scale texture coordinates to get mix of low/high frequency details
wave0 = vTexCoords * lambda + vSkyParams.w * vec2( 0.5, 1.0 );

// Perspective corrected projection
gl_Position = ftransform();
vpos = gl_Vertex;
lpos = gl_LightSource[0].position;

// Compute normal (assumes this is a sphere)
vec3 norm = normalize(vpos).xyz;

//Compute sun light
vec4 sunlight = vec4(pow( max(0.0, dot(light,norm)), 1024.0 ));

// Get bump layers
vec3 vBumpTexA = texture2D(BumpMap, wave0).xyz;

//Add an horizon haze
float haze = pow(gl_FragCoord.z*(1.0-norm.y), 10.0);
skyColor = mix( grey, skyColor, haze );

gl_FragColor = skyColor + vSkyParams.x*sunlight;

Wednesday, July 16, 2008

Eclipse & CVS in Windows

As you might have guessed I'm a Linux fan, and I'm using it most of the time, especially when I program. I'm also a big eclipse lover! However, sometimes I happen to have to use windows for programming and there's no problem concerning eclipse, since it runs perfectly on windows. Eclipse also provides an excellent CVS integration, but concerning this point I've always found that it is a big lacking that you can only use remote CVS servers and not local repositories... Well, I know that CVS is thought for collaborative programming, but I'm using it also to store all the versions of programs I work on alone (and I know many others do like this). Of course, under Linux it's a not big problem, since you install a local ssh server. But in Windows I had always experienced problems...

I then decided to go back to WinCVS,, which I had been using for a long time before eclipse came. During the installation, I noted that it was installing also CVSNT, a server for CVS under Windows. My problems with trying to setup a CVS server under windows were probably due to the fact that I was trying to use the one with cygwin which required an involved procedure (which never worked for me).

Well, CVSNT seemed to have solved all my problems! First of all you need to configure your repositories. Note that you can give the repository a symbolic name. This is pretty cool since it allows me to use the same path as in Linux

Then I checked the option "Pretend to be a Unix server", since the help says that programs like eclipse require this.

At this point, everything already worked fine, and I could access my local repositories from eclipse using pserver protocol, and using the user/password of Windows.

However, for C++ programs using autotools, I kept on having problems since the autotools scripts failed due to the \r\n DOS lines that seemed to be introduced during checkout.

Fortunately, this is easily solvable by configuring eclipse, by disabling "Convert text files using platform line ending" as shown in the following screenshot:

After a brand new checkout, everything worked like magic! :-)

Sunday, July 13, 2008

Videos on Ipod

I finally got an Ipod classic! I was quite skeptical about this music player, but since the price went down, and the giga bytes up, I decided to get an Ipod classic 80 gb, and I'm really enjoying it. However, I cannot say the same about the way I can access it. For the moment, I couldn't access it with Linux (well, I actually accessed it with amarok, added new files, deleted some, changed playlists, only to find out that afterwards the Ipod did not see any music, and I had to restore it; I'll work on this anyway), so I had to resort to Itunes.

I'll talk about some problems about this probably next time. The real sad surprise was that I just couldn't add videos on the Ipod (not even on Itunes), since you need to convert it to the required format. Actually the documentation does not say much, but you need another program for the convertion (actually, I'm not talking about the stuff you might buy on Itunes store).

After the disappointment about the converter I found here, which basically does not work at all for me, since it crashes after taking quite a long time even for a simply video of about 10 minutes, I tried this other one (which is also free): Videora converter.

This program is actually really full of ads (it contains a browser), but it does what you need, and it's actually quite fast!

But watch out Italians: you will probably get a terrible 10000 error when you start the conversion. It looks like it does not like the way dates are expressed (dd/mm/yyyy), so you need to change your regional setting from the Control Panel, and set it to English (at least when you need to use this program).

After this everything works fine, and after the conversion, you'll be able to import the generated mov file into Itunes and/or into the Ipod.

By the way, videos on Ipod really rock! :-)

Eclipse Ganymede

I finally took the time to give a try to the new version of eclipse: 3.4, codename "Ganymede".

I've been using it only for a few days now, but I was really impressed :-)

It looks like it's a little bit faster in many operations (but this might be an impression).

But what I really appreciated now, is the new update mechanism. Although the previous update (and also install new features) procedure was not bad in the previous versions, it still required to select manually the mirrors if you wanted to make sure the get a fast one, or simply rely on its automatically mirror selection feature, which, however, never chose the right mirror, at least for me.

Moreover, you first had to wait that all the update sites to be contacted, or select only a few sites in advance; if something went wrong, you needed to start again.

Well, now once you select the software update menu, you have a single windows with two tabs; the first one shows the installed plugins (really useful to have it in this place) and possibly update them, and the second one for installing new ones.

Moreover, you can inspect each single update site and its provided features directly from this window (and no mirror selection is required):

Really really much much better now :-)

Eclipse rocks! :-)

Thursday, May 22, 2008

total and unread in Thunderbird

When thunderbird 2.0 came out, one of the things I soon noticed was that in the folder pane, only the number of unread messages was visible and there was no way to see also the number of total messages for each folder. That's one of the things I missed most...

Well, actually it's quite easy to have this feature back: you only need to enable "expanded columns in folder pane" in the "Advanced" tab preference, as shown in the following picture. Then, you'll be able to show also the "total" in the folder pane. Hope this helps :-)

Saturday, May 17, 2008

The elegance of C++

Yes, C++ is my favorite language; it's one of the first I learned (surely the first OO language I learned) and I kept using it through the years. Of course, for network applications I used Java, since I admit it's easier for that context; but when I can, I always go back to C++.

One of the things I like most is the STL library; it uses generic programming extensively with nice and elegant results; by the way, we're talking about true generic programming... not the one provided by Java, which is very little generic :-)

Last day I had to copy the elements of a list into a set, and I was about to write the classical for loop using iterators, especially for printing the results to the screen, and then I said to myself "what are you doing? You're not using Java! You're in C++ now, you can use generic algorithms!"

You can use the insert method of the class set that takes two generic iterators and you can use the copy algorithm to "copy" all the elements of iterators into the standard output (by using an ostream_iterator).

It surely is a matter of taste (and de gustibus non est disputandum), but I find the resulting code very very elegant... probably stl lacks some functionalities when it comes to for_each loops that need to invoke class methods with some parameters... but you can always rely on the fantastic boost libraries!

#include <set>
#include <list>
#include <iostream>
#include <algorithm>
#include <iterator>

using namespace std;

int main() {
list<int> mylist;
set<int> myset;



cout << "list: " << endl;
copy(mylist.begin(), mylist.end(), ostream_iterator<int>(cout, "\n"));

cout << "set: " << endl;
copy(myset.begin(), myset.end(), ostream_iterator<int>(cout, "\n"));

myset.insert(mylist.begin(), mylist.end());

cout << "set after insertion: " << endl;
copy(myset.begin(), myset.end(), ostream_iterator<int>(cout, "\n"));

return 0;

Saturday, May 03, 2008

Konqueror instead of Dolphin

I've always loved KDE, but the latest file manager introduced with KDE 4, i.e., Dolphin... well... I just can't stand it. I prefer using Konqueror, the powerful Konqueror. However, after an upgrade of the system, although I was using Konqueror, when clicking on a folder it was using Dolphin to open it... really bad.

Fortunately, it was (relatively) easy to revert to the old behavior, and in particular, to set Konqueror as the default application for folders!

You need to run KControl (kcontrol from the command line) and then choose "File Associations" under "KDE Components", then select "inode" and "directory". Here, you only need to move up Konqueror in the list "Application Preference Order". Hope this helps.

Sunday, April 20, 2008

Ten Years After

On 18th April 1998 I got my master degree in Computer Science summa cum laude (Laurea in Informatica) at Dipartimento di Sistemi e Informatica, Universita' di Firenze... so... 10 years has passed now! Oh my God! It seems like yesterday... tempus fugit!

Monday, March 31, 2008

Nokia n800: my new toy

Here's my new toy, the Nokia N800! Isn't it wonderful? :-)

It's a sort of tablet handheld PC with wireless and bluetooth connectivity and lots of multimedia features which really rock!

I must thank Matteo Baldoni, my colleague from University of Torino (or should I say "blame" ;-) that convinced me to buy this gadget, which is pretty useful for surfing the web, reading my email, listening to web radios, using remote calendars, watching movies and all those sorts of things you can find in the very supported site

However, what really pushed me to buy this small computer it's the fact that it has a Linux operating system, which, you should have learned by now, I'm in love with ;-)

I have the linux shell I can play with! I have the apt Debian package manager! I really praise Nokia for adopting this operating system, which also lets many already existing open source programs be easily portable (and already ported) to this device!

I must admit that writing with the small touchpad keyboard on the screen might not be comfortable all the time, but you can still do that (you can enable the bigger on screen keyboard where you can touch the virtual keys with your fingers, or you can switch to handwriting).

Well, the next step is now to start developing for this device, using the Maemo SDK!

Here are some final screenshots!