Saturday, November 22, 2008

New Rule for registration processes

I just signed up for a site that asked for a password. Like most people, I don't create a different password for every site I visit I'd never be able to remember them.

Instead, I have a set of them, for differing levels of importance or required security. It works well, and so far I don't think I've ever had any security breaches.

The problem though is knowing which password you should use beforehand. This is a problem because some sites will email include your password in plain text in the welcome email after registration.

We all know that as soon as a password is emailed in plain text is can no longer be considered secure. These sites will no doubt also email it in plain text if you use the "Forgot Password" link too, which of course makes it worse.

I'm actually ok with this: some sites simply aren't that important and if you account gets hacked then meh. But I would like to know beforehand that they are going to be treating my password in this way before I decide which password I'm going to use.

So, New Rule: registrations should disclose if they are going to be sending the password via email in plain text prominently on the registration form itself.

Tuesday, November 11, 2008

Why I can't use KDE 4 (yet)

I've always been a flip-flopper when it comes to desktop environments. When I first started with Linux I think I was using KDE. Spent a bit of time playing with things like Enlightenment and black blox before settling for quite a while on XFCE4.

After a while I got itchy feet and tried gnome again, and I've been a gnome user ever since.

KDE3 just didn't do it for me, for many reasons that I mostly can't remember now. I do remember that its default themes were as ugly as hell, and I could never for the life of me get other themes to work well at all. They required weird contortions like compiling (for a theme?!?!), and never looked as good as the screenshots would have you believe.

So I stuck with gnome. Simple, clear and crisp. Compiz has given it a really nice boost, and I think the combination works really well.

But, I'm still a flip flopper, so I'm always on the lookout for something new. Unfortunately, E17 appears to have become to Duke Nukem Forever of desktop environments, so it was in the end KDE4 that got my interest.

I tried KDE 4.0 shortly after it first came out, and quickly switched back. It was unstable, and didn't have everything in place. I figured I'd try again with 4.1.

That I did, and this time it fared better. I decided to give it a week and make notes on what bugged me about it so I wouldn't forget. This way, when 4.2 comes out I'll be able to see if they've sorted any of the issues that bug me...

My work environment involves a desktop machine and a laptop, both of which are running (k)ubuntu Intrepid Ibex. I use the keyboard and mouse of the desktop machine and control the laptop via synergy. My KDE4 experiment has been run on the desktop machine (with the laptop continuing to run gnome).

So, without further ado, here is my list:

  1. Taskbar entries don't appear to be movable. That is, I can't change their order. This bugs the hell out of me: I like to have specific things on the far left, and if they aren't there I get lost.
  2. The taskbar is too chunky. Having just one at the bottom is nothing like enough space, so I opt to have one above and below in the gnome style, but the size of the taskbar means that quite a significant amount of vertical screen space disappears.
  3. No applet for Tomboy Notes. Yes, I know that KDE has its own note-taking application, but it's not as good, and I'd rather be able to use the same notes whichever desktop environment I'm using. It doesn't even have to use the same backend: just standardise on the file formats and that should do the trick.
  4. Is there any decent integration with MetaTracker? If there is I can't find it mentioned anywhere...
  5. Grabbing windows seems to be a bit sluggish. I'll point click and drag, and find that the window was never grabbed. So I'll have to go back and do it more slowly.
  6. There is no applet for the Revelation password manager
  7. Many applications appearing the notification area have a horrible white box around them. Something nasty going on with transparency I'd imagine. It only seems to affect non-KDE native icons too...
  8. Trying to assign CTRL+ALT+Left/Right to allow me to cycle through desktops doesn't work. They keys assign, but they don't actually do anything when pressed.
  9. Created a new panel, added a clock and System Tray to it. I can't get them to align to the right. The clock insists on taking up about a quarter of the panel's horizontal space, while the System Tray does even worse. Can't see any way to force them to behave.
  10. It is worth pointing out that gnome hosts KDE apps far better than KDE hosts Gnome apps. Not in terms of look and feel integration, but in terms of things actually working properly. Gnome apps in KDE seem to have weird quirks such as scroll bars disappearing.
  11. It makes really horrible things happen with the clipboard on the Gnome machine that this KDE machine is controlling (via synergy). I simply cannot paste sometimes: it just keeps pasting things I copied previously (and yes, I am trying both methods of pasting). Clearing Klipper seems to work around the problem, and it seems that this happens when Klipper's list gets full, which is rather annoying...
  12. Kopete doesn't do IRC.
There were other minor things too that I just forgot to write down.

And it is interesting to find that a number of the complaints above (such as the window grabbing issue) transferred to the laptop machine too. I wonder if this is indicative of it being a simple configuration issue?

Anyway, KDE 4.2 is now in beta, so it won't be much longer before I'll be able to give it another go...

Sunday, November 02, 2008

Thoughts about Ubuntu 8.10 - Intrepid Ibex

I've not posted about a Linux distro before, but I figured I would this time... just because!

Last week my Gentoo-based work laptop (IBM Thinkpad T43p) encountered a package blockage when updating. As usual, I tried to fix it myself, failed, and then discovered via the forums that this was a particularly tricky one to navigate that was probably going to require things like booting into recovery mode and doing manual surgery.

I decided that enough was enough, and that it was time to move on. It was a day before Intrepid's release, so I just went with the release candidate: I had done the same thing with the previous Ubuntu release on my desktop machine so I knew it would be ok.

And it was. Installation was as easy as it usually is, and the grub installation correctly picked up on the Windows XP dual boot partition which came with the laptop.

The first thing that has really impressed me is the networking and wireless support. This worked flawlessly straight away. Connecting to and disconnecting from the wireless network is handled properly authatically. Very impressed with this.

I was also impressed that hibernation support appears to works too. This is something that I had got working in the past but only by using the TuxOnIce kernel. This again appears to work out of the box, which is fantastic.

It's a shame that OpenOffice 3 didn't make it, but it can be installed pretty easily using a PPA.

I'm also a fan of the new "FUSA applet" which sits in the top right corner on the panel and provides one place from which to switch users, shutdown/restart/hibernate/suspend and also affect IM online presence. I'm not really one to manually mess with my online presence, but I do much prefer this to the previous shotdown window popup: it just seems cleaner and faster.

The only problem I have had is a keyboard repeat problem which I think is represented in Launchpad in the form of bug #278078. This only happens when I am controlling the intrepid system over synergy, not when using the machine's keyboard directly. Hopefully it will be fixed soon, becasue it is really quite annoying!

So all in all, I'm impressed. The next thing for me to look at is KDE 4: but that's another post. :)

Saturday, September 13, 2008

Its name is...

Planet Ubuntu just ran a meme on the subject of computer naming: i.e. how you choose names for your computers.

Mine are named after musical modes, so currently I have:

  • aeolian
  • dorian
  • mixolydian
I used to have locrian too, but that machine died and I decided to not reuse the name until I ran out of other modes. I seriously doubt that I'll ever have as many machines as there are modes anyway! There are (basically) seven of them, so I should be fine. :)

My next guitar

I've recently found myself wondering what guitar I'd like to get next. This is a little weird, because I really don't play the guitars I already have anywhere near enough, but lately I've found myself thinking about it more and more, so it might be time to get started again.

My current guitars are:

  • A blue Les Paul Studio Lite M-III, which is lovely and has an extremely flexible pickup arrangement that allows it to be played as a strat-style 5-combination single coil guitar, as well as a standard double-humbucker Les Paul.
  • A Charvel Model 3 (I think. It looks like this in red, but I see so many pictures of Charvels with the same name that look completely different, it's hard to know) , which is unfortunately in need of a bit of love. The bridge's fine-tuners aren't well at all, the locking nut doesn't lock any more and the pickups sound very lifeless (especially the bridge). On the other hand, it has a lovely neck, and also features a self-performed customisation in the form of an additional switch which reverses the connections to the middle pickup, adding an extra two pickup combinations.
  • A Washburn D10S12 12-string acoustic, which I actually bought brand new last year.
Now I'm not a guitar collector: I have little interest in spending money on and storing lots of instruments that are minor variations on the same model. So I won't be buying another Les Paul any time soon. When I look for a new guitar I want it to give me something new that the ones I already have doesn't.

Looking at that list, some sort of Fender immediately jumps out as a possibility, but the Les Paul does the three single coil job already, and while it won't really sound like a proper Strat, it's close enough for the time being.

As I was reading Paul Draper's emails about the recording of Six, I was reminded of the Gibson ES335 (as played by Mansun's Dominic Chad), which is a double-humbucker instrument like the Les Paul, but with the distinction of being semi-hollow. This gives it a quite different sound to other solid-body electrics, and so nicely fits the bill of adding something new to what I already have.

Unfortunately, the ES335 is very expensive. Yes, that's $1,999, and that is the cheapest model I could find on that site (the most expensive was $3,849). This is far more than I am willing to pay.

Fortunately, there is an alternative in the form of the Epiphone Dot, which is significantly cheaper at $459 including case ($399 without a case, but I see the case as being essential, and $60 isn't bad anyway).

I have read very positive reviews of this model, and looking around youtube there are a number of videos of people reviewing it and even comparing it to the more expensive Gibson model, with positive results. It's definitely on my list now.

Sunday, September 07, 2008

Celebrating the 10th anniversary of Mansun's "Six"

Today I had the very pleasant surprise of two rather long emails in my inbox, from Paul Draper (formerly of Mansun) regarding the recording of the album "Six" (two because there were supposed to have been two "sides" to be album).

I have many memories of this album from the time I first bought it, going to see one of the gigs on the Six tour (at the Leeds Town and Country Club), and enjoying it with friends.

One of the things I always appreciated it was the way in which it pushed boundaries and broke from convention in so many ways, and yet remained a really enjoyable collection of musical moments. The emails Paul wrote about its recording reveals a lot about how all of this came about, the reasons why things were done a certain way and what some things mean. It also shows a number of details that you might not notice: for example, "Special/Blown It" was written as an attempt to create a song based on one giant chord sequence: it in fact ends up being based on a 32-bar sequence repeated five times. This is similar to what Radiohead did with their song "Just", which came about following a competition between Tom Yorke and Jonny Greenwood to get as many chords into a song as possible. Little musical jokes like this that most people simply won't notice are one of the things I love about great music.

Some of Paul's commentary is simply hilarious. Take for example his story on how "Witness to a Murder (Part 2)" was devised with the goal of creating :

...something so off the wall, so fucking wacky that when people listened to it they think: "FOR FUCKS SAKE, WHAT THE FUCK IS THAT?"
Following a brainstorming session they came up with this plan:
An 18th century baroque harpsichord movement featuring one male and one female opera singer singing how miserable they were in Italian with Dr Who playing a dead Brian Jones in a swimming pool in East Sussex.
And that is exactly what they recorded. Brilliant.

Then there's an extremely long section about how the "Muttley" laugh in Shotgun was recorded that is, shall we say, perhaps exaggerating a touch? Wacky.

I was really sad when Mansun broke up. This was a band that was creating genuinely good music that was clever, had depth and rewarded repeated listens. They weren't just about creating hit after hit, and there aren't many bands like them.

The whole thing reminded me of how much I enjoyed making music years ago, with my friend Mark and friends from university, and how I would like to get back into doing it again. it's just a question of time and equipment really.

Maybe someday...

(I've held this post back for a few days in the hope that I could link to Paul's writings about Six, but it appears that it is currently for mailing list subscribers only. I'll add a link once it is published somewhere public.)

Sunday, August 10, 2008

In search of a new gaming mouse

bout three years ago (I think), I treated myself to a really good gaming mouse: the Logitech G7. It had a frikkin' lazer, adjustable DPI (which I actually never used and just ended up reprogramming the buttons for other purposes), and most importantly was cordless with a very clever battery charge and change system.

It was great. But a couple of weeks ago my son managed to break the radio receiver of my brother in law's G7, and so I was left with the burden of having to replace it. I decided that the best thing to do would be to let him have mine, and get myself a new one.

Now, I figure it would be foolish of me to simply go out and buy another G7, since it has been three years since I bought that mouse, and things could have come a long way in the meantime.

So I have been looking around, and to be honest really haven't seen anything of interest at all.

Logitech have the new G9 which looks interesting with its interchangable grips, but it has a cord. I really don't like a cord when I'm playing games as they always tend to snag on things at the most inopportune time.

Razer are a well-known gaming mouse brand, but they don't seem to have any cordless options at all. Microsoft are a company I'd rather avoid, but in any case they don't have a cordless gaming option either.

It is starting to look like the G7 really is still the mouse for me, but just in case there is something out there I have missed, I thought I'd see if anybody out there has any recommendations?

Saturday, August 02, 2008

How not to give helpful criticism

One of the things that people often struggle with it taking criticism.

Professional criticism though is part of the job. In software development we have code reviews, and the person doing it the reviewing is supposed to point out things that are either wrong, or could be improved upon. It is then up to the author of the code being reviewed to take this information as it should be: as constructive criticism where constructive is the operative word.

It has been pointed out before that programmers are insecure folk who don't like their work to be criticised, but the fact is that programming is a complicated task; one that is practically impossible for anyone to get right all the time every time with no mistakes.

This is what reviews are for, after all.

It is true though that people struggle with this: I have performed many reviews myself, and it is interesting to see the differing reactions from person to person. Some just get on with fixing what I point out, while others get very defensive about it. Of course, the reviewer isn't always right either, and sometimes you'll get a bit of debate between the reviewer and author on a particular point. This is all healthy, and the end result is better code, which is better for everyone.

Now, when I do code reviews I try very hard to be respectful of the person I am reviewing and of his work. I don't like to be offensive, or make the author feel like an idiot: as I say, people will always make mistakes, and may not know as much as I do about the particular item in question that I am pointing out. Again, this is to be expected: nobody knows everything.

But what if the criticism, while perfectly valid, is presented in an offensive way? How should one respond to that?

Recently I took over maintainership of a small bazaar plugin called diffstat. It is written in python, a language which I like but have little experience in. I figured this would be an excellent opportunity for me to learn more about python, and get involved in the open source community in some way in one go.

Today I was notified of a new bug against the plugin which I have to say got my back up a bit.

The report was not really a bug since the functionality was not broken. Rather it was pointing out how one part of the code could be improved. The diff is attached to the bug report, but in essence it replaces nine lines of code with two that work exactly the same.

It is a perfectly valid and good improvement that makes use of a feature of the python libraries that I was not previously aware of.

The subject: "Silly code for popping kwargs".
The message: "
The code in "cmd_diff.run()" for popping the "stat" and "stat_diff" parameters is convoluted and silly. The optional default parameter to "dict.pop()" is a better solution."

Erm, what was that? Silly???

I immediately felt offended and even unsulted, hit the reply button and, hands poised over the keyboard, thought for a moment.

The criticism was valid: the existing code was, while not 'silly', definitely convoluted in light of the better way of doing it that the reporter provided. Furthermore, despite the poor way in which this was communicated in the bug report, this was a good improvement to the code that the reporter was providing in his own time. The bug report was in effect a code review, and I should deal with it as such.

So I thought about toning down my response a bit: while the review was valid, the approach was not, so perhaps making it civil while writing "silly" in quotes to make the point passively would do.

Another moment of thought put rest to that. It was childish, and furthermore anything I write will become part of the project's permanent record in the form of the commit log and bug comments for all to see for ever more.

So in the end I sucked it up, thanked the reporter for pointing out the improvement, and made the change to the code he suggested. I did throw in there that I was quite new to python, to attemt to explain away why the code was like that, but that's as far as it went.

I have no interest in making myself look like an ass online. The things is though, others might have no problem with it. Those people would have reacted differently to how I did in the end, resulting in the bug reporter taking his attention elsewhere to the detriment of the project. Of course, this could all be avoided by people giving their criticism in a better way in the first place...

Before reacting to anything on the Internet it is worth thinking for a minute about the consequences of doing so. The bug reporter reacted to the code he saw by calling it silly. I chose to react to his reaction by thanking him.

Some people are just rude, some don't speak your native language and might not mean to be rude. Others will go out of their way to be polite. Whatever, if they are trying to help, let them.

Don't let pride be a barrier to collaboration.

Wednesday, July 30, 2008

Health insurance: it's all clear now

I'm not going to go over the whole health insurance debate that is going on in the US at the moment: it will make me angry.

Instead I'm going to write about something I just realised about how it all "works".

We've had to have our own insurance lately because my company doesn't provide it (though hopefully they will be shortly). When we got our insurance (itself a debacle of a process), our agent warned us that in six months time the price will go up significantly and we'll have to go through it all again.

Well, sure enough, we've just been informed the our premiums are going up significantly. By 26% in fact. So surely this is justified? Surely we've put such a great burden on them that they can only afford to keep us if they bump their rates to account for the massive losses we are causing?

Well, no actually. We've hardly used them. I haven't worked it out, but they've clearly made off like bandits with us, taking in hundreds of dollars more than we have used.

As I said, our agent said this is common practice, and it was because we were put into a group and certain people in the group got ill and that pushed up the premiums of everyone in the group. But it doesn't seem to make sense, because all it does it push everyone to cancel their insurance and take their business elsewhere.

But today I think I've got it figured out. They want us to leave. They've successfully made a profit out of us. "Thanks for the money, now go and take your risk elsewhere. We'll have no problem finding other people to milk for six months instead". The less time they keep us for, the less chance of us getting sick while they're covering us. And if we do get sick, well, they'll try their hardest to deny the claims, and if that fails they'll pay as little as they can, after which they will cancel you as soon as you can, with a pre-existing condition so you'll never be insured again.

You're out of the system.

Wednesday, July 02, 2008

T-Mobile massively increase text messaging rates

Today I happened to notice a notice on the my.t-mobile.com about text messaging rate increases. I was astounded to see that they are going up from an already too high 0.15 each to 0.20. That's a third, 33.33333% increase for a service that must surely cost them practically nothing to provide on an ongoing basis. Each message probably doesn't even occupy 1k.

It's worse though. Here in the US you get charged to receive them, as well as send them. So anybody could cost you money simply by sending you a joke text message they think you'll appreciate. Then there's the spam that we're not supposed to get but do anyway.

I suppose this is designed to push me into what they want me to do all along: buy a messaging bundle. My cheapest option is 400 a month for 4.99. If you use them all up, this works out at 0.012 per message, which is obviously a lot more like it. At the other end of the scale, I have to send or receive at least 25 a month in order to avoid end up paying more than 0.20 per message.

Given that my normal usage pattern generally puts me at about that mark, I'm basically screwed. I either stick with what I have and hope I don't go over 25 messages in a month, or just buy the bundle and feel compelled to send more messages than I would otherwise want to.

Last month my messaging usage came to 4.80, or 32 messages. At the new rate that would be $6.40. Definitely worth it. The month before though I only sent 13.

Sigh.

Alright, T-Mobile, you win. I've added the messaging bundle to my service.

Sunday, June 29, 2008

F-Spot's Import Rolls

I discovered F-Spot quite a while back and it immediately became my replacement for Adobe Photo Album: one of the last Windows applications to go in my complete move to the Linux desktop.

F-Spot continues to develop and improve with each release, and one of my favourites has to the the Import Roll feature.

I tend to import photos into F-Spot in a bit of a rush when I really don't have time to properly vet, delete, edit and tag them. I get around to doing that later.

The basic idea is that every time you import any photos, the application remembers when this happened. Photos with the same import time are grouped into the same import roll. You can easily filter on import roll either by selecting a specific one, choosing all after a given roll or all between two that you select.

Import rolls make it easy to come back to these photos later as a cohesive set without worrying about which photos mark the start and end of the import. The problem would be even worse if the dates of the photos imported overlap the photos you already have: properly distinguishing them would be very tricky indeed. Import rolls make it easy.

The only thing I would like to see added is the ability to add a short name or description to the roll. That would allow me to note things like "From Mum's camera" or "after holiday" etc. I could also shove some character in at the start of the name to tell me that I need to go through them, and remove it later when done. That would make it even better...

Tuesday, June 24, 2008

AIM == Site usability FAIL

So I find myself needing to use AIM again: something I've not used for years.

I used to have an account, so I go to the site and go to the 'forgot password' section, enter my email address and it tells me they've sent me an email.

30 minutes later and no sign of it (and yes, I have checked my spam folder).

FAIL.

So I figure I'll create an account, which I always hate doing because all of the good usernames have already gone. The signup form has a kaptcha imagse for fraud defense. Fair enough.

So my chosen username is taken, and guess what? I have to do the kaptcha thing again. And again. For every username I try, I have to do it AGAIN!

FAIL.

Thursday, June 12, 2008

Thunderbird + GMail IMAP == "Almost great"

Yes, it's almost great.

Almost.

Most of the time it's brilliant: labels appear as folders, starring things in TB stars them in GM too, creating a folder in TB creates a label in GM etc.

The problem is that sometimes authentication fails. I'm not sure where the problem is, but it's most likely a server-side problem (i.e. GMail).

Now, I'm certainly not going to complain that the free GMail service has the occasional outage with its IMAP server. As I say, most of the time it is fine. The problem is how Thunderbird deals with it.

It pops up a window prompting me for my password, with my password already pre-populated. So I hit enter, and it appears again. And again. So I decide to hit escape to get out of it, and it pops up again, and again.

While this is going on TB is of course completely unusable for other purposes.

Anyway, after a short while of banging away at escape it finally gives up and goes away for a while.

Then it tries to check my email again and decides that it has forgotten about my password, so I have to type it in again. And more often than not IMAP is still down so I get the box back again, leading to more escape pounding.

Grrrr....

It's not ideal, so what would be better? Well, I'm no HID expert, but for me TB should account for the possibility that your password is actually fine, it's just the remote server that is playing up a bit. Perhaps it would be better to do this non-modally for a start so the user can continue to do things like use lightening, or other mail accounts. A non-modal alert could tell the user that it is unable to access the account, and provide an option to enter alternative credentials.

Without any further input from the user, TB should continue to try with the credentials it already has stored in the background, without interrupting anything else.

Wednesday, April 23, 2008

Another thing happening on Thursday

Yesterday I posted about a few things that were going on on Thursday. I'd actually forgotten another thing going on that day that is significant for us and also leads on to something of a rant.

On Thursday our fridge/freezer gets repaired.

Now, this is nothing unusual really, but the thing is, this is a unit that we bought less than two years ago that cost us about $2500 (including fitting parts and delivery etc). Apparently pretty much all new units come with a very basic 1 year warranty these days, and this is no exception.

So much for having confidence in your products...

The unit in question is a Maytag Ice2O one that has a French door door fridge at the top with in-door water and ice, and a pull-out freezer at the bottom. It works very well: when it's not broken.

What happened was a couple of weeks ago the freezer started to warm up. The temperature alarm allowed us to save the food by moving it to another freezer. A while after that the fridge went the same way.

We called an engineer out, but he couldn't find anything wrong because we'd turned it off in the meantime (the noises it was making were worrying us) and when he turned it back on again it started cooling properly.

Then on Friday the same thing happened. This time we left it on, and called out the engineer again (on Monday). Unfortunately, we weren't as fortunate as my colleague Chris who merely had to replace a bulb in his freezer. For us, it was that the compressor had shorted out, and needed replacing.

I'm very grateful to the engineer who then went on to call Maytag himself to try and see what they could do. They first told him that it was a one year warranty and that was it. The engineer then continued to fight our cause, pointing out that this would be something like a $650 repair on a $2500 unit that is less than two years old, and Maytag finally said they would give the part for free, though they would not help out at all with the labour.

Firstly, I'm grateful to Maytag for giving the part for free: it is something they are no legally bound to do. I'm even more grateful to the engineer who did a great job at representing us to the company.

However, I would say that refridgerators are appliances that people purchase expecting to be able to keep them for like ten years. These aren't things we just throw away after a year.

I am new to this country (and Maytag isn't a brand I'd heard of before in the UK), but since I've moved here I've heard about the "Maytag Repairman" commercials which document the sad existence of the poor Maytag Repairman who is bored out of his mind because Maytag products never break down. What's happened to that? Why do your products (which are supposed to be long-life) carry only one-year warranties? Do you really have that little faith in your products these days?

Or maybe the situation is that you're quite fond of the income stream you get from selling extended warranties?

Hmm, this is getting personal, and I could go on ranting. but I think I've made my point.

I'm off to get a cold drink out of the cool box filled with ice in my garage...

Tuesday, April 22, 2008

All Go on thursday

A couple of things are launching on Thursday that are of relevance to me.

First of all there's the release of Ubuntu Hardy Heron: I've just come into the Ubuntu world having decided to install it on my new machine's replacement hard drive (couldn't be bothered to install Gentoo again, and fancied a change anyway).

I installed a beta version of Hardy Heron anyway when I installed, so the launch on Thursday won't actually have that much of an effect on me. Still a big event anyway for those who use Ubuntu or Linux in general (or are thinking of doing so).

The other thing that happens on Thursday is the opening of the new QuikTrip just up the road from where we live (it will be on Justin Rd, FM407 in Lewisville, TX). At least, it will be Thursday if the "open in X days" signs outside are being properly kept up to date. :)

It will be nice to have a QT so close for a number of reasons: we don't currently have a competitive place to buy fuel from, especially when heading north. QT is also an excellent place to get drinks from (fountain drinks, slushies etc), which will be very welcome in the appraoching summer. Also (and to tie this loosely into the previously blogged theme of weight loss), it's going to be close enough to walk to. which will provide us with a way to get some exercise. Walk up there, buy a drink and walk back.

I wonder if anything else of interest to me is happening on Thursday that I'm not aware of?

Friday, April 18, 2008

=== null is faster than is_null

I hate using more than one method to do the same thing in my code: it makes it read inconsistently in my opinion. I try to keep it uniform so there are no surprises.

Lately I've been struggling to decide which of the following is the 'best' way to check if a given variable is null or not in PHP:

is_null($v)

$v === null
So I figured I'd try a rough and ready script to benchmark the two. The following will do:

$c = 1000000; // Iterations
$v = null; // Value to use in comparison
$d = null; // Dummy variable for assignment
$i = 0; // Counter
$s = microtime(true);

for ($i = 0; $i < $c; ++$i)
{
$d = is_null($v);
}

$s2 = microtime(true);

echo $s2 - $s . "\n";

for ($i = 0; $i < $c; ++$i)
{
$d = $v === null;
}

echo microtime(true) - $s2 . "\n";
?>
A million iterations of each should be sufficient. Everything is initialised before the loops so neither has an unfair advantage. I also tried running the script with $v set to numerous other types and values with no effect on the result, and finally tried swapping the loops around to ensure that running order was not a factor.

The result? Well, on my machine === null turns out to be roughly four times faster than is_null.

I find this quite surprising: === is a generic operator while is_null is a very specific function. The only cause I can think of is that the function call adds overhead.

So, there you go. If you need to check if a variable is null or not, === NULL is the faster way to go.

Wednesday, April 16, 2008

Thanks for the tip, Vista Installer

Recently my hard drive died, and while it's been in the RMA process I've been running Linux only off an old IDE drive of mine.

I've got my replacement now and started putting things back on to it last night. The first task was partitioning it (which I did using Linux tools so I could get everything just the way I wanted it). This includes a 250GB partition for Vista, which I use for games and games alone. Nothing but games...

So when it came to installing Vista it asked me to pick where I wanted to install it, to which I selected the aforementioned 250GB partition.

Upon clicking install, I got this error message:

Windows is unable to find a system volume that meets its criteria for installation
Frikkin fantastic! Not only is the vista installer too brain dead to install to the partition I created for it (and explicitly pointed out to it), it won't tell me why. How's about telling me which criteria it's not meeting? That would be an excellent start.

In the end I did two things that fixed it (not sure if one or both was required, couldn't be bothered to do it scientifically).

The first thing was to delete the 100MB partition I'd created for the linux /boot mount. This was the only partition before the Vista one on the drive. If this was the problem I'd like to ram a rusty nail into the left eye of the developer that decided that was something that could prevent an installation. The partition is invisible to Windows anyway.

The second thing was to mark the Vista partition as 'bootable'. If this was the problem I'd like to ram a rusty nail into the right eye of the developer that decided that was something that could prevent an installation. The Vista installer can't mark a partition as bootable itself? Is it really that shit?

There is plenty on the net about other people having this same problem. More than one person had to unplug their card reader in order to get around this. Seriously, why the hell should the presence of a card reader prevent Vista from finding a partition to install on especially since the installer allows you to explicitly select the partition yourself.

The mind boggles.

Game developers: please get your finger out and start writing games that are cross-platform so I can finally wipe this chaff off my hard drive and out of my life for good...

Thursday, March 06, 2008

Snow in Texas

Snow is something of a headline news event in Texas. It hits the new and they stay with it for hours. The radar map is shown continually with the meteorologist showing how things are moving, what they think is going to happen and showing at-the-scene reports from out and about showing how the weather is playing havoc with traffic.

We had snowfall here a couple of days ago (up to a couple of inches) but it went away quickly the next morning.

Today it's snowing again, and it's looking like being a lot heavier. They reckon it could get up to four inches thick.

I've taken a couple of photos from my front doorway to show how things are going:
















I'm not entirely sure why snow is such a big deal here compared to the UK. One reason could be that it's very flat around here quite a bit, so there is little cover. To add to that there are a large number of bridges and overpasses that have little cover too which ice over very quickly in cold wind when wet, even without snow.

The other problem is that many cars here are automatics with no option to move into a higher gear. my CX-9 has an auto gearbox but has a sequential manual shift mode that allows me to select second gear for setting off, and this helps a great deal. I feel sorry for drivers who can't do that.

Fortunately it's supposed to be clear and warmer on Sunday, so my flight shouldn't be delayed.

Sunday, March 02, 2008

Leaving the worst till last

Anyone who knows me at last a little will know that I've been waging a battle with my weight for years now that has to all intents and purposes been something of a stalemate so far. Being the analytical type I'm always on the lookout for new techniques and strategies that might enable me to win that one battle that will put me on the road to victory.

The obvious answer is of course "eat less food", but that's something that is easier said than done. It's the psychology behind it that I need to explore.

One of my biggest problems is that when I eat I feel compelled to clear my plate, and often do so even when I'm beyond the point of being "full" (a big problem in the US where portion sizes are often immense). I've always put this down to being brought up to clear my plate, as many other people will have been too, but I recently discovered another (related) reason that is entirely self-inflicted.

For as long as I can remember, I've been pretty obsessive about saving "the best till last" on my plate. It's actually quite hard to justify when I think about it, but it's something I've always done. I think it has something to do with savouring the best taste to the end, or getting the "bad stuff" out of the way so I can get on with enjoying the "good stuff".

So say I'm eating some chicken tenders and fries (hardly weight-loss food but it's a simple example), my usual strategy will be to start with the scrappy fries and smaller, more battery chicken tender. I'll end up with the biggest and nicest fries and tenders at the end. Now, imagine at that point I feel full already: I'm there with a full belly but the best part of my meal is still left there on the plate. What am I supposed to do? :)

This all came to light when someone pointed out the weird way in which I eat burgers: I always eat the outside first, leaving the middle to eat at the end. I've always though it quite normal, but apparently other people think it's weird. :) It occurred to me that I do that because the middle is the best part because it has the greatest concentration of all of the ingredients.

So, my new plan is to force myself to reverse this tendency and eat the best part of every meal first. I tried this last night at Joe's Crab Shack (somewhere I've not eaten at before) where I ordered a Blackened Mahi Sandwich with fries.

I started out with the nicest looking fry on the plate, and then attacked the sandwich from the site that has the thickest amount of fish, and resolved to not eat around the sides.

The result was that I finished the meal with a number of scrappy fries and part of the sandwich left on the plate. Definitely an improvement. I remember looking down and not feeling particularly fussed about what was left there at all, so it wasn't a major effort on my part to leave what was there.

Of course, I need to work on my food selection too. But for me, this is another battle won. Here's hoping it turns the tide in the war...

Tuesday, February 19, 2008

Getting out of iowait hell

I have a problem that's really got me baffled. Some mornings when I get up to start work, I find my laptop is extremely unresponsive.

I ssh into it to have a look and see that the CPU is saturated with iowait. However, I can't for the life of me figure out which process is causing the problem.

The closest I've got is pidstat -d which should show IO hit on a per-process basis, but that doesn't seem to reveal anything of any significance either.

Any ideas?

Wednesday, February 06, 2008

Mouse sensitivity in FPS games

I've been playing Unreal 3 a bit lately and discovered that I'm still just as mediocre at this type of game as I used to be.

So I did some searching around for some tips, and found one about mouse sensitivity that caught my eye. I'd always tried to teach myself to be able to use a high sensitive setting so I could do everything I needed to do with the minimal of physical movement. However, this tip suggested bringing the sensitivity setting well down.

It notes that a lot of the professional players have their settings so low they have to frequently lift their mouse from the table when turning a lot; having to do this is one of the things I was trying to avoid by using a higher setting.

The pros don't mind this because of what they gain by using a lower sensitivity setting: accuracy. The lower the sensitivity, the more accurate you are. It's that simple.

So I thought I'd give it a try, and decided to halve my setting. After a bit of getting used to it against some bots I joined a game.

I finished mid-table in the game I joined, and stuck around for the next level (which just happened to be the same level: apparently this server plays "Deck" 24/7).

I shot at people and actually hit them. Quite a bit actually. And in the end I won the round by two points. I actually threw my hands up in the air in delight. Yay! I don't think I ever actually won a round at ut2k4, so this was quite an achievement for me.

I've not had time to play since, but I'm enthused; I really think this is going to make quite a difference. So if you're a casual gamer who has also been using a higher mouse sensitivity, give a lower setting a go and concentrate on being accurate: it might work wonders.

Friday, February 01, 2008

A solution too simple to find

I wrote this post's title back in January with nothing at all in the body to remind me of what it was supposed to have been about. Of course, now I can't for the life of me remember...

Rather than waste a good title, I'll forge an extremely tenuous link with version control software and bug tracking: always write a decent commit comment so that when you come read it later on you can have some clue as to why you did what you did, and if you close a ticket always write what you did to fix the problem to save future head scratching.

Thanking you... :)

Thursday, January 17, 2008

The true test of an Extreme Apple Fanboy

The other day the new Apple Airbook was announced, and I braced myself for the Apple Fanboy club to swing into action.

Of course it has done, but it's actually helped me to devise a test, to see just how much of an Apple Fanboy someone actually is.

It's really quite simple, though quantifying the results of the test is more tricky.

Basically, the test is to ask the following question:

"What is your opinion on Apple's penchant for captive batteries?"

You will most likely get a fuzzy answer, but your 100% pure unadulterated Apple Fanboy will think they're a work of genius and couldn't imagine buying a device like one. It's hard to imagine such a lunatic existing but I'm sure a few do. Conversely, a total non-fanboy will refuse to buy anything with such a ridiculous limitation, while most people will answer somewhere inbetween.

A fairly high score would be had by someone sticking their fingers in their ears and ignoring the question completely.

At the end of the day, captive batteries don't benefit the user/customer in any way whatsoever. You can't carry a spare, and worst of all the batteries run out of life. And when they do you either have to send the entire unit back to replacement (expensive) or replace the unit entirely (even more expensive). Both are wins for Apple, but not for you.

But Apple need not worry. They have an army of fanboys who willingly ignore such things.

Tuesday, January 15, 2008

"Calling the Police"

Today I made a post to my Ethan B's World blog about an incident that it too cute to not link to from here: "Calling the Police"

Tuesday, January 01, 2008

New Year Resolutions

Yes, everyone does it, and most everyone breaks them within the first week. But we do our best.

This year, I'm going to post them here to keep myself honest.

  1. No chocolate until Easter other than what I got for Christmas. I've actually succeeded at this one before in the past, so I know it can be done.
  2. No double-meat burgers and no up-sizing anything I buy from places that have up-sizing as an option.
  3. Lose weight (obviously tied to the first two, but worth putting down anyway).
  4. Try to be less grumpy
  5. Spend more time with Ethan
  6. Stop biting my nails and skin around my nails of my fingers. This is a horrible habit that I've been trying to get out of for years now. My aim is to need to start cutting my nails again. :)
  7. Keep better contact with friends and family in the UK. This is actually not entirely my fault, everyone seems to struggle to find time to stay in touch with life bein so busy these days. But all I can do is try my best at my end.
So there they are, laid out for all to see. Hopefully I'll be able to stick to them!