Where do you put your curlies?
Posted in Coding on March 27, 2007 at 4:47 pm
After twenty something years of coding I have finally come up against a coding standard. I did some work for the US office and yes it works thanks but we should have sent you our coding standard to work to. Please change your code to match it!
How do I feel about being told how to lay out my code? How many spaces to put in an if statement, Where to put my curlies (ooo-err ). It’s a strange experience. I’ve waffled before about the creativity of programming - and that does extend to how you lay out what you write. If it looks stupid / ugly / messy when you’ve finished what does that do to your satisfaction level? Where’s the pride in producing something beautiful / functional / “good” if you are made to make it look bad? If there is no pride / satisfaction why bother to do a good job. It’s the craftsman vs. the production line argument.
So are you required to layout code to a standard? Do you require a standard of others? Is it worth it?
4 in 5 ready for digital TV?
Posted in Digital TV on March 20, 2007 at 4:03 pm
Over at http://www.computershopper.co.uk/?news/news_story.php?id=107498
they reckon “Four in five UK homes ready for digital switchover” - *&^%! That’s based on “Almost 80 per cent of homes had some form of digital television”. That’s not the same thing.
I have made a will - it doesn’t mean everyone in my household is ready to drop dead. Just like I have one of 4 TV’s in the house with digital reception doesn’t mean I’m ready to have 3 blank screens.
How many homes have ALL their TV’s digital ready? Not 4 in 5. Not even here in IT blog land where it’s pretty fair to say there is a higher percentage of “early adopters”.
Lies, damned lies and twisted statistics.
Role models
Posted in Uncategorized on March 19, 2007 at 5:30 pm
Some chap on the radio the other day was saying that it’s because we are fundamentally herd animals that we have this stupid cult of celebrity at the moment. Having chucked out (in cynicism and individualism) our leaders we end up “following” the weirdos that inhabit MSN today and Hello magazine.
I’m not sure if this is right. We certainly don’t like to think we have leaders - being part of the herd is not cool. Someone must be interested in the doings (pun intended) of J Lo and the Beckinghams and … and I can’t think of any sensible reason why they should be. OK some of them are pleasant on the eye but is it all about sex appeal?
Anyway if we are in need, at some sort of emotional level, of leaders / role models who would you choose to follow? Don’t even think about saying it out loud or commenting because whoever you name will sound uncool to be a follower of. But given that you don’t have to admit it, have a think about who would make sense (as long as no one knew).
Problems with GetTextMetrics(hDC)
Posted in Uncategorized on March 12, 2007 at 4:14 pm
GetTextMetrics(hDC)
This is a call you make to the windows GDI to get details of the current font (like the size of the characters). Interestingly it can return an error. OK, you could pass in a duff handle to the device context but why else would it return an error? My code is returning an error from GetTextMetrics, I can’t see anything wrong with the handle and GetLastError() returns 0 (ie no error).
So:
my code says: - how big is the current font?
the system replies: - I dunnomy code says: - why not?
the system replies: - I dunno
Great! I suspect the problem is multi-threading so I tried a sleep & a loop -
my code says: - how big is the current font?
the system replies: - I dunnomy code says: - why not?
the system replies: - I dunno
wait a while, ask again (the way you would when nagging a recalcitrant teenager)
Hurrah!!! this fixes the problem - after a few times it says - Oh yes, it’s this big.
Boo!!! after a while it just keeps on with the “dunno” for ever (I haven’t actually tested it for ever but after a few thousand tries I think we can extrapolate!).
An interesting problem - as in the Chinese curse about living in “interesting” times.
What is rather worrying is that googling for GetTextMetrics() finds lots of code snippets (including from Microsoft). None of these check for an error return. As this can mean the app is then happily using the data from a failed call (which is random garbage) all sorts of problems may arise - deciding how many characters fit on the screen when each is 0 pixels wide being the simplest!
So save your work before resizing the window / changing font / doing anything at all - you never know when a divide by zero is going to crash your application (or your system).
Fake professor in Wikipedia storm
Posted in Wikipedia on March 9, 2007 at 4:44 pm
I’ve been debating with a few people recently about how useful Wikipedia is (or isn’t) and then this came along
http://news.bbc.co.uk/1/hi/world/americas/6423659.stm
Basically I treat wiki as part of the extended community. If I want to know something the first thing I do is ask around - just because a mate says something it doesn’t mean it is right. Depending on the importance & how confident / competent they sound I might take their word for it but I’m more likely to take what they say as a start point and confirm it elsewhere. Wiki is a structured way of asking around - more shouting across the pub than querying friends as you don’t know the person who answers or anything about them.
Anything important you need to check elsewhere but as a starting point it’s great.
There’s a longer article at http://news.bbc.co.uk/1/hi/technology/4534712.stm
Certainly students handing in work and quoting wiki as their research need sorting out - unless it is about web trends when wiki is a source in itself!
How to grab a bargain
Posted in Uncategorized on March 6, 2007 at 12:18 pm
Over at sister publication
http://www.computershopper.co.uk/?news/news_story.php?id=106448 you can read about renewing your AV S/W for £65 or buying it new for £25.
It does indeed smack of a fat bloke saying “It doesn’t work like that”.
It’s easy to see how this happens - you use promotions to get people into the loop & make money on them staying there. The cheapest option is not only to buy new rather than renew but to pay for it with your 0% credit card and then move the debt on when the free period is up. However, that we can’t actually be bothered is demonstrated by the fact that such offers still abound.
“It pays to shop around.” And when all that takes is a few clicks rather than miles of walking through crowded streets we really should make the effort.
School lottery - meritocracy Mr Blair?
Posted in Uncategorized on March 2, 2007 at 3:58 pm
Choice? Parents want a choice schools for their kids ? B******s. Parents want good schools for their kids first of all and good schools for everyone else’s kids second (that might be a close or distant second).
Choice is not the major factor - you can choose between 10 failing schools or take whatever you’re allocated from 3 excellent ones? - der, let me think
The problem is that choice is driving down the quality of schools. Obviously everyone who cares chooses the good ones, the ones who care a lot ,work hard, pull strings, move houses, jump hoops… to get into the good ones. Result? Kids with “good” parents gravitate to the best schools leaving the poor buggers who don’t get much of a deal at home in the sink schools. Worse, all the eloquent pushy parents, who might get some changes made, never get to lumbered with the bad schools that need some pushing and change. If you are following this you might claim the logical conclusion of my argument is to ban private education, erm, yes.
If a lottery system means any kid might end up any where they’ll be some more people pushing to get the naff schools better.
If that seems unfair a test could be applied to the kids and send the most able to the most academically competent. Except that would be an 11+ and that was declared heinous by somebody for some reason - probably by some Poles who wanted to benefit from our lack plumbers. Making kids sit a test to see what school they go to is so unfair compared with seeing how much their parents can afford the catchment area prices and can pull the right strings, jump the right hoops…
And by the way, just so you know I’m not just bitter and so you can be happy for us if you know me, my son did get into the offsted “excellent” not the offsted “failing” which was the “choice” he had. The “excellent” being over 100% over subscribed.
New web site and browser protocols needed!
Posted in Uncategorized on March 1, 2007 at 11:35 am
I re-arranged a meeting, rushed back and got to the telly for just before nine last Tuesday and tuned into the best thing on at the moment (ie Life on Mars) and got a screen full of footie. I double checked the Radio Times and no mention of the possibility of a schedule change. I know they “go to print” (or whatever) months(apparently) before the actual publication date but we expect better than that these days.
In this age of instant communication we don’t expect to be dealing with “old” information. I have tried several sites to list TV schedules (some quite clever) but for the amount of information (lots of channels, lots of times & the need to flip between several pages) an on line solution has never seemed to have enough text on the screen and quick enough updates when flicking about. The RT has about 8 fairly text full pages per day - that’s a lot of web pages to have on view almost simultaneously. Come one you web chaps Isn’t there some clever way of preloading another browser tab with pages relevant to the one you’ve just loaded? That would make it easier to flip between pages without the world wide wait sluggishness.
On a quicker solution couldn’t we sign up to an email update from the beeb or the Radio Times? Far more useful that all the mail I get about the size of my equipment (matron).
Is there a web site for TV “schedule changes”? I’ll bookmark it if there is!
Tag cloud
Archives
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
Most commented posts
Highest Rated Blog Posts
- No excuse - it's free to encrypt! (100%)
- PC Advance Required (100%)
- Virtualization's Dark Side - or stating the obvious for beginners (100%)
- Tabs - I might change my mind? (100%)
- Which Linux do you drink? (100%)
- Sat Nag (100%)
- What has you tube ever done for us? (100%)
- Is your back door open? (90%)
- What they don't say... (90%)
- Measuring the Metrics (80%)

