October 2005 Archives

Broken hard drive again!

| No Comments
Again with the broken hard drive. Oi! I should invest in a RAID solution at this rate. Lost a few desktop configuration items, but other than that everything seems to be hunky dory. Adobe products needed reactivation again! Activation of software bites the big one.
[Listening to: Year 2000 Non-Compliant Cardia - Mogwai - Come On Die Young (3:25)]
There's an article on Computerworld that Microsoft is telling us that multicore chips are changing PC software design, but that not enough people are programming multi-threaded applications to take advantage of this feature.
Let me tell you, writing multi-threaded code is really easy. Writing correct multi-threaded code is the tricky part. Most development frameworks are not Multi-Thread safe. This means that you can't use it willy-nilly from multiple threads at the same time (it's primarily a resource assignment issue). So you have one thread that performs all the GUI work. Then you have to coordinate to have either the data or something close to rendered detail for the GUI thread. Then you have a barrage of threads performing various other bits of work. Of course, don't forget that making an application too multi-threaded has negative effects.
There is a subtle difference between multi-processor and multi-threaded processors which means that an mt-processor isn't the same functionally as separate cores/processors (shared resources, this being the whole -threading implication behind the name), so just throwing arbitrarily extra work at the mt-processor won't gain you much. The OS needs to know this information to schedule more intelligently, so adorning the threads with informatiion about the related data-affinity can gain you significant performance boosts (the OS schedules different threads more intelligently). The problem is that you need to export this concept to an application programmer. Guess what, it's generally too complicated for anything less than the most processor intensive tasks.
Generally, having the extra threads/cores/processors means that you get an overall system performance boost, it's just that the OS stops the isolation granularity at the process level. Operating systems have been designed around the 'complicated process, simple thread' principle. You don't want to change the balance of complexity moving back into the threads, we'll just end up with a sub-thread concept, and my head just hurts from that (atoms, quantum elements).
So what does the average joe programmer do? How do you find places that are suitable for parallelizing? How do you then 'fix' them up? Well, unless your program needs parallelism in the first place, it's actually difficult to retrofit it into a pre-existing design.
Well, there's a ton more stuff on this that I would like to get down, but it's 2am, and I need to get some sleep. More in the morrow.

Annoying Delphi 2005 OTA issue

| No Comments
Well, this one is just lovely. The first problem is that it does not support introspecting the Environment Option Names. This is annoying, but the next issue makes it even more fun. When we go looking for the options for, for example the package output directory variable (PackageDPLOutput) it looks at the .NET version before looking at the win32 version i.e. it's got overloaded option names.
Oh well, it will need to be worked around again, I suppose.
[Listening to: SSREP13 The Veldt - Andy Doan - Spaceship Radio (29:48)]

Page Style Chooser

| No Comments
I put in the 'set page style' options on the right hand side of the page. They seem to work just fine, mind you there is also the choice in the View->Page Style menu option in Firefox. I'm going to have to change some of the styles to make them more fluid.
I like fluid pages - I tend to resize and get annoyed when they only occupy a small portion of the screen.

Typeface based personals

| No Comments
This is something that has always interested me. Certain typefaces cause me to think of certain things, just like certain pieces of music and certain half-seen images. The typeface personals is a collection of personal ads/dates oriented on different type faces. It's quite a good description, and evokes some of the feeling that you get from looking at them. Then again, I know of at least one person who will think I'm talking a load of w**k.
All I have to say is that the fight between Helvetica and Arial is not over yet!
Straight apostrophes and quote marks did not exist in typefaces until the advent of digital type in the 1980s. It’s a computer thing, not a typographic thing.
[Listening to: Break On Through - The Doors - The Best Of The Doors (2:28)]

Where Caffeine goes to die

| No Comments
Well it had to happen. Energy fiend has the Caffeine Database, it features all my favourites such as Diet Coke (10mg more caffeine per bottle than regular coke!) and Penguin Mints (7mg per pill). Woot! everyone loves the caffeine.
[Listening to: Receptacle For The Respectable - Super Furry Animals - Rings Around The World (4:33)]

Skeptic

| No Comments
I've been bemused by the TV programs such as 'Most Haunted' and 'Most Haunted Live', where they are claiming to be encountering spirits in places. I think they're nothing more than cheap entertainment à la 'The Blair Witch Project'. I can't see how people can be convinced that these things are true. The mediums they have on the show have knowledge of the locations, they're playing on the fears of the people there, and they're good at reading people. It's a scam, and harmless entertainment. The only problem is that it's convincing people that this stuff is real.
[Listening to: Interview: Fraser Cain interviews Tony Youens - Skepticality - Skepticality - Science and Skeptic Thought (46:09)]

Movie choices

| 1 Comment
Well tonight I was thinking of going to see the new Wallace & Grommit movie, but instead I decided to stay in and get some programming done. To that end, I've been treated to Hellboy on Sky Movies. It's a great movie, but you need to appreciate where it's coming from.
This afternoon I was treated to my sister in the house talking about here 'killen'. Just like issues with the pronunciation of 'fillum' I'd like to say for the record that I've stopped correcting people, I just groan inwardly. This coming from the lad who read the 'curry'man newspaper every week :)

Dermot came back from Holidays

| 1 Comment
and a round of applause... He got engaged. Good for the both of them.

How to steal focus on 2K/XP

| No Comments
You used to use SetForegroundWindow, but that only blinks your window now, this is because stealing focus is evil. It can be done and it's evil.
You use the AttachThreadInput API call. The process is attach, focus, detach.
AttachThreadInput(GetWindowThreadProcessId(
  GetForegroundWindow(), NULL),
  GetCurrentThreadId(), TRUE);

SetForegroundWindow(hWnd);

AttachThreadInput(GetWindowThreadProcessId(
  GetForegroundWindow(), NULL),
  GetCurrentThreadId(), FALSE);
Again, this is doable, the problem is that it's not good UI design as this will make your window focus even if your application wasn't in the foreground, which as we all know is a no-no.
[Listening to: Purple Haze - Groove Armada - The Best of Groove Armada (4:03)]

Default make rules

| No Comments
The default make rules for solaris are in a configuration file. This file is /usr/share/lib/make/make.rules
gnu make wanders around with the file built in. You use gmake -p to get it's default rules (and a whole load more besides).

Video iPod - meh.

| No Comments
Well, i've only had the iPod 60gig since March. Does this count as one of those 'as soon as I buy one it's half price' things? I don't particularly care. How am I supposed to watch the iPod while I'm driving? or walking? When I'm sitting and listening to the iPod, it's normally while I'm programming. Feh, who cares about the new iPod?
You would think that people would remember this. C keeps things as an integer unless you tell it otherwise. This means that unless you tell the computer otherwise, it will keep blithely working on integers. so to get a proper answer cast one of the values to a float, and the entire operation gets done as a floating point operation.
Simple rules for simple languages.

Patch Wednesday

| No Comments
9 XP patches today. I think it was the same last month. This is not a good track record, and wreaks havok on attempting to create a pre-patched OS image for reinstallation.

First rule of profiling

| No Comments
The first rule of profiling is that by profiling you change the behaviour of a system. This can mean intermittent bugs, performance slowdowns, or general wierdness. Nothing earth shattering, but you just have to keep reminding yourself of it occasionally.
[Listening to: The Lion and the Cucumber (The Doctor and the Rockit Remix) - Dr Rockit - The Spirit of Vampyros Lesbos (5:48)]
Just a hint for those who might forget, because the new layout manager is not standard in Java, you need to make sure that your application ships with the new layout code in tow. To find the location of this layout manager on your system, open the library manager and look for the 'Swing Layout Extensions' library. This will give you a pointer to the .jar file needed to run under the new layout manager. In my case that's J:\Program Files\netbeans-5.0beta\ide6\modules\ext\swing-layout-0.7.jar, Your jar file name and directory mileage may vary.
java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group. Then again if you don't know why the error is happening I'm slightly shocked.
[Listening to: Little Earthquakes - Tori Amos - Little Earthquakes (6:52)]
image of the layout manager
The new layout manager for the Netbeans 5 designer. This form designer kicks ass on so many levels. It's really quick and easy to get things into the correct places without having to worry about baglayouts within flowlayouts within gridbaglayouts. Truly a joy to make use of.
[Listening to: U Boat - Kasabian - Kasabian (10:50)]

Paycheck

| 1 Comment
I saw this last night on the telly. It's a fun action flick with a premise that could have been taken from a PKD short story. There is the mandatory dove that is part of all John Woo movies. I would not have seen this at the cinema, and I don't think it would have lasted long enough there to have even slightly piqued my interest.
On the other hand, someone was telling me that 'The Magic Roundabout' wasn't in the cinemas here. I can't seem to remember it, but I may have been not paying attention to the cinema at the time. Anyone else remember?

Serenity!

| No Comments
I went. I liked. It didn't suck. I know why they had to do the 'world saving' stuff - nobody likes a low scale movie.
Apart from that, I hope there is more to come from that universe because I find it an interesting place to see, but don't over-do it like Buffy. Maaan I was sick of it by the end and just wanted it to be over.
For all the fanboys: Please don't shoot me!

Good old PromptDataSource

| No Comments
This one makes building ADO connection strings in client applications very easy. PromptDataSource is a member of the IDBPromptInitialize COM object. Creating it involves a small bit of C++ code:
  IDBInitialize *pIDBInitialize = NULL;
  IDataInitialize *pIDataInitialize = NULL;
  IDBPromptInitialize *pIDBPromptInitialize = NULL;
  LPOLESTR strConn;

  CoCreateInstance(CLSID_DataLinks, NULL, CLSCTX_INPROC_SERVER, IID_IDataInitialize,
    (void **)&pIDataInitialize);

  CoCreateInstance(CLSID_DataLinks, NULL, CLSCTX_INPROC_SERVER,
    IID_IDBPromptInitialize, (void **)&pIDBPromptInitialize);

  pIDBPromptInitialize->PromptDataSource(NULL, 0,
    DBPROMPTOPTIONS_PROPERTYSHEET, 0, NULL, NULL, IID_IDBInitialize,
    (IUnknown **)&pIDBInitialize);

  pIDBInitialize->Initialize();

  pIDataInitialize->GetInitializationString(pIDBInitialize, true, &strConn);
There are no checks anywhere here! You should add your own. C# makes things quite a bit easier.
  MSDASC.DataLinks oDL = new MSDASC.DataLinksClass();
  ADODB.Connection conn = new ADODB.ConnectionClass();
  conn.ConnectionString = "Provider=sqloledb";
  object oConn = (object)conn;
  oDL.PromptEdit(ref oConn);
  OleDbConnection xconn = new OleDbConnection(conn.ConnectionString);
  xconn.Open();
Of course, you need to add a reference to the com types: 'Microsoft ActiveX Data Objects 2.8 Library', and 'Microsoft OLE DB Service Component 1.0 Type Library', which provide access to the MSDASC and ADODB COM objects. You just extricate the Connection string at the end. I'm explicitly setting the provider in the second instance as I'm lazy, and I'm always accessing sqloledb. The 2.0 .NET framework may introduce an easier mechanism for doing this.

Toe the line

| 1 Comment
Or: Gyles Brandreth shame on you!
on the generic complaints program 'Room 101' on the BBC, he claimed that phrase's origin was from the Houses of Parliament where they have a pair of red lines separating the opposite sides of the room. The problem is that it is a slight confusion. He was mixing up the 'Thin Red Line' phrase and the toeing the line definition. No-one in the houses of parliament would have been bare-footed, so they would have never 'toed the line'. The origin of the phrase is most likely military or naval, where people were required to line up at various times for inspection. Convention claims the navy, as most common crewmen on a boat were bare-footed.
The lines in the House of Commons themselves are actually quite thick, and are positioned two sword lengths apart from each other. The principle being that you stayed behind the line during a debate, and thus could not attack your opponent on the opposite side. Such was the animosity of the two sides during certain periods of England's history that this principle was created, and it is still adhered to.
The origin of 'Thin Red Line' is slightly different. In the mid 19th Century there was an understanding between officers and men that British Infantry would never be asked to stand and face an enemy onslaught in less than three ranks, four was more common. The retreat would be sounded rather than allowing this to happen. At the Battle of Balaclava on October 25th 1864, Colin Campbell's 93rd Highlanders (Argyll and Sutherland) stood in just 2 ranks and faced a Russian Cavalry charge. It was here that the phrase originated.
There is a similar, but not identical phrase 'Coming up to Scratch', which refers to the scratch line that bare-knuckled boxers were supposed to get to before resuming fighting once they'd been knocked down. If they didn't come up to scratch, then they were out of the fight.

Serenity?

| No Comments
Why will I be going to see Serenity. It's simple really. When I first saw the series I was not impressed. I think I was in a bad place personally and just didn't appreciate it. Upon repeat viewing I will have to say that the series really made me think about what life could be like in the future, and how a system such as Traveller with it's varied tech levels might actually come to exist.
Simple premise, simple stories, well drawn characters. Add in the frontiers of space and it works well.
Shame it didn't last, but I think a lot of the folks never sat around to give it a second look like I did.

All hail the T-bone

| No Comments
Yayy! According to the news today it looks like we'll be having T-bone steaks in this country again. I love a bit of steak, me :)

Anyone for golf?

| No Comments
Had a nice morning today. Out at Castlegregory on the lovely little 9 hole course. It's a bit hilly so it's trouble for the old man.

101 uses for a dead cat

| 1 Comment
What does one do with a dead cat? It's not mine, it just wandered into the garden and died last night. I'm not legally supposed to put it in the bin. There is the burial option, I suppose.

Baby tag

| No Comments
The little girl's name is Niamh Joan and weighed 3.98kg

Rob's had a babby

| No Comments
My mate Rob's had a baby girl. Mother and child are doing well. When I heard on Saturday there was no name mentioned.

About this Archive

This page is an archive of entries from October 2005 listed from newest to oldest.

September 2005 is the previous archive.

November 2005 is the next archive.

Find recent content on the main index or look in the archives to find all content.