How the Swedish OOXML Vote Was Bought for $57,000

Microsoft hijacked Swedish OOXML vote?Sweden is represented in the ISO through the Swedish Standards Institute (SIS). This means that our country has one of the 100 or so votes.

The member countries have had six months to consider if the Office Open XML (OOXML) format should become an ISO standard. In Sweden, SIS arranged a working group that have looked through the material. As you may know the OOXML format has been heavily criticized (by many e.g. Google (PDF)) for allowing embedding of closed Microsoft-specific objects in the document standard and thus making it difficult for non-Microsoft software to read OOXML documents.

Unfortunately, SIS is an organisation where anyone can become a member. Member organizations can send participants to a working group for a fee. The current rate is 17,000 SEK (~$2,500). The day before the vote that decided if SIS would say yes to OOXML in the ISO there were a couple of new members in the SIS/TK321/AG17 working group:

Company name Relation to Microsoft
Exor Microsoft Partner
Formpipe software Microsoft Gold Partner
Cybernetics Microsoft Gold Partner
Ibizkit Microsoft Partner
Emric Microsoft Partner
Strand Interconnect Microsoft Gold Partner
Nordicstation Microsoft Partner
Sourcetech Microsoft Partner
Cornerstone Sweden Microsoft Gold Partner
Solid Park Microsoft Gold Partner
Fishbode systems Microsoft Gold Partner
KnowIT Sverige Microsoft Gold Partner
Modul 1 Microsoft Gold Partner
IDE Nätverkskonsulter Microsoft Gold Partner
Connecta Microsoft Gold Partner
Camako Data Microsoft Gold Partner
Sogeti Microsoft Gold Partner
Tieto Enator Corp. Microsoft Gold Partner

And so, Sweden will be voting yes to make OOXML an ISO standard.

For more information see:

SimpleCrawler for your everyday web crawling needs

Over at the standards-schmandards blog I often test websites to gather statistics on specific HTML use, accessibility and other things. Each time I have written a web crawler to collect the data. In Python and Ruby this is a simple task but last time it was like a déjà vu and I decided to create a Ruby library that I could use in the future.

Content-aware Image Resizing

I am guessing this would be a valuable addition to web browsers in the future. With this technique it is easy to target an image for viewing in multiple displays (e.g. a 4:3 screen or a 16:9 TV).

“Seam carving” allows an image to be resized non-uniformly, so you can change the height to width ratio in the image without cropping, but also without distorting important features in the image (such as faces).

The video shows some intresting results when using this method too much, but the overall result is very impressing.

Hackzine has more details.

Looking for ASP.NET MVC Frameworks…

I have been looking for an open source alternative to the default way of buildig web sites in ASP.NET with Visual Studio. After having build a couple of applications with Ruby on Rails it hard to go back to the Page Controller pattern that Microsoft introduced in ASP.NET. Coming back to the ASP.NET page event model makes it clear that they created it for VB6 application developers that were used to Windows forms-centered development. Apparently they didn’t want to those developers to have to learn about HTTP and HTML to be able to write applications.

MySpace Layouts and Markup Quality

I have received an increasing number of advertising inquiries from MySpace layout sites. Apparently the term “MySpace layouts” is a very popular search term these days. Looking at the default MySpace layouts one can unserstand why. I am confident that they didn’t hire a designer to create the default MySpace look and feel. Looking at the MySpace HTML, they certainly didn’t hire a GUI developer. The markup looks like it was ripped from a teenage fan site from the early nineties:

  • There is no doctype declaration. Not that it would have mattered anyway…
  • The markup starts out nicely with divs and spans and then freaks out with some classic table layout. I though that went away in the nineties…
  • Inline styles are used all over the place.
  • Headings start at level 5. And continues to level 4…
  • Images are missing an alt attribute.

This contributes to making MySpace an inaccessible mess. What does it prove? That you can be successful with a crappy site? Maybe the laugh is on me.

Hackety Hack – The Foundation for a Revolution

Why the lucky stiff is a well known name among most Ruby developers. Many have read his Ruby programming tutorials and seen his spectacular performances (or whatever they are) at RailsConf and elsewhere. Personally, I owe him a lot for Hpricot, the liberal HTML parser (at my government agency we use it to run the quarterly test of all public websites in Sweden). Hpricot is also the default parser for the Ruby Accessibility Analysis Kit.

The iPhone cult and self criticism among followers…

Apple iphoneSo 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. TUAW is reviewing the touch keyboard and concurs that there is “nothing wrong with the keyboard”. The error seems to be the “meat mittens” of the user. How is that for self criticism? The user is to blame instead of the phone…

A macbook, a bowl of water and a solar panel conected to the audio n port.

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!

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:

class InsertCounties < ActiveRecord::Migration
def self.up
County.create :code => ’10′, :name => ‘Blekinge’
County.create :code => ’20′, :name => ‘Dalarna’
end
end

This assumes that the County model is available when the migration is run. If you checked out the most recent version of your code from svn it is possible that it doesn’t contain the County model and the migration will fail. To check if County is available before trying to use it we can use Ruby’s defined? like this:

Update: No we can’t. defined? always returns false inside an ActiveRecord migration for some reason (maybe the class isn’t loaded before the actual call?). We have to use a begin…rescue…end block instead:

class InsertCounties < ActiveRecord::Migration
def self.up
begin
County.create :code => ’10′, :name => ‘Blekinge’
County.create :code => ’20′, :name => ‘Dalarna’
rescue
puts “Could not add data…”
end
end
end

This way the rest of the migrations will run.

What happened to plain old HTTP redirects?

Broken redirect from bredbandbolaget.seSo, 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:

…which safari doesn’t follow. Interestingly, search engines won’t be following that either. What happened to the plain old HTTP redirect header? There can’t be a single programming language for the web today that doesn’t support output of HTTP headers. Or are there still web developers that don’t know about HTTP? Apparently so.

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. If you remember the whole SCO debacle I guess it isn’t that strange. Microsoft is in the position where software they develop potentially may end up in millions of computers. Apparently the US legal system awards damages in proportion to this. Thus, any issues with a Ruby implementation on .net can quickly become costly.

It is all quite bizarre. Does this mean that the Microsoft version of the Ruby language is different from the “original” Ruby? I guess we will never know. Developers will probably write a lot of Ruby code that runs happily on the CLR. Rails applications will be deployed. But I am sure that there will be “special cases” where IronRuby will differ from “original” Ruby.

Therefore is was refreshing to see that Queensland University of Technology are progressing steadily with their Ruby.NET implementation. Currently you can actually compile a Ruby script into a .NET 2.0 assembly that other CLR languages can talk to. This may be the spearhead into the other half of enterprise deployment options.

All in all the future of software development looks bright. Will developers that invested a lot of time in Java or C# switch? Or will they move on to maintaining applications?

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.

Maybe I should stop writing pointless blog posts like this as well. Aaargh!

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).

In Ruby on Rails, this is easy to solve as long as you only use Latin characters with diacritics. The solution is to switch encoding back to ISO-8859-15 for text strings you feed to PDF::Writer.

A simple extension to the String class will do the trick:

class String
  require 'iconv'
  def to_iso
    c = Iconv.new('ISO-8859-15','UTF-8')
    c.iconv(self)
  end
end

If you are working in Rails you can put this code in the lib folder (I usually call the file string_extensions.rb).

Then, when you call the text method on your PDF::Writer intance you can easily pass a correctly encoded string.

Overriding PDF::Writer text method

A much cleaner approach, as Aníbal describes in the comment below, is to override PDF::Writer’s text method.

Put the following code in a file called pdfwriter_extensions.rb (or whatever you choose to call it) in your lib directory:

CONVERTER = Iconv.new( 'ISO-8859-15//IGNORE//TRANSLIT', 'utf-8')

module PDF
	class Writer
		alias_method :old_text, :text

		def text(textto, options = {})
			old_text(CONVERTER.iconv(textto), options)
		end

	end
end

In your controller that handles the PDF output you add:

  require 'pdf/writer'
  require 'pdfwriter_extensions'

…after which you can use PDF::Writer like in the tutorial:

    pdf = PDF::Writer.new
    pdf.select_font "Helvetica", :encoding => nil
    pdf.text "User name: <b>#{@user.name}</b>", :font_size => 16, :justification => :left
    send_data pdf.render, :disposition => 'inline', :filename => "user_details.pdf", :type => "application/pdf"

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.

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. So what do you do? Well I continued coding on a different part of the application and in the end I had a fairly large changeset waiting to be committed.

This makes for bad coding practices. A large changeset is more likely to create problems for your colleagues when the do an update from the repository. I really wanted to be able to create several changesets offline and put them back in when my connection was restored.

Trying Mercurial as an alternative to Subversion

This is where Mercurial comes in. With Mercurial it is easy to create changesets when you are offline. These can be pushed to a central repository (of you have one).

Installing Mercurial in a shared hosting account should be easy if you have access to ssh, Python and Apache. Following the step by step instructions by Bill de hÓra it was easy to get Mercurial running on TextDrive.

My initial impression is that mercurial looks very promising:

  • Mercurial commands are very similar to those of subversion and it was easy to set up a new repository.
  • The web interface looks very nice compared to that of subversion.
  • Capistrano can be used with mercurial.
  • It feels marginally snappier than subversion.
  • Mercurial doesn’t litter your folder tree with myriads of folders (just one in the root folder).

The next step is to migrate my subversion repository history using Tailor. If that goes well I may well become a mercurial switcher.