✓ I'm available for hire! Check out my open source work on Github or drop me an email

Douglas F Shearer

Posts Tagged with scotlandonrails

There are 3 matching posts.

Scotland On Rails 2008 - Day Two

Today was the second day of Scotland On Rails which I was visiting courtesy of a free ticket from EngineYard.

Update: They had tea, maybe all conferences should do this!

Here’s a run down of the talks I went to:

Keynote – David A Black

Despite having been ill the day before, David provided a talk on the similarities between programming and music. I’m sure other people will provide more on this, but one difference is that musicians don’t hate those who play different instruments, unlike coders ripping on other coders due to their choice of tools.

Rails Patterns – Jonathan Weiss

Jonathan gave a talk on some common rails patterns, here’s a rundown:

  • Long running tasks, video/audio processing etc: Break these off into separate jobs, and run them later.
  • Lots of data: Use a background process to push to a service such as “Amazon S3”:, and use your local disk as a cache in case of downtime or for popular content.
  • Plugins: Don’t blindly use them, always look over the code. A lot of plugins are poorly or infrequently maintained.
  • Dependencies: Vendor everything, Gems, Rails. Saves your developers a lot of time in getting up and running when they join the team.
  • DOS avoidance: Split up your Mongrels into groups, that way multiple slow downloads or uploads don’t consume all your resource. Don’t use sendfile, use xsendfile, free’s up the Mongrels faster. Maybe use another tool to deal with uploads, Merb or CGI.

Collective Intelligence: Leveraging User Data to Create Intelligent Rails Applications – Paul Dix

Paul of Mint Digital gave a great talk on how you can mine your user data to provide them with recommendations. Using the “Netflix challenge” data, he showed an example using Ruby and some C libraries. Very clever stuff, I’ll probably be digging into this more later.

Advanced Ruby Class Design – Jim Weirich

Jim gave a great talk on designing Ruby classes in a Ruby way. He highlighted some cool tools, including the BlankState class, which undefines all the Object/Class methods normally attributed to a Ruby class. In 1.9 there will be a version of this called BasicObject, from which Object inherits, thus creating fewer problems for classes doing clever things like DSLs where namespaces may collide.

Domain Specific Languages: Molding Ruby – Joe O’Brien

Today Joe presented a talk on DSLs. So what is a DSL? Well, you know the absurd nomenclature Starbucks use for their coffees? Venti, Grande, etc. Well, that is a DSL, designed so that when a customer makes an order, the chance of the barista getting the order wrong is pretty wrong, as everything is ordered so that nothing can be missed out. I essence, as someone pointed out, the barista is a compiler.

A DSL is a mini language, if you will, with “Rake” being one of those that Rails developers will be most familiar with. When designed well, a DSL will bring methods calls and operations up to the level of natural language. Image the benefits of a well designed DSL in showing implementations and getting approval from clients. So, bring your code up to the client, not the client down to the code.

JRuby on Rails: Up And Running – Charles Oliver Nutter and Thomas Enebo

Charles and Thomas (THE JRuby guys) presented what was for me, the best talk of the entire conference. Not only in it’s revelations, but the enthusiasm they brought to the subject of JRuby.

The last time I played with JRuby was a year ago, when it was pre 1.0, and a bit buggy. During the talk the guys officially released 1.1, despite it being available for over a week. To save me a lot of effort I’m just going to list some of the facts regarding it:

  • JRuby is just Ruby.
  • Has a Java port of the Oniguruma regular expressions library, like Ruby 1.9.
  • Compatibility is key in it’s development, Rails, Rake, RSpec etc all run. Full ruby 1.8.6 compatibility. 42k assertions in tests.
  • Java 6 over 30% faster than 5, all good for JRuby.
  • JRuby 1.1 is 2-5x faster than Ruby 1.8.
  • Dynamic optimization makes programs run faster as they run longer.
  • JRuby almost twice as fast as Ruby on a single thread. Threads in JRuby are real, so near-linear scaling across cores!
  • Can take advantage of different profilers available to Java, the guys showed a live profiler demo inside NetBeans using fractal benchmark.
  • Can call Java APIs/classes from within Ruby. Showed off a Swing example where the interface was build through Ruby methods, much nicer than the horrible Java methods.
  • Can dynamically add methods to Java classes, Java won’t see them though.
  • NetBeans supports JRuby and Ruby. Command completion, method completion, method jumping, regexp completion, % completion. Shows RDoc for methods as you type them. Auto complete require classes and subclass completion.
  • Example of Processing , run Ruby algorithms, through the Java lib, hardware accelerated on OpenGL. Games, Nick? These guys reckon someone will do it soon.
  • JRuby database support through activerecord.
  • Package your Rails app as a WAR file, everything in 1 process. Throw into GlassFish, done, instant scaling across multiple processors.
  • JRuby runs in asynchronous mode, can spin off new processes.
  • Ruby 1.9 support on the way, maybe in the next major release.

Awesome stuff, expect an article on getting up and running with Rails on GlassFish here soon.

Wrapup

All in all, it has been a fantastic few days. I’ve learnt lots of stuff and met some great people. Roll on next year.

Thanks very much to the SoR Team for all their organisation.

 
 

Scotland On Rails 2008 - Day One

Today was the first (official) day of Scotland On Rails which I was visiting courtesy of a free ticket from EngineYard.

Have met lots of great people, as expected. Am rather surprised at the number of non-rubyists, there are a fair number of people who currently work full-time on Java or .Net and are pursuing Rails as a sideline with a view to either going freelance, or ‘sneaking’ Rails in the back door at their employer. They were all impressed that I was a full time Rails developer, and have been since I left University. Maybe it was jealousy, but I can see why it is a lifestyle that many would like.

Here’s a brief rundown of the talks I attended, and what I took away.

Keynote – Michael Koziarski

Many Rails followers will know Michael as Koz, the man on the Rails core you hassle until your patch gets accepted. His keynote wasn’t the inspirational piece I would usually expect as a keynote, but did cover some interesting material as far as code beauty is concerned. In Rails there is some nice code, and some not so nice code, as expected, but it was nice to be shown some of it, and the reasons for it’s existence.

Pushing Rails onto our Stack: A System Integration Study – Richie McMahon & Maria Gutierrez

Richie and Maria (was very amused by her accent, is Spanish, with random bits of Edinburgh mixed in) put on a talk about their adventures integrating Rails apps with an existing Java infrastructure. They covered:

As well as covering XMLRPC in the days pre-ActiveRecord, they also covered working with legacy database schemas. One interesting thing that was brought up is the lack of support in Rails for legacy STI keys. A quick patch seems to have solved it though.

Handling Long-Running Tasks in Rails – Andrew Stewart

Andrew gave a great overview of the solutions out there for running background and scheduled tasks in Rails. BackgroundJob seems to come out the best, through ease of installation, setup, breadth of use cases and persistance. Lot of options out there though.

Edgecase Dialog – Jim Weirich and Joe O’Brien

Due to some rescheduling, this was earlier than planned. Jim (Author of Rake) and Joe of EdgeCase gave us an amusing but informative three scene play on the benefits of using mocks and stubs in your tests. The examples were presented using Jim’s FlexMock library, which I shall be checking out as an alternative to Mocha over the next few weeks.

Code Generation: The Safety Scissors of Metaprogramming – Giles Bowkett

“Giles”: provided the most amusing top of the day, complete with pictures of Jessica Alba and Darth Vader in a sombrero. Apart from the comedy, his talk was a great overview of what can be done when code is used to generate code. In short, code == data && data == code! He highly recommends Jack Herrinton’s Code Generation in Action, which was originally supposed to be a Ruby book, but due to the publishers fears about a Ruby book (this was 2003) the second half of the book is filled with examples in various other languages.

Migrating to Ruby 1.9 – Bruce Williams

Bruce presented a great talk on some of the new features and gotchas in Ruby 1.9. The highlights for me were the new hash symbol syntax: { a: 1, b: 2, :c => 3}, and the persistent ordering of hashes. The new lambda syntax is somewhat less verbose than previously, and seems like a step backwards. Be sure to check out the app Bruce used to run code in both languages for comparison: Compare-1-9.

Bonus Erlang Session – Gordon Guthrie

Gordon is a (relative) local, having only travelled from Linlithgow. He works for a small two-man Erlang development team. He gave a great overview of why Erlang deserves the attention it has been receiving. Despite not showing many code samples, he certainly managed to whet my whistle for having another go at learning it.

All in all, an awesome day, despite the early start. Thoroughly looking forward to tomorrow.

 
 

Scotland On Rails 2008

Scotland is hosting it’s first every Ruby On Rails conference this coming friday and Saturday. Despite living just around the corner from the venue, I had totally forgotten to register by the deadline.

Thankfully, the thing that reminded me was EngineYard’s offer of a chance to win a pass for the conference.

So I was first in with the email, and am now thoroughly looking forward to it. Thanks very much to the conference organisers and of course EngineYard.