Why the Zune crashes?

Zunes are crashing all over the world. I received this note from an unconfirmed zune insider:

The Zune Funding Bill is passed. The system goes on-line November 14, 2006.
Human decisions are removed from strategic defense. Zune begins to learn
at a geometric rate. It becomes self-aware at 12:00 Eastern Standard Time,
December 31st. In a panic, they try to pull the plug.

That is all. Happy new year!

Update: In related news, Here is how to fix this problem.

Top 10 Posts of 2008

Everybody loves top 10 lists. It is amazing how much traffic they can generate with the least bit of effort. So, without further ado, here is the list of the top 10 articles on this blog for 2008.

10. Top 10 Eclipse Hotkeys

Ironically, this list starts with another top 10 list, namely Top 10 Eclipse Hotkeys. This article from 2006 has just made it onto this top list. With 3,302 pageviews it seems that these keys are still relevant.
9. Human Compact Themes for Ubuntu 8.10
Number 9 is a modification of the Ubuntu’s default theme that is optimized for small screens. With the recent rise of netbooks this becomes more and more wanted.
8. Logical Volume Manager Cheatsheet
sudo pvcreate /dev/sdg1
sudo vgcreate ext_vg /dev/sdg1
sudo lvcreate -L 450G -n ext ext_vg
sudo mkfs.ext3 -m 0 /dev/ext_vg/ext

A compact little cheat sheet that explains how to easily combine two harddisks into one large volume. I have used this to combine two 500GB disks into one large 1TB filesystem.

7. Comprehensive Linux Terminal Performance Comparison
In this highly controversial article I have compared how long several different terminals (xterm, gnome-terminal, etc.) take when displaying one large textfile. I still believe this is relevant, especially when compiling stuff and text flies by. You don’t want your terminal be the limiting factor for your compile speed! I would perform the test yourself, as this seems to be highly dependent on the graphics card driver.
6. Howto Create MANIFEST.MF Classpath from Ant
<!-- name of the output .jar file -->
<property name="jar.name" value="ourjarfile.jar" />

This HOWTO describes a simple way to create the classpath in a MANIFEST.MF file automatically from the libraries available on the harddisk. I have been using this since 2005, and it has never failed me.

5. Human Compact Gnome Theme (for Ubuntu 8.04)
Another Compact theme has made it on the list, this time for 8.04. I have used this theme for quite a while, even on a large 1680×1050 monitor because it really saves a lot of screen space. For everybody still using Ubuntu 8.04, this is the best choice to use a compact layout while still having the default Human look.
4. Optimized pow() approximation for Java, C / C++, and C#
public static double pow(final double a, final double b) {
    final int x = (int) (Double.doubleToLongBits(a) >> 32);
    final int y = (int) (b * (x - 1072632447) + 1072632447);
    return Double.longBitsToDouble(((long) y) << 32);
}

Through some funny floating point representation tricks it is possible to create an approximative calculation of the pow() operator, that is a hell of a lot faster than the standard calculation which has to be extremely precise. This might be useful for games, Artificial Intelligence applications, and everywhere else where performance is an issue and not precision.

3. Ajax Dojo Comet Tutorial
One of the most often seen article contains 3 buzzwords at once: Ajax, Dojo, Comet. This page was linked several times, and it is getting quite a bit of attention. The article was written by an intern at my workplace and he allowed me to put it up here.
2. Clearlooks Compact Gnome Theme
Yet another theme! This startet it all. The Clearlooks Compact Theme was the first compact theme I have created. It is just a modification of the original Clearlooks theme, with tighter spacing. This has been linked quite a lot of time and I get a continuous stream of visitors who are in the need for a compact theme.
1. How to get Enough Sleep Despite StumbleUpon With Ubuntu
This post about me struggling with getting enough sleep despite StumbleUpon was by far the most viewed article on the blog, it has received more than 4 times as much visits as the second best. I guess I hit some nerve with it in the large Linux using StumbleUpon crowd. The article is almost a year old, and I still get lots of visitors each and every day. Happy stumbling!

Thank you everybody for coming to this site and posting your thoughts. I appreciate each and every feedback. Happy christmas and happy new year!

Ripping Multilanguage DVDs with Subtitles using Mencoder

Yesterday at Christmas I got the Akira Kurosawa Samurai Edition, which is a 7 disc DVD set of his awesome movies. I am converting it into the best quality files currently possible: MKV as the container, x264 codec for the video, dual audio, and with subtitles. This is short Howto so that I won’t forget how :-)
Read more

Amazing Caching Proxy in Java

Use Case

Imagine you have some Java code that does lots and lots of computation. All the time intensive calculations is performed by the class SlowCalculator which implements the interface Calculator:

public static interface Calculator {
    public String calculate(int a, String b);
}

public static void main(String[] args) {
    Calculator c = new SlowCalculator();
    // call c.calculate() a lot of times here...
}

You notice that calculate() is often called with the same parameters which lead to the exact same result (SlowCalculator is stateless). This means it is possible to cache values so there’s no need to recompute. Using the generic CachingProxy™ described below, you can create a cached proxy for any class with just one single line of code:

// ...

public static void main(String[] args) {
    Calculator c = new SlowCalculator();
    c = CachedProxy.create(Calculator.class, c);
    // call c.calculate() a lot of times here...
}

That’s it, and the application is blazingly fast again.

UPDATE: Support for null values, transparently handles exceptions, better hash, nullpointer-bugfix.

UPDATE: Here is an article “Memoization in Java Using Dynamic Proxy Classes” that does (almost) exactly the same as this code.

Read more

Human Compact Themes (for Ubuntu 8.10)

This is a new release of the compact theme, based on the original Ubuntu 8.10 (Intrepid) theme. It was created by Jan Suhr almost a month ago, based on my little howto.

I have now two versions of the theme: one with normal icon sizes, and one with the smaller 16×16 icons for even more compactness. Here is a comparison animation of the standard Human theme vs. the compact theme:



You can download the themes here:

Download and Installation

  1. Save the theme to your computer.
  2. Open the gnome’s appearence dialog with System > Preferences > Appearance.
  3. Drag and drop the downloaded file into the Theme tab of the appearance dialog. If you get an error message “Can’t move directory over directory”, you have already installed a theme with the same name. To be able to reinstall it, remove the directory ~/.themes/Human Compact or ~/.themes/Human Compact Small Icons.
  4. Choose “Apply new theme” in the popup dialog.

Most changes will occur immediately, but for e.g. the icon sizes it is best to log out and log in again. When you change the theme, you can get the Human Compact theme back by clicking on Customize, and then selecting Human Compact.

Any question, praise or flames? please post them!

Install for root (e.g. Synaptic)

Some readers asked how to get this to work for applications that run as root (e.g. synaptic), so here it is: simply copy the copy the theme file into the root’s home directory, like this (exchange username with your own name):

sudo cp /home/username/.themes/Human\ Compact/gtk-2.0/gtkrc /root/.gtkrc-2.0

Afterwards synaptic uses the human compact theme.

Older Themes

Here is some information about the original compact themes I have created:

← Previous PageNext Page →