Oct 25 2009

Private Alpha!

Been awhile since I updated, spent more time coding than writing about it I guess. Project Chronos is finally up and running in private alpha. Things are still quite preliminary, it allows you to create and edit reminders, which are then sent to you at the proper time via an SMS. Here are some screenshots to get a feel for it:

Reminder Creation

Reminder Creation

The reminder creation page lets you create new reminders, clicking on the clock or calendar brings up time or date selection widgets.

Time Picker Widget

Time Picker Widget

Calendar Widget

Calendar Widget

Once you create a reminder you are presented with a summary screen showing a list of your upcoming and recently sent reminders.

Reminders List

Reminders List

That’s really about all there is to it so far. I have a lot of ideas about other things I’d like to add, but I want to get a few people trying it out before I make any firm decisions. If you’d like to help me out by testing it, and are willing to deal with potentially some bugs and changes, please drop me a line. You can get ahold of me (@LogicWolfe) via Twitter or any other means you prefer.


Oct 7 2009

Useful Maintenance Plugins for Rails

Been making steady progress on Project Chronos this week. There will be a new blog post here soon with some details on status. For tonight though I just want to mention a couple neat products I’ve started working with.

Hoptoad

Hoptoad

The first is Hoptoad, it is a rails service for tracking application errors. It aggregates error, tracks what deploys they’ve happened with, and integrates nicely with Lighthouse and GitHub (in the pay versions). It also sends you a notification email the first (and only the first) time a new error occurs. The integration though isn’t at all required to appreciate the app. It makes it incredibly convenient to track what types of things are going wrong, and how frequently they are occurring. We have some in house tools designed to do this kind of thing at Nexopia, but nothing as polished. The best part about it is from the time I decided to install it to the time I had completed integration was under 2 minutes.

New Relic

New Relic

The second cool new service I found is New Relic, recommended to me by @tvongaza after I mentioned my pleasure with Hoptoad. New Relic does performance monitoring for your app. Measures the time it takes to complete a page, the cpu load, database load, etc. It also has a very nice development mode that lets you drill down into the details of individual transactions on your development server. It has a free version that is available for unlimited hosts, but it doesn’t include the full feature set of several quite expensive pay versions. The feature set of the free edition is still excellent, it can be a bit annoying to see the constant reminders of features you can’t use though.

Between these two excellent services and my recent adoption of GitHub, I am feeling pretty happy about my developer tools now.


Oct 3 2009

Switched to GitHub

I’ve been doing version control for project chronos with git. Since starting with git I’ve been looking for a good project management/source code repository site that was free. For awhile I was using project locker, they provided Trac integration but other than that had about the worst UI I’ve ever used. After a round of frustration trying to find the URI to clone my repository from, I decided it was time to look for an alternative.

What I found was Indefero. It is also free up to 25MB of storage, has a relatively friendly if spartan UI, and is open source so if you’d like you can install it on your own servers. I was very impressed. I figured I’d roll with the hosted version until I hit my cap and then install it on my own server. Sadly it was lacking one key feature: multiple ssh keys per user. I use several computers, each has its own public ssh key, and I really don’t want to go around synchronizing them all. I also don’t want an account per computer. This was kind of a show stopper for me. I did some reading and it looks like a patch is available that overcomes this problem, and will presumably make its way into the hosted version at some point. I decided though, as is often the case, that it wasn’t worth the time I was spending trying to get something for free.

I’ve used GitHub in the past for open source projects. It is a wonderful product. Incredibly straight forward, it “just works”. $7/month got me their micro plan which covers all of my current needs and I don’t have to worry about what to do with my code anymore.

If you’re looking for something free and willing to spend some time on it I recommend Indefero. If you just want to get on to development and don’t mind a small fee (or free for open source), go with GitHub.


Sep 27 2009

A Time Picker Widget

Facebook Time Picker

Facebook Time Picker










I got my time picker widget built this weekend. I expected this to be a pretty straight forward port of a jquery widget I had seen. It turned out not to be.

Last week I was putting in a clock widget and I complained about FBJS and its lack of library support. I avoided that grief this time by just writing this widget from scratch. FBJS isn’t too difficult to work with on a new project, though the lack of offsetLeft support was a bit of a headache. At first I planned to just use some divs with a nice facebook blue border around them. It turns out something in Facebook screws up pixel perfect padding. 1px borders often randomly become 0px on some elements, 2px become 1px about 10% of the time, etc. I talked to Andrew about this and he had run into it too. I tried a version using tables as well and had the same problems. Never did figure out what was going on.

I ended up breaking out Pixelmator and making some curved border background images. Eliminating all borders, margins, padding, and using them seemed to do the trick. I also discovered how few skills I have with graphic creation, I really need to get better at this (making the border/fill graphics was about a 2 hour endeavour).

All troubles aside though I’m quite pleased with how the time picker worked out. It is a 2 click interface, once to bring it up, then you hover over your numbers (the rows below move with you), and then click a second time when you are done selecting.

After I got the time picker working I spent some time doing server migrations. I now have everything moved over to rackspace cloud, including this blog. I also started setup on my old media center PC; going to sell it once it’s running smooth again.

Update: Source code available from http://github.com/LogicWolfe/FBJS-Time-Picker.


Sep 20 2009

Adventures in FBJS

Another full day at ENTS developing Project Chronos, today I tackled the reminder creation UI. The facebooker gem has a handy helper class for generating forms in an FBML kind of way, this simplified the getting started a great deal. However once you move past the basic html input types it is no longer useful. My attempt to add a simple javascript calendar is where my troubles began.

The most important design aspect of my reminder app is the simplicity and ease of creating reminders. That in mind the default option of 3 select boxes to choose a date is not a viable option. Javascript calendars are normally a dime a dozen on the web and I figured it’d be no problem to add one in. That is when FBJS punched me in the face.

While I absolutely admire FBJS from the standpoint of a technical accomplishment on Facebook’s part, it is a pain in the ass if you want to reuse any libraries (and who doesn’t?). Facebooker has ported a lot of prototype to FBJS, which means a lot of normal rails helpers work. For the life of me though I couldn’t find any drop in calendars that were compatible or easily ported. What I did find on a Facebook developer forum was a kind of hacky solution that I could start working on (oh so greatful to whoever s10sys is at this point).

About this time Rob Davy invaded ENTS and I spent quite a bit of time over the remainder of the night chatting with him.

What work I did get done was my first attempt at hacking into Rails at a frameworky level. It is entirely possible that such was not the appropriate spot for my solution, but it was effective. I added a custom helper in the Facebooker form builder class to generate calendar fields with the appropriate bits of fbjs attached, and by 10pm when I left I actually have a functioning calendar control.

Next on my list is a time picker control. Since there are less graphical bits required and I’ve discovered how poorly most existing libraries play with fbjs I think I will just roll my own based on another solution I’ve seen and been intrigued by. It uses a simple 2 click interface to select any time.

If anyone knows of any wonderful fbjs libraries that my googling failed to find, please drop me a comment. Assuming they don’t exist, this seems like a huge gap waiting to be filled.


Sep 19 2009

Development Environment Setup Complete

I spent all day at ENTS getting started on my new hobby project to build a facebook app. I work in Ruby at Nexopia so it seemed an obvious language choice. I have only dabbled in rails (we wrote our own web framework at nex), but I know enough to get started, so the big thing to figure out was Facebook development.

I started with some extensive googling, with limited success. It seems there historically were two main Facebook gems for rails, RFacebook, and Facebooker. Facebooker as best I could determine seems to have taken over entirely, but its tutorial information seems largely broken and out of date (where it even exists). The API docs seem okay so far, but I really wanted some higher level getting started information. PeepCode to the rescue. They have a pdf and screencast available for $9 that provided an excellent starting point.

With that information I quickly got my app setup on both Facebook, and a basic set of scaffolding in rails, then reached my next hurdle. Since I needed Facebook to talk to my app to test anything, I needed a public IP for my development code. There are several options to achieve this, and I tried most of them before finally settling. Developing directly off of my VPS was an option, particularly by using sshfs to mount the project files. The problem there is largely performance. Textmate in particular makes the assumption that you have faster file system access than is provided by sshfs. Opening up a local port could have worked as well, but I deal with enough different firewalls moving around that it just isn’t really an option for me. That left ssh tunnelling, which I finally settled on. It’s a bit awkward but it allows instant testing of changes, through Facebook, as you make them. I setup a local mysql server (since Facebook uses 64-bit UIDs Rails requires a special plugin for this, scaring me away from multiple database types), and forwarded port 3000 (the default rails test server port) to my remote server, configuring my Facebook app to look on the non-standard port. Tested a basic rails scaffolding through Facebook and rejoiced happily upon seeing all the default forms working in Facebook blue.

I had hoped to get a bit further in actual development today, but given the awkwardness of getting started with Facebook and Rails I’m happy to be as far along as I am. It was fun hanging out at the ENTS space, met a couple people as they popped in throughout the day. Looking forward to going back tomorrow to start work on implementing a UI.


Sep 18 2009

Honey Brown

I went to Pub 1905 tonight after work to return GoW2 to Colin, and to have a couple beers. Ran into David there as well. Amidst yet another debate on religion, I decided to be antisocial and broke out my laptop. I have been wanting to make the switch from slicehost to rackspace cloud for awhile now and the dawn of a new project seems a reasonable time to make the switch. I setup a new server on rackspace and named it honeybrown in honor of my surroundings.

A couple of beers and a burger later I found myself at ENTS configuring the new server. I’ve been doing some reading lately and for my purposes Phusion Passenger and Ruby Enterprise Edition seem an excellent way to reduce my memory footprint (always the sticking point for me with a 256MB VPS). I managed to get both configured with very few obstacles, many points to the Phusion guys for providing amazing installers. I updated my rails versions, setup a git repository through Project Locker, and generated a basic rails app. Project Chronos now officially exists, albeit as just the default rails stub.

Tomorrow I hope to dig into actually getting some development done.


Sep 17 2009

ENTS Grand Opening!

Went to the ENTS grand opening tonight. Was good to see so many people in the space. We got the blade server donated by Nexopia hauled up the stairs, performed a ceremonial ribbon cutting on the Microsoft surface, and enjoyed hot dogs provided by our friendly landlord. Whenever there is a good turn out for an ENTS event it always reenergizes me towards the society. I look forward to spending some time there this weekend working on Project Chronos.

I’ll add some links here to more detailed/picture filled write ups of the evening when I find them.

Updated: Mastermaq’s ENTS writeup http://blog.mastermaq.ca/2009/09/17/ents-grand-opening/

Updated: More photos of the evening via Bill Burris http://www.flickr.com/photos/billburris/sets/72157621638929430/


Sep 14 2009

Project Chronos

So with my lady friend Stephanie out of town for two months doing an artists residency in Banff, I have been left with enough time on my hands to dabble with a side project. I’ve been wanting to try to make a Facebook app for awhile now due to my coworker Andrew’s great success with them. I got ahold of a key to ENTS today, and finally have a free night, so I popped into the space to try and get a start on something.

One thing that is difficult for me developing for Facebook is that I don’t really like Facebook. The simplest way to develop a site is to develop it for yourself, and there just aren’t many Facebook apps out there I would ever use. I considered doing another “Which is cuter?” style site, would be simple to make and they always seem to be popular, but I was having a hard time getting excited about it. After some random web surfing I was pondering the things I needed to remember to do this week and then the light bulb appeared.

I realized it would sure be nice if I could get a reminder message sent to me when I needed it. There are a few web services out there that do this, but I haven’t been able to find a good Facebook app that does. With Facebook’s status as a daily app for most people, and its built-in integration with email, etc. it seems like an excellent medium for the service. The idea lacks an obvious viral growth model, but it has the benefit that it’s something I would actually use. Even if it never becomes popular, it will make my life a small amount better, and it will be an excellent way to get my feet wet with Facebook development. For the time being I dub this Project Chronos, let it begin!


Mar 12 2009

Why Ruby?

After Demo Camp the other night I was talking about the merits of Ruby as compared to Java for web development. At the time I was perhaps a few too many beers into the night to speak coherently on the issue, and it was rather difficult to communicate over the karaoke. I figured I’d take another crack at the topic here with a more thought through response. I was originally going to write this as a Ruby vs. Java comparison, but upon starting to write I realized I really don’t have sufficient Java expertise to speak with any authority, so instead I’m just going to give a run down of why I like the web on Ruby. I invite comments/comparisons on the subject.

Let me start this by saying that I am not generally a language evangelist. I don’t think there is a perfect language, I also don’t hate any languages I’ve used. Languages, in my opinion, generally have a niche they are well suited for, and also usually can be used for nearly any problem with a bit of work. They always have strengths, weaknesses, and trade offs to be made. With all of that in mind I think the choice of language for a project is often far less important than the choice of people, the definition of requirements, the development methodology, etc. Please keep in mind that when I express my whole hearted support for Ruby it isn’t meant to imply that Ruby is always the best choice, that other languages are inferior, or that if you disagree with me I will be offended in any way. I always enjoy a good debate of ideas and there is no way I will address every area of contention in this article so please comment away on what I missed or why I am foolish.

I’ll start by addressing a couple common complaints about Ruby. I think the most obvious flaw with Ruby is its performance. It is a slow language beset by historically lackluster implementations. The problem with this as an argument against web development (as opposed to 3D rendering) is that in the big picture for web development processing performance means essentially nothing. Performance of web apps (at least the ones I work on) is dominated by database access times. On top of that it’s not really performance that matters, it’s scalability. Serving web pages scales incredibily well from the CPU side of things so one can always throw more processors at the problem.

Another complaint against Ruby is maintainability. This complaint was specifically made to me after Demo Camp and resulted in much of my floundering for an answer. One of the big reasons I was slow to come up with counter arguments as to the benefits/trade offs that warrant this, is that I don’t really believe it’s true. I took some time today to look for evidence in support of the claim, and instead found an article by Ola Bini, “The Maintenance Myth”, that sums up my own feelings on the issue quite well.

Basically I think there are two things that really prevent maintenance from being a disproportionate problem in a well organized dynamic language project. The first is that you write fewer lines of code. The estimates as to how many fewer vary extensively; but dynamic languages are more expressive than static ones. Fewer lines of code means fewer places to go wrong, fewer places to look when making changes, fewer lines of code to understand when you read the code later.

Second, dynamic languages lend themselves to DSL’s. DSL’s are another source of embarrasment to me from Wednesday night as when I tried to explain how awesome they were, I couldn’t even manage to explain what they were. For those not familiar with the acronym it stands for domain specific language. Basically it means you have a nifty little framework specifically tailored to your problem that allows you to describe instances of your problem in a way that makes sense for that specific problem. The closer your language is to the problem you are solving, the less work it is to think about how to solve the problem. In a statically typed language you typically solve a problem by instantiating a factory, and then telling that factory to build an object, and then asking that object for the answer. In a dynamic language you do something like find_restaurant :type => :pizza, :budget => 25, :location => 'Edmonton' and it returns you a list of restaurants that fit the constraints. The difference is both small and large. You use the same starting information and achieve the same results, it’s all about the extra thoughts/lines of code required to do it in a static language. Without the extra considerations there is significantly less potential for bugs when writing it, and for misunderstandings when reading and learning it after the fact.

I’m not making the argument that dynamic languages are inherently more maintainable than static ones. Static languages have advantages in tools: IDE’s that can reason intelligently about the code, compilation that removes an entire class of bugs before runtime, and generally superior debuggers. The problems one faces though are different and I have never seen in play out that it is inherently easier to maintain static code. The least maintainable piece of code I work with is written in Java. It is unmaintainable because it was poorly designed not because of any choice about language.

Based on these arguments I claim that Ruby falls into the category of languages that can be acceptably chosen for web development. This is a large class of languages and the choice between them essentially comes down to what language will developers be the most productive in. This is a question heavily influenced by the skillsets of the developers available, the development methodology, the culture of the company, and the existence of preexisting libraries suited to the problems at hand.

In the case of Nexopia when we made the decision to switch to Ruby, we were a group of young developers, with backgrounds in a diverse set of languages. We were practicing Scrum development. We were also perhaps a little to keen on doing things ourselves, driving us to discount the importance of preexisting solutions to our problems. As a dynamic language Ruby allowed us to write small amounts of code to accomplish very powerful things. It had a vibrant community all focused on the same types of problems that we were; social media seems to be a primary cornerstone of the ruby world. Within a couple weeks of development (our testing period for the language) we had a basic object relational mapping layer, a routing and controller layer, and a templating system; and we had used them to build a couple basic test projects to great effect. Ruby was fun to develop in and we were getting a lot done quickly. When we met to discuss whether we should go forward with it no one was against it.

It has been a rocky ride since that point, as I said earlier rewriting is not an easy task. The one thing that has held true though is that Ruby has been a joy to write. I spend my time solving interesting problems. Things that would be tedious in other languages are generally addressed in Ruby with a small piece of framework that handles class generation and boiler plate for you. Fixing bugs means fixing the framework and seeing the correction propogate into everything that uses it. When I write Ruby code I never feel like a code monkey, problems that don’t require thought aren’t problems that should need programmers to solve them. Ruby makes this a reality.

In short, the answer to “Why Ruby?” is “because I can”. Powerful language features like OO, closures, metaprogramming, eigen classes (to get all the buzz words out there), help to make it easy to not only solve problems but to solve them elegantly. The drawbacks of Ruby are not drawbacks to development, and in the end I will always choose the language that favours a developer over one that favours hardware. Ruby is a language that makes coding fun, and that is the best reason I think there can be to choose a language.