The brilliant idea

Posted by robbiebow on 23 July, 2010 under stuff | Be the First to Comment

As a new and avid fish keeper, I had a flash of inspiration a few nights ago at 3am, got up, wrote it down, and wrote off to a major pet product manufacturer offering to sell it to them. Now it really is a brilliant idea, and so far I haven’t seen anything like it on the market. I would tell you what the idea is, but then, you know, what would I have left to sell? This is something I’d like to pursue to a successful conclusion. I’m 3 emails into the attempt to sell and looking forward to further conversations with the manufacturer. I give it a 5% chance of success so far. That’s much better odds than the lottery and will actually produce something useful – a great new product that will make fishes and their custodians lives better. And a little lump sum for me too :-)

Hmm. I might need an NDA or, at the very least, a decent contract with which to ensure I don’t end up left with nothing. Time to start looking for a brief…

Add a UUID to a new row in MySQL automatically

Posted by robbiebow on 1 February, 2010 under Dunno | Be the First to Comment

Unfortunately MySQL only supports the CURRENT_TIMESTAMP function for setting default values on a column. If you maintain a CMS type system you’ll more than likely want UUIDs for each article or page, and also likely want to keep that data in your MySQL database. UUIDs are commonly used as unique identifiers in ATOM or RSS news feeds.

To automatically add a UUID when you insert a row, use a trigger:

DELIMITER $$
CREATE
 /*[DEFINER = { user | CURRENT_USER }]*/
 TRIGGER `mydatabase`.`Add UUID to mytable` BEFORE INSERT
 ON `mydatabase`.`mytable`
 FOR EACH ROW BEGIN
 SET NEW.`uuid` = UUID();
 END$$
DELIMITER;

UUIDs are 36 characters wide, so a column type of CHAR(36) is suitable.

The great banking stitch up

Posted by robbiebow on 17 November, 2009 under politics | Be the First to Comment

So a while ago I wrote up a golden opportunity about to be missed and it looks like, indeed, it shall. Despite Bank of England Governor, Mervyn King, calling for exactly the same change, for exactly the same reasons, the Gubmint are going to give the FSA some illusory powers to interfere with bankers’ employment contracts. These powers won’t be used and would be shot down in court if they were. It’s also an after-the-fact measure: The system is buggered already once you have your bonus because you get your bonus after you buy lots of risky debt / sell lots of unsustainable mortgages. It looks like Darling & Brown are more interested in landing a fat bribe consultancy post from the bankers for themselves rather like Tony Blair than making Britain any better a place to live or do business.