Friday, September 12, 2008

Nekthuth - Making Vim Love Lisp

My friend DieMumiee pointed me to a project call Nekthuth that is supposed to be a mini-version of slime, just for my beloved Vim. The web-site looks promising, there are even screenshots and short, but good documentation. Using it it's quite easy to get Nekthuth installed and getting started.


However, my current SBCL is kinda broken. Dunno what I did to it, but after an apt-get update it segfaulted while compiling some scripts and just seems defective. I tried Nekthuth anyways, just to experience a broken pipe. Ouch. :-(


So you're invited to test it out and send reports to me and the original author. I'm quite interested in whether this project could become at least a partial slime-replacement and drive more Lispers to use Vim, and make Lisp available to Vimmers.

Monday, September 1, 2008

Google's own browser: Chrome

I usualy don't like blogging about a blog-post, but I'll make an exception for this one:


Philipp Lenssen writes in his blog that he received a comic-book from Google that describes a new, upcoming browser called Chrome. You can read about everything announced in his blog-post. IMHO there's nothing special mentioned in the list, nothing that hasn't been done before. Probably the most "exciting" thing about Chrome is that the tabs are above the address-bar, which basically makes no difference, but looks different to all the other browsers.


My guess about some technical details about Chrome is that it is built using WebKit as it's back-end. More specifically, using QtWebKit from the new Qt 4.4 release. As Google has been a customer of Trolltech for Google Earth and maybe other tools before, QtWebKit is just the best tool to build a browser from-scratch.


Because usually Google-tools are high-quality and sometimes even revolutionary, we probably can expect more than has been mentioned in the comic from the browser. Nobody will give away his secrets before launch, anyways.


Update:There is coverage of this on heise, too: Google Chrome: Google greift Microsoft mit eigenem Browser an, but it's a bit too focused on Internet Explorer, imho. Some more interesting things about the relation of Google to the Mozilla Foundation, how it evolved and how Google Chrome might change it, can be found here. In this article I've been proven right that they use WebKit as their rendering engine. No word on Qt, though. The probably most interesting thing about Chrome is separating browser tabs in individual processes.

Thursday, August 28, 2008

BeagleBoard - mini-PC at mini-Price

The guys over at BeagleBoard created an integrated chipset including CPU and graphics processing for as little as $149. With this small thingie you could do gorgeous stuff while using very little room. It'd be perfect for a Car-PC, for example. And for only $23 you even get a transparent housing for that little fella. And there's effort to port and maintain ffmpeg for this platform, making it quite multi-media-enabled.


This is probably as cool as Bug Labs wants to be. At least hardware-wise... a raw chipset is not quite as cool as a BUG, is it?

Wednesday, July 23, 2008

New watercooling setup

I've expanded my watercooling-cycle by one graphics card, namely my new (and second) GeForce 8800 GTS 640MB. My modified Thermaltake Orchestra now cools my CPU, the RAM (OCZ-RAM with factory watercooling support) and two GPUs. The only piece that is missing is the motherboard's chipset. I think I will not add watercooling to my current motherboard, but wait till I buy a new one.
Here are a few pics that show how beautiful it looks now.









Thursday, June 19, 2008

Evangelion 1.01: You are (not) alone

Since anime and computer-enthusiasm are strangely connected together, here's some anime-news.

You are (not) alone is a new movie that re-tells the first few episodes of the original Neon Genesis Evangelion anime (and manga) and is the first of a series of four movies. We all know that Neon Genesis Evangelion is one of the best animes ever created and trying to remake it is a very delicate task.


I think, however, that the studios have done a great job with this first movie! The first fifteen to twenty minutes are nearly identical to the original, with a few scenes left out and short cg-scenes added (which I think look a bit misplaced and don't fit in that well). But the later the movie progresses the more scenes are replaced, and as the story develops (which has changed a little bit, too), the movie features quite much new, high-quality content. I don't know whether it was a sound problem on my system, but there's a high pitch sound in the background every time someone talks. I imagined that it could be caused by filtering out background sounds from the original material, but I hope this is not the case. I'll try the DVD on a normal DVD-player when I get the chance for it.


Overall, I am very satisfied with this movie. As I don't have subtitles for it, yet, I didn't understand a few scenes so I couldn't follow the story 100% (my japanese is still bad). I'll watch it with subtitles again as soon as I get the hands on some and find the time, and will post an update.

Monday, June 16, 2008

New introductory book on C++ by Bjarne himself

Bjarne Stroustrup, the "inventor" and first implementer of C++, is about to publish a new book. It's titled Programming - Principles and Practices Using C++ and is going to be published in August. It's already listed at amazon.com. In contrast to The C++ Programming Language, this book is on an introductory level to programming, not only C++. It's something that the C++ community was lacking for years now, with the only alternative of Accelerated C++.

Wednesday, June 4, 2008

xstartonce: Boost your productivity

I've grown accustomed to a way of working on my Desktop which greatly enhances the speed and therefore productivity of working by accelerating switching to certain applications. There are relatively few applications which I use on a daily basis. I'll mention just a few examples here: I use Firefox (well, now it's Arora) for browsing, Vim to edit files, and a shell for doing various stuff. I have to switch between those frequently. Often when coding stuff in Vim, I have to look up information on the net, so I have to switch to Firefox. When I'm done looking up stuff I'll try it out on the console and then switch back to Vim to integrate it into the program. Switching back and forth between applications can be quite a hassle because of the "most recently visited"-paradigm usual implementations of Alt+Tab (or similar) use. The most recently visited window is the one that'll appear first when switching windows. This works great if you have only two windows. It'll get irritating and slow when you have more than two windows and switch back and forth in an unstructured order.


So I've invented this methodology of work: Every regularly used application is assigned a shortcut. It's Ctrl+Alt+F for Firefox, Ctrl+Alt+V for Vim and Ctrl+Alt+C for the console. The program I use for shortcut is selfmade, because it needs one special feature: When the shortcut is activated, the program looks whether there's already a running instance of the application I want to switch to. If there is none, it'll be started (and automatically get the focus). If it is already running, the existing instance will be focused. This works great. When I need my browser, I don't have to think about whether I've already started it, and if so, where have I started it or anything. I just press Ctrl+Alt+F and have a Firefox or Arora window activated.
I have shortcuts for about 8 applications at work, including one or multiple local and several remote consoles, the aforementioned Arora and Vim, Delphi, Microsoft Visual Studio, InstallShield, the production-copy of the application I'm writing and a few more.
Without my shortcut-application I'm really at a loss and struggling with cycling through windows with Alt+Tab.


Until now, there was only one unreleased, Windows-based program which would enable this work-methodoligy: It's called KeyboardGuy, and it's written by me and exclusively used by me.


When I switched to Linux recently, I was really missing that comfort. So I looked for a way to accomplish this with as little work as possible.


The very first try was a shell-script that uses wmctrl to find out the Process- and Window-IDs that I needed. It looked up the process-name via ps and would activate the window if the basename of the specified application and the process-name in ps matched. With my relatively limited knowledge of shell-scripting, I came up with a script like this:

#!/bin/sh

PROCESSES=`wmctrl -l -p | awk '{print $3}'`
DOEXIT=
ps h -p $PROCESSES | while read i;
do
ID=`echo $i | awk '{print $1}'`;
NAME=`echo $i | awk '{print $5}'`;
NAME="`basename "$NAME"`";
if [ "$NAME" = "$1" ]; then
wmctrl -l -p | while read WID;
do
WPID=`echo "$WID"|awk '{print $3}'`;
if [ "$WPID" = "$ID" ]; then
wmctrl -i -a `echo $WID|awk '{print $1}'`
exit
fi
done
fi;
done

echo $DOEXIT
"$1"


There exists one problem, however: The script needs to completely terminate after wmctrl -a is executed. The call of exit that should accomplish this, however, did not work as expected and the line "$1" (which starts the application given as the first parameter) is always executed, even when the window was activated first. Because I was rather unsatisfied with the whole thing and couldn't get it to work, I decided to rewrite it in C++, using Qt (because Qt makes many things much easier for me here, and I wanted to get this done quickly).
The final result is the application which I call xstartonce.

xstartonce


The current version is the second iteration of the C++/Qt-version. The first version would match the basenames of the given application and the path found in ps's output. This leaves one big limitation, though: You can't assign shortcuts to one and the same program. I need this, for example, because I want shortcuts for a local and several remote consoles. Those would look like "urxvt" for the local console and "urxvt -e ssh melchior" for the remote console. Because the basenames match (both are urxvt), the shortcut-application would not be able to switch between those two distinct consoles.

Configuration file


That's why I invented the "named shortcuts". This needs a configuration file (~/.xstartonce), which has a very simple structure: It's <shortcut-name>=<command --param>. My ~/.xstartonce looks like this:

urxvt-local    = urxvt
urxvt-melchior = urxvt -e ssh melchior
firefox = firefox
assistant = assistant
gvim = gvim
vim = urxvt -e vim


Currently, only named shortcuts are possible. This means that for each application you want to launch, you need a configuration-file entry. I've totally abandoned the formerly discussed algorithm to match the basenames of the processes in favor of this approach. I will, however, make both possible in the future. This has an advantage that was bugging me with the Windows-version already: When opening firefox from anything else but my shortcut-app, it'll not get "recognized" by it and a second instance will be opened when using the shortcut next time. With the basename-matching algorithm, I can use apps that I don't want to open twice with distinct shortcuts better.

Temporary Process-ID list


xstartonce creates an entry in /tmp/xstartonce-db.<user-name> for each started named shortcut. The structure is like the configuration-file: <name>=<process-id>. When executing a shortcut, first the name is searched in the configuration. If it is found, the xstartonce-db is searched for the name, and if it is found there, the window-id matching the process is looked up via wmctrl -l -p. If a window is found, it is activated. If either no window or no process is found, the command is executed.

Getting xstartonce


xstartonce has tree dependencies: A C++-compiler, Qt and a UNIX-like operating system with the X window system running. If you meet those criteria, you can download the source-code in my github-repository.

Notice:I'll clean up this blog-post and correct spelling and grammar errors tomorrow. It's already past bedtime, so I'm off to get some sleep :-)


Using keyboard-shortcuts


What I haven't mentioned, yet, is how this all works together with keyboard-shortcuts. Well, the answer is easy: Use whatever tool you know for executing keyboard-shortcuts and run xstartonce instead of the application you want to launch. I'm currently using KDE's shortcut-enabled menus together with xstartonce. You can edit KDE's menu by right-clicking it and choosing "Edit menu". Then you can add new menu-items and assign a shortcut to them.
Here's a screenshot how I do this:
Assigning shortcuts in KDE's menu