Jun 2

Don’t Be a Douche

Posted: 11:06AM Tagged: Programming, Rails, Technology

If you’ve got a great idea for the next big web framework, the first thing you should do is not write a douche-y blog post bashing other web frameworks. Here’s some ideas for things you could do instead:

  • You could make a website promoting the advantages of your framework over other existing frameworks.
  • You could improve the framework itself.
  • You could document the framework so that others can easily begin using it.

The point is by attacking others, you don’t accomplish anything other than branding yourself as a grade A asshole. It’s fine if programming in C and doing all that memory allocation, dealing with pointers, and calling functions validates your skill as a programmer. I happen to like Ruby because I don’t have to do those things. What’s great is that we can co-exist. You can have your fast framework written in C and serve thousands of pages a second. I’ll stick to my ’slow’ framework written in Ruby. Chances are the people visiting the sites will never know the difference anyway.

Drop the ego. Realize that there can be more than one approach to solving a problem and yours isn’t always going to be the best one.

May 9

It seems that the Rails core team is so busy building awesomeness into Rails that they don’t have much time to improve the documentation. This is why docrails was started. The new Rails Guides are immensely helpful, and quite the improvement over the old wiki. However, you’ll still find a few surprises if you dig around in other people’s code like this handy feature I’ve found in ActionMailer.

ActionMailer let’s you specify the from address on emails sent out, but did you know you could also set a nice name in addition to that? You might have a basic mailer method like this.

  def my_email(to_email, to_name)
    from 'myname@example.com'
    recipients to_email
    subject "Hello There #{to_name}"
    body(:to_email => to_email, :to_name => to_name)
  end

We pass in an email address to send to and the person’s name. The from name is simply hardcoded as a string. If that email showed up in your inbox, it would probably say it’s from myname. Depending on the email client, it may just show the address it came from. That’s great, but it doesn’t look very nice.

Enter the undocumented syntax I’ve stumbled on.

  def my_email(to_email, to_name)
    from 'My Pretty Name <myname @example.com>'
    recipients to_email
    subject "Hello There #{to_name}"
    body(:to_email => to_email, :to_name => to_name)
  end</myname>

All you need to do is add the name you want to appear in the from field before your email address, then add a space, and finally wrap the email with angle brackets. That’s it! Now when your email arrives in someone’s inbox, it will show that it’s from My Pretty Name.

The syntax leaves a bit to be desired in my opinion. It doesn’t feel very Rails-y or even like the rest of ActionMailer. When specifying the recipients in ActionMailer for example, you can pass in either a single email address as a string or an array of string email addresses. The syntax should be similar with the from name and address. Here’s my proposed syntax.

  def my_email(to_email, to_name)
    from ['My Pretty Name', 'myname@example.com']
    recipients to_email
    subject "Hello There #{to_name}"
    body(:to_email => to_email, :to_name => to_name)
  end

Seems like a logical addition, eh? Pass in the from name as the first item in an array and the email as the second. Using a hash instead would also be acceptable. Maybe I’ll dig into Rails and submit my first ever patch.

Apr 23

Camping in the Cloud

Posted: 12:04PM Tagged: Programming, Technology
Cloud Camp Minneapolis

Cloud Camp Minneapolis

No, I wasn’t in a tent somehwere near St. Cloud last weekend. I was at Cloud Camp Minneapolis; a regional unconference on the emerging number of cloud computing possibilities that are poised to change the way we think about computers. In layman’s terms that means a bunch of local geeks and a few vendors got together to talk shop in a roughly structured conference format. There have been many such dates around the world.

The first interesting thing about this conference was that without Twitter, it never would’ve happened for me. In the middle of last week, I saw some talk of it in Twitter and checked out the event listing. Unfortunately all 100 seats were full and so was the waiting list. I didn’t even bother with the 2nd waiting list as I figured there was no way I was getting in. Instead, I said something on Twitter and what happened next I never expected. The local organizer, @georgereese, must have been monitoring #cloudcampmsp because he said I was all clear to come. That’s putting social networking to use.

I arrived to the U of M campus and made my way to the building. There were bagels, fruit, coffee, and juice for everyone to snack on. I grabbed a little cup of coffee and ended up talking to a guy who called himself “Danalytics”. He runs does consulting work. We talked about cameras, phones, and the Internet. I didn’t really see him the rest of the day, but he was nice to talk to.

Cloud Camp Breakfast Social

Cloud Camp Breakfast Social

With everyone fed, people began going into the lecture hall for the opening presentaions. This was really the only structured part of the conference. Each of the vendors gave what amounted to a 5 minute pitch for what they are doing with cloud computing. enStratus, Visi, aServer, RightScale, Microsoft, and Rackspace all were present. I liked the brevity of the talks. The 5 limit was indeed a hard limit.

Matt Tanase of Slicehost/Rackspace

Matt Tanase of Slicehost/Rackspace

Twitter and TweetDeck for monitoring the #cloudcampmsp hashtag were indispensable tools. It was interesting to see the reactions from the crowd in real time. Especially when you had these companies talking about their products. You could tell when they were talking BS because the backchannel chatter would pick up. At one point, the moderator pulled a question from the backchannel to ask the entire group. You can’t tell me Twitter is useless and expect me to believe you after what I witnessed last weekend. Can we all get over that now?

Following the vendor lightning talks was a panel comprised of the following gentlemen:

George Reese – enStratus
Jason Baker – Visi
Graeme Thickens – Tech ~ Surf ~ Blog
Jeff Brand – Microsoft
Curtis Thompson – Best Buy Contractor

Opening Panel

Opening Panel (L to R: Thickens, Baker, Brand, Thompson, Reese)

The purpose of this panel was to spark topics for the rest of the day. There were already some talks planned such one focusing on Curtis’ work on Best Buy’s GiftTag and their use of Google App Engine. Things began with with a discussion of why the group came together that day to talk about the cloud. The general consensus was that cloud computing is easy, cheap, powerful, and there is sort of a technolust around it right now.

From there the discussion steered towards the market or audience for cloud computing. The types of business that could benefit from it most are small to medium business. SMB’s generally don’t have the knowhow, infrastructure, or capital to have a large datacenter. Hosting in the cloud means they can try out things cheaply and grow the products later if there is promise.

We later moved into sort of a pros and cons discussion of cloud computing versus keeping resources in house. Things generally came out in favor of the cloud though. In house servers can be run into the ground and therefore you get your money’s worth out of them, but doing things in the cloud is cheap and you don’t have to pay people to run your servers and infrastructure. You just have to pay someone to maintain your cloud. There are also other costs such as bandwidth and HVAC that you don’t have to worry about with the cloud.

There was some brief talk of security, but it quickly became apparent how large the topic was and it was relegated to a session later in the day.

The panel discussions wrapped up with some talk of vendor lock-in and the existence of free cloud resources. Uri Budnik of RightScale was quick to jump in and promote his company’s template model for cloud hosting. They allow you to move things from GoGrid, to EC2, to Rackspace easily without the need to worry about what setup needs to happen on those services. This could be a bigger issue moving forward.

Uri Budnik of RightScale

Uri Budnik of RightScale

The nonprofit talk was also sort of squashed in favor of more in depth discussion during an afternoon session. I think it got relegated to the SMB session.

During lunch (which was provided free!), I met up with @staticnullvoid and @jostheim. It was nice to kick back and chat with those two. I don’t often find people I can have conversations about technology and not have to explain everything or ask if they’ve heard of it.

Afternoon sessions

Afternoon sessions

My first afternoon session of the afternoon was a case study of Google App Engine by a couple of guys who worked on Best Buy’s GiftTag application (slides). The session was led by Curtis Thompson (@iffius) and Thomas Bohmbach (@gumptionthomas). The fact that those two are contractors and kind of operate as rogue employees within Best Buy is interesting and probably worthy of a blog post itself. I’ll leave that for another day though.

Curtis and Thomas say that GiftTag is a “gift registry that doesn’t suck.” You aren’t restricted to only placing items from Best Buy on it. You can take things from around the web and pull them in.

The application started out being hosted on Slicehost, but after Google App Engine launched they thought that it would be perfect to try out. When on Slicehost, they were using Drupal and MySQL. In 3 weeks, they were able to rewrite the entire GiftTag app for Google App Engine and BigTable (Google’s storage solution).

Google App Engine provided them the ability to get the app running and try it out. They weren’t worried about scaling the application later. They just knew it would work. They can do things like push new versions and restart the app without any downtime. Deployments themselves are versioned. You can deploy a staging release and demo it before launching the changes on your live site. There are GUI applications for deployment and they are really “one click deploys.”

There are also some challenges to working with Google App Engine. The most glaring of those is that BigTable is not a relational database. Doing a count of records is not possible and you are limited to 5000 results returned. There are ways to code around this. Make your interface better. For example, instead of pagination displaying individual page numbers, just allow prev, next, beginning, and end. This is how Gmail and Google Docs work. Google’s “search culture” probably brought this about. Search becomes very important if you can’t browse through data.

The best part about Google App Engine is that it is free unless you get really big. You can try things out on it with the only investment being time. With the addition of Java as a supported language, it opens up so many other languages. Any language that runs on top of the JVM should be available for use on Google App Engine. This makes it a very attractive resource.

The second afternoon session I attended was about security and liabilities of putting data and services in the cloud. It was moderated by Jim Hanlon. I have to admit, I wasn’t as engrossed in this talk as I was with the events from the rest of the day. Most of the people seemed to be from larger businesses that had concerns about putting sensitive data in the cloud. I’m not saying these people didn’t have legitimate questions, that’s just not something I have to deal with.

The biggest takeaway from this session was that the question of where data is and who has (or has had) access to it becomes very hard to answer. Even someone like me who doesn’t have sensitive data concerns could be affected by an over-reaching goverment raid.

CloudCamp Minneapolis was a success. There were a few connections I made and some interesting topics to think about going forward. I also had a chance to use my camera which I hadn’t done in awhile. Hopefully more events like this take place in the Twin Cities.

Mar 24

 

I have some work to do.

I have some work to do.

Last week, Microsoft officially lifted the covers off of Internet Explorer 8.0 and deemed it ready for public consumption. According to a post on Neowin.net, the browser will be available via Windows Update as early as April 13th and as an Automatic Update as early as April 27th. Of course, you could also grab it right now if you wanted.

One of the key features that had developers like myself salivating was better standards compliance. Specifically with the CSS standard. The closer we can get all browsers to following standards, the easier it gets to create a website that looks right in all browsers without resorting to hacks and tricks. Unfortunately even the tried and true methods of targeting IE browsers in the past was made more difficult by a new feature, Compatibility View.

Windows Internet Explorer 8 improves browser interoperability and advances the Web by delivering a better implementation of web standards. Although this is a move in the right direction, you might encounter compatibility issues with some sites that still rely on the behavior of earlier versions of Internet Explorer. Common symptoms of site compatibility problems are out-of-place menus, images, or text.

Compatibility View resolves most site compatibility issues and makes websites that are designed for older browsers look better.
From: Release Notes for Internet Explorer 8

If you’d read only that, you’d think that Microsoft is doing the right thing. They’re helping website developers out by supporting more standards and they’re helping out “Joe the Computer User” with this Compatibility View feature. However, the devil is in the details.

Compatibilitiy View

The way Compatibility View works is like this. By default, IE8 will render in standards mode. This is good because as I said, it lets website developers code to the standards and not worry about whether or not things will work. They just do. If a consumer comes to a site that they don’t feel looks like it was intended, they can toggle Compatibility View for that site. What Compatibility View is actually doing is using a non-standards compliant rendering engine that is similar to IE7 to render the page instead. I say similar because it’s not the same as viewing a page in IE7 (yet another headache for developers). Furthermore, if a sufficient number of people use Compatibility View on a site, it will be added to an internal list on a server somewhere at Microsoft.

There are several problems with this. First of all, the fact that Compatibility View renders things almost like IE7, but not quite is a real problem. As far as I know, there is no way to query which mode the browser is in. Conditional comments targeted at IE7 won’t be picked up with Compatibility Mode.

Worse yet, a site that gets on the Compatibility View list has no way of taking themselves off the list. You are forever cast off into non-standards land for any Internet Explorer 8 user. If you update your site to fix whatever rendering issues there were formerly in IE8, there is no way to tell Microsoft that. Until Microsoft comes up with a way for site owners to have their site taken off the list, your site will be broken in IE8 (should you eventually update it).

In all likelihood, we developers have a few months before IE8 starts to gain any sort of market share. If you haven’t at least got a test box or VM with IE8 installed on it yet, then it’s time to get going. With any luck, some smart people will figure out how to deal with a lot of the mess IE8 has introduced and the web will move along. From a consumer point of view, IE8 is a welcome upgrade to IE7 touting better security and faster rendering. It’s too bad it has to make so many of us lose our hair. All the more reason to Bring Down IE6.

Mar 2

If you had asked me prior to this weekend if I’d planned to stay awake for 30 hours straight, I would have said, “No.” That’s exactly what I did for the F1 Web Challenge and the non-profit I worked with, Resource of the Americas. I was really impressed with the level of quality every site showed.

The Resource Center of the Americas is a non-governmental, 501 (c)(3) organization that informs, educates and organizes to promote human rights, economic justice, democratic participation, and cross cultural understanding in the context of globalization in the Americas.

Jason and Stephanie from the Resource Center joined our team for the challenge. They are the only two employees of the Resource Center and they used to have over 30. They once occupied an entire building of which now they only take up one room in the basement. I was more than happy to contribute to their new website.

The new and improved Resource Center of the Americas website

The new and improved Resource Center of the Americas website

It goes without saying that time management is crucial. We fell into a pattern of regular little meetings. Everyone would give a synopsis of what they had worked on and what they were going to work on next. This worked fairly well. A lot of times other little pow-wows would break out too. It was fairly interesting just watching all the teams work. There wasn’t a whole lot of mingling and I think the final results from each team showed why. We pushed ourselves.

The Ruby.mn team was great. We spent the first 3-4 hours getting to know what Jason and Stephanie’s needs were and trying to prioritize them into things we could accomplish in 24 hours. Jason was formerly in IT, so he was familiar with things like HTML and SQL. It was immensely helpful to have another geek on the team. Stephanie was also a big help with testing and data entry.

From the word go, Nate and Kim buried their heads in a new design. Kim came up with the stylish new logo. I like that she kept the upside down globe. Nate spent most of the first half of the event putting together what you see above.

We developers had decided on Radiant CMS prior to the event and had explored a few extensions. It seemed most every nonprofit wanted some kind of blog or current events area, a calendar, a way to take donations online, and maybe a couple other specialized features. Our nonprofit holds Spanish classes and sells Spanish books. Something we didn’t expect to do was sell things. I think we came up with a solution that will work now for them and it’s something they can expand into in the future if they want to. It also happened to be the Paypal portion of the site that gave us the most pain. It momentarily took our two of our developers at about 4 in the morning.

This was the only sleep any of our 12 team members had and these guys were only down for about 15 minutes.

This was the only sleep any of our 12 team members had and these guys were only down for about 15 minutes.

Listing of upcoming events were someting we identified as a priority. The Resource Center host’s a coffee hour once a week and also publicizes other community events. My role early on was bringing Flickr integration into Radiant so we could build an image gallery. In addition, they will be able to insert Flickr image into their new event listings. I ran into a bit of trouble when the first extension I chose to use simply refused to pull any images into Radiant. I gave up after a couple hours of manually executing json calls to Flickr. Luckily, I found another extension which used flickr_fu on the back end. It turns out Radiant has page caching built in, so the API hits to Flickr will be minimal.

By early evening, Nate had finished the homepage design and handed it over to me to slice and turn into HTML. He was pretty happy to have me do it as last year, I guess he was forced to do both the design and the HTML. I spent the next 5 hours between Photoshop, Firefox, Textmate, and Terminal. I barely looked up. This is where most of the time disappeared for me. I put on my headphones and just zoned in.

Heads down programming at f1webchallenge.com

Heads down programming at f1webchallenge.com

I had the shell, header, and navigation done fairly quickly. The main body of the page got fairly complex especially since the backend was evolving as I worked. At about 2AM I had the sidebar area and the 3 content areas at the bottom all finished. After that, I was helping Nate integrate the sub-page templates he designed into the CMS. The tear across the middle of the page came together somewhere between 3-4AM. Andy Atkinson (@webandy), John Reilly (@johnreilly) and I attacked the drop-down menus for the navigation. We were able to come up with a CSS+JS solution that should work in all modern browsers. I was impressed with myself. John ran into some roadblocks with the CSS as I was doing some other work on the homepage and I miraculously was able to hack out the fixes in Firebug in about 10 minutes. The final hours of the challenge were spent mostly cleaning up CSS and styling pages as they were created.

The rest of our team worked on a translation to Spanish module so the whole site could be translated. The Donation system was hooked in and a store was created with integration with Paypal. We weren’t able to deliver a custom mailing list with user management to them because we simply did not have the time. It was a frantic dash at the end, but the team held together well. In the end, District 202, a haven for GLBT teens and their team Praxis won out. Dan Grigsby told me via twitter that the decision was tough, but with the features the winning site had, it would impact real lives the most. There was a private, real time, chat feature and a private Ning social network was integrated to give the members a safe place to hang out online. In the end, I think it was said 2,800 hours of service were put in amounting to roughly $300,000 of free professional quality work.

1 second left

1 second left

Update: There is a group pool on Flickr containing a ton of photos from the event. My teammate Andy Atkinson also wrote a short synopsis of his experience.

Feb 27

Inspired by my fellow teammate, Justin Grammens, I’ve decided I should say a little about the F1 Web Challenge I am participating in tomorrow.

The F1 Web Challenge is a charity event where teams of developers and designers are paired with a nonprofit and are given 24 hours to build the nonprofit a website. The catch is that pairings aren’t announced before the start of the event and those 24 hours are consecutive. Crazy? Maybe. Fun? Definitely. Worth it? Absolutely.

Last spring I remember seeing some tweets about the event and I thought it was a really cool idea. Having worked for a nonprofit  myself at one point, I knew that they often lack the personnel, funds, and knowhow to pull off a great website themselves. So when the call went out on the local Ruby user’s mailing list, I jumped at the chance and found a spot on the Ruby.mn team.

I’ve been more than impressed with the people on my team. Within weeks of the team forming, we had 2 sponsors; Github and Tightrope Media Systems. Our sponsors really helped push our team up above the rest. With the funds donated by TRMS, we were able to purchase hosting for our team website, hosting for the nonprofit, and team t-shirts. Github provided us with a repository for our team website and the nonprofit. Thanks to Sam Schroeder for talking to Github and thanks to John Reilly for talking to his boss at TRMS.

I couldn’t let John and Sam be the only ones to step up for the team. I assumed the role of t-shirt designer even though I’d never done any t-shirt design before. With some help from one of last year’s team members and some feedback from the group, I was able to put a design together. I was happy with what I was able to come up with and I’m anxious to see how the finished product turned out. At the very least, we’ll look like a team!

It is my plan to tweet, live blog, and take photos throughout the day and night. I’m hoping to make a few posts here tomorrow. Follow me (@jrmehle) and @webchallenge on Twitter. Watch my Flickr stream for photos. FriendFeed aggregates all of the previously mentioned content sources, so that would be a place to watch too. Who knows, I may end up with Ustream account at some point to live-stream the event too. The festivities kick off at 9AM and will run through 9AM on Sunday.