Justin and I have written a paper on this topic titled
The road to hardware free from restrictions: how hardware vendors can help the free software community
The paper was published today on the Free Software Foundation website.
Justin and I have written a paper on this topic titled
The road to hardware free from restrictions: how hardware vendors can help the free software community
The paper was published today on the Free Software Foundation website.
So you’re writing a web-based application and you want journalling: when database records change, you want to keep track of the changes so that you have an audit trail. There are many ways to do this. If your application is going to be dealing with a lot of data, it’s best to have a separate ‘versions’ table for each table, where you store the old versions of your records.A couple of plugins for Rails exist to make this easier. The acts_as_versioned plugin deals with journalling for updates to records. It does not journal deletes – that’s where acts_as_paranoid comes in. That plugin will put a timestamp in the deleted_at column rather than delete the record, and it overrides the various find methods to ignore records with a non-null deleted_at column.
The 2 plugins don’t work together all that well without some modification, as described by Flinn Mueller here.
His solution solves part of the problem – deleting a record no longer deletes the versioned history of the record. But it still leaves the original record in the main table, with a deleted_at timestamp. I want to move that ‘deleted’ record into the versions table, with accurate deleted_at timestamp.
Here’s how I modified Flinn’s code to do that:
module ActiveRecord
module Acts
module Versioned
module ClassMethods
def acts_as_paranoid_versioned(options = {})
acts_as_paranoid
acts_as_versioned options
# Override the destroy method. We want deleted records to end up in the versioned table,
# not in the non-versioned table.
self.class_eval do
def destroy()
transaction {
destroy_with_callbacks # call the acts_as_paranoid delete function
tmp = self.class.find_with_deleted(id) # get the 'deleted' object
tmp.save_version() # run it through acts_as_versioned's save_version()
tmp.destroy_without_callbacks! # and finally really destroy the original
}
end
end
# protect the versioned model
self.versioned_class.class_eval do
def self.delete_all(conditions = nil); return; end
end
end
end
end
end
end
This code goes in config/environment.rb. As you can see it’s a bit of a hack, but it works. If you have suggestions to do this more elegantly, by all means leave a comment.
I think it’s time someone merges acts_as_paranoid into acts_as_versioned. Maybe I’ll look at that one day when I have more time – for now this will do.
Eric Flint, a sci-fi author, published a great essay on the counterproductiveness of DRM. It’s worth a read. Now if only the content industry could get their collective heads out of the sand and start listening to this guy… He is making a nice living by publishing some of his work online for free through the Baen free library – turning it effectively into free advertising for his (paper) novels. Eric Flint is living proof that Big Media has it all wrong.
Yesterday, someone posted a message to the linux kernel mailing list announcing LinuxBIOS support for the Gigabyte GA-M57SLI-S4 board. The M57SLI-S4 is a higher end desktop-class board that can be had for around $120.
This announcement was reported all over the internet, in many languages. Unfortunately there’s quite a bit of misinformation doing the rounds – for instance, Gigabyte has not announced any official support for LinuxBIOS – let alone that they would ship a version of the board with LinuxBIOS.
That being said, LinuxBIOS support for the M57SLI-S4 is still a big deal, because it’s the first time in several years that a current desktop-class board runs LinuxBIOS.
I wish, however, that the author of this post had held off a week or two more. The code in the LinuxBIOS source tree is not complete yet – a couple of patches are still missing to make the code build. Also, apart from Dr. Lu at AMD, nobody has tested this code. While I’m confident that it will work, I’m pretty sure that some small changes will be required after the merging of such a major patch. Finally, the message failed to mention that this board does not have a BIOS socket – the PLCC ROM chip is soldered directly onto the board. This means that you have exactly 1 chance to get the LinuxBIOS image right – if it fails to boot you have a brick, and you’ll need to desolder the BIOS chip, and add a PLCC socket to the board. With the right tools and soldering skills this can be done, but it’s not for the faint of heart.
Anyway; we got a couple of M57SLI-S4 boards this week. I hope that by the end of next week – with Richard A. Smith’s help – we’ll have them boot LinuxBIOS. I’ll report here, of course.
Dell is looking for suggestions, and they are publishing the results as they evolve. The top request – by an almost 2:1 margin – is about shipping machines with GNU/Linux preinstalled.
Dell, are you listening? That extra option needs to be available on all the machines you sell. And there has to be a price difference – no Windows tax!
If you vote, make an account first – it’ll make your votes count more than three-fold over an anonymous vote.
Michael Crichton (the author) has a most interesting op-ed piece in the New York Times today about the folly of gene patents.
Patents are supposed to cover inventions. Genes are most certainly not inventions. They are ‘features of the natural world’, as Crichton puts it. Patenting genes is as idiotic as patenting rocks, or sunsets. There’s a big difference between discoveries and inventions. It’s high time the USPTO starts to learn that difference.
Apple has posted an essay by Steve Jobs, with his thoughts on music. More specifically, his thoughts on the mounting pressure from Eureopean governments on Apple to open up it’s Fairplay DRM scheme to its competitors, so that consumers could mix and match music stores and music players.
Jobs basically says that Apple will not do that, because it would weaken their ability to keep the DRM unbroken, which would eventually mean contractual breach of their agreement with the 4 big music labels. But don’t take my word for it, read the essay, it’s a very good read.
He then goes on saying that Fairplay is only there because the 4 big labels require it, and that if they would drop the contractual requirement, Apple would get rid of it ‘in a heartbeat’. No DRM would be best for consumers, and would obviously save Apple a lot of money and bad press.
I like his statement. I’m happy that he’s putting public pressure on the big 4 – even though it is probably just to get the European governments off Apple’s back. I want to believe that this is really what he thinks. But I’m a little suspicous. After all, as others have pointed out, some of the independent labels that sell music through the iTunes music store don’t want any DRM, and have asked Apple to remove it from their music. Apple basically said ‘no’. And yet, the podcasts that are available for free through the iTunes music store are MP3 downloads – no DRM at all. Removing DRM from (some) music in the iTunes store should be hardly any work at all – Apple obviously already has the infrastructure in place for that.
So, Mr. Jobs, please put your money where your mouth is. Remove the DRM for the labels that request it. When you do that, I’ll believe you. And applaud you.
Have a Google account? Or more than one? Did you know that while logged in, Google keeps track of all the searches you do in your ‘search history’, and makes them accessible via your Google account? Did you know you can actually wipe out your search history, and switch the automatic recording off? More information on Nelson Minar’s blog.
I got a most intriguing piece of spam in my mailbox today. It passed through dspam because it was so interesting that I would appreciate it. I’m very happy with dspam that way – it really knows what e-mail I like
Here’s what the body looked like:
%TO_CC_DEFAULT_HANDLER
Subject: %SUBJECT
Sender: “%FROM_NAME” < %FROM_EMAIL>
Mime-Version: 1.0
Content-Type: text/html
Date: %CURRENT_DATE_TIME
%MESSAGE_BODY
Yeah, all of that in the body. The interesting parts of the headers were:
Received: from 192.168.0.%RND_DIGIT (203-219-%DIGSTAT2-%STATDIG.%RND_FROM_DOMAIN [203.219.%DIGSTAT2.%STATDIG]) by mail%SINGSTAT.%RND_FROM_DOMAIN (envelope-from %FROM_EMAIL) (8.13.6/8.13.6) with SMTP id %STATWORD for < %TO_EMAIL>;
%CURRENT_DATE_TIME
Message-Id: < %RND_DIGIT[10].%STATWORD@mail%SINGSTAT.%RND_FROM_DOMAIN>
So, someone pressed the wrong button, and their spam zombie software didn’t have any content to put into the spam messages. The software is so stupid that it then just sends the unmodified template. Lovely.
What’s interesting about this message is that they fake the first Received header. I wonder why – there’s really not all that much point in making it look like it came from a box behind a NAT gateway… I also wonder what SINGSTAT stands for.
Last week I wrote about the iPhone and it’s lack of openness. I mentioned the openmoko as an alternative. The company behind openmoko has just released it’s roadmap. The e-mail also contains the detailed hardware specs, and outlines their philosophy and approach, which is as they put it ‘unconventional’. They’ve got it exactly right. An open phone is what our community wants, and I’m really looking forward to getting my hands on one. Hrm, I wonder if I could justify getting a second new phone in 6 months time… The only thing that the openmoko lacks is high-speed data – EDGE, but more importantly 3G. Maybe that’s the surprise that’s referred to for v2?