Php

PHP frustration

Most of the code I’ve written in my life so far has been PHP, as long as I include all the small testing of different stuff just to see if it could be done. PHP is quick to prototype stuff in, because you quickly get something you can poke around with, there’s little boilerplate code. However, specially when I’m just hacking together something in a hurry, theres one thing that’s really, really frustrating.

Flickr shortcode (and some nice HDR photos)

I like using creative commons photos from flickr as illustrations on my blog, however, I find it tedious to add all the metadata to satisfy the BY directive in the creative commons license in a consistent manner. Then it’s really nice that flickr has an API where I can automatically fetch that information. I use the shortcode feature of wordpress, so I can use ?View Code PHP [flickr url=”

Great news in the software world

During the last week there has been a couple of great releases in the software I use every day. First out was Python 3.1. It was released June 27th and features An ordered dictionary type Various optimizations to the int type New unittest features including test skipping and new assert methods. A much faster io module Tile support for Tkinter A pure Python reference implementation of the import statement New syntax for nested with statements Next out was Mozilla Firefox 3.

Merging two lists

Lets say you have two lists, one of them containing the values [1,2,3] and the other one containing the values [4,5,6], and you want to combine these two lists into one list, like this one: [1,2,3,4,5,6]. Let’s see how this can be done in different (high level) programming (or scripting or templating) languages. Java Java has multiple list implementations, lets start with the most basic one, the builtin array.

Merkelapper

De observante der ute (og som ikke bare leser bloggen min fra rss-leseren sin) kan ha oppdaget at merkelappene på bloggpostene har fått et nytt utseende. Det begynte egentlig med at jeg så på en post jeg hadde skrevet og tenkte “Hm, de taggene der ser ikke ut som om de egentlig hører hjemme der”. Videre tenkte jeg, hva skal jeg gjøre for å få dem mer inn i det visuelle uttrykket på bloggen.

Upgraded to wordpress 2.6.5

with a

svn sw http://svn.automattic.com/wordpress/tags/2.6.5 U wp-includes/post.php U wp-includes/version.php U wp-includes/feed.php U xmlrpc.php U wp-admin/users.php I just upgraded multiple blogs running WordPress 2.6.3 (hups… seems like i missed one release).

Here’s the release announcement edit Nope, the 2.6.5 release is the first release after 2.6.3… Note that we are skipping version 2.6.4 and jumping from 2.6.3 to 2.6.5 to avoid confusion with a fake 2.6.4 release that made the rounds.

Upgrading WordPress to 2.5