April 2005 Archives
What was my charge for all this work? An Indian meal, complete with a bottle of beer! I really am cheap tech support.
Internet noise... what next?
The first thing you notice is that the C++ binary is smaller than the Delphi binary. There's a lot of framework code in the Delphi application that isn't in the C++ application.
Apart from that, the code is virtually identical.
I'll probably get around to writing it in C++ as well - delphi was a pain creating all those messages, and it's not Unicode aware.
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.

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!
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.
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.cThe 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.
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.
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.
I need to do something!
