Archive for the 'linux' Category

Maintenance Mode

In the last few weeks I’ve adopted a couple projects that, for whatever reason, had not been actively maintained for a while.

Cluttermm

Cluttermm wraps the Clutter Toolkit, “a software library for creating fast, compelling, portable, and dynamic graphical user interfaces”. Clutter has become an integral part of the GNOME project through its use in the GNOME Shell featured in GNOME 3. As such, I think it’d be a shame to not have high-quality C++ bindings.

Cluttermm had not really had much activity since early last year. With the rate of Clutter development, Cluttermm feel behind quickly. I’m trying to catch up now and as Murray mentioned, I’ve been able to wrap more API and fix a few bugs. So far I’ve got the 1.2 API almost fully wrapped. There are certainly bugs, some of which I’m finding now that I’m actually writing some examples. As I’m very much new to this wrapping business, I want to write a number of examples using the newly wrapped API. Once I’m comfortable that things are in good order, I’ll move onto the 1.4 and then 1.6 APIs.

GNOME System Monitor

GNOME System Monitor (g-s-m) is the default process viewer and system monitor in GNOME. I got involved by responding to the call to port g-s-m to Gtk3. Thanks goes to Openismus for allowing me to spend work time doing the porting (which I’ll blog about in the next couple days). During this process one always finds areas for improvement which spurred my interest in becoming the maintainer.

From what I can tell g-s-m hasn’t been actively developed in well over a year. You can imagine that bugzilla has a lot of suggestions for future tasks. My first order of business will be dealing with neglected patches and responding to bug reports.

So it appears as if I’ve filled all my free time for the foreseeable future. We’ll see how much I can get done between changing diapers and playing with the kids. ;)

Oh, and lastly… patches welcome. :P

Thoughts coming out of the GNOME Developer Documentation and Tools Hackfest

I’m a bit late in the game regarding blogging about the GNOME Developer Documentation and Tools Hackfest that we hosted at the Openismus Berlin office a couple weeks ago. There have been a number of good posts made summarizing what we talked about and worked on. In this post, rather than providing another summary, I’d like to share my thoughts about how we can get the most out of the demos (examples, tutorials… whatever) we started during the hackfest. Some of what I’m going to talk about was discussed at the hackfest, but much was not. Also, be warned that this will have quite a few references to Qt documentation practices.

A Tutorial for Tutorials?
So here we are, we’ve got some nice, simple code examples, some even with tutorial-style documentation. But if you look through the examples you’ll find that the documentation style varies dramatically. Before we go and write too many of these tutorials maybe we need to standardize how we write these. Some issues that arise when writing the tutorials are:

  • how do we structure the tutorial? Daniel’s Magic Mirror example incrementally builds up the program while others, including mine, explain the finished program.
  • how does one reference the code? Do we use line numbers, show full functions/classes? Do we include unexplained code in the code snippets?
  • how do you show a full listing? Do we append a full code listing at the bottom of the tutorial or provide links to files?
  • how much should we comment the code? If the code is going to be explained, do we need to repeat the same thing in the code comments?
  • and so on…

Some of these have answers. For example, we decided that we should build up the programs incrementally and that referencing line numbers is probably going to be more trouble than it’s worth.

When I was writing my photo-wall tutorial I knew that I was writing it not in isolation but as a larger collection. Thus, I wanted my tutorial to fit in with the other tutorials in the collection. As there was no guide to go by, I poked around the repository to see how others were doing it. I found one I liked and went with it.

The point is that because there is no canonical tutorial or document to go by, we are adding a possible barrier to those wishing to create such tutorials. During the hackfest it was mentioned that we can not motivate people to contribute, we can only demotivate them. Let’s not do that. ;)

For completeness these are my opinions about the above-listed issues.

  • structuring the tutorial: Incremental build up is nice for GNOME beginners and that seems to be the target group so let’s go with that.
  • referencing the code: No line number referencing. Break the code up into small logical blocks and describe. Blocks need to be small so that one can read the description and see the code without having to scroll up and down repeatedly.
  • showing a full listing: Do like the Qt examples do; list all files at the beginning of the tutorial. This gives quick access to folks who don’t need the description.
  • commenting the code: Heavily comment the code so that is descriptive outside the context of the tutorial and probably remove the comments when placing segments in the tutorial in order to save space.

Dealing with undocumented code examples

Right now I don’t know that we have a plan for dealing with this so here are my thoughts.

In a perfect world we are going to have a tutorial written for each example in each of the core programming languages. As perfection is rather boring, lets think about the alternatives.

I think in this case we should simply look at the Qt examples. They either have a tutorial-like description or they don’t. The one’s that do have an asterisks, those without don’t.

Regardless of whether the coder is willing or able to write an accompanying tutorial, we should promote getting as many code examples in as many core languages. In fact some example may be too large to expect a tutorial. Take a look at the Qt Network torrent example for one instance of this being the case. Looking at that example you’ll see that even though there is no tutorial, a file listing and description is available. If we were to standardize on having a file listing and functional description of the example at the top of each tutorial we could just copy the description and list the files for each newly added example port. Of course, hopefully someone would eventually get around to writing a tutorial as well.

Relating reference documentation with examples

One of the nice things about the Qt reference documentation is that it often references examples in the See also section. With one click your sent to an example that’s probably more complete than the small snippets you usually find in the API reference. Looking at the QTcpSocket class you’ll find 6 referenced examples. Some have documentation while some are just commented code. Maybe Shaun has something up his sleeve for something like this using Mallard.

Closing words
Basically, I would like to see a consistent, wide-ranging, integrated and ever growing set of examples and tutorials to help developers get started with developing with GNOME technologies. I think the Hackfest was a great start to getting us there. The documentation team has done a great job laying the foundations and providing infrastructure for getting us where we want to be with GNOME 3 regarding developer docs. We just need to finish ironing out a few things before we are quite there.

Getting Openismus ready for the Development Documentation and Tools Hackfest

In 2 days the GNOME Development Documentation and Tools Hackfest starts here in the Openismus office. For the past 2 days we’ve spent a couple hours of each day getting things ready. We’ve designated two rooms as hacker rooms. Our central common area will be the main sit-down hacking area.

Common area hacker space (facing the front courtyard)

Common area hacker space (facing the front courtyard)


Common area hacker space (facing the back courtyard)


And the front room will serve as the bean-bag hacking area and provides a little warmth and color to contrast the current weather situation here in Berlin.

Bean bag hacking area in the front room.

On Wednesday we’ll have a welcome dinner for all the attendees sponsored by Openismus. Should be a good opportunity to get to know more of the GNOME hackergotchi heads in real life.

So, Openismus is ready and looking forward to a productive four days.

xorg.conf for Ubuntu Gutsy tribe 5 on IBM Thinkpad t43 2668-75U

This is the xorg.conf file as generated from the Live CD.

# 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.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section "Files"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizScrollDelta" "0"
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/input/wacom"
Option "Type" "stylus"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/input/wacom"
Option "Type" "eraser"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "cursor"
Option "Device" "/dev/input/wacom"
Option "Type" "cursor"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "Device"
Identifier "ATI Technologies Inc M22 [Mobility Radeon X300]"
Driver "ati"
BusID "PCI:1:0:0"
EndSection

Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
EndSection

Section "Screen"
Identifier "Default Screen"
Device "ATI Technologies Inc M22 [Mobility Radeon X300]"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Modes "1400x1050"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "stylus" "SendCoreEvents"
InputDevice "cursor" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"
InputDevice "Synaptics Touchpad"
EndSection

Setting Up Tomcat 5 on Ubuntu 6.06

I had mentioned that I’d post a quick how-to on setting up Tomcat 5 on Ubuntu Dapper. So here it is and lucky for me it’s VERY easy.

Translations: castellano

First a quick overview of what we are going to do:

1. install software
2. change 1 line in a configuration file.
3. start the Tomcat5 service
4. go to http://localhost:8180

And now for the good stuff.

First we want to install the right packages. basically we want to install apache2, a java jdk and tomcat (duh). I’ve chosen to use Sun’s java implementation. To install this you need to enable the multiverse repository. See this section of the Unofficial Ubuntu Starter Guide for help with enabling additional repositories. To install Tomcat itself you will also need to have the universe repository enabled.

Note: For Tomcat you MUST have a jdk not just a jre.

So, for the basic install use the following command.

sudo apt-get install apache2 tomcat5 sun-java5-jdk

If you want a shiny Tomcat welcome page when we finally get that far then install the example apps by adding tomcat5-webapps to the end of the last command. For the Tomcat admin web interface add tomcat5-admin, too.

My final command looks like this.

sudo apt-get install apache2 tomcat5 sun-java5-jdk tomcat5-webapps tomcat5-admin

By default Ubuntu uses a free Java implementation. We now need to tell Ubuntu that we want to use Sun Java as the default. Run the following command.

sudo update-alternatives --config java

Then enter the number of the version of Java you want from the list when prompted. The one I wanted was /usr/lib/jvm/java-1.5.0-sun/jre/bin/java.

Now we need to tell Tomcat where the jdk is. Open /etc/default/tomcat5 and change the variable JAVA_HOME to read…

JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun/

Make sure it’s NOT got a “#” at the start of the line. You can should now be able to start Tomcat5 with…

sudo /etc/init.d/tomcat5 start

Tomcat is listening on port 8180. So open up firefox and enter http://localhost:8180 in the address bar. Once the page loads you should see either a tomcat welcome page or, if you chose not to install the examples and admin packages, a fairly empty page with “Apache Tomcat/5.0″ at the bottom left. Congrats, you just installed a working Tomcat service. If you don’t see one of these pages, either you or I screwed up. ;)

If you installed them, the example apps can be found in “/usr/share/tomcat5/webapps/“. Also take a look at the configuration files in “/etc/tomcat5/“.

Hope that was helpful.

Update: Manolo Canga added a section in his Spanish translation of this tutorial that I’ve translated into English below.

Setting up an admin user

If you try to use the admin interface you’ll find you can’t because no admin user has been set up. To resolve that go into /var/lib/tomcat5/conf and edit tomcat-users.xml. You’ll see that 3 users have been created by default. We’re going to change the password of the user “tomcat” (<user username="tomcat" ) to something better than the default of “tomcat”. Duh!? Now we are going to give the user “tomcat” admin access. Add “admin” to the user tag’s roles attribute. It should look smilar to this.

<user username="tomcat" password="your_password" roles="tomcat,admin"/>

Now restart tomcat…

sudo /etc/init.d/tomcat5 restart

…and you’re done!

Sleep Deprivation and Being a Loser

On Sunday I installed Ubuntu 6.06 (Dapper) at Sprachenatelier Berlin e.V. a small language school in Friedrichshain. It took all night and I’m still not finished. Someone had installed a Tomcat server that was serving a custom jsp app. Having never installed tomcat nor having ever developed Java Server Pages and only finding out about it when I arrived I didn’t have enough time to do all the other thngs plus learn about tomcat and install jsp apps. So I installed Ubuntu on the 4 “student” computers and left the 2 office computers for some time in the next couple days. On Monday in the comfort of my own home I learned about Tomcat and I had everything running in an hour or so. I also wasted a good amount of time ridding the single duel-boot Windows install of viruses and spyware.

I’ll do an Ubuntu 6.06/Tomcat install how-to soon. No, really… I promise. :)

On Tuesday Annika and I packed a picnic and went to the Fan Mile to watch the Germany vs. Italy match. Of course, Everyone knows the outcome of that. I was so looking forward to the penalty shoot-out. Oh well. May Italy suffer a humiliating defeat in the finals. They are such whiners; falling at the slightest touch. I’m hoping Portugal wins it all now.

Mysql, JDBC and relationships in Openoffice.org 2.0.x

By default when attempting to create a relationship by way of Tools > Relationships… in OpenOffice you’ll get an error that relationships are not supported. However this is not true if you are using the InnoDB tables. In order to enable relations you need to add overrideSupportsIntegrityEnhancementFacility=true to your connection string. So where do I do that you ask? Simply append the option to the end of your Name of the MySQL database field preceded by a “?”. Just right click on the database name and choose Propeties to get there. Mine looks like this now…

test?overrideSupportsIntegrityEnhancementFacility=true

…with test being the database name.

This will work with both the Mysql Connector/J 3.1 and 5.0

Tracking Ubuntu Adjectives

Ubuntu‘s quite known for its {obscure adjective} {animal} release names. I though it might be interesting to see how the Ubuntu release cycle affected the {obscure adjective}s’ search volume. I turned to Google Trends and did a query for each of the {obscure adjective}s. The results were quite interesting.

Warty wasn’t even on the chart before the initial Ubuntu release and the Hoary release showed the first clear jump in queries. It looks like the Ubuntu’s popularity really took of with the release of the Breezy Badger release and the Dapper Drake (current) release will soon top Breezy. Edgy just crossed Hoary and I suspect it will increase dramaticaly once the Ubuntu Developer Summit in Paris is finished and the work for the next release (Edgy Eft) gets underway.

The Dapperness of the Drake

This was originally going to be a response to a comment on my last post but it got a bit long.

I’ve been using Ubuntu Dapper Drake since Febuary and often forget about the improvements I noticed upon first upgrading. For me, Nautilus has finally become a pleasure to use instead of the pain it used to be. Although not in the default install, NetworkManager is my absolute favorite improvement. Even my wife can now connect to almost any network. The infrastructure for updates and adding/removing software is a huge step forward for linux distros. And last, but not least, the documention is light-years ahead of Breezy. I applaud the documentation and localization teams.

Some of the smallest things are also what makes Dapper such a pleasure to use. For example, my laptop’s (Thinkpad T43) volume keys finally change the master volume and not just the PCM volume. Also I now get an on-screen indication of the change. The menu layout is also much improved.

Even with all the wonderful improvements, there are still so many things to refine and many things that are still semi-broken. One of the more questionable choices in my view is making the live cd the recommended install path. I’ve tried this a couple times on machines with 256mb of RAM and it hung everytime. Even on the machines with plenty of RAM I found myself fighting with the partitioner. Both of these issues have been quite a lot of attention in Malone (The Ubuntu Bug Tracker). For me the “text-based” install is extremely easy to use and works flawlessly. I’d like the idea of have an atttactive introduction before the actuall install but not at the expense of causing a large portion of potential users the headaches that will prosumably come from the live cd.

Overall Ubuntu is hands down the best distro for the largest audience. Not only because it is currently the most user-friendly distro but because the communty (users and developers) that surrounds it is rapidly growing AND dedicated to continuing this tradition.

PS: For anyone interested in getting started with Ubuntu, Linux or open-source software, please don’t be afraid to ask questions to me directly. To start, go to ubuntu.com to get a feel of what ubuntu is.

Recovering from Ubuntu Dapper Release Party

Last night I went to the Berlin Ubuntu 6.06 (Dapper Drake) release party at Danial Holbach‘s (dholbach) place. It was nice to meet other ubuntu lovers. I arrived at 8pm and left at ~4:30am. By then the sun was already on the rise and by the time I arrived home it had already become completely light out. I finally woke up at 12:30pm with a sore throat from all the talking I did.

It seems as if Daniel and I share a love for a certian british band from the 80′s and the singer of said band. I met Ellen, a kde usability contributer. I envy her persistence with such a thankless task. I also met Daniel Elstner, co-maintainer of gtkmm as well as a very easy-going and likable guy. Furthermore, Matthias Klose, Nina Feyh and about 20-30 others including a couple people from Frankfurt were there.

So it seems as if the Berlin Ubuntu community is pretty strong. Too bad I’ll be leaving in a few months. Of course, the wonderfull thing about the open source community is that it really doesn’t matter were you are. The community is global.