Sunday, 21 December 2008

colemak

I have some time off from work and decided it is time to
finally learn and use the colemak keyboard layout.
This is one of my new year resolutions, and I cannot
explain how exited I am about this. I'm actually typing
this post using it, but its still slow going.

I had some trouble getting it to work in ktouch, but I figured it out:
http://forum.colemak.com/viewtopic.php?pid=4378#p4378

I also had some trouble convincing kubuntu to handle the capslock key
as a backspace key. The final solution for me was to make a little script,
and get it to run when kde starts up.
script:
#!/bin/bash

#setup capslock -> backspace (nice for colemak)
xmodmap -e "remove Lock = Caps_Lock"
xset r 66
run it automatically:
system settings -> advanced -> autostart

I practised for 30-45 minutes per day and I learn more keys every day.
Some of the nice things about Colemak for me are:
  1. You learn the common keys first, so you can actually start typing quite soon. (You can type a lot by just using the home row.)
  2. You are forced to touchtype, because looking at the keyboard doesn't help (assuming you didn't swap your keys, which I recommend.)
  3. Most of your short cut keys are in the same position.
I found these finger stretches quite handy:
  1. http://ergotrading.net/officeathlete/ergonomics/Nine_Stretches_and_Alternative_Instructions/FingerStretch.htm
  2. http://www.rsiwarrior.com/stretches.html
  3. http://www.mayoclinic.com/health/stretching/WL00030

Thursday, 11 December 2008

Symbolic link not allowed

I got the following nasty exception in my /var/log/apache2/error_log,
and it took me too long to figure out how to fix it:

Symbolic link not allowed or link target not accessible: /opt/gforge5/plugins/scmbzr

Where in my case /opt/gforge5/plugins/scmbzr is a symlink to somewhere else.
I checked and rechecked all my permissions, but nothing worked.

So eventually it turns out that for every directory in the path where you have symlinks, you need something like:

<directory>
Options FollowSymLinks
</directory>

(because I have a symlink in plugins called scmbzr)

Thanks a LOT to Ivan Van Laningham who mentioned this on some mailinglist:
http://www.mail-archive.com/mailman-users@python.org/msg44430.html

Monday, 8 December 2008

A query which generates a sequence in Oracle

Sometimes for some reason, you may need a query in Oracle
which can generate a sequence of numbers or dates.
I found the following to be an elegant way of doing it:

--count from 1 to 10
SELECT rownum
FROM dual
CONNECT BY LEVEL <= 10

--even numbers from from 2 to 20
SELECT rownum*2
FROM dual
CONNECT BY LEVEL <= 10

--get the previous 100 days
SELECT trunc(sysdate) - rownum day
FROM dual
CONNECT BY LEVEL <= 100

Thursday, 4 December 2008

Whoohoo, I'm a hero today!

In order to answer somebody's question today,
I figured out how to use bzr replay
this made me his hero for a day,
and this in turn has made *my* day!

https://answers.edge.launchpad.net/bzr/+question/53349
Markus Korn confirmed that the question is solved:
Thanks a lot Marius, this initial commit did the trick,
you are my hero of the day ;)

Wednesday, 3 December 2008

oracle XE sessions and processes

I found that my locally installed Oracle XE runs out of available connections far too soon for a php app I'm running. This results in some weird gui behaviour: some frames just don't load. Fortunately I found a way to sort of makes it a little better:

sqlplus system@XE
show parameters sessions;
alter system set sessions=250
scope=spfile;
show parameters processes;
alter system set processes=200
scope=spfile;
sudo /etc/init.d/oracle-xe restart

http://www.markcallen.com/oracle/oracle-xe-tuning