The iPhone cult and self criticism among followers...

So the iPhone is out and the Apple cult followers are going crazy all over the place. Unpacking porn and disassemblies are being posted. When the iPhone was announced I had my doubts about the touch screen keyboard. I had been using a HTC phone for a while and did not really see how they would be able to make a decent touch keyboard. Especially not for us in the norhern hemisphere that use gloves during winter....

June 30, 2007 · Peter Krantz

Water and Light Controlled Synthesizer (No Soldering Required!)

This was going to be my summer project, but after getting the parts I couldn’t stop myself from putting it together straight away. About a year ago I read an article about a guy who put together a synthesizer controller using laser pointers, a bowl of water, a solar panel and MAX/MSP. I can’t find the link anymore but it doesn’t matter when you want to roll your own! This is what you need:...

June 20, 2007 · Peter Krantz

Checking for Model Classes Before Using Them in Rails Migrations

If you are using model objects in migrations (e.g. for inserting data) you should make sure that the migration works even if that model class is removed. I discovered this when setting up a new development environment and running all migrations in an empty database. Let’s say you have the following migration code: [source:ruby] class InsertCounties < ActiveRecord::Migration def self.up County.create :code => ‘10’, :name => ‘Blekinge’ County.create :code => ‘20’, :name => ‘Dalarna’ end end [/source]...

June 7, 2007 · Peter Krantz

Bringing Ruby to the .NET environment

Things are heating up in the Ruby-as-a-dotnet-language area. Martin Fowler voiced his concerns on Microsoft not being able to look at source code and therefore having trouble implementing Ruby properly. Microsoft, with John Lam in the cockpit, is implementting Ruby for the .net platform (if you have been reading my previous blog posts I predicted way back in february 2006 that John Lam would get scooped up my Microsoft:-). Ola Bini is also concerned about Microsoft not letting ther developers look at the Ruby implementation....

June 5, 2007 · Peter Krantz

What happened to plain old HTTP redirects?

So, I was looking for an offer on IP telephony and thus decided to point my browser to one of the larger ISP:s. I get a blank page back (blank as in “all white”). A couple of years ago, this wasn’t uncommon if you were brave enough to use a non-mainstream browser. But today it is 2007. A brief look at the HTML source gives: [source:html] [/source] …which safari doesn’t follow....

June 5, 2007 · Peter Krantz

Self-imposed RSS reading ban...

Am I alone having trouble staying away from the RSS reader? With the number of subscriptions I have there is always something interesting to read. This absolutely kills productivity when you try to use the 1 hour free time per day you have when you are on parental leave. Must. Stop. Reading. And who cares about the recommended refresh rate property anyway? I want to update NOW! I need some sort of time lock on all things RSS....

June 1, 2007 · Peter Krantz

Working with UTF-8 in PDF::Writer and Ruby on Rails

Googling for information on how to use PDF::Writer shows that there are many european developers frustrated with the lack of UTF-8 support in PDF::Writer. As Ruby on Rails works great with UTF-8 these days this can be a bit of an issue. Part of the problem lies in the fact that the PDF specification (at least up to 1.6) does not support UTF-8 (you can use UTF-16 if you like). I had the misfortune of plowing thorugh it a couple of years ago when developing a PDF form filler library for a customer (don’t ask)....

May 31, 2007 · Peter Krantz

Installing an e-ID in 47 Simple Steps (Not Counting the Eternal Loop)

(Please note that this post is from 2007 and things have become much better). When you are on parental leave you have to register which days you are away fro work with the Swedish Social Insurance Agency. To access the online services of an agency you have to have an electronic ID. In Sweden this is a locally installed certificate issued by your bank or large telecom provider. In my case my identity is checked by my bank and then I am forwarded to Telia, which handles the process of generating the ceritificate and installing the appropriate software on my computer....

May 24, 2007 · Peter Krantz

Enterprise Rails Deployment Getting Closer (thanks to Ola Bini and the JRuby team)...

Let’s forget about that for a while. Ola Bini and the JRuby team is quickly moving forward with something I would consider a breakthrough in Rails deployment options. In fact, it could well mean a breakthrough in Rails adoption in many organizations. Why (some) IT-managers like Rails but don’t like deploying it When I was a consultant I talked to many IT-managers that had heard about Ruby on Rails. They were intrigued by the fact that Ruby and Rails were created for developers rather than machines....

May 7, 2007 · Peter Krantz

First impressions of Mercurial (as an alternative to subversion)

So, I was in the mall the other day where I bumped into Marcus Ahnve. He mentioned that he had been using Mercurial instead of Subversion for his latest project. Just before I met Marcus I had been coding on a rails project housed in subversion. I was sitting in a cafe without internet access which means that it wasn’t possible to commit changes to subversion. As my son was asleep time was scarce and I wanted to get as much done as possible....

May 4, 2007 · Peter Krantz