Crusher Development!

August 28, 2007

Back from traveling around the UK and excited about HAML

Filed under: advertisement, food poisoning, haml — Russell @ 4:46 pm

I spent the last 2 weeks traveling around the UK. Went to Dublin, Waterford, Glasgow, Islay, Edinburgh, and London. If anyone ever has a chance to visit Islay it is extremely beautiful and the whiskey is just as amazing as the surroundings. If you’re looking for an internet connection it is mostly found in internet cafes, although I was able to jump on some open wireless networks next to some apartment buildings in different places :-) I didn’t meet any software engineers in my travels, and all the people I mentioned computers too jokingly hoped that I could fix their computer. I had terrible food in Ireland, including a serving of scallops at Floridita that left me with severe stomach pains for a couple days and helped contribute to me catching a cold for the last half of the trip. I did however meet lots of people that have events and go to them!!

In my time away I was able to reflect properly on the glory of html. I had dreams about how glorious some pieces of the crusher html code looks. For instance, our advertisement. The reason why it looks so good is thanks to HAML, which automatically formats haml when it is generated.  I’ve been hand-coding html for the past 8 years, so the idea of a plug-in helping me seemed a bit silly.  However, with the embedded conditional statements and removal of html closing tags, haml really does help make the source more legible.  So, for those out there who haven’t played with it you should give it a try.

August 9, 2007

I finally got to use my favorite HTML tag!!

Filed under: code, html, plaintext, view source, winforms — Russell @ 7:21 am

I’ve been professionally using HTML in some capacity for the past 9 years. It has definitely been a roller coaster of love and hate. The years when I was doing WinForms development I was waiting for the browser to die and for rich applications to take back over. Still hasn’t happened. However, during those times of hate the one tag that kept me loving HTML was the PLAINTEXT tag.

The plaintext tag is so powerful that it actually ignores its closing tag! How great is that? and even further, imagine all the uses of this tag?! It worked marvelous for doing QA work against textboxes that would eventually become unescaped HTML. Seriously though, how could this tag ever be useful? Also, why are we developing UI against a platform that has such a thing?

Two whole days ago, the Crusher team officially had a plaintext tag sitting in its source tree. Doing something useful! Across some of the pages on the site we have a beautiful simple piece of text that reads “(see ad)”. Which shows you the source code on our page! Which shows you a possible spot for doing ascii art advertising! Now view source acts differently across browsers. In IE it brings up notepad, and the “view-source:” code in the URL doesn’t work. This is when I knew my love was going to be put to use. Check it out in action here! or find “(see ad)” in our site :-) If you’re really curious you can view source on our view source and see the plaintext tag at the top.

.. and yes .. I really am very excited about this since I’ve been talking about this tag for so many years but never got to use it.

August 7, 2007

Could someone build a feature rich contact management system for all of us?

Filed under: acts_as_taggable_on_steroids, contact, management, performance, plaxo, tagging — Russell @ 4:46 am

Last week with our upgrade to the latest version of rails we also migrated ourselves over to using a new plug-in for tagging, acts as taggable on steroids. It has some convenient functions built in that let us easily make any object taggable. If you’ve got a big group of items that are all taggable, and you need to read the tags, it unfortunately does query after query against each individual row when you access the tag_list. Easy enough to get around, and probably not that difficult to extend the plug-in .. but when you’ve got 1.5 engineers there are only so many things that can be done each week! :-)

This week we’ve been having fun over here re-vamping how everyone can manage contacts in Crusher. Tags for contacts! Yep! If you’ve got a bunch of mailing lists, you can add them and put tags on them like “SF” or “Sacramento” or “coders” or whatever you want. As I’m going through writing this code I can’t happen but think to myself .. all these applications around the web need contact management. So many websites that I’ve signed up for get you to create your contacts and relationships over and over and ask for duplicate information.  Maybe plaxo can step up their game a bit?  Maybe they can do contact tagging?  Maybe this is in the works and I’m just out of the loop …

but it’d be great to login to a new web application, click sync with ContactManager, and then be all set to go with pictures and everything .. and then be able to sync back and forth seamlessley  .. or just always do your contact management in ContactManager.  I’ll be happy to see this duplicated effort cut down so we can all focus on features more specific to the companies that we are trying to build :-)

August 3, 2007

The mini-heart attack

Filed under: capitrano, deployment, memcached, oops, piston — Russell @ 1:48 am

We use Capistrano over here for deployment and it makes it really easy for us. If everything goes correct it takes 6 different lines in the terminal window, some passwords, and we’re good to go. Last week we deployed using the latest rails revision 7199 (updated with piston) and started using memcached. From these 2 things we were able to increase our req/sec by 10x! Very exciting! Although, we haven’t setup our build to properly set the memcached server during deploy, and Capistrano doesn’t correctly restart the memcached server. That’s ok, because since this was new there was a lot of testing. No heart attack yet.

We have 4 servers that we use. One is for staging, one is the database, and 2 are running mongrel – one of which has apache and the other now runs the memcached server. There is a memcache yml file that tells rails where the memcached server is running. For production and staging it is localhost, and same with mongrel machine #2 .. however mongrel machine #1 needs to point to mongrel machine #2. This makes our deployment to machine #1 not completely automated because we have to change the production memcached setting for machine #1 after we upgrade the server. So, if anyone out there can tell us how to automate this that’d be great – otherwise we will get to it soon to ensure our longevity.

Now the fun of deploying at 1 this morning. Run the 6 lines. Do the manual step of telnetting to the memcachd server to flush_all so the home page updates, since we can’t use Capistrano for this yet .. bring everything up and yeay! we deployed! Oh wait, 500 error? yeay it works! 500 error? Aaaahhh .. !! Machine #2 was fine, but the logs told us promptly that machine #1 didn’t know about the memcached server.

@#$%^@#$ were the lines in the IRC chat window.

Russell brings server #1 offline, while brave young Doug goes in to the servers to work his magic. Crush3r.com now doesn’t come up at all!! AAAhhhh .. Eric has a mini-heart attack via the chat window. OMG MHA!! (haha .. he did spell it out in the chat) Somehow Apache mysteriously decided it didn’t like machine #1. Brave young Doug promptly starts Apache and the servers with the proper memcached settings.

Just like that, we now have the “demolished bridge in Poznan!” release. Properly named and swimming laps without a problem :-)

August 1, 2007

Moving out of the Microsoft development world

Filed under: asp 2.0, c#, crusher, mac, macbook, parallels, rails, ruby, web development, windows — Russell @ 6:44 pm

I’ve been using a dos or windows based machine for the past 15 years, and it finally came completely to an end (not counting Parallels) this past April with my macbook purchase and working at Crusher. I also did a majority of my development the past 8 years using either C++ or C#, and now I am using Ruby. For those of you out there thinking about doing all of this, I’ll tell you about a couple things that had me worried.

having to re-learn the keyboard shortcuts

This definitely has been a bit of a pain. The keyboard shortcuts are somewhat similar between the mac and PC. The approach I have taken is if I really miss a shortcut and I can’t intuitively figure it out I’ll search for the answer and find it fairly quickly. Then I force myself to use the shortcut to retrain my hands. The first shortcut I wanted was the ability to skip words while editing text. In the PC you hold CTRL and hit the arrows, but on the mac you hold ALT and hit the arrows. It also really helps if you work with other mac users, which I do now, or if you have friends who use the mac. There are some features you may just not discover if you don’t do any reading. For example, on the mac F9 & F10 are extremely useful! The PC doesn’t have an equivalent of nicely tiling windows for window switching purposes.

simply not having a windows machine around for any legacy stuff I have

Parallels completely removes this worry. Although I’m not a gamer, so that definitely helps. Although I have played worms world party here and there .. which I have missed and doesn’t run in my parallels installation :( I also have all my documents sitting on a NAS on my network, so things like my old outlook pst files I can access via outlook on parallels if I particularly bored.

no auto-complete in textmate

Surprisingly I’ve found that I don’t miss auto-complete from visual studio. Between the ruby reference, rails manual, and quick silver shortcuts, I find it is more informative than auto-complete because I get full descriptions or example code for a majority of APIs I’m searching for.

RoR debugging is commonly done through puts and logging

There is a debugger for RoR, but I haven’t tried it yet, because I’ve been pretty happy with puts and logging. I attempt to do test driven development, which is hard to do as a beginner, but when I do this debugging is pretty straight forward. I write a couple blocks of code, run my tests and then see if they pass. There’s plenty more to talk about here, but the main thing is I don’t miss the line-by-line debugger very often, and when I do I think it is just residual effects of years of break points. (more…)

Blog at WordPress.com.