Windows 95: someone still loves you

Or at least uses you.

I use StatPress to get statistics of the last readers of this blog. One of the informations I have access to are the operating systems that the last visitors were using. And how surprising it was to discover that I still have a visitor that was using Windows 95:

I really hope this person is using some extension to change his/her browser’s user agent header or just woke up from a sleep of 10 years or more.

Fixing problem with Subclipse and svn+ssh repositories

I was trying to synchronise a Java project with a SVN repository that runs over a SSH tunnel. It was working right in the command line, but in Subclipse it was showing a “network connection closed unexpectedly” error.

It was fixed changing the SVN interface from JavaHL to SVNKit in Eclipse preferences (click to zoom):

Changing SVN interface in Eclipse

Open Sonic

I was looking for some good games for Linux a few days ago and I found an incredible one: Open Sonic. It’s a free, open-source game featuring Sonic The Hedgehog (don’t tell Sega about this) and it’s available for Linux, Mac and Windows. And it’s very, very fun, just like the old Sonic games for Master System and Genesis I used to play fifteen years ago. I’m getting old.

The game is still under development (only two levels until now), but it’s a good game anyway. It has a cooperative play mode which lets you control three characters simultaneously (Sonic, Tails and Knuckles), and at some parts you need to use two of them (Tails must open a door so Sonic can pass, for example).

There’s a demo video available. It’s a little bit outdated but it can show what the game already has to offer:

httpv://www.youtube.com/watch?v=Q7us7wM14As

How to fix ugly fonts in Qt-based applications

I was using Qt Creator and tried to change the editor’s font to Monaco, 9. But hey, Monaco is not that ugly:

Monaco before fix

So I googled a way to fix for this problem, and found the fix at Arch Linux forums. You’ll need to create a file called .fonts.conf in your home directory with this content:

[sourcecode language=”xml”]
<?xml version=’1.0′?>
<!DOCTYPE fontconfig SYSTEM ‘fonts.dtd’>
<fontconfig>
<match target="font" >
<edit mode="assign" name="rgba" >
<const>rgb</const>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="hinting" >
<bool>true</bool>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="hintstyle" >
<const>hintslight</const>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="antialias" >
<bool>true</bool>
</edit>
</match>
</fontconfig>
[/sourcecode]

I closed Qt Creator and reopened it. The result was this:

Monaco after fix

Why I chose Qt

A few months ago, I planned to learn some graphic toolkit. As a GNOME user, GTK was my natural choice. Although I’m a Python lover, I chose C++ because I just wanted to learn a new language and stop being afraid of pointers. So I started to read the gtkmm documentation, like tutorials and API, and to program a simple music player. I was learning gtkmm and it all seemed okay.

But I read a little about Qt and, after talking with some friends about the pros and cons of GTK and Qt, I decided to do with Qt the same things that I’ve already done with GTK up to that point. So I would know what choice was better for me. Notice that I’m not saying that Qt is better for everybody and that GTK must die, but that Qt looked better for me and my personal project. After this disclaimer, and can tell my reasons:

  • Look & feel. I’m a look&feel fanatic, and sometimes I move from GNOME to KDE only to check its new features. But I hate how GTK applications look in KDE. You can use gtk-qt-engine, but you’ll still notice the differences. You can set GTK to use the excellent QtCurve theme, that have identical versions to Qt and GTK, but you’ll get tied to a theme. But look what you have if you run a Qt application in GNOME (gedit is a GTK-based application and Picard is a Qt-based application):

    Thanks to QGtkStyle, Qt applications detect if you are in GNOME and your Qt application gets an almost perfect GTK look & feel. And yeah, it includes open and save dialogs.
  • Documentation. Qt has a very, very rich and well-organised documentation, with tutorials, API references, and examples. gtkmm also have all these items, but they didn’t look very friendly to me. And the documentation of Qt 4.7, still in development, will be even better.
  • A simple, but good IDE. A good programmer must not be dependent on IDEs, but they really help you. I tried to use Anjuta (unstable sometimes), MonoDevelop (very good for .NET platform, but not a good IDE for C/C++ development) and Netbeans as IDE when I was using gtkmm, and I was not satisfied with them. But Qt has its official IDE, Qt Creator:

    Qt Creator is clean, simple, and complete. It has quick access to documentation, breakpoints, project configuration, native support for CVS, Subversion and Git, good code completion, a good GUI designer (like the GTK’s Glade), among other features.
  • Runs well on many platforms. Qt is smart enough to run well – and with native look & feel, I really like this – in Linux, Mac, Windows, and others.

But Qt still has some cons:

  • Users should have it installed to run Qt applications, and this is not very usual in Linux environments based on GNOME, neither on Windows systems.
  • Qt is free only if you’re using it in a free project. For commercial applications, you must obtain a commercial Qt licenceUpdate: this is not exactly a con. You still can use Qt under LGPL in commercial applications, but if you make any change to Qt you must publish them or purchase a commercial Qt licence (thanks, krok, for the comment).

If you’re beginning to learn to program for graphical environments or you’re looking for a good graphical library to use in your project, you really should give Qt a try, implement some examples and feel which option is better for you.