Sucking the geek right out of you

Well, we are 35 weeks pregnant and the doctor has decided that the baby is not growing at the right rate, so it’s time to take the baby out. I have to say you cannot think about fixing that bug or finalizing a release when all your brain is doing is thinking about what to expect when the baby arrives.

Will she be ok? How long with she have to stay in hospital?

Your thoughts and prayers will be appreciated as the birthday of our daughter is made.

When Websites Dissapear

Over the last 12 months many websites have ceased to exist, GeoCities served it’s last Under Construction gifas yahoo shut the service down. Back in high school I submitted an assignment as a website using this service, now long gone. And the web erupted in a sad chorus to the loss, with some nice tributes.

404 on wall

Then Jeff Atwood lost all of his website to catastrophic data loss. It makes me ponder the feebleness of the web and how it all falls down when a link disappears.

There are many internet spiders archiving the content of the web but that’s largely just text, not images. If you look way back your web browser you will wait for most websites as the now offline images timeout.

I recently took the decision to remove the gallery from my rarely visited part of the web. Mainly because of the maintenance overhead of running two separate web applications, wordpress and gallery, but also for the fact that wordpress now has built in gallery functionality and I rarely have images I want to share. Come to think of it I rarely take photos anyway.

In the end if you want control of you own online identity, ie. your own website, not Facebook, wordpress.com or blogger. Then I guess there will be content that disappears all the time, this dns record would quickly walk away if I didn’t pay the fee or even worse the website would be deactivated by the host if I don’t log into the forums.

A Truly Free Domain

Kitten with Money

If you have ever had a personal website, like me, you would know that your url to your website is important

However if you are also don’t like to pay for things that you can get for free, such as webhosting, you end up with a url that is not as nice as a top level domain.

There are some free domains at the top level but the never have the same feeling of a .net or .com.

So how did I get a .net without using my own money? Well I did but not through a credit card or check I did it by filling out online surveys. They offer cash out via paypal then all I needed was to buy the domain using the survey money.

I had enough in about 3 months just filling out surveys during my usual time on the web.

I ended up buying the domain through namecheap. They offer WhoIsGuard for free for the first year which is a great service so your personal details don’t show up in whois searches.

So it’s not entirely free but if you don’t value your time too much it’s not much work to do a few surveys and have a professional looking domain for your website.

And yes that is my cat! He is a year old now but still very cute, when I bought my last car the seller insisted on cash, I just couldn’t resist the photo opportunity.

time_t and printf

The bane of my existence is work where I use c++ primarily with MFC.

Now today I have come up to one or the most strange occurrence while debugging the database code in our product. I was formatting a string with sprintf and all of my time values were being formatted as “(null)“.

I know we should really be using parameterized queries but this is legacy code created by PC software guys, and I really don’t know if ODBC supports it in a database agnostic way.

Now we have been using Visual Studio 2005 for years but this code has not been working for years, the problem showed up around the database purging code.

When looking in the debugger at the formed SQL I noticed “(null)” showing up instead the numbers I was expecting.

It turns out we were using time_t as the type being fed into sprintf which under this version of Visual C++ is actually a 64-bit integer, or unsinged long long.

So the solution to this rather strange error in formatting is also quite strange, as in how do you format a unsinged long long into sprintf. Well it’s rather simple just add another formatter charter so if you have a signed long long use %lld or if you have a unsinged long long use %llu.

I hope you don’t get tripped up like I did. And if you were wondering why there was “(null)” in the string it’s because the next token was a string, %s, and intel architeture is little endian making the upper 4 bytes all zero, ie null.

Floder Properties in Windows Vista

When using the explorer in Windows Vista I was having trouble finding the folder properties, for showing hidden files among other things. Like everything else in Vista it has moved and changed name. No longer can you find it under “Tools” -> “Folder Options…”

But now under “Organize” -> “Folder and Search Options”

Location of Folder Options in Windows Vista

Location of Folder Options in Windows Vista

It really shook me and the help only had a link to open the options and didn’t tell you how to actually get to the options directly.

My very own home

Well it finally happened. No we moved into our own home like 6 months ago :p get with the program.

Today I purchased my first domain :)

So as of today welcome to jprogrammer.net a nice short sucsinct way to acess the random ramblings that don’t happen as often as they should.

Death in a Digital Age

I have recently experienced a death in the family, which has started me wondering about how our digital persona’s will live on.

I personally spend alot of time on the internet, a couple of hours a day at least. Spending my time reading email and rss, writing a blog entry (ocasionally :P ), particiapating in online discussion (Stack Overflow at the moment), buying stuff, reasearching stuff. There is just soo many things that I rely on the internet for.

But at what point do these things dissapear, with the cheapness of media maybe what we create will exisit on forever. This webpage may not as hosts come and go like my first provider, but you can still see entries from there, not very pretty ones, with the internet archive.

It just goes to show that there really isn’t anyone who produces on the internet will ever trully die and therefore no one should be lost to history no matter how small your percived contribution was.

Just makes you think doesn’t it.

The house is finished!

Have you ever noticed that as time goes buy your passion for different things start to wain? I do it seems some things that you thought was important is not so important any more. Like blogging for instance :P

It has been quite a while now mainly because work has been heating up for me. I went on a week long trip to China visiting different customers.

And most importantly our house was finished and we moved in about 4 weeks ago Yey!

And we are loving it, the cat hasn’t adjusted too bad either. But the money is now flowing out finishing off the house. Oh well such is the life of a mortgagee.

House Update

Most people would know we bought land in April to build our first house on.

And since then we have been trying very hard to get approval to build the house we want on it. There was a clause in our title, Memorandum of Common Provisions to be exact. That no structure within the first metre of the boundary will be greater than 3.6 metres tall. And the house plan we decided to build once sited on the block made the height of the garage at 1 metre from the boundary 3.79 meters.

So both I and the build phoned the council to see what could be done, simple they said all you will need is a Planning permit and it should only take a couple of weeks for such a small item.

Thats when the fun really began it took the council 3 months not a couple of weeks to approve the permit and when we finally got it back we were told that the planning permit was not all that needed to be done to allow us to build our house :(

A planning permit like this gives you permission to get a licensed surveyor to draw up a plan that will then be approved by council which will then need to be submitted along with the title kept by the bank to the Titles Office.

So here’s the list of things that cost money along the way:

  • Planning Permit
  • Letters to neighbours
  • Plan
  • Approval of Plan with Council
  • Release of Title from bank
  • Submission to Titles office

So if anyone ever tells you that a Planing Permit is no big deal laugh in their face it is a big deal and it will take time effort and quite a bit of money.

But if you are going through something similar take a queue from me that I should have known earlier, you need to be a squeaky wheel. If the person says that something will be done on a certain date or in a “couple of days” then make sure you phone them then and find out if it has been done.

Other than that we are now very excited about the prospect of getting on with the building of our house :)

Vertical text align of radio buttons in java

I have been doing some GUI java code in both swing and SWT recently and find text alignment a niggling annoyance of mine. Often you want to align components with the text line vertically of combo or check boxes.

Here is the code for determining the width in pixels for the two most popular GUI libraries in java. Both are cross platform/look-and-feel solutions.

Swing

JRadioButton radio = new JRadioButton();
int raddioButtonOffset =
    UIManager.getIcon("RadioButton.icon")
        .getIconWidth()
    + radio.getIconTextGap()
    + radio.getInsets().left;

SWT

// get the width of a space
GC gc = new GC(parent);
int spaceWidth = gc.getAdvanceWidth(' ');
gc.dispose();

// create radio widget to get widths
Button radioButton = new Button(parent, SWT.RADIO);
Point baseSize =
    radioButton.computeSize(SWT.DEFAULT, SWT.DEFAULT);
radioButton.setText(" ");
Point withSpaceSize =
    radioButton.computeSize(SWT.DEFAULT, SWT.DEFAULT);
radioButton.dispose();

int radioButtonOffset =
    withSpaceSize.x
    - ((withSpaceSize.x - baseSize.x) / 2)
    - spaceWidth;