Wednesday, March 31, 2004

Lisp Books

So I aquired the CLOS book and CLtL2 and read a bit in these two and the UCI Lisp manual. Apparently in old Lisps there were functions which were used purely for their sideeffects, such as MAP which always returns nil regardless of it's parameters. When I saw PROG2 for the first time, I thought it was a optimized PROGN for only two forms, little did I know that the 2 means the value of the 2nd form will be returned instead of the last form. in LOOP AS and FOR are interchangeable, though I prefer the latter one.

Time to blog

I didn't have it in the last few weeks, however quite a few things happened.

First of all o got a new PC, which is one of the reasons I didn't have time, and it is causing trouble. It's a new AMD 64 3000+ (really 2GHz), with 1GB of RAM, a shuttle AN50R mainboard and a HIS ATI Radeon 9600 XT (no VIVO). It's a bitch, it looks fine Warcraft 3 is running smoothly at 1280x1024, Divx movies aren't a problem anymore and with the new gfx card it's really quiet. But, and thats a big but, there are some issues like freezing, random segment violations, dirty IRQs, lost DMAs and 2.4 kernels not getting into the net. While the last problems have been resolved by kernel upgrades and fault-save BIOS settings, the others are still causing reboots, and I don't know what to do.

Wednesday, March 17, 2004

lisp books

Yesterday I browsed Amazon for lisp books and decided to buy Keenes CLOS book. Browsing a bit more I came along a unusual suspect, someone was trying to sell CLtL2 on Amazon marketplace, well he succeded and I'm now a proud owner of CLtL2, I can't wait till I hold it in my hands.

I have advanced to chapter 5 in PAIP, but it took me almost halve a day to solve exercise 4.2: Write a functions that generates a list of all permutations of a givn list. There were two problems for me: Bridging the gap between algorithm and code and figuring out that I didn't cover the simplest case: (PERMUTE '()) -> (()) while I thought (PERMUTE '(A)) -> ((A)) was the simplest case.

Sunday, March 14, 2004

keyboards, keybindings, keywords ...

I ordered a keyboard with a US layout to see if programming with is easier/faster because often used keys like ([{/ are easier to reach and some emacs keybindings should seem less painfull, because you don't have to stretch your hand over the whole keyboard. Depending on if I want to keep the windows key as meta/super or I like the old IBM keyboard click better I'll try to get a IBM keyboard with US layout.

While I'm at it, i learned some new and very useful keybindings if you are editing lisp or any other code with lots of parenthesis. In addition to those a also added the following code, which is not as good as insert-parethesis, but does well enough for me.

(defun insert-doublequotes ()
  "Like insert-parenthesis, but inserts doublequotes (\")
   instead of parenthesis "
  (interactive)
  (insert "\"\"")
  (backward-char))
(global-set-key "\M-\"" 'insert-doublequotes)

I always wondered why you need C-f, C-b etc. when you have arrow key which are there for just that specific purpose, but when you use parenthesis movement it's very nice to have them, because your hands can stay where they are and don't have to move to the arrow keys.

Saturday, March 13, 2004

books

So much for writing daily, maybe it will work later.

At the moment I'm reading “Paradigms of Artificial Intelligence Programming” by Peter Norvig. So far it's easy and thus fun, and this time I'm actually typing most of the code in the book & try to do most exercises. Before that I read “ANSI Common Lisp” by Paul Graham, having tried to read “On Lisp” first I must say OnLisp is not for the novice, despite the almost identical introductions saying otherwise.

Wednesday, March 03, 2004

xmms-remote 0.21

I have updated xmms-remote again and added /xmms-volume to get & set the main volume, added /xmms pp to toggle between play & pause and replaced COYPING with a file that actually contains a license, somehow it had become a gzipped tar.