git-svn article
written by admin 4 days ago. Last update at 2010-02-05 21:40:21. Categories git. Tags git, git-svn, subversion, VCS .
Working with git-svn without upstream (= subversion) branches is kind of no-brainer. It starts to be a different story when branches are involved. I wrote a rather small article about some experiences and experiments taken with git-svn. Please download this article for reading by following the link(s): PDF. HTML.
XeTeX: “Failed to convert input string to UTF16″
written by admin 4 days ago. Last update at 2010-02-05 21:40:21. Categories tex. Tags tex, xetex .
XeTeX allows me to hack away directly in Unicode. But what’s even more cool is that I can just use the fonts installed on my system without diving into some of TeX most darkest corners. However, when I compiled a larger document with xelatex, I faced some strange warnings like
This is XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009) entering extended mode [..] ** WARNING ** Failed to convert input string to UTF16...
and I had no explanation where this might come from. After a divide-and-conquer debugging session, it turned out that my input was just fine. It was rather a setting that caused this warning:
\hypersetup{
..
unicode=true % causes UTF-16 warning
}
After having removed that line, all UTF-16 warnings are gone.
iSync Plugin
written by admin 7 days ago. Last update at 2010-02-05 21:40:21. Categories macosx.
Uploaded an iSync plugin for the Nokia 2720 (fold) mobile phone. When plugged in, it will become easy to synchronize addresses, events etc. between the mobile phone and your Mac. Just enable Bluetooth on your Mac and on your phone and make sure that they are paired. Then, start-up iSync and add a device. It should find automatically your mobile. Otherwise it will report that your mobile is not supported. Once the device is added, just press the big round button to start syncing.

iSync screenshot with device Nokia 2720 added.
The easiest way to install this plugin is by using the nokia-2720a-2.dmg installer package. When being used, the plugin will be installed in folder /Library/PhonePlugins/. To support other installation locations, other package formats have been uploaded as well. To support a private installation, create folder ~/Library/PhonePlugins then download an untar package nokia-2720a-2.phoneplugin.tgz within this folder. Eventually restart iSync and try adding your device again.
About Reseting CSS Properties
written by admin 71 days ago. Last update at 2010-02-05 21:40:21. Categories webdesign. Tags css, webdesign .
Designing a layout using HTML/CSS is not a job for the faint hearted. Quit often there is a clash with built-in properties which are not consistent defined in all browsers. This led to the approach of using a style-sheet which resets CSS properties. The style-sheet populated by Eric Meyer, a rather well known CSS styling guru, is for example given here.
Eventually I would like to say that it did not work out for me. All too often I found myself trying to set the default values I have just discarded in my reset.css style-sheet. Ignoring inconsistencies for the moment, the I would like to state that usually all default properties are rather wisely chosen and contain exactly what you want when writing an article, a posting whatever.
Inconsistencies start to matter when designing a website. Then browser inconsistencies can have disastrous effects (like two divs are not side-by-side floated cause they don’t fit in the given width by perhaps just one pixel). However it’s just a small part of the website which needs precision rendering and not the whole website.
So, instead of setting the padding of all divs to be
div { padding: 1px 0; } /* avoid margin collapsing */
I propose to reset only where it matters:
#header, [..], #footer, #header div, [..], #footer div, #content-main {
padding: 1px 0; /* avoid margin collapsing */
}
Please notice that divs are reset in all grid elements except within #content-main (supposed to hold your page its informational content). Therein, default values are just fine.
Forward By Word!
written by admin 131 days ago. Last update at 2010-02-05 21:40:21. Categories admin, bash. Tags bash, emacs, readline .
I have to confess that I’m a notorious user of the command line. I do use the command line also on my MacBook Laptop where one of the first actions after having logged in is to open the so called terminal application (Terminal.app, kind of hidden in the Utilities folder). This terminal application is really a step forward compared to xterm or rxvt and is also looking marvelous good.
The hidden gotcha is speed. Where would speed matter you may asking? Well, after having typed in and executed some command, the next command is most often just a minor variation of the previous one. Instead of retyping almost everything again, I let readline’s previous-history function repeat the last (or an earlier) command, move the cursor char-by-char to the desired position where I dare to change something, do the change and eventually execute the command by pushing the RETURN key.
At this point I would like to add a not on the notion used in this small survey about to denote a particular key. Obviously if I mean the key “a” then it’s the small tile on your keyboard with that engraved letter “a”. “A” is bit more complicated cause it is a combination of two “tiles”, namely the “SHIFT” tile and the “a” tile. What you need to do to get the “A” is to hold down tile SHIFT, followed by “a” without releasing SHIFT. So how does the SHIFT key looks like on your keyboard? I have no clue. On my keyboard it’s a tile with a upword-pointing non-filled arrow character. Other keyboard keys of particular importance are the (carriage) RETURN key (originally to move the typewrite’s write position to the line’s beginning), the CONTROL key, the ESCAPE key and usually four navigation keys (usually right and left, up and down).
There must be some convention how to write down a sequence of keystrokes. The one readline uses and which is also being used in this survey is the following: \C means the control key and \e is the escape key. \M is the meta key. I don’t have one on my keyboard, so \e is taking over automatically. Furthermore there are the left and right navigation keys which I’m denoting with <- and ->. Notice that readline does not have a notation for this keys. Instead such a key is represented a key sequence starting with the escape key (\e).
This all works fine except that moving the cursor char-by-char is awfully slow, even in those days with a small super computer right in front of me. It would be really great if I could move forward/backward word-by-word as well. This is of course possible using readline. The function names to do so are forward-word and backword-word.
All fine and well except the default key bindings used for forward/backward word. The standard key binding is \M-f and \M-b. The idea is good. Use \C-f to move forward a char and just switch to the meta key to move forward a word instead. My problem is that I have to press key \e once, then release that key and the press the f key to get the desired effect. That’s much slower than pressing the \C key followed the f key while still holding the \C key. In fact is so much slower that I almost never used the forward move feature. But as I said, forward by char is anoyingly slow.
What I want to do is to assing forward-word with \C--> and backward-word with \C-<-, i.e. I would like to invoke forward-word by holding down the \C key followed by pressing the right arrow (and left arrow for moving backward). This would suite me quite well cause the standard action when pressing the right and left arrow is moving forward or backward a char and this are the keys I’m actually using when moving the cursor (for completness: the up and down arrow move forward and backward in the history).
At this point I had to dig into the documentation to be able to continue:
- How to configure readline?
- How force bash to re-read the configuration?
- How can I see the active bindings?
- How can I see the escape characters generated by a key?
The first question is easy. Add or change a (hidden) file named .inputrc right in your home folder. This file is taken into consideration if existing. You can change that setting an environment variable named INPUTRC if you are not happy with the name or the location. In any case, readline will also read the system wide configuration file /etc/inputrc if existing.
Having changed .inputrc, how do I make my terminal application (which runs bash as interactive shell) aware of any changes? You can start a new terminal application (tab or window) or you can type \C-x \C-r in your current one as cheap alternative.
Ok by now, but how can I check the current bindings? When running the bash, use bash’s builtin command bind. For example, you may want to run
% bind -P
to get a relation between readline functions and keys bound to that function. Or you may use bind -p to get a key : function mapping for each function (the output of bind -p would be a valid .inputrc file; it also shows unbound functions – quite useful actually).
Jolly good by now. Except that I have no clue what kind of character sequence is generated by pressing down the right or left arrow key or even what might be generated by additionally holding down the control key (\C). Here another useful readline function, named quoted-insert, comes to rescue. By default, this function gets invoked by \C-v and what it does is, that it inserts the next character you type right there at the cursor’s position.
So you are curious what might be generated by \C followed by holding down the right arrow (->) key? Go ahead and type \C-v \C--> in your terminal and the result on my terminal looks like
$ ^[[5C
Great, now we are almost there. The very last hurdle to overcome is to understand that ^[ is actually the escape key. You can verify this easily using the quoted-insert method explained previously. So what’s left is to add something like this to your local .inputrc and make readline reload that file:
# Make CONTROL - (left arrow) move cursor backward
# one word resp. forward one word
"\e[5D": backward-word
"\e[5C": forward-word
Happy hacking.
IRB and the missing idiom
written by admin 138 days ago. Last update at 2010-02-05 21:40:21. Categories devel, ruby.
I have recently turned my eye on using Ruby for small and not so small programms. Honestly, Ruby is really exciting and should probably also been listed as one of those things that brings the wow! back on your computer (the other being Apple and Google). Then there’s this book about Ruby, the so called Pick-Axe, wetting my appetite.
The Pick-Axe writes also about irb, the interactive ruby interpreter. So what you can do with irb is to fire it up and hack away some ruby code to give it a try. When you eventually shutdown irb your typed code is gone of course. The book shows lots of such examples.
That’s all fine and good except that using irb this way is bit unrealistic. Actually what I really want to do is to load my ruby project in irb and call methods, create objects, inspect variables etc — without running my project of course. But this is exactly what happens when doing something like
% irb -r 'foobar.rb'
So how to tell irb not to execute my ruby code? Unfortunatly the Pick-Axe is rather silent on this. Here’s how to do it:
if __FILE__ == $0
# executed if not in irb
..
end
I love my Mac!
written by admin 146 days ago. Last update at 2010-02-05 21:40:21. Categories macosx.
This article is actually not about developing software. It’s all about that the wow!.. is back, at least once a while. It was again my Mac featuring MacOS X 10.5 aka Leopard making me happy. It started with my mobile device which, for unknown reasons, stops working when in a foreign country. Stops working in this context means that I can’t make any phone call nor send SMS. So this is pretty serious. I called my provider’s help desk. Not that I expected any help. It’s just about that I call it because its there or not having a bad conscious not having called them for help. After 12 days without any sign of live from my provider, I called them today for a status query ..
After that call I decided to go for a master reset of my good old T630 phone. Obviously such a master reset will kill any data on that device. So how to export them? On Windows XP I used FMA which worked reasonably well and is free software. Ok but now I’m using a Mac..
After I while of searching the Internet for a Mac based tool I had the glorious idea to just let my Mac connect to my via phone via Bluetooth and see what will happen. So I did and voila , after having established a connection, a tool started up out of the blue. It was iSync which comes packaged with Leopard. And from there I lifted off and saved my phone’s address book on my back. Basically it all happens in seconds. So there it was, the wow effect. This is really a marvellous piece of work, this computer and it’s software. I love it.
As you might know, light and shadow are close friends. I’m still not able to do my master reset cause I have no clue about my phone’s phone lock code….
Happy Hacking.
mod_autoindex
written by admin 149 days ago. Last update at 2010-02-05 21:40:21. Categories admin, apache httpd. Tags apache_httpd .
mod_autoindex is a plugin for the the Apache web server. The plugin is responsible for presenting the contents of a folder if folder browsing has been enabled and if a default file, traditionally index.html, is not available.
So far so good except that the default presentation generated by mod_autoindex is rather boring. We want to have it a bit more spicy. Therefore mod_autoindex has a lot of applicable options which are crying to be used.
Apache’s webserver has got a reputation of being difficult to configure and mod_autoindex is actually a perfect example for this claim. I don’t judge the software here as such, in my opinion, it’s rather about the documentation. As a teaser, you might wonder what mod_autoindex generates by default? This is what get generated for a folder containg just a file and just a subfolder:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head><title>Index of /js</title></head>
<body>
<h1>Index of /js</h1>
<ul><li><a href="/"> Parent Directory</a></li>
<li><a href="file"> file</a></li>
<li><a href="folder"> folder</a></li>
</ul>
</body>
</html>