Posts Tagged ‘ruby’

RailsConf Reflections

Released May 24th, 2011

Today, I’m feeling mostly recovered from my first ever RailsConf, so I thought I would take some time to reflect on what I learned there, and share it with you, my dear reader. So, here we go, in no particular order…

CoffeeScript is happening…

…whether you like it or not. Personally, I’m psyched — it looks like it solves a lot of the annoyances I’ve had with Javascript syntax, and I got a sweet deal on CoffeeScript: Accelerated JavaScript Development during the conference, which I hope to put to good use starting this week.

The Rails Community is Awesome

My wife’s response after she read my tweets upon my return:

“Just wondered, who is this guy? Dinner anyone? Share a cab? You became an extrovert on your mothership.”

It’s true, I did. It’s weird. I’ve never been to Baltimore before (save time spent between flights at BWI), but among my fellow Rails coders, I’ve never felt more “at home.”

As I thought about all of the people I finally got to thank in person for all they’ve done to make my time in the Rails community more enjoyable, it really drove home what an awesome community we have. It’s easy to lose sight of this while working away in Louisville, my little corner of Kentucky.

Aside from this, getting a chance to put a real face to a name, make and receive thank-yous for all the hard work we put in on Rails patches, plugins, and the like, has the effect of re-energizing a developer. I’d go on and list all of the awesome people I got to meet in person here, but I think it’d just make @casron more jealous.

I would like to say, however, that Emilio Tagua (@miloops) has got to be one of the friendliest guys I’ve ever met. I’d hoped to catch up with him to thank him for helping me get commits added to ARel back in the 1.x days that were needed for MetaSearch and MetaWhere. Instead, he ended up two seats over from me at Ignite, noticed I was hacking on a Squeel bug, and introduced himself first. Every time I saw him during the remainder of the conference, he had a smile and a kind word. Just an all-around great guy to have met.

PostgreSQL is awesome, too!

Now, I should have known this. I had started out using MySQL many years ago, when it had solid speed advantages over PostgreSQL, but far fewer features. Somewhere along the line, that balance shifted, but I stuck with MySQL due to familiarity. Nick Gauthier’s KnowSQL presentation has made a believer out of me. I’ll be using PostgreSQL as my RDBMS of choice from here on, and making sure that Squeel works as well as possible with it, too.

The Fundamentals are ALWAYS Relevant

There were tons of talks on design patterns, best practices, and so on, and even as long as I’ve been doing this whole coding thing, there are plenty of areas in which I can improve. In particular, Avdi Grimm’s talk, Confident Code, José Valim’s talk about the design principles behind the Rails 3 refactoring, and the talk on Building Bulletproof Views by John Athayde and Bruce Williams all challenged me to elevate my game in these areas.

HTML5 is sooooo much more than semantic tags

LocalStorage, audio, video, canvas drawing, web sockets, web workers — this stuff is all crazy cool and I can’t wait until more browsers support it. Mike Subelsky’s HTML5 tutorial was a real eye-opener.

That’s about it, for now. What were some of your takeaways from RailsConf this year?

A Webby for Figment

Released April 13th, 2011

And the envelope please….we are proud to announce that our recent work on figment.com, a community for young folks to read, write and connect is a Webby Award Official Honoree in the Youth category.

The 15th annual Webby Award winners were announced yesterday. Some say The Webby Award is the Internet’s most respected symbol of success. We’re just delighted to receive Honoree status for our work and rank in the top ten percent of the nearly 10,000 entrants. We’re in good company too, Disney and Lego also received the Honoree nod.

Website and mobile winners were selected for recognition based on excellence in Content, Structure and Navigation, Visual Design, Functionality, Interactivity and Overall Experience. Winners were selected by The International Academy of Digital Arts and Sciences (IADAS), a global collection of experts and technology innovaters, including David Bowie, Arianna Huffington, Harvey Weinstein, Martha Stewart, Vinton Cerf, Biz Stone.

We’re proud to be recognized by our peers with this gesture but we’re even more proud of our work and the success of Figment. Tell us what you think…

Programming Languages Are Slow

Released October 15th, 2010

Moore's LawI was chatting with a friend of mine who’s been working toward getting his company to consider a migration to Ruby on Rails. It’s interesting to me, because they’ve been using frameworks that are heavily influenced by Rails, but the developers there are resistant to moving to the real deal. They’ve started to lean away from PHP and toward Java lately, so naturally I suggested they take a look at JRuby, which provides all the awesome of Ruby but runs on the JVM, thereby keeping the suits happy. The  response from one of his co-workers when he passed on my suggestion? “Ruby was (and is) terribly slow.” Argh. This, again? I tweeted my response:

If your best argument against using Ruby is a perception that it’s slow, a reminder: Moore’s Law is on our side. :)

(more…)

Treetop: Grammar’s Cool

Released February 12th, 2008

Treetop was one of the more exciting projects I saw at last year’s RubyConf. Nathan Sobo’s Treetop talk is available online and I urge you to watch it. Nathan did a great job of explaining the basics of syntactic analysis, and then got into the specifics of using Treetop’s implementation of parsing expression grammars to put the concepts to work.

Treetop appeared to gather all the concepts together into an understandable domain specific language. All of the tokenization and node structure can go into a single file, and the interactive nature of Ruby makes for the perfect sand box. I felt like I could get somewhere if I invested just an hour into this. I was happy to find that my impressions were correct.

After a short time I had caught on enough to start writing my own code. Once over the hump the rest was easy. I was able to write and test a Treetop grammar for parsing CSV files within a few hours. I chose CSV parsing because I was already familiar with the format, and I could compare my implementation to not just one but two existing Ruby libraries.
(more…)

Deploying a Subversion branch with Capistrano

Released January 30th, 2008

Capistrano is a tool for automating tasks via SSH on remote servers. It has many uses, I (and many others) use it to deploy their (rails) applications. The best I can tell there is no built in way to deploy a branch from your source code control system. There are a couple ways of accomplishing this. I chose passing in the branch as a parameter to the Capistrano command:

cap --set-before branch=testbranch  deploy

(more…)

Rails fixtures with models using set_table_name

Released April 22nd, 2007

If you have a model that uses set_table_name you may hit a snag when trying to use fixtures and unit tests. The solution is twofold: name the fixture file using the legacy table name, and use the set_fixture_class method in your unit test. I coudn’t find this method mentioned in Agile Web Development with Rails, and there’s only a brief mention on the rubyonrails.com site. Still, some web searches turned up the answers.

Here is a simple example:

(more…)

Mongrel vs. WEBrick

Released April 3rd, 2007

We had the need to hook up a simple ruby web process (non-rails) to our production apache server. As Leslie Hensley pointed out, fcgi and scgi are on the way out, and mongrel + mod_proxy_balancer is the new way to go. We use mongrel extensively in our rails deploys, but always just used WEBrick to do simple serving. To make a long story short, we had to ask ourselves….is mongrel that much better (and in this case better == faster) than WEBrick?

(more…)

Latest on Rails Performance

Released April 1st, 2007

Updated Rails 1.2 performance numbers have been released. While these number look pretty good it is hard to get a good idea of exactly what the performance of Rails is. A couple of other benchmarks that include Rails such as performance tests for 6 frameworks and Grails vs Rails benchmarks show a different picture. Both of these come up with much worse performance than the first. Maybe the issue is that the second two benchmarks are using Apache ab but the first uses a new version of rails bench. Of course most people probably aren’t that worried about the benchmarks that much because you can find ways to make anything fast as shown with Rails doing 4000 requests a second.

Building a better world with Google Spreadsheets

Released December 6th, 2006

I was tickled when I ran across the GoogleLookup and GoogleFinance functions in Google Spreadsheets. I was very tickled when I found there was a REST API for interacting with the spreadsheets.

So not only can you lookup the current volume of Google stock in a spreadsheet (=GoogleFinance(“GOOG”, “volume”)) or find out Roger Clemens’s ERA (=GoogleLookup(“Roger Clemens”,”earned run average”)) you can access those values real time using an open API. I cobbled together a quick ruby program that can retrieve values from a private or public (published) Google spreadsheet.

(more…)

Cleaning Up Rails Sessions, Revisited

Released September 16th, 2006

In an earlier post, we detailed a method for removing stale Rails session files. In more recent version of Rails, there is a Rake task built in for this administration task.

rake tmp:sessions:clear # Clears all files in tmp/sessions