2008-09-26

Lights on, that includes you, BMF

This is a pet-love-hate topic of mine, but I haven't aired it here on the blog yet. I was thinking of writing about it on my "proper website" but I've never got around to it.
Anyway, EU has put through legislation that requires all cars to have daytime running lights (DRLs) by 2011. This would mean that you can now see which cars are running by looking at them and checking whether the lights are on or off. In my opinion this is good. But many bikers think this is a bad thing.
You see, many many many bikers, including the BMF, live in a belief that because bikes run with the lights on, they're distinguished from cars. They also believe that if you put your lights on during the day in your car, then you're more or less masquerading as two bikes. To me this edges on pure bullshit (there, I said it!).
Admittedly this fact is true, but only if you decide to look at it from this narrow perspective. You see, the "fight" is not bikes versus cars. Really, it's not. Try to get over that for a second. Then find out what the "fight" really is about. In my opinion the "fight" is about life versus death. Notice that I'm not pointing out bikers or car drivers in particular, but everybody. All of us. It's about getting home safely so you can hug your partner and have a cold beer. That's what it's about.
To me, humans are, by definition, humans. That is, we make mistakes. We screw up, we're engrossed in something that's distracting, we're simply put quite bad when it comes to paying attention and foreseeing things. This (and lack of skill) is what causes "accidents', or should I rather use the word "incidents" as accidents "just don't happen", they usually take a human to make them.
Therefore, it's a good thing to have some sort of system telling other people that "a human is about". In this case, you put your lights on in your car to signal to everybody around you that there's now a stupid human being operating the vehicle. That includes you (and me). If you spend time in traffic at all, I'm sure you've had a personal experience with one of these situations;
You're driving down a residential street, you're being very observant, you're not feeding your kids or reading the Financial Times, and suddenly a car just jumps out at you. You almost panic, but realise you don't have to. All is well.
In a similar situation you're still in a residential area, and you come to a tiny T-junction. You give all cars a quick look, you even look both ways, and just as you're pulling out, you notice something in the corner of your eyes; THAT CAR IS MOVING!! Brakes..!! All is well.
Or another situation. You're driving down this nice country lane one sunny Saturday (or whatever day it was), the road turns, you're enjoying your meagre existence, and out from the shadow jumps a car. BAM! There it is. Luckily you're not trying to change the CDs in your CD changer in the boot at this time and you're the correct side of the road. All is well.
These situations are all situations where a fraction more reaction time would be a very good thing. Luckily it's easy to fix these situations; Put your lights on. It's as easy as that. If a human is piloting the vehicle; have the lights on.
What BMF and other "experts" in the subject doesn't get is that it doesn't matter whether it's a car or a bike. On top of all this, this "lights for bikes only"-theory goes totally against the grain of the first motorcycling rule; "Ride as if you were invisible". What this means in practise is that you should treat every other member of the road as if you were invisible and that they haven't seen you, and can therefore act in an "unpredictable" manner. Why should bikes have the exclusivity of "being seen". Why do bikes "need to be seen" more than cars, especially as a motorbike and it's rider weighs around 250kg and a car weighs around 1500kg. Isn't the car a much more dangerous "weapon"?!
As I stated above, it's not about bike versus car, it's about human survival. And if we mark the all vehicles that have humans in them, humans that make mistakes, with lights then I sure think it's a very good thing.
Now, before I stop this rant, I'll give you two things. First, I've lived in countries where dipped beams have been mandatory outside of towns, end result being that lights have pretty much been on all the time, and this has probably saved my bacon a few times.
Sadly, I'll negate all of this; I've not seen a single piece of statistics stating that countries who have mandatory lights-laws have fewer accidents than countries that don't have it. I guess this all comes down to what I stated earlier; Humans are stupid. You can't teach pork. The easiest thing that you can do to prevent accidents is to not have accidents. I.e educate yourself in the subject (go to a skid-pan, practise emergency braking, etc), be vigilant, be observant, and don't read the bloody map when you're driving.
In the mean time, please, lights on!

2008-09-22

Tryphonos - Hub-steered bikes.

Sometimes you can't stop but being in total awe. Through a friend I (or Caz and I) got the opportunity to go see Mike Tryphonos. This guy is so incredibly passionate about his bike, and bikes in general you can just feel it like some sort of force field when you get near him. When I first met Mike a long time ago he was very reserved about what he said and what he was working on. Understandably, I guess someone with his experience has heard a lot of BS and gotten a lot of negative criticism about his work.
Anyway, back on track. Yesterday we got the opportunity to go straight to the birthplace of Mike's bikes; His workshop. Not only was it immaculate, but Mike's enthusiasm also was glowing. You could tell from all his stories he was telling and the way he answered all the silly questions I had for him.
Oh, am I skipping a bit here... Let me fill you in; Mike builds (yes, builds, not assembles) his own Hub-centre steered motorbikes, the Tryphonos bikes. In fact, his history is, as of today, the 615, his final year project bike, then the 750TT, a bike that finished 11th in the IoMTT (out of some 80 starters!!), next an evolution of the 750TT, called the 907 which has been ran on the road for some 50,000 miles, and the 937TT, the most elaborate running prototype. You might have seen this in bike magazines etc. Mike's website is also mentioning the 998ZX prototype, but I'm quite glad that, after 2 years or so, Mike has scrapped this bike. He said that he's tried for two years to package it, and things just didn't work out. Don't worry though, Mike hasn't given up on the concept and that the future might (or might not) have something nice in reserve - if/when he does, it's his news to tell, not mine...
Either way, I had a great day, was awesome to see Mike's bikes, it was awesome to just chat bikes in general with Mike the rest of us. Thanks for having us over, Mike! :)
Top day out!

2008-09-09

Let's talk about eBooks and eReaders

I think it's time to air this old bag again. Since the dawn of time, well almost, eInk and eBooks and eReaders (and eSpace) has been mans dream. My friend bought the Sony Reader 500 a while back, and he quickly sold it onwards. It couldn't render PDFs and was slow (if my memory serves). A few days ago I fiddled with the all new to UK Sony Reader 505 and I must admit that I was quite impressed. The screen quality is frankly astonishing. The price isn't too bad either; £200 from official Sony Store. I'd love to have a three device set-up when I travel, or even around the house; Smartphone, eReader and laptop computer. The smartphone for anything I need when on the move; i.e walking, driving, etc. The eReader for when I sit down for a moment (train, airport lounge etc) and for my reference books and as notepad next to my laptop. Laptop obviously for all my computer needs. Where's the beef with the eReaders then..?

Well, for me there's quite a few points where these devices of today fall down. In no particular order:
1) Page changing sucks.
The flickering of the screen is absolutely mind numbingly horrible. Imagine a shot of strobe-lights everytime you change the page. Seizure galore! And it's slow. Bhlergh!
2) Available material
For now, you can get "real books", but I don't read "real books". I read geek books, news and magazines. I've never read a Shakespear book, never a Sherlock Holmes novel, not to mention the Iliad! I want to carry all my geek books with me. I have meters of them. They weigh a lot. This is where the eReader would rock. Carry around 500g of eReader or 6 meters of books..? Easy choice.
3) Connectivity.
If this is going to be like a book, it needs to be able to adapt. Whatever you throw at it, it should render. What I mean by this is that I want it to render news, I don't care what format it is (PDF/HTML etc), but I want it, and I want it universally. I don't want Sony, or any other company to dictate what news I should read. If it's "out there" I want the option to read it. But I also want it to update without wires. The batteries last for hundreds and thousands of page-turns. I don't want to carry a cable to get the latest news to the device. So it has to be able to download the books, news and magazines over the air. I don't need it to be an active web browser. In fact, this could be a bad idea, but let's not dwelve into that now.
4) Price vs. features
For me £200 means it'll be gadget of the month. Any more and I'll have to consider it, any less and I'll buy it "for the hell of it". I will not pay £600 (Iliad et al) for the ability to add notes. If a real book can handle notes and scribbles, the eBook should too. It's as easy as that. Know your competition (paper books in this case).
5) Choice of formats
At the moment you can buy a paper book and get the PDF version of the book. This is good, but eReaders so far don't render PDFs very well. And then there's a bunch of different eBook formats. This is not good. Can't you all just get along and decide on one format. How about HTML with SVG support..?! Some strict dialect? CCS contained within the eReader..?! I don't really care what format, but I do care about the fact that a book that I buy may not be readable on my reader. That sucks. Fix it!

There you have it dear eBook manufacturers. The day I can get my technical geeky books onto a £200 eBook reader that can handle notes, download news feeds over the net, and possibly switch any paper-based magazine subscriptions into electronic ones, then I'll be first in queue to get one.
And one last thing, if you make it splash proof I can read my books in the bath or on the beach. That'd be very cool.

This Plastic Logic one is quite close, but just look at the lag for the page turning and the flashing. Not very pleasant.

2008-09-08

D.R.Y Class Methods in Rails

There you are, coding something fairly simple. In my case I wanted the latest ActiveRecord object, either created or modified. I had this in my model;
def self.find_last_updated
find(:first, :order => "updated_at DESC")
end

I wanted to reuse this code in other models. The natural progression is to stick it in a file into the /lib/ directory. However, there's a slight gotcha. You can't have class methods in modules without a bit of trickery.
The way I went ahead was that I created a file in /lib/, in my case, I had generic_helper.rb in there, so I decided this was such common code that I can put it in there. Then load it with include GenericHelper. But that didn't work.
Thanks to Marcus, I now know how to fix this. What you do is you create another module within your module, and ditch the self. part from the method declaration. Something like this:
module GenericHelper
module ClassMethods
def find_last_updated
find(:first, :order => "updated_at DESC")
end
end
end

You can then load the code with this:
include GenericHelper
extend GenericHelper::ClassMethods

Now, that's pretty neat, and it allows you to choose if you want to load the class methods or not. However, if you stick it in a file on its own, then you don't need to choose that, and here's a piece of code that allows you to omit the extend-part.
def self.included(cls)
cls.extend ClassMethods # The nested Module's name
end

What this does is it basically pushes itself through the door and extends itself. You should now end up with something like this:
module GenericHelper
def self.included(cls)
cls.extend ClassMethods # The nested Module's name
end

module ClassMethods
def find_last_updated
find(:first, :order => "updated_at DESC")
end
end
end

In /lib/generic_helper.rb. Which you can "activate" by using the include statement such as: include GenericHelper. I can now go into the console and ask for MyActiveRecordModel.find_last_updated. Pretty neat, huh?! Ruby for President!
Now, how could the almighty Marcus know all this..?! Well, he's go a secret (no, not that one). He's been watching Dave Thomas' Screencasts from the "The Ruby Object Model and Metaprogramming"-series. Needless to say those are on my shopping list.