How to make the Magic Trackpad work in Ubuntu Maverick Beta

I came by an Apple Store today and could not resist…

Pairing

Pair the trackpad using the Gnome Bluetooth Setting dialogue. As the device is not automatically recognized as a trackpad, a random PIN is generated. Hence, you need to choose ‘0000′ in the PIN options in order to pair successfully.

Changing the driver

The device works out of the box, but with the evdev driver, which seems to be used by default, I did not have multitouch scrolling and no tap to click. Add the following section to /etc/X11/xorg.conf (create it if it does not exist) in order to use the synaptics driver

Section "InputClass"
        Identifier "multitouch touchpad"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "synaptics"
EndSection

Afterwards, log out to restart the X server

Enable two finger scolling

The mouse settings dialogue has a button to enable two finger scrolling, but it is grayed out for me. However, we can enable it directly in gconf: Launch the gconf-editor and set /desktop/gnome/peripherals/touchpad/scroll_method to “2″.
That’s it. I hope these small glitches get fixed before Maverick.

Maven archetypes to avoid PITA

In my previous post I have described how to configure an Eclipse project with the natures for OSGi bundle, Java and Scala development and use Maven to build the whole thing. This required 20+ steps, so I was looking for a way to make things a bit easier.

As it turns out, Maven archetypes are very helpful. Maven has a nice feature, which helps you turn any existing project into a maven archetype:

Setup your Eclipse project as required and Maven-enable it. Also set up the pom.xml. When done, exit eclipse and clean up any files it created, which you might not want to have in your archetype. Then type

mvn archetype:create-from-project

in the root directory of your template project. If everything goes well, Maven generates an archetype project in

target/archetype

From there, copy it to the place where you want to keep it.

Finally, inside the new archetype directory, type

maven install

to compile the archetype and install it to your local Maven repository.

Now you can instantiate the archetype from within Eclipse by selecting New -> Other -> Maven -> Maven Project -> Next -> Select your archetype (It should be in the local repository) -> Finish. Wait a moment ant there is your shiny, all new Project. Of cause you could also generate it manually using

mvn archetype:generate

Eclipse Project with OSGi + Maven + Java + Scala

I want to write an OSGi bundle using Scala. Dependency management should be done by Maven. And Eclipse should be the IDE. Should be easy going, as all of that is excellently supported by Eclipse, right? Well, in fact making everything run together was a serious PITA. So to make things easier for you, here is the step by step guide. I assume you already are somehow familiar with Eclipse, OSGi and Maven.

We start by setting up the necessary Eclipse environment.

  1. Install Eclipse Helios for RCP and RAP Developers from here
  2. Install the maven plugin for eclipse. It is called m2eclipse and can be installed from the following update site:  http://m2eclipse.sonatype.org/sites/m2e
  3. Install the Scala plugins for Eclipse. Unfortunately, the Scala Plugin for Eclipse has not been ported to Helios yet, but the available nightly build works well for me. Simply install everything found at the following update site: http://download.scala-ide.org/nightly-update-master-2.8.0.final. I guess the port will be finished soon, to better check http://www.scala-ide.org/ for a stable version first.
  4. Install the Scala Maven Plugin for Eclipse. This, too, has not yet been ported and caused some hickups in my installation, but whatever. The plugin is called m2eclipse-scala. At the time of writing, it is not available from any update site, so download the latest version here and copy it to your eclipse dropins directory.

Now we should have everything in place to get started. Restart Eclipse to make sure all changes are applied.

We will have to start from a Java OSGi Plugin Project. We will add the Scala nature to it and finally mavenize it. In order for the whole thing to build within eclipse, we will finally create an OSGi runtime environment which contains the necessary libraries.

  1. Select File -> New -> Other…
  2. Select Plug-In Development -> Plug-in Project
  3. Click Next and enter a Project name, e.g. TestProject.
  4. Click Next and fill the OSGi properties.
  5. Click Finish. A new project called TestProject is created in your workspace.
  6. Right-Click TestProject -> Configure -> Add Scala Nature. In addition to telling Eclipse that we use Scala in this project, this also adds a dependency on the Scala library to the Manifest. Unfortunately, org.scala-ide.scala.library is added as a requirement and that is maybe not exactly what you want, but we can fix that later.
  7. Right click TestProject -> Maven -> Enable Dependency Management and fill the artifact metadata. Click Finish.
  8. In order to allow for stand – alone builds with Maven, we need to add the Maven Scala plugin and a dependency on the Scala library. A form for modifying the pom.xml for Maven pops up automatically.
  9. Go to Window -> Preferences -> Maven -> POM Editor and enable “Show advanced tabs in the POM editor”.
  10. In the POM editor, go to the tab Repositories.
  11. Under Repositories click Create… and fill the following details: Id: scala-tools.org, Name: Scala-tools Maven2 Repository, URL: http://scala-tools.org/repo-releases
  12. Repeat the same under Plugin Repositories.
  13. Go to the Dependencies Tab
  14. Under Dependencies click Create… and fill the following details: Group-Id: com.weiglewilczek.scala-lang-osgi, Artifact-Id: scala-library, Version:2.8.0 (This will add an OSGi enabled Scala Library.)
  15. Go to the Plugins Tab and click Add… under Plugins. Search for *.scala and add maven-scala-plugin

We now have an Eclipse Project with OSGi + Scala + Java + Maven. We are still missing an OSGi bundle for scala-library in the runtime target. The Scala IDE uses a dependency on org.scala-ide.scala.library. For running outside of eclipse, I prefer an import of the OSGi enabled scala-library we just added as a maven dependency. We will now create a new target with this library added and adjust TestProject’s manifest accordingly.

  1. Right-click Test Project -> New -> Target Definitio
  2. Select Parent Folder TestProject, enter a name, for example “default”. Start with an empty target definition or if you already have a working target, Copy settings from current trget platform. Click Finish.
  3. We now need to add the scala-library bundle to the platform. I encourage you to create a directory somewhere, which contains all your external bundles, but for now we will choose the lazy approach and just reuse the file already downloaded by maven: On the Definition tab click Add…
  4. Select Directory and click Next
  5. Browse to ~/.m2/repository/com/weiglewilczek/scala-lang-osgi/scala-library/2.8.0
  6. Click finish. A new line should be added with a note that one plug-in is available
  7. Complete your target as you like
  8. Double Click the MANIFEST.MF of TestProject.
  9. On the Dependencies Tab under Reruired Plug-ins replace org.scala-ide.scala.library with scala-lang.

Aaaand we are done. Finally. Works for me, but I will have to find an easier way of completing all these steps. If I need to do thyt multiple times a week I will end up banging my head against a wall.

Steve jobs at home in 1982

Photo by Diana Walker (http://digitaljournalist.org/issue0712/y_walker08.html)

Photo by Diana Walker (http://digitaljournalist.org/issue0712/y_walker08.html)

“This was a very typical time. I was single. All you needed was a cup of tea, a light, and your stereo, you know, and that’s what I had.” – Steve Jobs

My personal hero.

This reminds me of the time during studies, when I used to move with just one trunk full of stuff. Including my bike, computer, CRT and laser printer. Which left little space for clutter. Good old times.

The Future of Publishing in Computer Science

I just read an interesting article by Lance Fortnow about how (and why) publishing in CS differs from most other disciplines. Beware that it is a bit ACM biased. :)

Open Access by Gideon Burton (cc-by-sa)

Open Access by Gideon Burton (cc-by-sa)

I agree that the current situation is not perfect. E.g. the focusing on deadlines has disadvantages (but also advantages). And I must say, that the most useful parts of most conferences are the coffe breaks and birds-of-a-feather sessions. I guess something like the Linked Data Meetup would at the same time be cheaper and more enjoyable.

On the other hand I am not sure whether the best solution would be to change to a journal centric model as in other disciplines. Fortnow criticises the “least-publishable units”, which end up as conference papers. On the other hand, working in small increments is a main feature of lean processes, and also start-ups (cf. Eric Ries “minimum viable product”). For example, FOAF+SSL has been developed publicly, on the web. As Fortnow explains, the current model of publication in CS has emerged as a result of the agility of the discipline. It would be a pity to sacrifice this agility.

I guess what we need is a mixture: Web 2.0 style work within sub-communities, publishing early and often. And then maybe some kind of journal (or better open access) style process for disseminating results across communities.

Cheers, Simon

Hackers anti back pain measures

I have had  serious lower and upper pack pain for a couple of days this week, which effectively kept me from working. Once it got a little bit better and I started working again, the pain returned after two hours. Here are my counter measures, which seem to work so far:

  1. Workrave Micro Pause Dialog

    Workrave Micro Pause Dialog

    I have set up the workrave applet, such that it forces me to do a 30 seconds micro-break every ten minutes and a 15 minutes break once an hour.

  2. During each 15 minutes break I do some excercises from this book (German only, sorry) for about 7 to 10 minutes. The rest of the 15 minutes I walk around or do something useful, that involves movement, like taking out the trash. Additionally, I have a glass of water. Nice by-effect: I will automatically dring 2.5 litres during a typical work day.
  3. I periodically move between my armchair and a PEZZI ball. The latter forces my back to move constantly.

In addition I get some physiotherapy.

How did this happen? Well, I have a typical desk job and I use to travel a lot, often for 7 or 8 hours, multiple times a week. Now trains, planes and cars are not the places where you get much movement either. Last weekend we went on a three-day trip for a friend’s wedding, travelling another 25 hours. And that obviously finished me off.

Why will this not happen again? This experience has been so painful that I will do everything to prevent it happening again. Despite the above measures, I will exercise at least three times per week again. I’ve been there, but became lazy over the last year. And I will do more breaks while travelling and maybe reduce travelling, where possible.

When I feel better again, I probably will reduce the frequency and length of the breaks a bit, but the overall setting seems quite useful.

What are your measures against back pain?

Cheers,

Simon

Homeoffice Refurbished

We bought a new desk yesterday evening. This morning, I set it up. This is where I work, when I stay in Lübeck. A short overview of the equipment and the way I use it:

Homeoffice

Homeoffice

In the picture you can see the 150×75cm desk, with lamp, telephone and inbox, whichwill be empty this afternoon. The laptop is a Lenovo X300 – highly recommended. Lightweight, small, good battery (I’ve got the 6 cell battery plus 3 cell extension), SSD, great display. The LCD is 15″ and will probably be replaced some time soon. I am still looking for a new lamp. Any recommendations? The telephone is a Fritz!MT-D, connected to a Fritz!Box7270, which can be controlled through the phone. The Fritz!Box serves as a DECT base, router, alarm clock, print server and streaming server. All cables, the router etc. are fixed to the bottom of the desk with two IKEA Galant cable holders. I attached a socket to the left leg of the table, which is easily accessible and can be used for devices like laptops, which are not permanently in use.

On the small shelf we have two printers: a Canon photo printer and a LaserJet M1522nf for cheap printing, fax and scanning. I mainly use the scanner with document feed. In fact, the printer was cheaper than a scanner with document feed alone. This device has already digitized 2 meters worth of shelf space, which are now compressed to a 3,5″ 1TB hard drive. The shelf is not yet perfect. I was looking for a small one with wheels, which would fit under the desk, but there are none available, which can hold the LaserJet.

Right of the shelf there are some drawers with stuff like pens, paper, photo paper and stuff. The black box under the desk is a shredder.

After a couple of iterations I would say, this is close to my perfect home office. Ideally, I would not need the drawers and the paper…

Cheers,

Simon

Simon starts blogging

Dear reader,

Simon

Simon

this is me, Simon.

I was updating my university homepage, when I started wondering, how much more work it would be to set up a blog instead of hacking CSS by hand. It turned out not much more. :) So here we are.

From time to time I will post thoughts about Semantic Web, entrepreneurship and privacy here.

Cheers,
Simon

 
Powered by Wordpress. Design by Bingo - The Web Design Experts.