Thursday, December 25, 2008

Umlauts on the US keyboard with xmodmap

I'm totally dependent on my US layout keyboards, both on my stationary PC and my laptop because it proved to be my preferable way of coding, mainly because the majority of symbols used in most programming languages are easily accessible, sometimes even without the need for modifier keys (e.g. '{','}','\' and most of all '/'). Once I've tried the British English layout (back when I had the C1 'picture book' of Sony) which wasn't bad either and had some interesting ideas ('"' reachable via SHIFT+2) but it didn't convince me to make a full change.
I actually can even get used to QUERTZ-layouted keyboards (like the German or Swiss one) and other, non-coding-friendly QUERTY-layouts (like the Spanish one) quite fast because I get to use them from time to time when I use (read: fix) a friend's or family members' computer. But still, the US layout is my prefered choice and I wouldn't want to miss it on my own devices which was, by the way, one reason why I imported my last laptop from the states.
Nonetheless, every once in a while I need to use symbols like umlauts or the German eszett (ß) in order to write emails properly. That's why I'm using a couple of xmodmap rules to add that functionality in a convenient way: Umlauts are mapped to the ALT key and the corresponding vowel (e.g. ALT+u=ü), the same applies for the eszett (ALT+s=ß). My old rules stopped working some when because the keycode for the ALT key changed and thus interfered with other keys (in my case with the cursor keys). This is my current script which I'm using on X.org 1.5.2:

keycode 108 = Mode_switch
keycode 20 = minus underscore ssharp
keycode 34 = bracketleft braceleft udiaeresis Udiaeresis
keycode 47 = semicolon colon odiaeresis Odiaeresis
keycode 48 = apostrophe quotedbl adiaeresis Adiaeresis
keycode 26 = e E EuroSign EuroSign e E
keycode 30 = u U udiaeresis Udiaeresis u U
keycode 32 = o O odiaeresis Odiaeresis o O
keycode 38 = a A adiaeresis Adiaeresis a A
keycode 39 = s S ssharp ssharp s S

Labels: ,


Friday, December 5, 2008

create packages of E17 themes

Before the repository revamp there were packages for E17 themes in the repository on debian.alphagemini.org; they were based on a BASH script which fetched the themes listed on get-e.org. Now that get-e.org is gone, E17 themes can be found on exchange.enlightenment.org along with a whole lot of desktop wallpapers, 3rd party applications and modules. That's why I felt it was time for writing a new script, this time in python. It basically does the same, with less BASHish temp files, sed, grep or wget usage. To use it, simply run it in an empty directory as a normal user (no privileges are required) and run dpkg-buildpackage in the resulting folder. It can be downloaded here.

I've uploaded the packages to my repository, including the virtual package e17-themes which installs all available themes.

Currently included themes:

e17-theme-apple-17 - The Apple 17 theme for E17
e17-theme-baroque - The Baroque theme for E17
e17-theme-black-chrome - The Black Chrome theme for E17
e17-theme-blingbling - The BlingBling theme for E17
e17-theme-bloody-imago - The Bloody Imago theme for E17
e17-theme-blue-eyed-theme - The Blue Eyed Theme theme for E17
e17-theme-camou - The Camou theme for E17
e17-theme-cerium - The Cerium theme for E17
e17-theme-chrome - The Chrome theme for E17
e17-theme-clearlooks - The Clearlooks theme for E17
e17-theme-crema - The Crema theme for E17
e17-theme-crude - The Crude theme for E17
e17-theme-cthulhain - The Cthulhain theme for E17
e17-theme-dali - The Dali theme for E17
e17-theme-darkness - The Darkness theme for E17
e17-theme-darkrevolution - The Darkrevolution theme for E17
e17-theme-darkside - The Darkside theme for E17
e17-theme-dukes - The Dukes theme for E17
e17-theme-edjy - The Edjy theme for E17
e17-theme-fireball - The Fireball theme for E17
e17-theme-gant - The Gant theme for E17
e17-theme-grunge - The Grunge theme for E17
e17-theme-iceball - The Iceball theme for E17
e17-theme-imago - The Imago theme for E17
e17-theme-japan2007 - The Japan2007 theme for E17
e17-theme-kor - The Kor theme for E17
e17-theme-night-bling - The Night Bling theme for E17
e17-theme-nyz - The nyz theme for E17
e17-theme-pinkapple - The PinkApple theme for E17
e17-theme-purewm - The PureWM theme for E17
e17-theme-siro - The Siro theme for E17
e17-theme-smoke - The Smoke theme for E17
e17-theme-steampunk - The Steampunk theme for E17
e17-theme-winter - The Winter theme for E17
e17-theme-xliquid - The XLiquid theme for E17

Labels: , ,


Monday, December 1, 2008

classic template tag cloud

Since I'm hosting this blog on my own server I'm not able to use the blogger's new "Layouts customization" and thus can't display these fancy tag clouds which usually appear in the sidebar. However, I've found some solutions which add labels functionality to classic blogger templates, the most flexible of which seem to be using a PHP script which can be used in the template. So I've modified the script found on this blog, fixing a minor bug and adding two new features. First, the script now takes care of the actual amount of tagged articles under a certain label which can optionally be displayed next to the label (check the second source code snippet and uncomment the appropriate lines):

if(preg_match("/\/labels\//", $_SERVER['PHP_SELF'])) {
$files[$file] = substr_count(
file_get_contents($file),'<!-- End .post -->');
} else {
$files[$file] = substr_count(
file_get_contents(PREFIX.$file),'<!-- End .post -->');
}

Second, result pages invoked from links in the label cloud now correctly link to other results by conditionally removing the prefix to the label directory:

if(preg_match("/\/labels\//", $_SERVER['PHP_SELF'])) {
$output .= "<a style=\"".
get_style($low_end, $high_end, $size) . "\"".
"href=\"". htmlentities($name)."\">".
# Uncomment the next and comment the following line in order
# to display the number of posts for each given label.
#htmlentities(str_replace('.html','',$name))."(".$size.")</a> ";
htmlentities(str_replace('.html','',$name))."</a> ";
} else {
$output .= "<a style=\"".
get_style($low_end, $high_end, $size) . "\" ".
"href=\"".PREFIX. htmlentities($name)."\">".
# Uncomment the next and comment the following line in order
# to display the number of posts for each given label.
#htmlentities(str_replace('.html','',$name))."(".$size.")</a> ";
htmlentities(str_replace('.html','',$name))."</a> ";
}

The complete file can be downloaded here. Follow these steps to set it up and running:
  1. Copy the script to the root folder of your blog.
  2. Modify the SEARCH_DIR define in line 4 to suit your setup.
  3. Create a directory called cloudtemp in the ./labels directory of your root folder:
    # mkdir labels/cloudtemp
  4. Add the directive
    AddType application/x-httpd-php .html
    to your VirtualHost file, e.g. to the section.
  5. Reload your apache server:
    # /etc/init.d/apache2 reload
  6. If you'd like to display the number of related articles in brakets behind the label's name just follow the directives in lines 52 and 60.

Labels: , ,


Sunday, November 30, 2008

Lumix DMC-LX3

Every once in a while I find myself taking a look around the market regarding gadgets, PC components or alike. Two weeks ago, for example, I was tasked to find a new digital camera for someone. Yep, the term "digital camera" is quite wide and given that I had no restriction on the price nor the brand mark I almost didn't know where to start looking. I searched for prices, specs and reviews on everything from light weight compact toys to full blown SLR behemoths. To make a long story shorter, I ended up buying a camera myself.

My girlfriend and me decided to buy the Konica Minolta DiMAGE Z10 camera about four years ago because it was using some kind of fake SLR view finder. This so called "Switch Finder" allows to project the image on the LCD to the view finder which comes in handy if you're used to shoot photos like that or if the daylight makes the LCD unreadable. The rest of this camera's features were all good but none of them were that important either: 8x optical zoom, fast start up, use of normal AA batteries (we used to have bad experiences with proprietary ones) - all at the cost of quite a bulky device with rather low 3.2Mp. Most of the photos I've taken during the last years, including those found on my picasa gallery, were all shot with this camera.
Actually buying a new camera after all these years was something I really didn't expect because the Z10 worked (and still works) without any issues.



I've looked at plenty of new cameras and could narrow the results down quite well by discarding cameras with CCD chips which contain insane amounts of pixels on a small chip area. Thus I was looking at cameras with a chip size of 1/2.0" or bigger to have decent sensitivity and color saturation. Now I started discarding results of cameras which had still a too high density of pixels on their CCD chips which might result in image quality degrade as described on http://6mpixel.org, like the Ixus 980 IS of Canon with a 14.7Mp sensor on a size of just 1/1.7".

At this point I was left with the Sony Cybershot DSC-W300, the Pentax Optio S12, the Ricoh GX200 and, of course, the Panasonic Lumix DMC-LX3. I discarded the first two quite quickly because of their cheap plastic body and overall medium features.

Next was the optical system. Without doubt there are plenty of opinions out there about lenses and their qualities and I won't go into detail. The Leica F2.0 24mm DC Vario-Summicron lens however was what made me choose the Panasonic over the Sony device. In combination with the high sensitivity CCD chip it allows the user to shoot pictures in dark surrounding with much higher shutter speeds than any camera in that category resulting in sharper pictures with minimal noise. Additionally, its SLR-like wide angle and very constant sharpness allows for compositions not yet seen from compact cameras.




The only catch for me was the lack of a view finder as I was used to from the Z10 but this got resolved when I could try the LX3 in a local shop to see that LCDs evolved greatly during the last four years, especially in regards of brightness. Also, view finders usually bloat the cameras which, at least for me, is a high price to pay - especially if I can get used to live without them. Another slight disadvantage is the reletively small 2.5x optical zoom. This however is understandable considering the wide angle lense and the total size of the camera and zooming in more than 4x with my old camera resulted in blury pictures anyway, at least most of the times.



The LX3 comes up with some supposedly new and fancy user interface, but to be honest I can't comment much on that because nowadays every new camera naturally features far more functions than the Z10. Overall, the LX3 offers technology which is only found in SLR cameras so far - which is probably why it is targeted at the SLR photographer who needs a compact camera but doesn't want to miss out all the manual adjustment posibilities or the high image quality. On top of all the technical details though, I simply fell in love with the design of the LX3. It looks serious, not cheap, useful and without useless eye catching or modern properties - I think this is why I've got a weakness for Thinkpad notebooks, too.



Last but not least Panasonic offers a couple of accessories, like a wide angel converter, an external, optical view finder and various filters.

I did some field tests with the LX3, to see how it performs in low light situations. The results can be found here:

LX3 shots

Labels: ,