<< April 2006 June 2006 >>

Monday 29 May, 2006
#

"Do you feel 38?" asked Natalie, as we herded the kids towards lunch at Pizza Express.

"No", I replied, "because I'm 37". Good job she only put a single symbolic candle on the cake this morning. Jolly nice cake too. I also received a shiny new copy of JPod and had my office rewired. You can never have too many sockets in your computing facility, indeed, by definition they have too few.

Pete Ashton said Happy birthday, chap. [added 29th May 2006]
Marv said Happy birthday, Jez xx [added 29th May 2006]
smellygit said You're only 37? [added 29th May 2006]
allan@allankelly.net said Happy birthday! - and it good to know your older than me.

My trouble is... I keep thinking I'm 37 when I'm 36, there is like a 5 second gap everytime I think about my age before I realise. Heaven only knows what happens next year. [added 30th May 2006]

Ken [e] said Wait 'til you reach 39: the prospect of then hitting 40 genuinely feels like "it's not me, it's happening to someone else". Must be a safety feature.

Happy belateds, Ken. [added 30th May 2006]

John H [e] said Is it that time already? Belated congratulations to you (even more belated congratulations to Nat). I've taken to only celebrating those Birthdays of mine that end in a 0. That way, although they are quite traumatic, I get a nice long recovery/denial period. [added 8th Jun 2006]

[Add a comment]
Wednesday 24 May, 2006
#How To Work At Home: Phone

I've talked about the importance of having a defined work space before. Knowing when you're at work or not is vital to working successfully in your own house. It's not just physical space that's important though, it's communication space too.

Consider - you got up nice and early, packed the children off to school and hit your attic/shed/whatever and went to work. Eight or nine hours later and it's time to clock off. You wander downstairs to watch the tail end of Countdown, leaf through your collection of takeaway menus, or to play a round of poker with the kids. You've just settled down when the phone rings. It's a client. Gah! Suddenly you're back at work, but the setting is all wrong. You haven't got your notes to hand, you can't refer back to an email, you don't even have a pen. Worse, your client now knows they can ring you at quarter to six in the evening, plus they can hear the tv in the background so they start to think you spend all day messing about.

There are other variations on this. Not all my clients know I work at home, so I don't really want to run the risk of them hearing Hi, Jez and Natalie aren't home at the moment ... on the answering machine. Hal-baby is keen to talk on the phone, but he's not really up to talking sales enquiries from American clearing banks.

The solution is simple - get another phone installed. You have your house phone and your work phone. When you're at work you can ignore the house phone if you want to. When you're off the clock, the work phone machine can answer with a nice corporate message.

Getting a second phone line is pretty cheap these days, particularly with someone like Telewest. If you have a fat pipe, you could perhaps try using Skype-In or some similar softphone service. I feel that a landline number looks more professional, but you could just as well use a mobile phone as your work number. Should you claim your phone usage against tax, having a seperate phone can also help head off potential awkwardness with the tax-man. It certainly has in my case, anyway.

Working at home means you need to seperate work and home. Having two phones helps you do that.

[More How To Work At Home]

smellygit said If one of your clients doesn't know you work from home, then they haven't done even the most basic of Googling ;) [added 24th May 2006]
They aren't contracting clients, but remarkably it is actually true they don't know. At least I don't think they do ... [added 24th May 2006]

[Add a comment]
Tuesday 23 May, 2006
#[linkfarm] Scientists build caramel-powered margarine-making fuel cell - One more step to an independent Bourneville
[Add a comment]
#XSLT Scrapbook: The default is probably not what you want

The empty stylesheet almost certainly does the wrong thing.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

</xsl:stylesheet>

The default processing is equivalent to

<xsl:template match="*">
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="text()">
  <xsl:value-of select="."/>
</xsl:template>

All the text gets dumped out and everything else is lost. When starting a new stylesheet, you probably want to start by passing through everything or suppressing everything. You almost certainly do not want the default behaviour.


[Add a comment]
#XSLT Scrapbook: Suppress Everything

Here's a stylesheet that generates no output

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:template match="node()"/>

</xsl:stylesheet>

It's a good starting point for building a new stylesheet.


[Add a comment]
Saturday 20 May, 2006
# Chaired my first ACCU meeting this afternoon. Not sure I made much of a fist of it, although we did manage to finish on time :) There's a balance between letting everyone say what they want to say and keeping what they say on track, and it's going to take a little while to find it. I was surprised, and pleased, that Ewan, my immediate predecessor, seemed rather more assertive and definite that had when he was chairing. Perhaps that's just because I was seeing the meeting from a different point of view, but whatever the reason, I found it helpful. We made a couple of quite exciting decisions, appointing a new editor to one of our magazines, and agreeing to slap the content of the other magazine on to our boffo new website. Bugger - just realised I completely forgot to mention changing our publication schedule. Gah, I am a twit.
Ewan said

I did actually feel I behaved differently, though it wasn't deliberate. Talking of finding the right balance, when I was chairing I think I always concentrated on making sure everyone had their say, sometimes at the expense of having my own.

Hope I didn't swing too far in the other direction, at one point I felt I was in danger of being too overbearing.

[added 21st May 2006]


[Add a comment]
Monday 15 May, 2006
#[linkfarm] Bob Kojima's rolling ball clock - made of Lego

   * Ken [e] said This is kludge engineering surely?

"Here is the ball detection tunnel. The first design I made used only one light sensor. Unfortunately sometimes a black dot of a soccer ball happens to roll just in front of the sensor and the ball is not detected. To avoid this, I used a second light sensor, the probability that the ball is not detected by either sensor seems almost null."

Why not paint the balls completely white? [added 15th May 2006]

Well, I guess it allows you to use any ball you like. Unless the ball is completely black presumably. So, yes, you're right, particularly as he suggests a any-ball-would-be-fine alternative right there in the text. [added 15th May 2006]

   * Ken [e] said Completely black, or even "substantially" black would foul it up, as the chances of both sensors glancing across black would be too high. I'm too many years down the line from when I did numerical / stat analysis to do or care about the sums, but I guess even one or two more black spots per ball would give him trouble. Unless of course the black bits would have to be square on to not register: the albedo of these areas on an angle may cause the sensor to read them as white.

Anal, moi?

Or, maybe the clock balls have to be sports-themed - golf balls then! Golf? Sport?

[added 16th May 2006]


[Add a comment]
#[linkfarm] Backwards Is Forward: Making Better Games with Test-Driven Development
[Add a comment]
Friday 12 May, 2006
#

Today, Hal did the worst poo in the history of his nursery (and by extension, the history of the world). It's things like that, that make a chap's heart swell with pride.

Marv said Jez, if your blog is still around in 10 years' time, Hal will hate you for this. [added 13th May 2006]
Quite possibly. But ten years after that, he'll thank me. [added 13th May 2006]

[Add a comment]
Wednesday 10 May, 2006
#[linkfarm] Let's Settle This. Who Would Win? - Ninjas! Ninjas are cool; and by cool, I mean totally sweet

   * A Ninja [w] said I look forward to killing you soon. [added 11th May 2006]

[Add a comment]
Tuesday 09 May, 2006
#[linkfarm] Python 2.5: The 'with' statement - I think this is fascinating really. It's a language change to allow for deterministic cleanup - "The 'with' statement clarifies code that previously would use try...finally blocks to ensure that clean-up code is executed." It's further evidence to support my theory that all languages evolve to become more like C++

In his (mistargetted) ACCU keynote, Guido mentioned the Java Collection framework, and how much he liked it. He specifically said it was pythonic, because you could mix arbitrary types in one collection. Later he said Python would be removing comparision operators for abitrary types, because you just can't get them right for the general case. The primary use for those operators was sorting lists containing arbitrary types, which practice had shown to "not be useful". To me, that sounded like he was starting to recant the dynamic typing creed.

I'm sure if I dig around a bit I can find more. These are significant and intriguing examples of language development.

[Add a comment]
Friday 05 May, 2006
#.NET Annoyances: A single pixel? Through that hoop there, sir

.NET's System.Drawing namespace is absolutely stuffed full of groovy classes brimming with graphics manipulation goodness. Chief among these is Graphics, which provides a surface for you to draw on. It's an abstract thing, so it doesn't matter if you're drawing to the screen, a bitmap, a printer or whatever. You've got your Graphics object, and that's what matters.

Your Graphics object comes equipped with a ton of drawing methods - for hollow or filled rectangles, curves, bitmaps, polygons, bezier splines. You name it, it's got it.

Almost. There is no method for plotting a single pixel. Plotting a single pixel may not be the commonest thing to do. You could spend your whole career and never need to, but when you do need to, well then you need to.

Here's how you do it using the .NET Framework

  using(Bitmap pix = new Bitmap(1, 1))
  {
    pix.SetPixel(0, 0, Color.Gray);
    myGraphicsThingy.DrawImageUnscaled(pix, x, y);  
  }

Stinky isn't it? It's also horrendously slow, the SetPixel call more so than the DrawImageUnscaled call. On my Athon 3400 system with 1G of memory, plotting around 150 thousand pixels took around 5 seconds, which is extremely poor. If you Google around, you'll find people explaining this on the grounds that .NET doesn't use hardware acceleration, or that's it's only optimised for 3D or some similar nonsense. That's a lot of crap. I'm not doing some horrendous texture mapping, or simulating lens flare, or applying some crazy transform. I'm plotting a single pixel at a time. Plotting pixels is, ultimately, what graphics is all about. I can only assume that, under the covers, SetPixel has to go through some incredible convoluted path to do what should straightforward.

Should you just need to plot a few little pixels here and there, the above code should serve you fine. You can make the Bitmap static if you like, and just call SetPixel and DrawImageUnscaled repeatedly. If, on the otherhand, you need to draw more than few, you need to get to grips with LockBits and UnlockBits (which I shall write-up as soon as I have the energy).

[More Annoyances]

c said Absolutely major omission no .NET plot especially given that line(0,0,0,0) doesn't plot a single point which it should as line(0,0,1,0) plots 2 ! [added 24th May 2008]

[Add a comment]
#

You are driving your children to school. You are cutting it a bit fine, but you can probably get there on time. Less than 400 metres from the school gate, you find the road blocked by a lorrying dropping a skip. The drop is already well underway, and will clearly be finished in a couple of minutes or so.

Do you

allan@allankelly.net said Surely it is better to just leave the car at home?

- kids get some exercise

- dad gets some exercise

- less CO2 emmitted into the atmosphere

- less road conjestion

- safer school

And most of all a well balanced Dad who isn't stressed out my men with skips.

Do on, you know it makes sense to walk

Yours, High Minded of London

[added 5th May 2006]

As you've probably guessed, I was the shoutee rather than the shouter. I didn't tell him that my own children had left to walk and cycle to nursery and school half an hour previously. It didn't seem helpful. [added 5th May 2006]
Ken [e] said I don't know. Just as people are starting to feel good about the world with the onset of better weather, we all get brought back to grim reality ;)

Clearly the shouter had issues before he charmingly introduced himself to you. Reading between the lines, how did you manage to remain calm? I think I'd've been guilty of losing my temper when faced with this tit - probably to my detriment.

BTW even if you'd have mentioned that your kids have already walked, he wouldn't have heard the logic.

Best answer - glaring silence. Second best answer - throw dog shit at him. [added 5th May 2006]


[Add a comment]
Tuesday 02 May, 2006
#

Still feeling my way into the job of being ACCU Chair. Tonight, I'm trying to write my first View From The Chair. So far I have

View From The Chair
Jez Higgins

Uhngh


[Add a comment]
#[linkfarm] Sudoku Solver - written in XSLT2

   * Ken [e] said Dead link Jez! [added 3rd May 2006]

Fixed! [added 3rd May 2006]

[Add a comment]

Monday 01 May, 2006
#[Arabica]It's about time I dropped a release
Just built through with gcc 3.4.4 on Cygwin using Expat and Visual Studio 2003 using MSXML.gcc 4.1.0 on Cygwin using Expat [added 1st May 2006]
gcc 4.1.0 on Linux is failing, because of some codecvt weirdness. Either it's broken or my understanding is less complete that I believed. Probably the latter. gcc on Cygwin doesn't support wchar_t, so it dodges the issue. Am vexed. [added 3rd May 2006]
terris [e] [w] said Jez, you gotta start thinking about RDF. Methinks Redland needs a competitor! RDF is everything I thought DOM would be but alas wire formats are just wire formats. ~Terris [added 19th May 2006]
gcc 3.4.4 on Cygwin using Expat. [added 19th May 2006]
gcc 3.4.4 on Cygwin using libxml2 version 2.6.22 [added 19th May 2006]
gcc 4.1.0 on Cygwin using expat [added 19th May 2006]
Kicked off a gcc 4.1.0 build on Linux. I think it's going to go through ok, but it's a rather aged box (Cyrix 333 with less memory than you get today's graphics cards) so I won't know the result until about this time tomorrow. [added 19th May 2006]
ras52 said Are your gcc 4.1.0 problems on Linux to do with undefined references to various std::codecvt symbols? If so, I think this is a fundamental problem. My reading of the C++ standard (specifically 2.1.1.1.1) suggests that there is no requirement for std::codecvt to exist because there is no requirement for the standard library to support wchar_t as the external character type. Because of this, I'm unable to make either utf16utf8codecvt or ucs2utf8codecvt work on my system. [added 19th Jun 2006]
That's not the problem, although it was a problem. You read it as I read it - although it took me three or four goes. The solution is to provide your own specialisations, which is what the code in CVS now does. I've been distracted from this recently, and I might just kick the release out anyway and see what happens :) [added 21st Jun 2006]

[Add a comment]
<< April 2006 June 2006 >>