2006, October 12 (Thu) | |
Linux, Programmierung – Deutsche Umlaute auf Tastatur mit US-Layout | |
---|---|
Wer viel programmiert hat wahrscheinlich bemerkt, dass das englische Tastaturlayout dafür besser geeignet ist, als das deutsche, da dort viele Sonderzeichen leichter zu erreichen ist. Allerdings stehen dort keine Umlaute zur Verfügung. Oft kann man diese zwar nur ae, oe, ue ersetzen, in formellen Schreiben ist dies jedoch eher unerwünscht. Um dieses Problem zu umgehen, habe ich mir eine Keymap für xmodmap angelegt. Diese ermöglicht es mir, die zweite Windows-Taste (Menü-Taste) als eine Art zweites Shift zu benutzen. D.h. mit Win2+a mache ich ein ä, mit Shift+Win2+a ein Ä. Selbiges natürlich auch bei öüÖÜß. Um dies zu erreichen legt man eine ~/.Xmodmap mit folgendem Inhalt an: keycode 117 = Mode_switch keycode 38 = a A adiaeresis Adiaeresis keycode 30 = u U udiaeresis Udiaeresis keycode 32 = o O odiaeresis Odiaeresis keycode 39 = s S ssharpUm das Layout sofort zu aktivieren, einfach xmodmap ~/.Xmodmap ausführen. Der Keycode 117 steht dabei für die Windows-Menü-Taste. Die Keycodes von anderen Tasten kann man über das Programm xev herausfinden. Die Namen von weiteren Sonderzeichen aus anderen Sprachen kann man sich aus den jeweiligen Layouts in /usr/share/xmodmap heraussuchen. |
|
2007, January 31 (Wed) | |
Netzwelt, Programmierung, Web Dump – Irssi Scripts | |
Don’t get me wrong, please. I haven’t written these scripts — I was Because I’ve got them lying ‘round in my so called “Web Dump” I hope this can be of interest to some of you, and maybe I have a lucky I have lsted these works in no particular order:
|
|
Tags:
| |
2007, June 28 (Thu) | |
Linux, Programmierung – Direct I/O filesystem access in Linux with O_DIRECT | |
I just tried to read files from the filesystem using direct i/o to avoid the operating systems caching effects. contrib/myfile.c:44: error: ‘O_DIRECT’ undeclared (first use in this function) The solution was easy: #define _GNU_SOURCE before including fnctl.h. This is actually mentioned in the manpage, but only in a footnote that is easy to overlook. |
|
2007, October 24 (Wed) | |
Linux, Programmierung – thttpd and hgweb.cgi | |
hgweb.cgi, which is a Pythonscript to provide webaccess to a hg repository, does not work out of the box with thttpd. The error is: The quick-and-dirty fix is kinda simple; write a small wrapper which sets REQUEST_URI and runs hgweb.cgi. The content of REQUEST_URI seems to do not matter at all. |
|
2009, March 09 (Mon) | |
Programmierung – Jabber components | |
I could not really find an easy example how to get started with Jabber components (using xmpp4r), so this I will cover the absolute basics here. You will need a Jabber server to connect your component to. I suggest to install ejabberd locally. Also needed is xmpp4r, which can be installed through rubygems (e.g. using The following snippet is used to configure ejabberd to listen for your component. After altering the configuration, do not forget to restart ejabberd. DNS seems to be important for elang-stuff, so make sure the host you use (e.g. localhost) can be resolved properly. Now you can create this small file, name it mycomponent.rb and use the following content: Using this kind of Hash as configuration makes it very easy to use YAML to store your configuration in a file. If ruby can’t find xmpp4r, you might have to Now you can run your component and send messages to mycomponent.localhost. The |
|
Programmierung – Ruby Logger Singleton | |
Sometimes you might want a Singleton Logger in Ruby. Here is what works:
|
|
2009, March 19 (Thu) | |
Programmierung – Jabber component mapping Microblogging to Multi-User-Chat | |
I have put some glue between xmpp4r and twitter, et voila, a Jabber component mapping Working right now:
Missing:
You can try this out by joining the MUC-room {identi.ca|twitter}@omb.jabber.teamidiot.de The repository (mercurial) is at: http://gonzo.teamidiot.de/repos/ombmuc/. |
|
2009, October 04 (Sun) | |
Programmierung – calling C++ bind-bound functions with variable parameters | |
Consider this following small example program.
We write a subroutine that outputs the multiple of its arguments, a and b.
We then call it from main.
Next, we want to use bind to bind some arguments and call it. Unsurprisingly, the output is the same.
We can also store this bound function and call it:
Things get wicked, when we want to predefine only one parameter, though :(
|
|
Tags:
| |
Continue reading “calling C++ bind-bound functions with variable parameters ” » | |
2010, May 26 (Wed) | |
Programmierung – cpan for local user configuration | |
To install perl modules without root permission, this seems to work for me within UPDATE the modern recommendation would be to use the (almost) excellent local::lib module. First, download the archive through the link on the right side of the CPAN search page. Unpack it somewhere and follow the instructions on the CPAN site: run Now you can (after log-out and log-in) just run (old content below) |
|
Continue reading “cpan for local user configuration” » | |
2010, June 18 (Fri) | |
Programmierung – int log2 in gcc / c++ | |
I wonder why this result isn’t on google’s #1 for int log2 gcc. To get the integer logarithm to the base of 2, try
|
|
2012, July 31 (Tue) | |
Programmierung – g++ make depend generation | |
If you look at automatic make file dependency rule generation for the g++ compiler, there are a lot of different solutions on the Internet. I’m not sure which one is the best, but it sure involved the I found the following to work sufficiently at the end of my simple project Makefile:
the this requires the source files predefined in SRC, example:
|
|
Tags:
| |
2013, January 18 (Fri) | |
Programmierung – mysterious crash in program_options | |
gdb backtrace looked something like this:
note to self: don’t forget to upgrade binutils/gold/ld |
|
2013, October 30 (Wed) | |
Linux, Programmierung, Web Dump – Network Scanner Server, headless | |
Usage scenario:Your small group has a scanner in walking distance, and wants to use it for simple scanning.
This script will poll the buttons, scan according to two pre-sets (you could make the scripts more complex if desired) and publish the result on a Windows share. Communication with the user is done through speech synthesis software. End user experience:
Script to do it:You can grab your copy here: scanbtn.tar. Detailed information is inside the README file therein. Enjoy! |
|
Navigation | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
« | Politik | « | Main | ‹ | All articles list (Archives) | › | Search | » | Web Dump | » |