Blog Modifications

I decided to make a few changes in the blog. The first thing I did was made the comments appearable in-line. It required a few changes in the moveable type back-end.
I needed to add the ability to strip extraneous bits from the comment.cgi form. This was accomplished with a ‘raw’ parameter, that allowed it to remove code that fell within a <COOKED></COOKED> pair of tags. I also added in a ‘redir’ tag. This allows it to rediret the page somewhere other than the default redirect page – namely back to the homepage instead of back to the comments page as it is by default.
I was greedy, and wanted to add the ability to control output if there already were comments, so I added the <MTEntryIfHasComments> tag, which works quite nicely. I may need to add an inverse to this. This allows me to have entries on the main page that read Comments or Comments (<Number>)
Finally, and slightly annoyingly, I had to add a redirect to the proper hostname of my website, as the XMLHttpRequest open operator will not operate correctly cross domains (security feature for unsigned scripts). I have no intention of signing my scripts, so a simple javascript redirect is in place there.
Mozilla throws an exception if you try to cross-site execute and XMLHttpRequest, IE does a security confirmation and Konqueror (and probably safari) simply ignore the open request. annoying, but I suppose the have a point.
Things learned at this point

  • XMLHttpRequest rocks!
  • MT is a bit of a pain to customize
  • IE caches more than it should – I can’t get the comments to reload.

Re-duuude

Of course the reason I was going to the Dell website – I needed to buy a new main battery for my laptop – the current 4 cell has about 45 minutes battery life. This is probably related to me leaving it in the machine all the time, thereby subjecting it to a long series of charge/discharge cycles. The replacement battery, including vat and delivery is slightly over €90, and it’s a 6 cell battery over the 4 cell that I have already; I won’t know what to do with myself with all that extra battery life – maybe I’ll be able to watch a DVD, as advertised in the original adverts about the laptop; they forgot to mention that you needed to have the 6 cell battery for that to work in the first place. Until I have more money coming in the XPS2 would simply be too much the piece of luxury. I’m reminded of the going into the shop to get some repairs done to the car and ending up with a newer car (this has happened to me). I’m a scary consumer. Sometimes I can resist, sometimes I cannot. This time I must be strong!

Duude…

dell xps2 laptop

Dangnabbit, of all the companies to have released a relally nice gaming laptop it’s Dell. The XPS2 laptop is a really shit hot piece of kit. We’re talking big display, reasonable battery life (2.5 hours), groovalicious graphics card (6800 go Ultra – faster than anything I’ve got). It’s got insane blinky lights. It looks like Dell have finally gone out and done something really, really nice. I would have been following ths piece of hardware if it weren’t for the fact that I’ve been distracted these last few months. Maybe I should buy one! that would mean it becomes reasonably priced for everyone else. My current guide price is a hair under €4000, which is really, really expensive.

I’ve been pricing apple laptops and there’s no way – even at a stretch I can make the 4k mark! I mean really – apple; you’re not trying here!


Network printers and big print jobs

Hmmm, strange one this. We have print jobs that are actually a batch of documents sent to the printer over the standard print spooling mechanism of Windows 2003. The problem is that the printers are network printers, so they can be stolen between documents by other machines feeding to the same printer.
How do we fix this?
Windows does not seem to be providing us with a way of doing this. There is no way of specifying that all the jobs need to be printed at once. Getting a lock on the printer seems impossible – they’re designed to just be dropped into the network taking the jobs as they’re being fed to it.
Potential solutions:

  • Remote queues per printer – spool jobs for each printer on the single machine. This cuts down on the scalability of the system, but it’s probably the quickest fix
  • Combine all the separate documents into the one print job and send that to the printer. Requires no reconfiguration of the printer queues. Means we have to concatenate all the jobs from the batch into the one file. This is ok, as weve got PDFs and there are a multitude of programs around that allow us to concatenate them.

Anyone have anything else like this happen to them and how did they solve it?

Makefiles and VPATH

Ok,
Time for a little bit of programming trickery – this one related to makefiles and the fun of VPATH. One of the projects I was working on used the VPATH feature to build the code for each version in a subdirectory. That meant that you can have one makefile for any version, and simply include the delta makefile which contained all the conditional compilation work. The problem with this is that you need to write the makefile carefully, otherwise you can’t take advantage of this feature.
When you write a makefile rule you end up with something resembling:

target: dep1.c dep2.h
   $(CC) $(CFLAGS) -o target dep1.c

The rule itself is fine, the problem is that the build command will mess up when executed on a relative path build. The make tool cannot change the target and dep1.c entries to match the locations of the files in the build command; It’s not been given the ability to parse shell scripts. You need to use the correct variable syntax.
Firstly, we never use the absolute target name in a build – that’s really effing stupid – after all if we change the name of the target every other entry needs changing. What we use is the $@ variable – this is expanded at run time to match the target name – it means less typing, and less chance of an error.
The Second change is to replace the dep1.c with $<, this means take the first dependency of the rule, and as this is a vpath substitutable entry, this gets replaced with wherever the dep1.c is found.
I’ve been experimenting with this on a linux box and it works exactly as advertised for the gmake. I’ve not tested it recently on Solaris for svr make, I know there is a different semantic to $lt; there.

Star Dust (factual errors)

stardust segment
Ok, teacher tells their class that the moon is not out during the day! How whacked is that. Then also proceeds to tell them that all rivers flow south. Downhill maybe, but south! this smacks of something out of 1984.
Reminds me of the occasion that I got screwed in a general knowledge quiz over the question… how much light does the dark side of the moon receive as a percentage of the overall light the moon receives. The reason why the dark side of the moon is called the dark side of the moon is that it is not generally visible from our perspective. The moon takes about 29 days to rotate on it’s axis; almost exactly the same amount of time it takes to orbit around the earth. If we see the same side of the moon all the time doesn’t that mean that when the side we see is a new moon (dark) the other side is bathed in light! Dammit, that was a fricking tiebreaker question as well.

facts vs. factoids

This would be attributed as a whine from me; more or less. I’m regularly seeing people saying ‘factoid’ and then attributing it to a fact. The problem with factoids is that they are not true, they are not a miniature fact. Facts are facts; no matter how small or large the are.
The problem is that the reason whay factoids are called factoids is that they have the appearance of facts, but they are not. For the most part the reason why they are so is that they have been repeated so many times that they are attributed as fact.
Consider the oft touted ‘fact’ that Sweden has the highest suicide rate in the world. This is a true factoid. It originates in a speech of a US president, and has absolutely no basis in fact. It was used to argue that the social system in the country does not help the people in the country; for after all; they’re fucked regardless of how much money they put into it.

One less SUV

If anyone actually reads doonesbury (on slate now), they might remember a short segment about people gtting SUV tickets – ones that tell people that their car gives really sucky gas mileage, and burns a hole in the environment. Earth On Empty have created the tickets that you too can use in your neighborhood. that loophole needs to be closed. Strangely enough, the loophole has been there since the Clinton administration!

Cat comment

catcomment.gif
Yes, this is how cats do ackt when you encounter them after they do something utterly stupid.

Last night in Donnybrook

Well We’ve been in the pub and we’ve arrved back to the house. It’s the last night in the house for Tara and Nicky (and myself). I am of the no fixed abode problem, so I’m just following people from house to house (:-); not really.
I need to do something!