Move CTRL with colemak

I’m trying out the colemak keyboard layout. It seems interesting, but it takes some effort. There was one problem, though: colemak removes the capslock button, and so my Xmodmap settings to switch capslock and CTRL didn’t work anymore, which is a bother since I need it for emacs.

After some trial & error I managed to find how it’s done:

remove Control = Control_L
keycode 66 = Control_L
add Control = Control_L

Of course, keycode might be something else depending on your keyboard, you can determine what it is using xev.

Looping through a dict

It seems I’ve never looped through a dict in Python before. I just assumed that it would work the same as with a PHP associative array, since the syntax of creating one is fairly similar. I just thought this would work:

for key, value in somedict:
    print key, ': ', value

But I guess not.

You have to call the items or iteritems functions on the dictionary, where iteritems is faster, but also doesn’t allow certain actions that items might:

for key, value in somedict.iteritems():
    print key, ': ', value

I was trying to loop through a dictionary in a django template like so:

{% for key, value in somedict %}
  {{ key }}: {{ value }}<br/>
{% endfor %}

Which, since it just skips over most errors, generated this response:

:
:
:
:
:

Which I only later found out was caused by an error when trying it in some regular python code. It should be:

{% for key, value in somedict.iteritems %}
  {{ key }}: {{ value }}<br/>
{% endfor %}

I feel like this shouldn’t have happened to me. Oh well, now I know…

Why?!

I don’t really use wordpress, I was/am using IkiWiki for my blogging and other wiki needs, but org-mode can’t be beaten when it comes to generating syntax highlighting. I think I might (have to) try this out for a while.

echo 'hello, world!\n';

for ($i = 0; $i < 10; $i++) {
  echo '$i\n';
}

ntd progress #1

So I’ve only had a little bit of time to work on ntd. But at least I did do something, though nothing major. I got rid of the gets() function by replacing it with getline(), I know this is a GNU extension, but it’s apparently recommended and for now I don’t think anyone other than myself is using it, and since I only use archlinux I’m in minimal danger of incompatibilities.

I’m still getting some errors with valgrind, but if I eventually figure them out I will be able to fix it.

Maybe tomorrow I can finally start adding another command.

New toudou

So, I’m trying again… After feeling I couldn’t achieve what I wanted with toudou or toudou2 through 5, I’m starting from scratch again with ntd (New toudou).

This time I’m first going to focus on creating a shell in which I can perform the actions that I want. After that I will start looking at/thinking about user interfaces again.

Right now it’s only a tiny shell with some big holes in it (usage of gets, for example) that need to be fixed, and it only knows help and exit for commands, but it’s a start, again.

The code for it is here, though I can’t recommend looking at it yet, it might burn your eyes out.

urxvt Rainbow

I have used gnome-terminal and terminator, and they are nice. But they are big and bulky. urxvt is nice and small, but it has an ugly default color scheme for at least Fedora 12 and Ubuntu 9.10.
So I wanted to start using urxvt because it seems smaller and faster, but it doesn’t have any menu structure to speak of to make it simple for me to edit the color scheme. Which is fine, it just means I have to find out where the settings are located.
Continue reading

My ASP.Net intellisense was gone!

I use Visual Studio 2008 at work on a remote terminal server.
This server doesn’t have enough disk space on its C drive, and VS2008 likes to place a lot of ReflectedSchemas there.
It got to the point where I has some 4GB of ReflectedSchemas and this was too much, so I deleted them all (nice and definitive) and things were great again.

A couple of weeks later the exact same thing happened again, so I deleted them again, this time though I noticed that my Intellisense for the standard ASP.Net controls (like ) was gone! Still had it for other (custom) controls and HTML tags and everything, just not ASP.Net controls.

Today finally I decided to look into it (2 or 3 months later).
I got a tip to try devenv /ResetSettings, which didn’t help.
One person suggested you change the tag prefix, which also didn’t help.
I also tried copying someone else’s ReflectedSchemas, which still didn’t help, though this could be explained perhaps by the fact that I didn’t overwrite the entries.xml, I don’t know.
After this I tried deleting the ReflectedSchemas again, this time making 100% sure that I had closed devenv.exe. This fixed it…

So now I am enjoying my ASP intellisense once again.

Enabling/Disabling Services in Fedora 12

I have been having trouble with my sshd service.
I use SSH to log in to my home computer and manage things like the hours I work and such, and sometimes when I restart my computer I forget to turn it back on.

But thanks to this site I figured out how to manage services from the command line and now I’ve set both sshd and httpd to start at start-up. Which makes it easier.

But to sum up:
Log in as root with su and then run chkconfig --list to view which services are enabled at which runlevel (runlevels are explained on the linked page). Then to enable services use

chkconfig --level 35 sshd on

specifying runlevels 3 and 5 here and turning the sshd deamon on.

This helps me, now I can’t forget to turn on sshd and my boss won’t have to fear that I might not be able to log in to my home computer so much anymore.