2008

2007

2006

2005

2004

Sick Puppies

▁ jan 22 2008

Watched this youtube video yesterday; it’s great. I don’t know the story behind it, and don’t really care, but it’s nice, nonetheless.

The music is by some guys called “Sick Puppies” and the track is “All the same”, from the album “Dressed up as life.” It’s really a great track. Go buy it.

Edit: Turns out I do indeed care about the story behind this. You can read it here. I nearly cried.

. o .

"Hey sorry, your rent bounced, but here's a picture of Homer Simpson"

▁ jan 16 2008

That pretty much summarizes what happened over at Dreamhost today. Noticed how that’s not a link? I wouldn’t want you to click it and somehow get into using their services. Why?

Read more »

. o .

Chicken Oscar

▁ jan 11 2008
. o .

Beans

▁ jan 09 2008

My coffee pusher made me an offer I couldn’t refuse.

Beans

Pun is Copyright (c) 2008 Joen P. Olsen, All Rights Reserved.

. o .

Tagged again

▁ jan 07 2008

Yes, Mr. Stavem tagged me in some random meme (again). Here goes:

  • Where is your cellphone? Desk
  • Describe your girlfriend? Wonderful
  • Your hair? Longer
  • Your mother? Deserves a lot more credit than she thinks
  • Your father? Honest
  • What is your favorite gadget? Girlfriend
  • What did you dream last night? Forgot
  • What do you prefer to drink? Espresso
  • Dream car? Audi A8
  • What room are you currently in? Office
  • Your ex? Who?
  • Your biggest fear? Insignificance
  • What do you want to be in 10 years? 32
  • Who did you spend last night with? Katie
  • What are you not? Sloppy
  • The last thing you did? Kissed
  • What are you wearing? Clothes
  • Favorite book? “The Fall”
  • The last thing you ate? Cereal
  • Your life? Great
  • Your mood? ;)
  • Your best friends? Know
  • What are you thinking about right now? Work
  • Your car? Who?
  • What are you doing right now? Relaxing
  • Your summer? Who?
  • Marital status? Happy
  • What is on your TV right now? Commercials
  • When did you last laugh? Today
  • When did you last cry? December 7th, 2007
  • School? Ha.

Katie, Vetle & Joen, you’re up.

. o .

More useless Fibonacci

▁ jan 06 2008

I’m looking into various programming languages these days. Today I took a quick look at a guide to Io. Io is a small language, which has some pretty cool concepts, aggregated from other powerful languages (Lisp, Smalltalk, the list goes on.)

So here’s the mandatory fibonacci 0->36 code:

Io> fib := method(n, if(n < 2, 1, fib(n - 1) + fib(n - 2)))
Io> Date cpuSecondsToRun(fib(36))
==> 455.8999999999999773

Meh. Python did faster than that; of course none of them are a match for D. Also, monitoring the memory usage of the VM as this ran, it became obvious that there’s no tail recursion here.

Seriously though, Io is a fun language, and with things such as coroutines and a nice standard library, it has a good chance of making it.

. o .

N = C + {fb(cm) · fb(tc)} + fb(Ts) + fc · ta

▁ jan 04 2008

We make the best bacon. And yeah, the article is so last year. Link

. o .

Experimenting with pizzas (again)

▁ jan 03 2008

So, after the move, I haven’t had much time to buzz around with my pizzas. I even forgot the recipe I used in Oslo.

Our oven here is some piece of shit electrical monster, so it won’t bake my stuff evenly. So I bought a dedicated pizza oven. It too, is a piece of unknown-korean-brand-crap, but at least it hits 250C fairly quickly, and it even came with its own stone (hooray for not having to find a matching size elsewhere.)

I upped a set to flickr. Here’s my favorite:

DSC01841

. o .

Coffee @ home

▁ jan 02 2008

My setup at home.

DSC01807

KitchenAid Artisan espresso machine, Krups burr grinder, Dreamfarm knockbin, 1883 syrups, cool sign I got for xmas, from Katie :-)

. o .

SQLAlchemy caching (second level)

▁ jan 01 2008

SQLAlchemy is an Object Relational Mapper (ORM) for Python, supporting a wide variety of databases.

As per the 0.4 documentation, it mentions that:

Is the Session a cache? Yeee…no. It’s somewhat used as a cache, in that it implements the identity map pattern, and stores objects keyed to their primary key. However, it doesn’t do any kind of query caching.

Admittedly, it would be an extremely daunting and challenging task to write a caching framework that would work well for all use cases. Yesterday, after some googling, I decided to write my own cache. As of version 0.4.1, there are some features that makes it possible to do this rather easily; you can write a MapperExtension that overwrites the ‘get()’ method that SQLAlchemy usually uses to fetch data. There you can cache your things. I’m doing this in memcached.

It’s built heavily on this thread from the SQLAlchemy mailinglist.

Oh, here’s the code.

How to use? Like this:

mapper(Foo, t_foo, extension=MemCachedMapper(mc, timeout=35))

Easy, eh? Now just use the session.query(Foo).get(xyz), and you’ll be caching results for 35 seconds (the second named argument to MemCachedMapper.) ‘mc’ is an instance of memcached or cmemcached, that is already connected.

This is in semi-production on my own pet-project, but I’d really appreciate some feedback from anyone who attempts to use this in their own code. If/when you run into a bug, write me here, and I’ll do my best to fix it.

. o .

Adaptive Replacement Cache in Python

▁ jan 01 2008

Today we’re going to talk about ARCs, or Adaptive Replacement Caches.

So what is it? Well, lets talk about some other caching algorithms first.

  • LRU: Last Recently Used. This means that you have a cache with a fixed size. For each “hit” on an entry, you increase the hit count (or the timestamp of access time) on the entry, and you keep the cache sorted sequentially. Once the cache “overflows”, you expunge the least used entry.
  • MRU: Most Recently Used. This is used when your entries are mostly unpredictable. You keep the most recent items in the beginning of the list, and you expunge from the end once you hit the fixed size.

So what’s an ARC? Well, it’s basically a more sophisticated caching algorithm, which sort of, kind of, looks like a MRU/LRU. We’ll try to explain it in further detail here, and also provide a Python implementation.

Read more »

powered by