Archive for the ‘Everything Else’ Category

Why Do We Write Code?

Tuesday, September 27th, 2011

Building Great Code

I had a somewhat heated discussion with a co-worker this morning and he's been at The Shop for a number of years while I've only been here a little over one. He's adapted to how this place measures success, and I can't blame him for it. He's tried to write code to the best of his ability, and when he thought he was being successful, he's been told it was a failure. He is reacting to the measurements of success and failure that he's seen, and in that sense, it's completely understandable why he sees things the way he does.

But that's harder for me to deal with. Much harder.

All the time I was talking to this guy I was thinking How can I tell him why I write code without coming off as a jerk? Which lead me to this post. I can't really tell him, but I can tell you, and maybe you'll understand.

Writing code isn't just about a paycheck for me. In fact, I'd say that if it ever becomes just about a paycheck, I think I'd get out of it. Coding is about the creation of beautiful, functional, code that fulfills a specific need in an elegant and awe-inspiring way. I'm not niece enough to think that all code will be this wonderful an experience, but that's the goal. When code is being written, it ought to have all of these factors in mind: simplicity, clarity, style, function, and design.

So why do I go through all the headaches? Why put in all the hours? I believe it's because when I get the opportunity to create software, I will create something I'm proud to have my name on. It'll be something that has a good number of those idealistic qualities, and I'll be glad I put forth all the effort.

So when I hear a good developer talk about essentially "looking on the bright side", I get a little worried because I think I've lost a fellow Creator. He's become a worker - happy to deliver whatever it is that management asks for - no matter how outrageous, and unrealistic. It makes me sad.

Everyone has bills. Everyone needs a paycheck, and I'm no different. But I think there's a way to pay those bills and do something that's aligned with your moral compass. And as extreme as that sounds, I think it is a moral issue. Someone can ask me to deliver them something that's unreasonable, but if I let them believe that it's OK and reasonable, then that's my fault. If, after I tell them it's unreasonable, and I'll try, but won't write junk, they still want me to do this, then I'll give it a try. But we all have to live with ourselves, and thankfully, I've been given a set of talents that allows me to be a little picky in the work I choose to do.

I have to feel that my life has been something good. I'm almost 50 years old. If I don't do that now, when will I?

On Leadership and Management

Monday, September 26th, 2011

I was going through my weekend Twitter backlog and came across this tweet from Rands. It's solid gold:

Managers think it's a science. Leaders know it's an art.

What a beautiful expression of the difference between the two. One will look for formulas, and apply patterns, but the other will realize that each step is a new canvas, and that you can't expect to create something great without putting a little of yourself into it.

Upgrading to PostgreSQL 9.1.0 from KyngChaos

Friday, September 23rd, 2011

PostgreSQL.jpg

I have been a big fan of the KyngChaos builds of PostgreSQL for quite a while. After Marc L. stopped posting his, it made sense to find another source, and while I've heard that Apple's Mac OS X Lion Server has PostgreSQL as opposed to MySQL which it had in Snow Leopard, I haven't seen a lot about this part of Lion Server, and I'm consequently a little nervous about getting Server on my laptop and not being happy with the burden it places on my box. If I had a nice Mac Pro, I'd get it - but that's not (yet) the case.

So here's what I noticed in the update from PostgreSQL 8 to 9.0.4, and on Mac OS X Lion. There's a lot of little things, and it made for a somewhat hybrid scheme that I'm going to try and get rid of today with the upgrade to PostgreSQL 9.1.

First off, Mac OS X 10.7 has psql on it already. It's got a complete PostgreSQL client in it. It happens to be 9.0.4, which is nice, as that matched the version I was targeting. Given that, it's only the server I need to install. Not bad, but it's all a package anyway, so no big deal.

Secondly, in 10.7, the PostgreSQL user is _postgres and it's not a user that can login. This means that a lot of the update schemes that I used to use don't work because you can't log in as the postgres user any more. However, there seems to be a better scheme - assuming you're migrating from a recent version. The update procedures are detailed in a file in the disk image you download from the site, but I haven't been able to get it to work. I'll try on the next update again, but this dump-and-load works really well for me and does not require that we have a postgres user to log in as.

Step 1 - we need to get a complete dump of the database. It's pretty easy, just get to anyplace you can write a file - I used my home directory, and issue the following command as yourself:

    /usr/local/pgsql/bin/pg_dumpall -U _postgres -o > pgbackup

Step 2 - stop (unload) the existing version of PostgreSQL. This is going to shut it down, but it's possible to pull it back if you need to:

    sudo launchctl unload \
      /Library/LaunchDaemons/org.postgresql.postgres.plist

Step 3 - install the new PostgreSQL package from the site. I noticed that I had to install it twice in order to get the contents of the /usr/local/pgsql-9.1/data directory, so if you don't get that, then install it again, and it should get installed properly.

Step 4 - start the new version. The launch daemon file should be installed properly and you should be good to go, but it never hurts to check:

    sudo launchctl load \
      /Library/LaunchDaemons/org.postgresql.postgres.plist
    ps -ef | grep post
      …lots of postmaster processes listed...

Step 5 - reload your database. Be in the same place as Step 1 and you can simply issue:

    /usr/local/pgsql/bin/psql -U _postgres -d template1 \
      -f /full/path/to/pgbackup

Check with psql and maybe a simple PHP script, and you should be good to go. Once it's all OK and running, you can remove the old install:

    sudo rm -rf /usr/local/pgsql-9.0

At the same time, if you have the old postgres user still installed, you can delete him as well - there's nothing you need from him any longer. Lion's _postgres user can handle all the chores from here quite nicely.

If you run into problems, check the permissions on the directories. Because I was switching from the postgres user to the _postgres user, I needed to make the old install usable by the new user:

    sudo chown -R _postgres:_postgres /usr/local/pgsql-9.0/data
    sudo chown -R _postgres:admin /usr/local/pgsql-9.0/var

PostgreSQL 9.1 has a ton of interesting features. I'm using the replication at The Shop, and it's working like a charm. I'm a big fan, and these updates are really exciting to see.

Google Chrome dev 16.0.889.0 is Out

Friday, September 23rd, 2011

Google Chrome

Seems the posts were right, Google Chrome dev 16.0.889.0 was released this morning and I picked it up. I had suspected that they'd move a major version number soon, but as I've known for a long time, it's the third number in the version that really matters, and it'll be interesting to see what happens when it tops 1000 - will they move up the next number or not? I'm guessing they're a bunch of engineers, and because of that, they'll have numbers like 20.0.1011.0… we'll have to see. For now, it's nice to see that they have updated the V8 javascript engine and done more with the Mac port.

Google Chrome dev 15.0.874.21 is Out

Wednesday, September 21st, 2011

Google Chrome

This morning I saw that Google Chrome dev 15.0.874.21 was out, so I picked it up. It looks a lot like it's getting close to the promotion stage, as backed up by several of the comments on the release notes page. I like that they are working hard on the Mac OS X Lion compatibility, and in recent weeks they've been updating the V8 Javascript engine as well. All good news.

Just wondering what they are going to do next. With the binary-mode web sockets, it's possible to do a lot with this… I just don't know what they are planning on doing. Hope it's interesting.

Google Chrome dev 15.0.874.15 is Out

Friday, September 16th, 2011

Google Chrome

I haven't posted any updates to Google Chrome dev for quite a while, but I've been updating every chance I get. The most recent cut is 15.0.874.15 and has the latest V8 javascript engine, as well as lots of fixes for Mac OS X Lion (10.7). It's been at version 15 for quite a while, and they are starting to issue updates to the "fourth octet", so I'm guessing that it's getting close to time to cut version 16 and make 15 the 'beta' channel and keep on going.

UBS’s Rogue Trader – Bad Boy, or Good Boy Caught?

Friday, September 16th, 2011

WhiteCollarCrime.jpg

I was reading Slashdot this morning when I came across this article on Reuters:

UBS $2 billion rogue trade suspect held in London

and I almost had to laugh. In this industry a lot of people think investing is legalized gambling, and hedging is throwing away your profits. They make fantastic returns until the day they are wrong, and then they make fantastic headlines.

This guy is no exception. Two Billion Dollars. That's a staggering sum of money, and certainly more than you should ever have un-hedged. But they play the game and hope that their role of the dice winds up in their favor. Too often, it doesn't. Now he's serving time with Carlos the Jackal.

Not my idea of fun.

Upgraded to Mac OS X 10.7 Lion

Tuesday, September 6th, 2011

Mac OS X Lion

A few weeks ago, yeah, I know, I've been busy, I got Lion (10.7.1) from the Mac App Store and installed it on my main MacBook Pro. The upgrade took longer than I really expected - the downloading was not fast at all. But I will say, it was smooth. Very smooth.

The big issues I found with Mac OS X Lion is that Colloquy 2.3 wasn't really working properly. Thankfully, all the other apps that I depend on day-to-day were working fine. I still have the problem that Twitterrific does not work when the video card is changed and it tries to "pop up", but hey, it's a small price to pay, and it's not just Twitterrific - it's all the pop-up Twitter clients I've tried. Kind of disappointing.

Anyway, Colloquy had a new build that does support Lion, and it's available from the Colloquy Downloads Folder. Go there, get the latest, or at least 2.4, and you're in business. Kind of surprised that they aren't more responsive as Lion has been out there for a while, but at least they have something that works for me.

Other than that, Lion is working just fine and the look and feel of the OS is very nice. I especially like the vanishing scroll bars. On Terminal.app, I've been asking for those for ages, and I now have them. Good. Fantastic.

OK, It’s Time to Start Setting Priorities

Tuesday, September 6th, 2011

I know it's been ages since I've really posted much here, and I know the exact reason - I'm working like a dog. I have plenty to write about, but I simply have no time. Well, I need to correct that situation. I really do. I need to make time, and make time to get back to what I was doing - writing about the issues I was facing on a day-to-day basis.

So I'm going to try. Try harder, that is.

Fantastic Find on Netflix – MI-5

Thursday, August 25th, 2011

TV.jpg

I was flipping through Netflix a while back, and came across a updated take on Sherlock Holmes done by the BBC in 2009 to 2010. It was updated to current day, and the really nice effect they did was to display Holmes' observations as little white, pop-up text near the clue so that we in the audience can get the clues without Holmes being a blabber-mouth. The effect was perfect. Holmes still appeared to be the genius pulling deductions from thin air, but we knew how he did it. Fantastic fun.

The series was a three episode run, and I read somewhere they are planning on releasing three more in the fall of this year. Great news. But that's not the real reason for this post. The real reason is what I found because of watching (and rating) Sherlock Holmes. Netfilx's suggestions included another BBC show - MI-5, or as it was known when aired on the BBC, Spooks. Very interesting show.

It's basically a dramatization of a group of folks in MI-5, and their professional and personal lives. What's been very interesting to me is the ability of the producers to kill of main characters. In a US production, it'd never happen with such speed. Middle of the season, and you're shot in the head. End of the season, and you're out. I think there is probably only one or two characters that make it through the eight seasons. Harsh, to be sure.

But what an interesting show. Well worth watching.