10 January 2008

gouge your eyes out with a rusty etymology

A recent Dave Snowden article uses "synecdoche" in its title, and it hurt too much to read on without understanding this word. Google's definition lookup explains this word means referencing a whole by a part - a common example being "all hands on deck" to mean "all men on deck". Then I got to wondering if the English word "man" was somehow related to Spanish "mano"/French "main" ("hand") - which would give us an interesting path from "hand" to "human". Maybe "man" is already an example of synecdoche?

While I was there, I noticed that "man" is recent in English - up to the 14th century, according to etymonline , "wer" was used instead. From Latin "vir", also giving "fear" (pl "fir") in Irish. I had thought old English and Irish generally didn't derive from Latin - so was I wrong or do these all derive from some earlier common ancestor - from India?

"Wyf" was the Old English word for "woman". There must have been a time, maybe around the 14th century, when "wife" had the double meaning of "woman" and "female spouse", just as "femme" and "mujer" do nowadays, in French and Spanish, respectively.

Fun stuff, no? Alas, It didn't help me with Dave's article though ...

06 January 2008

resolution(s)

I've been in hiding for too long. I need new relationships - partnerships for business, for fun, for Deep Philosophical Conversations ...

I live in France with my family (Sabrina and two wonderful children). Meeting people in the flesh involves a serious hit to family time. This is not ideal for a conversation that's going to be in somebody's second language.

So I want to learn how to do online relationships. If it's possible to call someone a "friend" through uniquely text interactions, I want to do it. And make lots of friends.

Hence the interest in a couple of recent posts in online social networks. I'll let you know how it works out.

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