Wednesday, May 16, 2007

Integrating KDE applications into a Ubuntu desktop

One of the things that strikes the novice Linux user is how out-of-place KDE applications look like when running under Ubuntu's GNOME desktop (not to mention the fact that most users probably don't quite understand the difference between the two).

Here's a few simple steps to get your favorite KDE apps to look a bit more "native" in Ubuntu:

a) Install the KDE control center (commandline or via Synaptic Package Manager):
sudo apt-get install kcontrol

b) download the Kubuntu Human theme from here:
http://kde-look.org/content/show.php/Kubuntu+Human+Theme?content=42746

c) start KDE control by simply invoking "kcontrol" from the terminal

d) change the default KDE fonts to the same one you use in GNOME, including anti-aliasing settings:e) change the default KDE theme to Kubuntu Human (after installing the .kth file you downloaded in step (b) by pressing "Install New Theme"):
f) change the default icon set to Ubuntu's Human:
After that your KDE should look reasonably similar (not identical by any stretch of imagination), but close enough not to be annoying due to the differences in the two toolkits being used:

Personally, I think something like this should be part of the standard Ubuntu configuration, but I guess I'm just picky....

UPDATE: I realized afterwards that it would be also useful to download a KDE color scheme that is identical to the default Human color scheme in Ubuntu. They highest rated one seems to be this one:
http://kde-look.org/content/show.php/Human+%28Dapper%29?content=39402
so try downloading it and adding it to the list of color schemes in the KDE control centre as well.

Also, one of the comments brought my attention to the fact that KDE 4 will have a brand new widget set that is supposed to look like the Clearlooks widget style that is default in Ubuntu:
http://doc.trolltech.com/4.2/gallery-cleanlooks.html
and there are other enhancements coming to the Qt toolkit to integrate it better with GTK:
http://doc.trolltech.com/4.2/qt4-2-intro.html#desktop-integration

Now the only challenge should be to get them configured by default properly in the next release of Ubuntu.

Tuesday, May 15, 2007

JDK 1.6.0_02 still not working with Beryl under Linux

I was under the impression the latest JDK 6.0 was supposed to fix Swing's Beryl problem, but alas it seems that is not the case.

This is what NetBeans looks like under Beryl:

I verified my netbeans.conf is pointing to the correct version:
netbeans_jdkhome="/home/jacek/Dev/Java/JDK/jdk1.6.0_02"

and my default Java home is set up correctly as well:
which java
/home/jacek/Dev/Java/JDK/jdk1.6.0_02/bin/java

It's a pity, I was really looking forward to using the new NB builders under Beryl, guess will have to fall back to Metacity in this case.

UPDATE: Found the bug number, unfortunately it says still in progress:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6509038

Fortunately enough this link:
http://wiki.beryl-project.org/wiki/Java

provides a workaround (switch Beryl's WM to Metacity, then back to Beryl), which seems to work reasonably OK at first glance:
Still, it would be great to see it fixed...Beryl is where all Linux distros are heading, and fast...

Ubuntu gems : Brasero CD/DVD burning

One of the nicest parts of moving to Ubuntu as my primary desktop is the sheer amount of applications in the repositories, many of which exceed in terms of quality and functionality the default applications shipped with GNOME.

While it seems the most popular burning app for GNOME is Gnome Baker, I have been using Brasero more and more, due to its simple, yet powerful interface:
http://www.gnomefiles.org/app.php/Brasero
http://perso.orange.fr/bonfire/screenshot.htm

It's a worthwhile contender to KDE's K3b, which was one of the few reasons I still think about going back to KDE/Kubuntu every now and then.

Monday, May 14, 2007

JavaFX - first (negative) impressions

As the dust on the initial release JavaFX (or JFX as its creator likes it to be called) is settling down, I tried doing some "real" work in it and the results so far are quite discouraging.

I'll omit the fact that the JFX plugin for NB 6.0M9 is more trouble than its worth (see previous blog entry). I wanted to try a very simple app that gets a JFX frontend with a JPA-powered backend.

First surprise: JFX does not support annotations

This is a really bizarre decision. Without annotations a whole class of really powerful Java functionality is unavailable to JFX, starting from JPA @Entity creation to @EJB dependency injection, etc.

So, I cannot take a JFX data class, e.g.:

class Person {
attribute id : Number;
attribute firstName: String;
attribute lastName: String;
}

and turn it into a JPA entity:

@Entity
class Person {
@Id
attribute id : Number;
attribute firstName: String;
attribute lastName: String;
}

This simply does not compile.

OK, then...I guess I have to define JPA entities as regular Java classes and bind them via JFX in the UI.

Second surprise: JFX does not seem to understand Java type-safe collections / generics

I created a simple Java class called Person with a static method to return two instances of it in a List collection.

Then tried to display this in the UI via this simple JFX class:

Frame {
height: 120
width: 500
title: "SimpleTableDemo"
content: Table {
columns:
[TableColumn {
text: "First Name"
},
TableColumn {
text: "Last Name"
}]

cells: bind foreach (p in Person.getPersons())

[TableCell {
text:bind p.firstName
},
TableCell {
text:bind p.lastName
}]
}
visible: true
}

where Person.getPersons() has a simple signature of:

public static List<Person> getPersons()


Well, this does not work, we get a runtime exception:

Main.fx:25: No such attribute firstName in class java.util.List: should be
empty

Only if I change the signature to explicitly return a Person array, i.e.

public static Person[] getPersons()


did everything work.

Needless to say, I am somewhat underwhelmed. It's nice to have Flash-style effects and everything, but if I can't easily retrieve data from the DB, pass it to the UI, bind it/display it, etc. then the tool is not very useful for your regular, everyday corporate applications.

Follow up to my previous blog: it seems like there really are no constructors in JFX, none. Only "new" triggers (like DB insert triggers). So if you have an instance variable that positively, absolutely needs to be initialized upon object creation, it seems there is no way to accomplish this (at least none that I see from the JFX manual).

And since my DBA colleagues are not that keen on triggers (things get complicated when you have multiple of them on the same object, especially in terms of controlling their execution order) it would be interesting to see if JFX has similar issues once you created a complex class in it with multiple triggers added by different sources...

I think for now I will stop my JFX experimentations, this language has a LOT of potential, but it still lacking in many areas that stops it from real-life use IMHO, namely:
a) lack of usable development tools
b) not very smooth integration with the existing Java functionality (annotations, generics, who knows what else)
c) triggers instead of constructors or actions (sorry, I just don't like this language design approach, period)

I'll stick back to good old "it just works" Java and hope Sun will keep improving JFX to make it actually usable for regular applications. It has a lot of potential, that's true, but Java/Flex/Silverlight killer it is not, at least not yet.

On the positive side, I just read Sun hired one of the creators of GCJ to work with Chris Oliver on future development of the language, so it's good to see they are serious about investing some talented manpower into its futher evolution.

Friday, May 11, 2007

JavaFX plugin for NetBeans

I downloaded the latest preview of NetBeans 6.0 (M9) and it is definitely getting more and more impressive with every release. Couldn't help noticing the JavaFX plugin on the update site, so decided to downloaded and get down and dirty with F3...err, I meant JavaFX.

I have to say first impressions are pretty negative...there are some nice wizards to create a new JavaFX app or JavaFX file, but they barely do anything, just create a blank file. The plugin seems to be very slow (it locks up the entire IDE for a few seconds with a "Parsing..." message in the Navigator even when opening a very simple JavaFX file), offers not much more than basic syntax highlighting, often highlights errors when there are none...etc. Not even alpha quality at this time.

I hope this really is just a basic preview of some "real" plugin, because if this is the depth of functionality that Sun is hoping to compete with let's say Microsoft Expression Blend, then we Java developers are in a lot of trouble.

Next step: I will be trying to create an actual "real" app in JavaFX, i.e. one that retrieves data from the DB using JPA, presents it/edits it and allows to save it back. We'll see how that works...

But seriously, Sun claiming that JavaFX comes with any sort of development tools support at this point is a gross overstatement.

Outside of that, I have to say I am really liking a lot of what I see of JavaFX in the docs, especially the easy and powerful data binding (with expressions! very cool!).

What I am not liking at first glance is the lack of constructors...how do I then enforce mandatory parameters are passed to me during object creation? Will need to investigate...I am sure such a basic requirement could not have been missed...

Thursday, May 10, 2007

Eight things I DON'T like about Ubuntu

So, Ubuntu 7.04 is out and everyone is raving how good it is. Got to agree, it's the best Linux desktop distro ever and has some great solutions to your regular pesky Linux issues (e.g. restricted NVidia drivers, restricted codecs, etc.).

Nevertheless, it is not perfect and here are some of my pet peeves (most of them admittedly minor or at best medium-level) which stop me from giving Ubuntu a 10/10 rating. Some of these are Ubuntu issues, some GNOME and some just have to do with particular Linux apps.

  1. Does not recognize wide-screen monitors

    My brand new 19" widescreen Acer just doesn't get recognized properly, in particular it's 1440x900 resolution. I had to manually edit /etc/X11/xorg.conf to give me that option, but I still have not been able to force it to use 75Hz refresh rate, Ubuntu shows me only 50Hz, 60Hz and 61Hz in my options.

    Responsibility: Ubuntu. Needs to improve hardware detection

    UPDATE: According to one of the comments, this is an issue with the Acer 1916W monitor which (supposedly?) does not report its resolution correctly. Although that explains things a lot, it's still an issue since on XP I was able to set up the correct resolution without issues (once I got the NVidia driver installed it showed me 1440x900 as an option), while Ubuntu did not...hence the manual hacking of xorg.conf. It would be nice if the Screen Resolution screen showed all available resolutions, just like its Windows counterpart.

  2. Has problem dealing with multiple sound cards

    On my system I have 3 sound cards: the default one on my motherboard (never used), an old Soundblaster Live (used only for its MIDI input port, but not for audio) and my main one, a high-end professional M-Audio M66 (24-bit, 96KHz). Even after setting the proper soundcard in the GNOME option panel, some programs (in particular games) still did not use my M-Audio card.

    In the end I had to drop down to command line to properly set the default card in ALSA after looking at this thread:
    http://www.linuxquestions.org/questions/showthread.php?t=499520

    Responsibility: Ubuntu. Improve handling of multiple sound cards.


  3. Does not allow to change default music player

    Rhythmbox is fine, but it's a poor cousin of Amarok (for KDE). I would like to change it to use Exaile, which is more in line with Amarok's features. Although you can change the default application for MP3 files to be Exaile, GNOME does not allow you to change the default media player to be something different than Rhythmbox.

    Responsibility: GNOME. Add more flexible configurations.

  4. Global keyboard shortcuts are inflexible

    I wanted to assign some global keyboard shortcuts to Exaile's functions (e.g. play/pause, volume up/down, next/previous track, etc.). Unfortunately, GNOME's options only allow to do it for the default player (i.e. Rhythmbox, see point above) so I was not able to assign global shortcuts to Exaile.

    Responsibility: GNOME. Once again: ADD MORE FLEXIBLE CONFIGURATIONS

    P.S. Btw, the volume up/down shortcut did not work, even with Rhythmbox. Looks like a bug.

  5. SoundJuicer has no control over CD ripping quality

    Most proper CD rippers give you some level of control as to whether they are using cdparanoia to properly rip CDs, even scratched ones. SoundJuicer has no configuration whatsoever and rips them without doing any serious error checking (which is why it is so fast compared to other CD rippers). As a result, a lightly scratched CD I had was ripped with audible cracks/pops, while using other rippers (like KDE's default KAudio CD Creator) took longer, but gave me a clean, good sounding rip.

    Responsibility: GNOME. ADD MORE FLEXIBLE CONFIGURATIONS!!!

  6. SoundJuicer has wrong MP3 options configured

    Selecting "CD Quality (MP3)" in SoundJuicer will create MP3s with 128kbps bitrate. This is NOT CD quality, not even close. If you want to use CD quality, you need to use the "-- preset standard" option of the LAME encoder, which means creating a new GStreamer pipeline with the following value:
    "audio/x-raw-int,rate=44100,channels=2 ! lame name=enc preset=1001 ! xingmux ! id3v2mux"

    BTW, creating a new GStreamer pipeline is a major pain. If not for the fact that this preset was in the Ubuntu Wiki, I would not have been able to figure it out on my own. Give me command line options any day.

    Responsibility: Ubuntu. Create a proper CD quality MP3 setting for SoundJuicer.

  7. Gimp UI is so 1994

    Really, Gimp is such a great tool. But can someone finally update it's UI to stop looking like the Visual Basic 3 IDE with its dozen of floating windows? Whatever the Gimp team is doing, they should drop it and focus on rewriting the UI. It makes my Windows friends laugh every time they see it and is the butt of endless Linux jokes. And they are right. Linux's best graphics app should look better than that.

    Responsibility: Gimp. Rewrite the UI.

  8. Digital Audio Production on Linux is a Joke with a capital "J"

    As an amateur musician, I am used to the power, ease of use and flexibility of such Windows tools as Cakewalk Sonar, Native Instruments Guitar Rig, VST/DXi plugins and virtual instruments, etc.

    First of all, Linux doesn't come even close to the same depth and quality of audio production software.

    Second, the whole concept of the JACK server (wiring separate apps together) is complete idiocy. It is too complex and offers not much extra in flexibility compared to what VST can do on Windows. Not to mention that if I really created a full song using let's say in Ardour (multi track recorder, which BTW looks horrible on Ubuntu), Hydrogen (drum machine), Freebirth (synth) in order to load that song again, I would need to load each app separately, remember which preset I had loaded into each for that particular song (e.g. Hydrogen drum patch) and then wire it all again with JACK. Are you guys for real?

    I won't even mention the fact that getting Hydrogen to play properly took me a week (didn't show any errors, just wouldn't play, turned out to be some hidden option in JACK once again, related once again to multiple soundcards) and as soon as I added a slightly heavier plugin to it (I think it was parametric EQ) it started dropping out and couldn't play. Pretty sad.

    Contrast that to my Windows XP, where I start up Sonar, it loads all my plugins with their own presets automatically for every song and I am up and running in 20 seconds, trouble free.

    Right now digital audio production on Linux is not simply behind Windows, it is basically in the Stone Age and no one seems to be doing anything about it. That's why unfortunately I still have a Windows XP partition on my PC and dual boot into it.

    Responsibility: No idea. No one seems to be really thinking seriously about this space on Linux.



    With that in mind, I will repeat that Ubuntu is great, it is my primary OS and I enjoy it a lot for all the wonderful things it provides. I hope the points above will help make it even better one day.



Java IDE review by yours truly on DevX.com

DevX.com has just posted a review of the three main Java IDEs: NetBeans 5.5, Eclipse 3.2 and IDEA 6.0.4, written by yours truly:

http://www.devx.com/Java/Article/34009

I hope you will all find it balanced and well researched. Looking forward to any comments.

My page at PBDJ

Back in a previous life as a PowerBuilder developer, I had a written a whole series of articles for PowerBuilder Developer's Journal (PBDJ).

Here's a nice summary page they created with all of them:
http://pbdj.sys-con.com/author/790Furmankiewicz.htm

P.S. If in 2006 your career still evolves around PowerBuilder you need to study C# or Java...fast. There is still hope for your career. :-)