ingvar is currently certified at Master level.

Name: Ingvar Mattsson
Member since: 2000-03-15 10:32:47
Last Login: 2010-02-09 11:13:03

FOAF RDF Share This

Homepage: http://www.hexapodia.net/~ingvar/

Notes: About me? I'm not that interesting.

I run and occasionally build networks for a living. Sometimes I poke servers and make them happy or build fail-over clusters spanning multiple timezones.

I sometimes write code. Mostly in Common Lisp or C. I find things like "work flow services" interesting. It's probably a perversion, I guess. In my other spare time I read. Lots. Mostly SF and fantasy, but the occasional mainstream fiction or protocol spec manages to sneak in.

I like to cook, too.

Projects

Recent blog entries by ingvar

Syndication: RSS 2.0

3 Dec 2009 »

Neat(ish) hack...

Sometimes, I find myself writing anonymous functions, to fill out keyword arguments for functions or adapting the argument order. So, I thought, how hard would it be to write a macro to write the code for me? Turns out, not very complex, at all. The formatting is not QUITE what I started out with, as the Advogato edit box is a bit on the short end, but, hey...

(defmacro _ (form)
 (flet ((is-arg (sym)
	  (ignore-errors
	   (and (char= (char (symbol-name sym) 0) #\_)
		(cons
		 (parse-integer (symbol-name sym)
				:start 1)
		 sym)))))
   (let ((syms (loop for arg in form
		  for temp = (is-arg arg)
		  if temp collect temp)))
    `(lambda
	 ,(mapcar #'cdr (sort syms #'< :key #'car))
       ,form))))

With this in hand, you can, for example, easily make an adapter to parse C-style hex constants:

  (_ (parse-integer _1 :radix 16 :start 2))

Not that the lambda-wrapping of this would've been much more complex and I am not entirely sure this wins as far as readability is concerned, but that is as it may be. It's if nothing else a neat macro that would be more than a little tricky to pull off with a less capable macro facility.

27 Nov 2009 »

So, one of the users of my Image library asked if there wasn't any way of using a font other than the rather ugly, built-in one. I said, roughly, "you can define a new one, in an analogous fashion to how the built-in oine is done?"

Apparently, that was not the wished-for answer and I started thinking. Bit-mapped fonts are (relatively) easy to deal with. There's a helluva lot of bitmapped fonts for X11. So, I set forth to code up a reader for PCF fonts, converting the bitmaps to internal format and some multi- font support in Image. All done, now.

Common Lisp is still very pleasant when dealing with binary file I/O, even if I wished that there was an easy way of changing the binaryness of a file on the fly.

18 Nov 2009 »

Currently tooling away at asked-for functionality for my IMAGE library (specifically, a request was made to see if I can scare up another font or three, so I am currently noodling on a PCF font-file reader, as you do).

Common Lisp continues to be amazingly convenient for "binary I/O", although it does require a certain mind-set to consider it convenient, I guess.

13 Nov 2009 »

I've just packaged up a new release of my IMAGE library, with some new functionality in place. It now supports copying (parts of) an image into another image (with either the same alpha across the whole copied section or with a provided alpha map, so one can do Clever Stuff that way).

I suppose I should write documentation for the image library at some point, but...

6 Oct 2009 »

Idleness is the source of many bugs. I suppose. It's certainly the cause for a lot of code I write.

Lately, I have been pondering hashing of octet vectors. Well, actually, I've been pondering the hashing of strings, but these days strings need mangling to octet vectors before one can reasonably reason about them as numbers (in my case, turning a vector of characters into a possibly- longer (well, possibly-more-elemented) vector of (UNSIGNED- BYTE 8), containing a UTF-8 encoding of the character string).

But, what's a hash without an idea how well it performs? So, with a pluggable (or at least semi-pluggable) hash algo, what I now do is run it across a dictionary (in my case it is /usr/dict/words, containing a British word list) and see how many collisions one gets.

The next step is, of course, to try to figurte out what is and isn't bad, as far as collissions go. From memory, the last attempt say something like 600 collisions out of just under 70k words. I'd have to run a simulation to say if it's well above, well below or around what I'd statistically expect.

Next after that will have to be concatenations of words, though that MAY take a bit longer to test-run.

303 older entries...

 

ingvar certified others as follows:

  • ingvar certified ingvar as Apprentice
  • ingvar certified Simon as Journeyer
  • ingvar certified Skud as Journeyer
  • ingvar certified scromp as Journeyer
  • ingvar certified Telsa as Journeyer
  • ingvar certified alecm as Master
  • ingvar certified winter as Journeyer
  • ingvar certified esr as Master
  • ingvar certified argent as Master
  • ingvar certified Zell as Apprentice
  • ingvar certified pvaneynd as Journeyer
  • ingvar certified thorfinn as Journeyer
  • ingvar certified kira as Journeyer
  • ingvar certified mpawlo as Apprentice
  • ingvar certified crhodes as Journeyer
  • ingvar certified pfdietz as Master
  • ingvar certified wnewman as Master
  • ingvar certified lukeg as Journeyer
  • ingvar certified metaur as Journeyer

Others have certified ingvar as follows:

  • ingvar certified ingvar as Apprentice
  • mstevens certified ingvar as Journeyer
  • Simon certified ingvar as Journeyer
  • Marcus certified ingvar as Journeyer
  • jrennie certified ingvar as Apprentice
  • winter certified ingvar as Journeyer
  • scottyo certified ingvar as Journeyer
  • scromp certified ingvar as Journeyer
  • jpayne certified ingvar as Journeyer
  • nixnut certified ingvar as Journeyer
  • manu certified ingvar as Journeyer
  • rw2 certified ingvar as Apprentice
  • pvaneynd certified ingvar as Journeyer
  • thorfinn certified ingvar as Journeyer
  • dan certified ingvar as Journeyer
  • fxn certified ingvar as Journeyer
  • sulaiman certified ingvar as Journeyer
  • pencechp certified ingvar as Journeyer
  • metaur certified ingvar as Journeyer
  • fzort certified ingvar as Journeyer
  • wingo certified ingvar as Master

[ Certification disabled because you're not logged in. ]

New Advogato Features

FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

X
Share this page