20 December 2007

one day I will be cool

Today I thought the same thing as Hugh McLeod - so if that doesn't make me totally cool I don't know what will ...

I was reading the Jack Welch autobiography and realised: I will probably never be the CEO of a huge company like GE ... one day. And I also realised: that's ok. I'll be quite happy being CEO of a company 1/10th the size ...

I confess however, that as heres and nows go, my here and now is pretty good. It's a relaxing thought. Simply accepting, as Dhaval put it. More (money/fame/holidays/children/private jets/whatever) would be good, but not worth sacrificing the peace of mind that comes with acceptance.

17 December 2007

even more connected!

So in the space of one evening, just when I thought I was getting no more Plaxo invitations, Spock pops into my inbox with no less than three invitations. (Ok, so if you got thirty or three hundred, I'm a loser, big deal. At least my friends are real :))

What's Spock??? Another social networking platform? Kind of, but instead of a profile you have a "search result", and you get to vote on it, and you get to vote on bits of other people's "search results". It seems you can also make up arbitrary lies about people, but doing so risks reducing your "Spock Power". Oh dear, better avoid making up arbitrary lies.

One major gripe: I've accepted all three Spock Trust invitations, but I haven't figured out how to reciprocate. Why does this need to be difficult? Am I not Web 2.0-compliant enough?

And, I'm not giving you my linkedin password, or my gmail password, or any other password for that matter. So please stop asking!

03 December 2007

i'm so connected

I have an account on linkedin, plaxo, ning, xing, viadeo, orkut, ecademy, and probably some more that I've forgotten. Am I normal? How many online social networks does it take?

21 October 2007

Horrible onmouseout flicker in IE

For some kinds of application, it's useful to highlight a row when the mouse goes over it. Using CSS this is easy to implement:

tr:hover {
background-color: #123;

Unfortunately, we're stuck in the IE-age, and this simple, elegant solution doesn't work with the world's most popular browser. There appears to be a straightforward, if annoying, workaround: a little bit of onmouseover/onmouseout magic to change the row's CSS class.

A reasonable person might expect that, once the mouse enters the row, we would consider that it is still over the row until such time that it actually leaves the row. In other words, if I enter my house, and then enter my kitchen, I am still in my house, despite also being in my kitchen. Notwithstanding everything I learned at school about physics, it appears that I can be in more than one place at one moment, and, indeed, my mouse can too.

The authors of IE didn't think so

When the mouse enters the row, and then enters, say, an image in a cell in the row, an onmouseout event is fired on the row.

This doesn't break the straightforward if annoying workaround - but it flickers so much you might worry about having a seizure.

So one day we came up with this workaround to make the workaround work:

function really_over(src) {
  if (!window.event) return true;
  var event = window.event;
  var from = event.fromElement;
  var to = event.toElement;
  return ( to == src || src.contains(to) ) && !src.contains(from) && src != from;

function really_out(src) {
  if (!window.event) return true;
  var event = window.event;
  var from = event.fromElement;
  var to = event.toElement;
  return (src == from || src.contains(from)) && !src.contains(to) && src != to;

It simply returns true if an onmouseout event really represents a mouse out event. The effect of if (!window.event) return true; at the top is to return true if the browser is not IE, in which case the reasonable-person interpretation of "mouse out" applies.

Use as follows:

<tr onmouseout="if(really_out(this)) {unhoverRow(this);}">

where unhoverRow() is your function for changing the element's CSS class.

Of course, if you didn't want to do any of this, you might prefer to use Prototype's observe method, which is a lot nicer and appears to deal with the flicker thing internally ...

14 June 2007

Why I Like Ruby

I need to see if a property of the last n elements of a collection ("moves") is nil, where n is the number of players:

 moves.last(players.size).collect(&:piece).compact.size == 0

I don't know how to do this so readably in any number of lines of code in java:

  • initialise a counter to zero
  • from (moves.size - 1) down to (moves.size - (players.size + 1)), inspect "piece" property
  • if it's not null, increment the counter
  • counter == 0

10 May 2007

Open Coffee

I visited Open Coffee Club for the second time in Paris today. Great people, great venue, no smoke. Many thanks to Louis for organising this.

The OCC concept is interesting: every week, at the same time, in the same place, a meeting takes place. The focus of OCC is on Internet entrepreneurship, but one could re-use the same structure for any other topic ... something I've missed with other offline social networks - I need to find out where it is this month, which day, what time. If I miss it I wait another month before the next opportunity. OCC is every week - I don't need to obssessively attend each and every meeting.

On top of that, it's completely informal. There's no speaker, no agenda. Just tables, chairs, people and drink. OCC seems to belong nicely with Open Space and similar unconference approaches to building communities.

03 May 2007

industrial or artesanal?

at XP Day France today we debated whether software is or should be an industrial process or an artesanal one. It's always interesting to explore new analogies for software development. Car manufacturing was mentioned frequently.

Just for fun, I came up with some more. Sofware is like:

  • Evolution of Species
  • Stock Trading
  • Politics

I'm not sure where any of these fit in the industrial-artesanal dichotomy. What they all have in common is competition. The software industry is a whole bunch of memes competing for space in your brain. Competing methodologies, platforms, frameworks, approaches, languages ...

We - developers, users, IT departments, corporate clients - feed software memes with our brains. We take a bet on who will win - object/functional, java/c#/ruby, eclipse/intellij, windows/linux/mac. And our gamble affects the outcome. Kind of like voting. Or trading. Or evolving.