October 2006 Archives

Granted it's a bank holiday weekend here in sunny old Ireland, so the Gardaí are out in force trying to catch speeders and make sure people aren't driving while drunk. I've been stopped before, and it was at most a check of the tax and insurance on the car but this time it was breathing into the breath-alcohol meter. First time I've ever done it, and as they bag everyone on the road, I wasn't concerned that they thought I was driving erratically or anything like that. I would have been stunned if it had given any result other than zero, but even so I was a tad nervous. There is a feeling that you are under a spotlight (it was a big chunky torch).
Noew I'm back at the house and enjoying a relaxing drink before heading for bed as after all, I need something to get the smallest twinges of adrenalin out of my system.

space for beer

| No Comments

A professor stood before his philosophy class and had some items in front of him. When the class began, wordlessly, he picked up a very large and empty mayonnaise jar and proceeded to fill it with golf balls.

He then asked the students if the jar was full. They agreed that it was.

So the professor then picked up a box of pebbles and poured them into the jar. He shook the jar lightly. The pebbles rolled into the open areas between golf balls.

He then asked the students again if the jar was full. They agreed it was.

The professor next picked up a box of sand and poured it into the jar. Of course, the sand filled up everything else.

He asked once more if the jar was full. The students responded with a unanimous "yes."

The professor then produced two cans of beer from under the table and poured the entire contents into the jar, effectively filling the empty space between the sand. The students laughed.

"Now," said the professor, as the laughter subsided, "I want you to recognize that this jar represents your life. The golf balls are the important things--your family, your children, your health, your friends, your favorite passions--things that if everything else was lost and only they remained, your life would still be full.

"The pebbles are the other things that matter like your job, your house, your car.

The sand is everything else--the small stuff.

"If you put the sand into the jar first," he continued, "there is no room for the pebbles or the golf balls. The same goes for life. If you spend all your time and energy on the small stuff, you will never have room for the things that are important to you. Pay attention to the things that are critical to your happiness. Play with your children. Take time to get medical checkups. Take your partner out to dinner. Play another 18. There will always be time to clean the house, and fix the disposal.

"Take care of the golf balls first, the things that really matter. Set your priorities. The rest is just sand."

One of the students raised her hand and inquired what the beer represented.

The professor smiled. "I'm glad you asked. It just goes to show you that no matter how full your life may seem, there's always room for a couple of beers."

bulls don't have udders

| No Comments
I saw a trailer for some stupid animated farm movie. A male cow is a bull. Bulls do not have udders. All the cattle on the trailer - both male and female alike had udders. Could this be the first transexual animal movie for kids?
Probably one of the handiest features of C++ is the ability to create an object on the stack, and have it destroyed once the class has gone out of scope. This is because of the design of the language.
When you create an object using the syntax 'ObjectT foo' the object is instantly initialized, and you refer to each of the items in the object as foo.<whatever>. When the function returns the ObjectT's destructor is called to clean up the object. This happens for every class.
Borland have seen it fit to make their compiler barf when you use one of the Visual Class Library(VCL) classes to create an object. Personally, I find the fact that you have to then wrap the code in a __try__ __finally__ block to be a waste of my time. After all there is no rational reason for preventing me from using the variable on the stack, as stack memory is just as good as heap memory (I'm old skool me!).
All you're going to have on the stack is a pointer to a VTBL and the data concerned with the object; nothing more. If you have to cast it to a lesser object, then cast it to a lesser object. If you are using this object in another object (for example adding it to a collection), then use the proper syntax (in this case the ObjectT *foo = new ObjectT()). As a programmer you should know these things.
I would argue that the compiler should not protect us from such annoyances, but the reality is that to make better code we need more assertive nannies. All my C code is compiled with -Wall -Werror, which catches a lot of stupid mistakes, but doesn't catch a lot of normal problems. Sometimes I think I would be better in a garbage collected, reference managed, array overrun protected world... but where would be the fun in that? I like my assembly language, I'm more careful as I know every instruction counts. That and the fact that a review of assembly code takes significantly longer than the same review of C code makes me pray that the developers are paying more attention.

I am kimiko?

| No Comments
Another one of those surreal quizzes. This one gave me an unusual result...

Which Megatokyo Character Are You?
created with QuizFarm.com

Commander, my commander

| No Comments
It's an interesting one. I seem to be less capable of commanding troops in Company of Heroes than other games. The problem stems, I think from the feeling I have that the troops in CofH are real people, I empathize with them when I see them being cut to ribbons by machine guns. I hate it when my snipers get shot, and I get angry when a tank runs my men over.
Then we have Warhammer 40k, Dawn of War. I have no compunctions to sending wave after wave of troops at the opposition, slowly eroding their numbers until I can actually wipe them out. Entire squads get wiped out and I just send more in. I just don't have the same connection to them.
Strange that, and it's only a computer game.
I'm getting annoyed with the number of programs that I have to exclude from DEP. Practically all of the palm simulators fall into this category along with all the securom games I've used.
Grrrr.
God, this one really annoys me. I've installed an application and it puts the shortcuts into the root of all programs. I move it where I want it to be (There was no choice on install). Then I run said program. Up pops the windows installer and recreates the shortcuts in the root of the start menu.
You ignorant stupid rat b*****d wh***son of a b****h. What; do you think you own my computer? Away with you and your crappy force fix of my choices as a customer. This complaint brought to you by shite software and a harkening back to why is there no programmatic access to the Start menu pin list. Thank you for small mercies.
It's significantly slower to access a disk than it is to access memory. When given a choice between using a bit more processor power to decompress the information once it's been read into memory or pulling more information from the drive then you really should make the smart choice.
Even if disk space is cheap/free, it doesn't make sense to spend the time reading the information whan you could be using it. The problem is of course, using a sensible and fast compression/decompression algorighm, and also realizing that it really screws with the whole ease of write on the disk. You end up with some change one byte means completely altering the on-disk image so you need to write a lot more information. This is probably why we use transparent compression on files that don't change that much.
Whee, ain't science fun.
Trivial, I know, but some people need to know these things.
From the start we have the header, appinfo (optional), sortinfo (optional) followed by the record entry headers.
The header is:
FieldSizeValue
Db Name32Ascii Database Name
attributes2See DataMgr.h for meaning (dmHdrAttrResDB)
version2Version number an application would use this to decide if the content was compatible
creationDate4Creation date of the database - time from the palm epoch when it was created
modificationDate4Last modifiied date of the db. creationDate by default.
lastBackupDate4date last backed up ina hotsync
modificationNumber4when changed this gets bumped
appInfoID4Offset in this DB to the appinfo block (0 if it does not exist).
sortInfoId4Offset in the DB to the sortinfo block (0 if it does not exist)
type4the 4 character type of the pdb
creator4the 4 character creator of the pdb
uniqueIDSeed4Stumped - I don't know what this is for, leave it at 0
This is the end of the header structure, the next is the record entry information
Record list:
FieldSizeValue
nextrecordList4Address of the next record list (only used for really bit pdbs)
nRecords2Number of records in the recordlist
pad2Number of records in the recordlist
nRecords items4 * nRecordsAddresses of the records in the pdb

The address of the first record usually lies immediately following the appinfo and sortinfo data. As this data is consumer defined, the only way of determining it's size is to use relative calculations. For example, the size of the appinfo structure it's local address up to min(addr(sortinfo, Address of any data records)) - 1. The size of the sortinfo structure is it's local address up to the min(Address of any data records) - 1. They are application defined, and as such should not be messed with.
I think fintan says it best when he says 'Hmmm, which part of stock market floatation did you not grasp Jack?. Welcome to the world of private business.
Aer Lingus... a division of Ryanair has a nice ring to it.

I just redacted my last entry

| No Comments
Stupid Pete, read the law, not your thoughts before commenting.

This is really a WTF

| No Comments
I discovered this one in a state management routine - save the address of the database corresponding to the module that's loaded. It works until the program is restarted or the operating system is rebooted. I'm going to have to change it to use the name of the module instead of it's address. The only problem I can forsee is the presence of multiple copies of the same named module in the application path; That's just another thing to work out.
Firstly, it's cool that they are there. Rather than having to do something surreal involving runas, explorer and a couple of other things to allow you to run an application at a privileged level you now encounter the ubiquitous shield icon, which tells you that to perform this operation you need to acquire the appropriate privileges. It's a lot like the linux sudo, except by default you just have to click the 'continue' prompt instead of a password.
Pretty cool, even if you're an administrative user, you don't start with all the privileges that your group memberships provide.
Here comes the rub - I've stopped reading the prompts, I just find the one that tells me how to get to the next step and click on it. I'm not positive, but I think this is probably par for the course for other users as well.
Shame that, nice idea, but hamstrung by having too many things need administrative privileges.

About this Archive

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

September 2006 is the previous archive.

November 2006 is the next archive.

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