Posted by Kevin D Smith @ 8:44 pm on September 12th 2007

Remove your “self” from my premises!

Bruce Eckel made some comments about the upcoming Python 3K (or is it Python 2.9)? While I respect the work that Bruce does and think he is very intelligent, I think I have to agree more with Guido van Rossum’s retort. Yes, the issues that Bruce brings up would be nice to solve. However, as Guido says these are mostly library issues not core issues, and more aptly

It’s open source. What are you waiting for?!

As far as the complaint about self, I realize that this is a religious war and has no clear answer. I do completely agree with Brandon Corfman’s comment about the confusing message TypeError: printString() takes exactly 1 argument (2 given) where one of the arguments is always self. Putting self as the first argument of a method has bothered me about Python since I started using it; however, I do not agree that Python user’s shouldn’t have to use self. when referring to an instance variable. I think Bruce is just plain wrong when he says that “parroting ‘explicit is better than implicit’ is a misuse of that maxim.”This is exactly the kind of thing that maxim is good for. There is no question in anyone’s mind where that variable is coming from when it has self. prefixed to it.

I also prefer things like self. to Ruby’s @, because self at least has a chance of being interpreted correctly without having to look up its meaning. Using an arbitrary character such as @ has no chance of correct interpretation without reading the manual. This is the main reason that I like Python: the syntax is consistent. Okay, it’s not as consistent as Lisp, but it’s pretty consistent. This is also the reason that I hate Python’s decorator syntax, but that’s a discussion for another day.

I think it’s pretty clear that Python 3K isn’t going to solve everyone’s problems and make everyone happy, but it is definitely a step in the right direction.

Posted by Kevin D Smith @ 10:26 pm on August 14th 2007

CVS, Sourceforge, and Authentication

I’ve been using SourceForge to host some of my open source projects for a while. One thing that has been annoying to me is typing in passwords whenever I do any CVS commands. It hasn’t annoyed me enough to automate the process though. However, I recently started working with a new editor called Editra, and I’m creating a project management plugin that handles source control which needs automatic logins.

I figured that there must be an automatic login procedure for repositories in SourceForge because there had to be someone that was annoyed enough with password prompts to implement it. I searched the documentation on the site, but that was fruitless. While there is a lot of documentation on SourceForge’s web site, it was just too much to sort through to find the one little piece that I needed. So I started searching the web for a simple solution and came across this page.

The solution is rather easy, especially for someone who already has SSH keys. Simply log into your SourceForge account, go to http://sourceforge.net/account/editsshkeys.php, and paste in your ~/.ssh/id_dsa.pub key.

Posted by Kevin D Smith @ 7:34 am on July 31st 2007

The Ultimate Web Application Development Environment?

I’ve decided to team up with a friend of mine to create a new application that will be implemented on the web. This is the first commercial venture that I’ve ever taken up personally, but it sounded interesting enough to take a crack at it. My friend actually brought up the idea. He has the domain knowledge and industry connections, but not enough programming experience to pull it off on his own. I have a vague idea of the domain and quite a bit of programming under my belt, so it seemed like a good pairing.

In making the decision on how to implement this software, it was decided to do it in a web application as a service rather than as shrink-wrapped software. This actually has benefits for our company as well as the customer. The customers don’t ever have to upgrade, worry about backing up data, and the interface will be platform independent. Our company benefits by having a constant stream of income from the subscriptions.

Since all of my prior programming work has been in existing company environments, or open source projects hosted on SourceForge, I never had to set up a complete development environment of my own. Since this is my company and I get to pick whatever I want, I thought I’d share what I think is the ultimate web application development environment.

Source Control

I’ve been using CVS both at work and in my open source projects for years. However, Subversion is getting very popular nowadays. After reading the documentation, it seems to solve a lot issues with CVS and has a nice programmable interface.

Bug Tracking

While I’m doing the programming and know that there won’t be many bugs to track, I figure I might as well have some bug tracking software around just for kicks. ;) I didn’t really find any free solutions that got my attention, so I decided to look at some commercial products. I finally decided on FogBugz. I’ve been reading Joel’s website for quite a while, and have also read his books. I figure I’d see if he’s really all he’s cracked up to be and try out some of his software. Plus, it’s not really that expensive.

Backups

If you’ve read my previous blog entries, you’d know that I am a big fan of backups. I’ll still be using SuperDuper! for my mirrored backups, but I’ll definitely want to have remote backups as well. For remote backups, I’ll probably use a combination of Mozy and rsync.

Web Application Software

If you do any work in web applications today, Ruby on Rails is probably on the short list of tools to use. Well, I’ve been using Python as my main language (for personal projects) for quite a few years now and haven’t found any of the benefits of Ruby to be significant enough over Python to take the time to learn it; so I think I’ll stick with Python. In the Python world there are three major players in the web application framework ring: Zope, Django, and Turbogears.

I was a big fan of Zope many, many years ago. In fact, I started learning Python just for the purpose of using Zope. I even wrote several websites using Zope for work and for personal use. It offers a huge number of features and management capabilities, but it is a big pill to swallow. When you get into the world of Zope, you pretty much have to take-it-all, or leave it. While I do still like Zope, I think I’m going to pass for this project.

Django was the next candidate. I don’t really know that much about Django, but I just didn’t feel right when I read the documentation on the website. I also don’t like the fact that they use their own template language (aren’t there enough already). So on to Turbogears…

Turbogears has a philosophy that I really relate to: take a bunch of really good, open source tools and combine them into something cool. The documentation on the website was nice, and there is a book as well. It also supports various types of page templates (much like my LaTeX processing framework, plasTeX)! Overall, Turbogears looks like the framework for me.

Database

I’ve used PostgreSQL for various little projects throughout the years mainly because I liked having transactions, sub-selects, and free software. Up until recently, this was the only free database that had all three of those. However, even though PostgreSQL seems to be the more feature-filled database, MySQL is clearly more popular, and better supported on most web hosting sites. MySQL does support transactions and sub-selects now, and even if it didn’t there isn’t much direct manipulation of SQL in Turbogears, so it wouldn’t make much difference. In addition, FogBugz requires MySQL, so I was going to have to have a MySQL server up anyway. Due to all of these reasons, I’m going to pick MySQL for my new project.

Conclusion

There is still more software that I need to evaluate the business end of things like accounting, customer databases, etc., but the development environment appears to be set at this time. While many of these tools are new to me, and it will take some time to get up to speed, I’m looking forward to trying out a combination of tools that I got to hand pick for my own business.

Posted by Kevin D Smith @ 9:07 am on July 26th 2007

Back to the Drawing Board

Well, my evaluation of the Mirra Chair didn’t go as well as I had hoped. While my back did feel better in it, the seat just wasn’t for me. After a couple of hours sitting in the seat, I just couldn’t get comfortable so I had to send it back. I’m not really sure where to go now since I’ve tried out pretty much every high-end, ergonomic chair there is. I guess that leaves the low-end.

I went to Staples to look at the chairs that they had and came across some by Sealy. Yes, that’s the same company that makes mattresses. I was quite impressed with their chairs. While they aren’t as stylish as the high-end models, and didn’t come in as many colors, they did seem very comfortable. Not only that, the prices ranged from only $200 to $300. I haven’t purchased one yet. I would like to sit in Staples for a couple of hours while working on my laptop to see if it would really work out for me, so I’ll probably do that in the next few days.

Posted by Kevin D Smith @ 2:09 am on July 23rd 2007

Quest for the Perfect Chair

I have always strived to have an ergonomic workstation. Even when I didn’t work from home full time, I would spend my own time and money trying to achieve a workplace that was efficient, ergonomically correct, and of course, stylish. Not all of my attempts worked out however.

The first chair that I purchased several years ago was a black leather executive type chair. While it was very comfortable, and very stylish, it didn’t have any back support. After working in that chair for a year or so, I started to develop pain in my legs. I didn’t realize that it was due to the chair until I started trying out other desk chairs. The ergonomic department at the company that I worked for set me up with one of their ergonomic chairs. It had many adjustments and controls, and a lot of lower back support. It wasn’t, however, stylish.

I used this chair for several months and my leg pain did subside. Unfortunately, I started to develop lower back pain. It took me a while to figure out why. I had a good ergonomic chair with lots of adjustments. I thought that would be sufficient. To figure out the problem, an all out chair shopping trip was in order. I researched the web to see what the most popular ergonomic chairs on the market were and set out to evaluate each one.

The front runners for best chair were: the Aeron chair by Herman Miller, the Liberty chair by Humanscale, and the Leap chair by Steelcase.

The first chair that I tried out was the Aeron. This chair is famous for it’s popularity during the dot-com boom in the late ’90s. One thing that attracted me to this chair was the mesh seat and back. I work in a hot climate, and anything that can make me cooler while working is a plus. I went to a local store (actually about an hour away) that carried the Aeron to try one out. Boy was I disappointed. Maybe my expectations were just too high, but I found this chair to be very uncomfortable. In particular, the lumbar support felt like a 2×4 being strapped across my back. This would certainly not do.

While at this store, I also tried out the Leap chair. I was pleasantly surprised by this chair. It was very comfortable, and was nicely adjustable. The Leap chair did have an upholstered seat, but featured a mesh back. I was very impressed with this chair, but it had a problem similar to the Aeron, the lumbar support felt harsh. The amount of lumbar support could be adjusted, but it still felt like a hard object strapped across my back.

After trying out these two chairs, I realized what was wrong with my existing chair. The lumbar support was just too extreme. While you could adjust the position of the back support, the amount was not adjustable and it was just too much. It was like I was trying to brace my back into an unnatural position with the chair back. With these other chairs that I was trying, the position of support and amount of support were adjustable. This change made an immediate improvement.

The Liberty chair evaluation came about a week later at a different store since the first store I went to didn’t carry them. Luckily, this store also carried the Aeron and some other chairs that I hadn’t considered yet. The Liberty chair is a very nice looking chair; probably the best looking of all of the chairs that I looked into. This is mostly due to the fact that Liberty has a minimal number of adjustments. Sitting in the chair showed that the seat was definitely comfortable. I also liked the mechanism used for the arm adjustments. However, the seat back didn’t have enough tension in it for my tastes. The chair back would recline too easily with just minor pressure. It also didn’t have any upper back support whatsoever.

This store also had an Aeron, and I thought I would give it another try. How could a chair that was so popular be as uncomfortable as I had found it? Well, the second try didn’t change my mind at all. However, there was another chair there by Herman Miller called the Mirra. It was definitely a unique looking chair. The back was very tall and wide, and made out of a slotted polymer. The mesh seat was very similar the the Aeron. Sitting in the Mirra was very comfortable. The back molded perfectly to my back and was supportive from the lower back all the way up to the shoulders. The Mirra wasn’t as adjustable as the Aeron, but I consider this to be a good thing. The number of controls was enough to fit it to your body, but not enough to be confusing.

After sleeping on it for a couple of nights, I decided to purchase the Mirra chair. It was a difficult decision between the Mirra and the Leap chair, but my wife really liked the Mirra, and the store was 30 minutes closer.

The store that I bought it from was only a showroom, so it had to be delivered. A few days later it arrived. I decided to get the Citron finish because I’m tired of the typical black/gray office chair. The style and color of the chair fit perfectly into my office decor. I haven’t tried the chair out for a full day yet, but the little bit that I have used it, it has been quite comfortable. The only concern that I have is that the pressure on the bottom of the legs isn’t even. The back of the seat is only mesh, but the front does have some foam to protect against the hardware underneath. The seam between the two seat materials sat right across the point on my legs where I had previously had some leg pain. I’ll hold off any real judgments on the chair until I get more time in it. I’ll let you know my final evaluation at that time.

Posted by Kevin D Smith @ 9:10 am on July 8th 2007

Backups - The Next Level

After my recent scare with my computer, I decided that there are still some types of events that my backup scenario won’t cover. All of my backups are located in one location: my home. If, God forbid, my computer equipment was stolen or destroyed in some type of catastrophe, I would still lose everything. That lead me to start looking for off-site backups. While I have heard of people burning DVDs and keeping them in a remote location, or cycling through external hard disks, those sound like plans that I would give up on because they just aren’t convenient.

Another option which doesn’t require so much manual labor is online backup services. Currently, I’m trying out Mozy. Mozy supports the Mac, gives you a 2GB trial service, and unlimited storage for only $5/month. That seems like a pretty good deal. Uploading huge amounts of data over an asynchronous broadband connection isn’t as fast as I’d like, but I’m hoping that after the initial backup the subsequent partial backups won’t take long. I’ll let you know how it works out after a few weeks.

Posted by Kevin D Smith @ 10:39 pm on July 6th 2007

FileMerge and CVS

I’ve been working on improving my workflow in programming lately. This is mainly due to the fact that I now work from home. Working from home poses some new problems since I don’t have a 1Gb connection to my network resources anymore. In the process of rethinking my processes, I decided to play around with FileMerge, one of Apple’s developer tools. FileMerge enables you to visually see the difference between two files and interactively merge them into one final form. This is a very common operation when using CVS and you have a conflict with a push from another developer, or you just want to see the differences between two file revisions. Because I use it in conjunction with CVS so much, I thought I’d add some CVS features to FileMerge.

The result of this work is cvs-opendiff. It’s called cvs-opendiff because Apple supplies a utility called opendiff which invokes FileMerge from the command-line, and cvs-opendiff invokes this command along with various CVS commands to do its work. The feature list for cvs-opendiff is shown below.

  • Compares two files like diff
  • Compares the current working file with the current revision in CVS
  • Compares two file revisions or dates
  • Continues running until FileMerge is exited, or the window containing the file comparison is closed

This last feature is the key feature since the opendiff command exits as soon as it finished invoking FileMerge. This behavior is often undesirable when merging files especially when the merge is invoked by a third tool that expects this behavior.

I’d love to hear your comments and suggestions for cvs-opendiff. I’m planning on starting to work with subversion soon, so I imagine I’ll be updating it to work with that eventually.

Posted by Kevin D Smith @ 4:21 am on June 29th 2007

Back From the Dead in 60 Minutes or Less

This article could have also been titled, “Bootable Mirrored Backups are a Computer’s Best Friend.” I avoided a small catastrophe today thanks to a bootable mirrored backup created by SuperDuper! Believe it or not, my MacBook crashed (I think due to MacFUSE). In the few times that it has crashed in the past, it usually just takes a reboot to bring the machine back to life. I wasn’t so lucky this time.

When the machine rebooted, I was not greeted with the usual login screen. All I saw was a blank blue screen (not the Blue Screen of Death Windows users are familiar with, but just as ominous). Every few seconds it would flicker as if something was trying to restart. This was not good news. I tried booting into single user mode to see if running fsck on the disk would help, but it was no use. There was something corrupted in a system file that was causing the login screen (and just about everything else in the system) to crash while launching. Luckily, a few months ago I had started a fairly rigorous backup routine.

Every Monday night, I use SuperDuper! to mirror my MacBook’s hard disk. The key to this is that this is a bootable backup. In addition to the mirror, I also do incremental backups of my user files using Apple’s Backup available as part of .Mac. I rebooted the MacBook while holding down the Option key. This allows you to select which drive you want to boot from. I chose my bootable mirror, and it came up just fine. Once I logged in, I was able to copy the System folder from my mirrored backup to the hard drive in my MacBook using the ditto command. At this point, the only thing left to do was restart the MacBook from the internal disk and hope for the best. Lo and behold, it worked perfectly. My machine booted up beautifully, and I was back in business in under an hour.

Please let this be a lesson to you. Always make sure that you have a good backup plan that includes a bootable mirror. If I had only done backups of user files, it would have taken hours to reinstall the operating system, updates, then restore my files.

Posted by Kevin D Smith @ 1:28 am on June 20th 2007

Python 3000

Guido van Rossum posted an update on Python 3000, the next big Python release that is due out in alpha form by the end of the year. What’s interesting about this release is that it is throwing backwards compatibility to the wind. It will definitely be fascinating to see how that turns out.

Overall, I’m pretty excited about this new release. The Python crew is trying to do away with a lot of cruft that has been building up over the years. One of the biggest changes is in printing and formatting. There will no longer be a print statement. Printing message will now be done with print() function. The % string formatting character will also be removed. The most interesting part though is the new formatting strings. They are no longer in the form of “%s” or “%(name)s”. In fact, they look more like a page templating language now with ways to reference attributes, mappings, and sequences.

One thing I’m looking forward to is unicode everywhere. Working on plasTeX has shown me just how vigilant you have to be in programming to keep all of your strings in unicode form. This should make things easier.

Posted by Kevin D Smith @ 8:15 pm on May 8th 2007

MacFUSE & SSHFS

I tried out MacFUSE and SSHFS a few months ago when I started to work remotely. While the connection speed was much faster than SMB, the connections weren’t very stable. Any type of network disruption (including sleep) would cause the machine to lock up. The only way to get operation of the machine back to normal was by rebooting (ick!). After a couple of days of that, no amount of speed increase was worth it; I had to go back to SMB.

Recently, I’ve been getting fed up with the slowness of SMB again, so I thought I’d check on the status of MacFUSE and see if they’d made any progress. Lucky for me, they had been working very hard on it. The most recent version of MacFUSE is much more stable. It doesn’t lock up my machine any more. Now when it loses a connection, it displays a window asking if you want to try to reconnect on to eject. This is a huge improvement.

Everything isn’t sunshine and roses though. While it doesn’t lock up the machine, the reconnection dialog has never worked for me. In order to reconnect, I have to cd out of any mounted directories in any open shells, then unmount and remount. I guess I’ll see in the next few days if this remaining annoyance drives me batty. Hopefully some day soon they’ll have a fix for this as well.

« Previous PageNext Page »