Opengov.se launched

Says the Open Government Working Group: The Internet is the public space of the modern world, and through it governments now have the opportunity to better understand the needs of their citizens and citizens may participate more fully in their government. Information becomes more valuable as it is shared, less valuable as it is hoarded. Open data promotes increased civil discourse, improved public welfare, and a more efficient use of public resources....

July 25, 2009 · Peter Krantz

Rails vs Grails vs Django models

Coming back to Rails after being away from some time in Django land I discovered a huge difference in how Rails, Grails and Django treats your models. In Django and Grails you can look at a model class and see all the properties it has: [python] class Organization(models.Model): name = models.CharField(max_length=255) url = models.URLField(verify_exists=False) orgtype = models.ForeignKey(OrgType) [/python] The same model class in Rails typically looks like this: [ruby] class Organization < ActiveRecord::Base belongs_to :OrgType end [/ruby]...

June 24, 2009 · Peter Krantz

Remixing Youtube

An interesting approach to chains of copyright but these are really interesting. None of the participants were involved in making these songs. At the same time all of them were. A guess is that remixes like these will become more and more popular. Where can I buy these songs? Who will get paid? More information at http://thru-you.com/

April 28, 2009 · Peter Krantz

Solving Project Euler Problems With Ioke

For those of you that have been following Ola Bini’s work on Ioke, the dynamic language for the JVM, I am happy to report that the current release 0.1.1 is usable enough to solve Project Euler problems with. I wanted to learn more about Ioke and the best way to learn a new language is to use it on your own. So, here is some example Ioke code for some of the simpler Project Euler problems....

January 3, 2009 · Peter Krantz

Integrating Yahoo Search in a Django site in 5 easy steps

I have been experimenting with various search options for the eutveckling.se site for a while. Google Custom Search is nice and very fast, but the number of ads appearing in the search result page makes it difficult for users to separate result items from ads. (Update: I am sticking with Google Custom Search until I figure out how to get Yahoo search to present proper excerpts). I am a fast reader which comes with the tradeoff of missing important information sometimes....

December 18, 2008 · Peter Krantz

Twitter synchronicity

Everyone is celebrating this friday in a different way, apparently:

November 28, 2008 · Peter Krantz

What Sun Should Do

Tim Bray has an interesting post titled What Sun Should Do where he lists some suggestions. I have been thinking about Sun for a while and how my own image of the company has changed over the years. A long time ago I was working for Cambridge Technology Partners (later acquired by Novell). We did a lot of interesting projects, some of which were deployed on Sun hardware. At that time (around ‘97-‘98) my image of Sun was that it was a huge company selling huge hardware at huge prices....

November 26, 2008 · Peter Krantz

The Gnostic Nihilist

Modelling by Niklas Lindström who also knows a lot about SPARQL, RDF and Brilliance.

November 7, 2008 · Peter Krantz

Improving Django performance with better caching

The Django cache middleware is great, but has one drawback. If you are caching views (which can give a nice performance boost) Django will only use the path segment of the URL to create a cache key. If you are an avid reader of RFC 3986 you may remember that a URI consists of multiple components; path and query being of special interest here. The problem is documented in ticket 4992 (Update: it is now in Django)....

November 2, 2008 · Peter Krantz

Stuff I learned over the weekend

1. Finding stuff in lists of dicts in Python If you have a list of dicts in Python like this: [python]items = [{“id”:1, “name”: “Rasmus”}, {“id”: 2, “name”: “Rick”}][/python] …and want to check if there are any dict items with an id of a specific value (e.g. 2) I first came up with this: [python]2 in map(lambda x: x[‘id’], items)[/python] The downside is that it will loop all items which may be inefficient for larger lists....

October 27, 2008 · Peter Krantz