Monthly Archive for July, 2007

3gb 2.5tb

As an update to an older post, I did go with the extra 2gb of Ram and I did purchase a 750gb hard drive. In fact over the last few months I have bought 3 750gb drives. According to the hard drive manufacturer I now have 2.5 terabytes of disk space, but it’s more like 2.3tb.

Why so much space? I love information. I like the fact that I don’t have to delete anything.

Slightly related: crucial have released an 8gb upgrade kit (2x 4gb) for my computer bringing the maximum ram up to 32gb.

Website Pimping

This is one of my favourite sayings. The concept of pimping is making someone feel good about themselves. Pimping usually builds in a feeling of need, that the victim needs the pimp.

Pimping starts off by breaking someone. You really bring them down. Failure, sadness, worthlessness. Then you spend time bringing them back up, incorporating what you want them to believe. It’s really that simple. You would think that they would be no better off, but if the pimping was done right the victim will end up feeling better than before. This is a weird paradox, that you only really feel great and happy if you have been through pain and sadness. This is apparently what earth and heaven is all about. We have pain and suffering on earth so that heaven is wonderful to us. We wouldn’t appreciate heaven without pain and suffering.

The opposite is also true. If you build someone up by saying all these awesome things are possible and that they will get all these great things then tell them that is isn’t possible and they aren’t getting them they will feel worse than when you started.

The order you provide information matters. To website pimp you tell the client that there are difficulties in creating what they want - there always is. But if anything is easy or goes smoothly they will appreciate it all the more.

Of course I don’t actually deal with clients - they don’t let me out of the cage. I would never use this technique. If I was dealing with clients I would use an honesty approach and be fully open with what’s happening.

Happy pimping!

Code Chef

For a while now I’ve been searching for a good way to explain why I prefer writing it myself than use an already made library. Unless the library is very good I would rather write something from scratch.

Joel Spolsky, from joelonsoftware.com says:

When you’re working on a really, really good team with great programmers, everybody else’s code, frankly, is bug-infested garbage, and nobody else knows how to ship on time. When you’re a cordon bleu chef and you need fresh lavender, you grow it yourself instead of buying it in the farmers’ market, because sometimes they don’t have fresh lavender or they have old lavender which they pass off as fresh.

(from this article and recently quoted by himself here.)

Suggestions Part III - Leopard

In this riveting episode I visit bugs and annoyances that have been fixed in Leopard. So even though these are problems with the current OS X we can rejoice that the new version has them fixed. Okay here goes.

Renaming File Extension Dialog

The Finder in leopard now has a option to stifle this annoying dialog that appears for every rename that changes the file extension.

Overall Finder Speed

It’s faster now.

Lack of Multiple Desktops

Spaces.

No GUI for sharing individual files and folders

Leopard now has a new preference pane for editing the permissions of folders and setting up users and groups.

Setting up a custom folder for desktops

I have thousands of desktops and while I don’t change them that often I do get annoyed when I try. In the Desktop preference pane you can select a folder to view all the images within. You can’t save this folder in the list and whenever you want to select another folder it defaults to your home directory not where you were last.

Fixed in leopard, you can now create custom locations for your desktop pictures.

Column view preview

This is cool for seeing what is in a file without opening it but is very slow when you don’t want it. You can turn it off but it’s usefulness outweights it’s annoyance. Now in leopard you can turn it off and just use quicklook instead.

Passive Aggressive

I had a pretty rough day last Wednesday. I tried to code in a way I normally do with concepts I thought were the same across most languages but it didn’t work. PHP does not have pointers. Their concept of ‘references’ is, in my opinion, flawed. A reference is basically a pointer to the variable itself. In C we define this as int**. The crux of this is that if you change the original variable the other variable changes too. Make sense? Not in your life. This is a situation where a statement has unexpected side-effects. A statement talking about x can actually be changing y and z as well. This coupled with the fact that php does no scoping within a function means you have to be very careful when dealing with references.

So I now understand this concept, and in a few parts of the otherwise elegant and understandable system I use the function unlink before setting the variable to something else, even if this is at the end of a loop because the start of the loop sets it again. So this was annoyance one.

Alex had noticed that the log files on the server were getting astronomically large. We are talking 350MB of text. This is a significant amount for a hosted website.

So I was criticising Alex’s code, not something that I normally do but I was annoyed and taking it out on others (sorry!). I had a go at rewriting a function that he had hacked to add some extra functionality. I managed to get it down to a few lines. Alex pointed out that what I was doing was incorrect. My rebuttal was that PHP would tell me if I was doing something wrong. Turns out that this is wrong. Whenever possible expect PHP to be configured and written in a way that almost encourages sloppy code. By default PHP, and the package xampp that we are using for development, have notices turned off. This is a problem, but not a biggy. What is a problem is that code that normally stops a compiler of a decent language only generates a notice in PHP. How sad. The combination of notices not showing and PHP only generating notices meant that errors in my code were getting through to a live site.

Upon turning on all errors, warnings and notices we were bathed in a large list of notices. The reason for these was in part due to PHP’s lack of elegant syntax and non-object way of doing things. So the code I have been writing for 2 months was incorrect. This was quite a blow to me as I take pride in writing proper, elegant code. I spent around an hour fixing all the errors.

Media Temple, the hosting we use, has notices logging by default so this was the cause of our overly large logs. This logging is arguable for a production server, but I think it is a great thing because it allowed me to find something I was doing wrong.