Posted by Kevin D Smith @ 7:38 am on March 25th 2008

Life with MooTools

It’s been a while now since I’ve started using the MooTools Javascript toolkit, and I haven’t regretted that decision once. MooTools still doesn’t have a following as big as Prototype or jQuery or maybe even Dojo, but it just seems to fit my code aesthetic the best. I love how non-invasive MooTools is when the HTML is concerned. Applying a function to elements based on selectors is fairly easy.

$$('.myelem').each(function(item) {
    myfunction(item);
});

This idiom is actually the way that you deal with arrays in general. Another highlight of MooTools is the Class object. This object lets you program classes in Javascript much like in other class-based languages like Java or Python. I couldn’t possibly do a better job of demonstrating classes than this tutorial on //clientside. When I originally started using MooTools, I didn’t think I was going to use the Class object much, but it has ended up being one of my favorite things.

Last but not least in the world of MooTools is the effects library. You can get a good feel for the quality of the MooTools effets simply by going to their web site. It’s hard to ignore the slick animation effects that MooTools gives you access to. The only trouble with effects is that it can be pretty easy to go overboard and start to make some really tacky web sites; however, in moderation, visual effects can really make your work stand out.

There are lots of other cool things about MooTools such as custom events and introspection of style attributes. If you use MooTools, I’d like to hear what your favorites idioms and features are.

Posted by Kevin D Smith @ 10:35 am on January 19th 2008

Prototype and jQuery and MooTools, Oh My!

I’ve been playing around with writing web applications lately and have been looking for a good Javascript library to help with Ajax and web browser differences. After doing a little searching, two libraries floated to the top: Prototype and jQuery.

Prototype was definitely the most popular, partially because of the script.aculo.us user interface library. Prototype is definitely extensive and fairly well-documented. On the other hand, it plays a lot of dirty tricks under the covers to do it’s work. I wouldn’t count it out just for that reason, because it is very popular and well-tested in the real world. I do find the script.aculo.us web site to have absolutely horrible navigation, which is very odd since it is claiming to be the premier user interface library.

The other problem I have with Prototype is that is is fairly large (~100k). I want to make my web application usable by people with dial-up access, so file sizes are very important. Through compression and other techniques, you can minimize the download time, but it is not something that can be ignored.

jQuery was the next candidate. jQuery seems to have a somewhat different focus than Prototype. Prototype is more of an application building framework, whereas jQuery seems to be more of a quick-and-dirty query-and-modify toolkit. I really liked the idea of jQuery and can see why it has a large following. Being able to use CSS selectors to locate elements and chain functions is very powerful. So powerful that I almost chose jQuery as the toolkit to use for my projects. What stopped me was the somewhat ugly API. The method names and arguments seemed to be somewhat inconsistent and overloaded to excess. It felt more like an accident than a design.

While deliberating over whether to choose Prototype or jQuery, I came across a forum of Ajax developers where MooTools was mentioned. I didn’t really want to research any more tools especially ones that didn’t have that big of a following. After seeing the MooTools web site though, I thought I’d give it a shot.

I really like the look of the MooTools web site. This may sound superficial, but I figure that if they have a good aesthetic for their web site, they probably care about what their code looks like too. Looking at their API confirms this. The API is very consistent and powerful. In addition, it is also modular so that you can simply include the pieces you need rather than having a monolithic library.

MooTools seems to be a happy medium between Prototype and jQuery. It has enough application building tools and extensions of native Javascript objects without getting too invasive or outrageously large. It also has the power of jQuery’s CSS selector method of locating document nodes.

If you haven’t figured it out yet, I’ve decided to use MooTools for my applications. I’ve been playing around with it for the past couple of days and am quite happy with the results. The API is very easy to work with and extremely powerful. It’s not all a love-fest though. I have had some major problems with getting the correct keys for key-based events, but I think that has more to do with the inconsistencies between browsers than anything else. Hopefully, they’ll come up with a fix for these problems soon. Until then, I’ll continue to learn more MooTools tricks and idioms and let you know how it goes.

Posted by Kevin D Smith @ 9:58 am on October 28th 2007

Python User Group

Now that I’m living in Oklahoma I thought it might be fun to try to organize a Python User Group. My friend Blaine has been running a dynamic language user group for a while now in Omaha, NE and it sounds like a lot of fun. I thought about doing something similar, but pretty much everyone that contacted here in Norman was only interested in Python. That’s fine with me since Python is my language of choice (although I do enjoy a bit of Javascript from time to time). Anyway, I met up with some people at the National Weather Center who had an interest, and it looks like it’s a go! We’ve set up a web site and we’re working on getting our very own python.org mailing list. So if you live in the central Oklahoma area and are interested in Python at all, keep an eye on our web site for meeting details.

Posted by Kevin D Smith @ 9:26 am on October 28th 2007

The Coolest Application You’ve Never Heard Of

I’ve been doing a lot of security work on my web server and email this past week and decided to update all of the passwords on my accounts in the process. I have to admit, that I’m really bad at coming up with good passwords. I guess that’s why password generators were invented. I did a quick search on the internet to find about 11,000,000 matches for the phrase “password generator.” Then I remembered something from a couple of weeks ago. I was adding a new account to my Mac and there was a little application that popped up next to the password field that generated passwords for you. I’ve been using OS X for years, and it’s probably been there all along, but I never paid much attention until now.

The window that pops up calls it the Password Assistant. It allows you to select from different types of passwords such as “Memorable”, “Letters & Numbers”, “Numbers Only”, “Random”, and “FIPS-181 compliant.” This is really cool, because some accounts limit the types of characters that you can use. The Password Assistant also lets you select the length of the password. It does this all while showing you a nice little gauge of how strong the password really is. Ok, maybe I’m getting a little carried away just for a freebie password utility, but I have to say that it has made coming up with new passwords much more enjoyable.

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 @ 4:44 am on September 3rd 2007

Moving to Oklahoma: Day Two (You’re not in Kansas anymore)

Day two of our trip got off to an early start. We can thank our cats for that. Our cats don’t like to be out of the house and decided at about 5am that they were ready to get out. Since they made sure to it that we couldn’t sleep, we decided to just get up and go. Not getting much sleep, and driving through Kansas is not exactly a good combination. This is made quite evident by the occasional road sign advertising free coffee at all Kansas rest stops. Unfortunately, neither I nor my wife likes coffee.

We drove for about an hour before stopping the first time. I was feeling pretty much awake by that time, but my wife was still having trouble concentrating on driving. Luckily, one of our cats decided that today was the day to create all kinds of noise during the entire trip to keep here awake. With Prairie Dog Town behind us, there didn’t appear to be any more sites to see in Kansas. The good news is that we soon hit I-135 and started heading south to Oklahoma.

I was excited to see the border of Kansas and Oklahoma. Every truck and rest stop that we visited had all kinds of Wizard of Oz stuff and I was just dying to see a big sign on the border that said “You’re not in Kansas anymore!”. I was, however, greatly disappointed. There was no such sign.

Northern Oklahoma was much like Eastern Colorado and Western Kansas, more nothing than I have ever seen before. However, after getting further south, the landscape got greener, and there were more towns. We stopped in Guthrie on the way through, which is the site of the Oklahoma International Bluegrass Festival in October. Being a banjo player, I’m definitely looking forward to that.

Less than an hour after Guthrie, we were in Norman, our new home. After picking up the keys to our rental unit, we were pleasantly surprised by our new home. It looked a lot better than either of us remembered it when we visited a couple of months earlier. We still plan on making quite a few changes to the place, but there’s no place like home even if we aren’t in Kansas anymore.

Posted by Kevin D Smith @ 4:23 am on September 3rd 2007

Moving to Oklahoma: Day One

It was time for my wife and I to head out of Colorado and make way for Oklahoma where we’ll spend at least one year living. Rather than hiring a moving company like we did for our last move, we decided to rent a truck and move ourselves. This decision was made based mainly on the thought of having to live without our possessions for at least two weeks while the moving truck made it’s way to all of its destinations before coming to our place. Since the trip from Colorado to Oklahoma was mostly freeway the entire way, it would be an easy drive as well. Easy for someone who is experienced at driving a truck that is.

Out with a Bang… Literally

This would be my first experience driving a rental truck. I have driven tractors and wagons, cars with trailers, large vans and large pickups, but nothing quite like a large U-Haul truck. The main difference is that in a U-Haul truck, you can’t see a thing behind you, which I learned the hard way. After picking up the truck and getting back to our townhouse to load the truck, I thought I would back the truck up to the sidewalk to make it easier to load. The driveway to the townhouses in our neighborhood are pretty tight, but it looked like there would be room to do it. Apparently, there was a medium sized high-voltage box right next to the parking spots that I was trying back into. As I wheeled around to bring to truck into the spot, I backed right into it. When I looked back to see what it was that I hit, I finally saw it. At first I thought that I just put a small dent in it, but when I took a second look I realized that I had knocked the metal box off of its mounts so that it was sitting at an angle with the cables inside exposed. This was not a good start to the move…

I got out of the truck to take a closer look. It didn’t look like any major damage had been done. Yes, the box wasn’t mounted to the ground correctly, but it appeared as though all of the electrical equipment was intact. I certainly wasn’t about to touch anything, so we ended up calling the electric company to come take a look. Meanwhile, our hired hands had showed up to load the truck.

After a couple of hours, the electric company showed up and verified my evaluation of the damage. They took down my name and address so they knew where to send the bill and proceeded to put the box back onto its base. The procedure was basically the reverse of my procedure for pushing it off: hook a cable to the box and yank it with the truck. Five minutes later, they were gone. I’m curious to see what they’ll charge for something like that; I guess I’ll find out soon enough.

On the Road

It took about three hours to load the truck. Not too bad, although it wasn’t the best packing job as we would find out later. Now with my nerves all frazzled about running into things with the truck, we headed out. The plan was pretty simple: take I-25 to E-470 to I-70 into Kansas. I’m happy to say that this went without a hitch.

It took a few uneventful hours to get to Kansas through eastern Colorado. This is desolate ground, and I could tell that it was going to be a long drive. Western Kansas was more of the same. I lived in Michigan for most of my life and I’m used to seeing a lot of farmland, but nothing like Kansas. The whole state is farmland. The odd thing is that I didn’t see that many farms. My history of watching horror movies started getting the best of me out there. The sky was cloudy and gray, there was nothing but farmland for hundreds of miles in every direction, and there were only two radio stations, both Christian. If those stations had been preaching fire and brimstone, I think that might have been too much for me. I have seen way too many horror movies that start out this way. Even when towns did pass by, I was creeped out by it. Take Goodland, KS for instance, with the town motto “We’re waiting for you.” No, I am not making this up.

One of the finer landmarks on the way through Kansas was Prairie Dog Town which was advertised about 100 miles on either side. Prairie Dog Town featured such sights as a Russian wild boar, a 5-legged steer, and best of all, the largest prairie dog in the world! Unfortunately, it was late enough in the day that we figured Prairie Dog Town was closed for the night; or maybe my wife just wanted me to think that it was closed.

After driving about six hours, we decided to stop in Hays, KS, the largest town in Northwest Kansas: population 20,000. If you haven’t been to Kansas before, this should give you an idea of what it’s like. The largest town in the entire Northwest quadrant of the state only has 20,000 people in it! After getting there, I think that 20,000 was an optimistic count.

Overall, after hitting the high-voltage box and missing out on Prairie Dog Town, the day was uneventful. And if you know my luck at all, you’re well aware that my life runs in two modes: uneventful and freak-accident. I’ll take uneventful any day.

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.

« Previous PageNext Page »