Archive for November, 2008

Become a Badware Buster

0

BadwareBusters.org went live today! My rails shop StopBadware.org and Consumer Reports WebWatch have combined forces to create a friendly online community where casual computer users like our moms and dads can feel comfortable mixing with security experts and power geeks to work together to remove viruses, spyware and other badware from their computers and websites.

The idea behind the site came from my co-worker Jason Callina who also conceived of a reputation and rating system that would visually highlight popular posts. I really enjoyed putting together this site and I look forward to improving it over the next few months as we move from beta into a full launch early next year.

We welcome your feedback on BadwareBusters.org and encourage you to get involved in the online community.

Voices That Matter: Professional Ruby Conference Wrap Up

4

Photo by Sebastian
Photo by Sebastian Delmont

I’ve been to a few conferences in my day, and I have to say that I am a true fan of the single track, short 30 minute presentation thing.  RubyConf was an intimate gathering of super friendly folks.  

Usually, I just hang out in the back and watch.  At rubyconf2008, I was engaged and talking with everyone and at the end I felt like I was a part of something special.  I learned a lot and made a few friends and it was the best conference evah!

Monday, I was scheduled to attend the Fluent In Ruby: Getting Beyond The Basics workshop taught by Russ Olsen.  Unfortunately, my babysitter (a.k.a. MIL) went to the hospital (she’s fine now, thanks) a few hours before.  Not wanting to miss a class I was really looking forward to, I thought I’d try bringing Lilli and see what happened.  She’s a very easy going baby and I figured I could always step out and go home if she was fussy or otherwise bothering people. It was worth a shot since I live only 25 minutes away.

I felt very “cosmo-mom” bringing my baby to a conference.  Of course, these events tend to be male dominated and I wasn’t sure how the guys would feel to have a pregnant lady with a baby in class. Some of the 20-somethings didn’t know where to look, but many of the attendees were fathers themselves. They made it a point to smile, ask my baby’s name and tell me about their own kids.

Our speaker, Russ Olsen was a little taken aback when he heard “moaning” in the back of the room during his talk but then was pleasantly tickled to discover that it was just the coos of my little girl.  He should be flattered.  Lilli was engaged in his talk for over 3 hours.  All in all, everyone was very kind.  And while I did feel a little awkward, Lilli enjoyed herself immensely.  That’s my girl!  

Most notably, I had lunch on Wednesday with Jon “Lark” Larkowski, Tammer Saleh, Pat MaddoxSandi Metz, Sophie and Carlisia.  Sandi, Sophia, Carlisia and I had sat down at a table to chat girl geek talk since we were the only four female coders at the conference.  We were engaged in a very lively discussion about gender and technology when Jon, Tammer and Pat sat down with us and joined in.  I was really pleasantly surprised that these guys weren’t intimidated by our conversation but rather were willing to hear us rant and answer our pointed questions.  

In particular, we asked what kind of developer does your company prefer to hire and would adding a female coder significantly change your company culture.  Not surprisingly, ruby folk tend to prefer well rounded people who have lives away from their laptops.  And yes.  Women in the workplace does change the atmosphere but for the better in many ways.

For me, the theme of this conference was community, an inclusive community of geeky hipsters where all are welcomed to contribute with their own unique viewpoints and talents.  Nice job, Obie.  And thanks for linking to me on your blog.  Can’t wait for next year.

Thursday Morning Session Notes

0

The Voices That Matter ruby conference is a single track conference emphasizing short 30 minute presentations that give you a taste of a variety of topics.  These are my notes:

Josh Susser woke us up this morning with his talk Ruby: Fragile or Agile?  He spoke about the evolution of programming languages in particular a great deal about SmallTalk – “the best of the best”, “superior to everything that superseded it”.  Smalltalk’s greatest strength is also it’s weakness.  The language carries it’s house on its back.  It needs its own environment to run in but this causes portability issues.  Then along came C++ and sucked up all the oxygen.  C++ gave the existing C programmers and tools OO advantages.  You could ship apps you built in C++ to your customers and it gave developers just enough productivity over C that developers were not encouraged to shift paradigms.  History is entertaining but what can we take away?  Ruby needs to be careful not to be blindsided like SmallTalk.  How is Ruby positioned, where does it fit?  Folks have referred to Rails as the ruby killer app, what’s coming next?  The greatest thing about rails is the test directory, its easy to test in rails. There is a culture of agile development that comes along with the ruby community.  Building ruby’s momentum around that is the way to go.  There’s a trade off between concise, elegant code and readable, maintainable code.  There needs to be tests for every “interesting” bit of our program.  The pitfalls of ruby development is that it makes it difficult to do static analyses and refactoring.  Because of the dynamic structure of ruby and the code is more compact and DRY, perhaps analysis and refactoring is easier and perhaps unnecessary.  The problem is that refactoring happens in our brains and you have to understand what’s going on in your program.

James Golick spoke about RESTful Possibilities – REST in Rails and Beyond.  The rails community has been outspoken about REST.  As a result, a lot of people are starting to see REST as something that is only interesting as a Ruby/Rails thing.  We’d all benefit from a web which where all technologies provided restful services (unless it’s java).  In SOAP or CORBA, you can just write your regular old code and make a remote procedure call and you are protected from the complexity of it all.  But they all suffer from fatal flaws in today’s era of computing.  In order to create interoperability between java, Ruby C++, Python, etc. the complexities of the underlying technology stacks are huge.  In trying to insulate the developer from the complexities of distributed programming, these stacks create more problems than they solve.  These stacks tend to hide things you need to know from you.  Remote procedure call – FAIL.  HTTP is representational state transfer (REST).  In REST anything that can be named is a resource.  Standardization is good.  Any rails developer who has worked with rails is going to have familiarity with the restful pattern.  By exposing XML, JSON to your controller you get a cheap, clean, easy api which makes it easy to create more powerful tools.  REST apps are pleasant to integrate with.

I was really interested in hearing the data talk from Matt Bauer on Using Berkeley DB and Ruby with Large Data Sets.  They had the problem of having lots and lots of data to capture and crunch.  Much like the situation we’re in with our URL Clearinghouse.   Berkeley DB is able to handle thousands of concurrent threads and processes.  It scales to a huge database (256TB).  It also supports ACID transactions, fine grain locking, XA, etc.  Berkeley DB is embedded, runs in the same address space, written in C with many bindings, data access is very fast because its all right there.  There’s no SQL or schema and it doesn’t operate on keys or data.   It comes in two data store flavors: concurrent and transactional.   A lot of the speed comes from the fact that they don’t need to go over the wire. Berkeley DB is not easy to handle and you can hit the wall really hard.  Please read the documentation!  Well worth reading.  It’s difficult because there are so many different options.  Everything is very customizable.  There are two versions of the Ruby & Bdb bindings.  The first version was written for a much older version of ruby. It’s more ruby-esque but skip this one.  The next version is an exact match of the C implementation and is very stable.  I really wish this talk involved MySQL… Berkley DB sounds interesting but the non-relational aspects make it seem like there’s a bit of overhead before I can use it.  Twitter seems to be able to handle large volume using MySQL and I would guess most people are in the MySQL camp.  I’m a fan of SQL and entity relationships, so perhaps Berkely DB is not for me.  He mentioned ActiveWharehouse for more traditional databases, and this might be worth looking into.

Michael Hartl spoke about contributing to GitHub via his talk Case Study: Building the Insoshi Social Network.  Insoshi is an open source social networking platform.  By design it is a standard social network.  Another project on GitHub is the RoR project.  If you want to add extra features in rails, you can got to github and make a fork of rails and then clone your fork.  You can work on your own little fork of rails and you can also pull from the main rails project as updates appear.  This forking process is how you contribute to a project.  If you find something you want to change or bug you wanna fix, you can do that via a github account.  You first have to create a github acount and then you navigate to the project you want to work on.  When you click on the fork button you get “hardcore forking action”.  You get your own fork of the project.  You’ll want to clone it and push/pull which gives you a chance to make your own branches off the freshest release.  Once you have the local repositiories you are ready to code.  Commit the changes with git.  When you’re ready to push to the insoshi fork, git.push.  When you go to github, you will see a list of all the commits.  Do a diff to be sure to all worked.  When you’re sure everything looks right, go back to your main page and click the pull_request button and submit it!  The Steps are: 

  1. Fork to the repository at GitHub
  2. Clone and connect your local repository
  3. Write a failing test
  4. Get the test to pass
  5. Commit your local changes
  6. Push your changes to your GitHub fork
  7. Make a pull request
  8. It may or may not get approved by staff
  9. We all profit

Wednesday Afternoon Session Notes

1

The Voices That Matter ruby conference is a single track conference emphasizing short 30 minute presentations that give you a taste of a variety of topics.  These are my notes:

I met Jon “Lark” Larkowski at lunch who spoke about Testing as Communication: Real-World Techniques.  Testing is communicating which means that we should be communicating all the f’ing time.  HashRocket uses PivotalTracker all the f’ing time. No programming is done without a story in PivotalTracker.  It keeps track of the velocity of todos getting done while providing transparency between management and the programmer.  A Story contains (As a/ want to/ so that/ given/ when/ than).   client vs. developer vs. code vs testing are all speaking a different languages from a different point of view.  The goal is the transfer information and ideas seamlessly. At the end of his talk, Jon took a moment to point out that the Ruby community fosters inclusiveness.  He encouraged us to walk up and talk to him or Obie because we come to the conference to share.  What a sweet guy!  :-)

David Berube was brave enough to present Surviving as a Windows-based Ruby and Rails Developer amongst a large majority of mac users.  Still, I was grateful for the topic since I am still Windows based.  But basically, Dave just spit out a bunch of tools that are needed to get up and running on Windows… but I’m already working in it, so not super useful.  Not surprisingly, he told us that not all the third party software will work right on Windows, and there are other pitfalls as well. Ruby code that opens binary files doesn’t work because LF => CRLF and vice versa.  There is no Kernal#fork.  No GNU or compiler out of the box.  But there are some good IDEs out there like Ruby in Steel, NetBeans, gvim, Emacs, or E text Editor (Textmate clone). (We use Aptana)   POSIXing Your Windows Box…. you can never get all the way there.  I haven’t needed to do this yet, thankfully.  The closest you can get is Cygwin, but you can only have one Cygwin dll in your searchpath at a time (if windows detects more than one dll in the search path it simply won’t run).  Unxutils is preferred.  In the end, this talk was basically a commercial to switch away from Windows and go to Ubuntu.  Of course, if your clients are windows based, then you need to have a windows based machine to test with… which is the case we find ourselves in… and so far, I’ve been happy enough with my work enviornment in Windows (even though Aptana can be kinda bloated and kludgey)… so I guess I’ll stay here for now.  

Chad Pytel and Tammer Saleh (who I also met at lunch) gave the best presentation yet called Rails AntiPatterns.  What does Red-Green-Refactor mean?  Red: write a test (it fails of course), Green: write the least amount of code (the simplest thing that works) to make the test pass, Refactor: rearrange your code to eliminate duplication and allow patterns to evolve.   The boys stepped through moving code from the controller to the models by giving specific examples of how certain pieces could be moved into callbacks and migrations to make the code more concise.  They also made it a point to name their callbacks as specifically as possible.  Also, don’t forget that you can add a condition to your callback.  Even a 15 line controller action is too long.  Exceptions should be exceptional, and your models should use callbacks to add complex behavior.  Tackle large refactorings iterively.  Push as much business logic into the model as possible.  In lots of code, simple DRY pricnciples will lead to a lot of refactoring.  Named_scope is a shortcut for defining a helper method on your model. Bad code happens to good people.  Bad code works.  Refactoring is not bug fixing.  Always be refactoring.

Foy Savas also gave an engaging and entertaining talk about Merb in his presentation Battle Royale: Merb’s Role in the MVC Holy Wars.  Foy is writing The Merb Way and even more impressive he can read chinese. Merb is a new database framework that takes the best of existing frameworks and claims to do what Rails is bad at: quick responses.  Merb can handle more requests per second.  There is a Merb Performance Promise.  No release of Merb will be released that is slower than the last.  Merb works with any server that has a Rack interface.  Rack allows you to string together apps using Rack:Cascade.  DataMapper destroys ActiveRecord by making working with collections easy.  Merb gives us granulated modularity increasing the potential reuse of code.  Where do you go for help?  Just look though the clean source code.  The books are coming out, but aren’t ready for primetime yet.

Will Koffel presented a Case Study: Sinful Ruby at Sermo.  Sermo is a discussion community for nearly 100,000 US licenced physicians.  Wish I could have stayed to learn more about their RoR and various tools choices, but I need to get home early to put my little girl to bed.  All in all a great day at VTM!

Wednesday Morning Session Notes

0

The Voices That Matter ruby conference is a single track conference emphasizing short 30 minute presentations that give you a taste of a variety of topics.  Unfortunately, I missed the keynote speech this morning.  But when I arrived, it turns out that the speaker had missed it too.  Although I was sorry to miss the “smackdown”.  These are my notes from the rest of the morning:

Cody Fauser spoke about Payment Processing with Active Merchant.  Active Merchant is an extraction from the e-commerce system Shopify.  Active Merchant strives to have a simple uniform API, a universal translator for payment gateways.  No matter which gateway you use, the code stays the same.  So you can switch from Paypal to Braintree with no code changes.  One stop shop for all payment gateways.  The credit card object is rich in features that includes a whole suite of validations. Active Merchant also gives you uniform AVS and CVV responses and is extensible. There’s a large community of folks using Active Merchant who are contributing to the project and you can find help via the mailing list.  This is open source but production level code with SSL peer verification.  Be aware of PCICS Data Security Standards before you begin coding.  If you want to see it in use check outhttp://is.gd/882N and http://is.gd/883c.

Philippe Hanrigou from Thoughtworks presented Rock Solid Ruby Deployment.  Tough to catch everything with his accent and quick, clipped speech but you adjusted after a bit.  Check out Troubleshooting Ruby Processes (Leveraging System Tools When the Usual Ruby Tricks Stop Working).  Most important is to “know your stack”. Phillipe created caller_for_all_threads which is a patch for the Ruby interpreter which provides a way to collect the stack traces of all the threads of a Ruby application.  With caller_for_all_threads, just send a signal to your Ruby process to capture all your application stacks!  DTrace is a freaking awesome tool.  DTrace is a comprehensive dynamic tracing framework for the Solaris Operating Environment. DTrace provides a powerful infrastructure to concisely answer arbitrary questions about the behavior of the operating system and user programs.  Unfortunately, its only available for Solaris at present.  Paul Fox is working on DTrace for Linux but its not ready for prime time yet.  But when it is, you can at last figure out what’s going on in all your components.

Blaine Cook formerly of Twitter spoke about Messaging with Ruby and Rails.  There hasn’t been a lot of use of messaging to build systems on the web.  If we can build systems that talk to each other we can build powerful things.  AJAX is almost messaging, an ajax request is providing instant feedback to the user and doing work in the background.  Messaging can help us with parallel processing.  You can also use messaging to decrease latency.  Normally you have a polling, request cycle and with a lot of social apps being built on the web these days you want that response in milliseconds because it creates a richer experience.  There are a bunch of options for building messaging systems.  RabbitMQ is best of breed at the moment with an Erlang implementation.  Other systems include ActiveMQ, Spread, beanstalkd (used on Twitter), Starling, German/ TheSchwartz (used on LiveJournal), Delayed::Job and cron.

Rails Scales! How? We all know that rails scales so instead Matt Pelletier talked about the mobile landscape.  Many more phones are being sold than pcs these days.  There are a lot of voice technologies out there like robo calls, VoIP, Automated Voice Services, Voice XML, Asterick, etc.  SMS has recently started to surpass the amount of voice calls made in the states.  Nothing new in Japan, Korea.   But SMS doesn’t give you any meta data and you are limited to 167 characters.  MMS is “a total shit show”, even Apple said screw it, use email instead.  Mobile Data Services are the next tier with a lot of activity like WAP, the “Real” Internet (MobileSafari, Android Browser, Fennec, Opera, Skyfire), and Apps for your phone.  People like apps, what are folks doing with them?  Same thing as on the web, an extension of the desktop.  Many phone apps provide Location Based Services because people are out and about with their phones but it’s not quite “there” yet.  IPhone development feels like the Rails community 3-4 years ago.  There is sparse domain knowledge and its poorly organized.  There’s some UI design patterns but not many coding conventions.  Objective-C isn’t Ruby and iPhone SDK ain’t Rails.  But a decent coder can get going without much experience with some time and dedication.  Its fun because mobile apps are simpler than web apps.  And if you get a hit, you can make BIG money.  

Tuesday Afternoon Session Notes

0

The Voices That Matter ruby conference is a single track conference emphasizing short 30 minute presentations that give you a taste of a variety of topics.

Had a fabulous lunchtime conversation with fellow female coder Sophie from the American Physical Society and her coworkers.   Very yummy lunch sponsored by Sermo where the Boston Ruby Group currently meets.

Sophie and I discussed the dirth of women at the conference.  Barbara Gavin told us that usually only 5% of programming conferences are women.  Sad statistic.  I know there are more women coders out there.  We really need to make an effort to be visible.  Me and my bringing a baby to the afternoon workshop can only accomplish so much!

At yesterday’s workshop, Lilli and I sat next to Nick Plante who (other than the sexist scantily clad super woman image in his PPT) gave a dynamic talk demystifying developing rails plugins.  The trick is to write generalized code for reuse and to contribute to the Ruby OSS ecosystem.  The ultimate in “community love”.  Make people learn as little “new stuff” as you have to when creating a new plugin.  Check out existing plugin patterns, conventions and incorporate functionality folks are already used to using.  BTW, no one is going to have confidence in your plugin if you don’t include tests.  Test the behavior of the system with the plugin installed rather than the eccentricities of the plugin code itself.  Github is the current plugin repository of choice.  Why not write a gem?  They provide proper versioning and dependency management and GitHub makes it easy for you.  Don’t be afraid!

Ezra Zygmuntowicz works for EngineYard and spoke about Ruby Deployment.  Lighttpd + SCGI was okay, then people tried Apache + FCGID which was a little more stable, then there was Mongrel + Apache which was kickass.  A lot of people still use this model.  Lightspeed is a commercial web server that offers a free version but you can’t surf porn with it.  WTF?  Mongrel + Nginx (writen for massive Russian porn surfing) for the win!  Thin or Ebb + Nginx wins sometimes too because of efficient thread schedules but the trade off is that really long requests are bad for this web server  Passenger is the latest thing people are using and is an awesome solution but not ready for larger production websites just yet due to issues with Apache.  It’s okay for shared hosting and small VPS but Nginx + Mongrel or Thin works best for high volume production and is the deployment enviornment of choice. Rack is the great web server equializer.  Its a web server gateway extracter interface which boils down a web server into a class that takes the enviornment as an argument.  It lets you use a variety of web server options without writing new code handlers.  Ezra is currently working on Nanite: self assembling cluster of ruby processes built around RabbitMQ.  Everyone here is excited about EYAAS (Engine Yard As A Service) cloud, load balancing with nanite and rack to be released in January.  A different way of thinking about deployment.  Its all about automation – State Based Configuration Management.  More at http://bit.ly/bRcA

Matt Jankowski is from Thoughtbot, a consulting firm who recently created a social networking for scientists capturing relationships and publication data amongst academics and researchers to provide a forum for online communcation. The first half of Matt’s talk about Agile vs Enterprise seemed more like a rant against his parents.  He compared “Agile people” who have fun and enjoy their work to “Enterprise people” who “just” want a 9-5 job and prefer to “pay their mortgage” and “get their kids to school on time” over folks who prefer to live their job 24-7.  I guess Agile developers aren’t interested in having a home and kids.  I think his intent was to talk about how to integrate the two but he didn’t really offer any solutions, just banal comparisons.

Shane Harvie used a network sharing example to explain Refactoring Complex Domains in Ruby and Rails.  He chatted about Inheritence vs. delegation.   Call extend to change behavior at runtime.  Mixology allows you to take away old behaviors and add in a new behavior.  What if a method involves writing to multiple models?  Answer: Service objects!  Also try using result objects as a refactoring alternative to arrays and hashes.  Difficult topic to discuss in 30 mintues, best to refer to the PPT here!

Finally Bryan LilesPat MaddoxSandi Metz and Tammer Saleh formed the panel that discussed testing methodologies.  Nice to see a woman and a non-white male up there.

“Its cheaper to write tests than not to write tests!”  The test driven development folks refer to a quick, exploratory, investigation that involves coding something up to see if it works, a spike.  Tests shouldn’t be so granular that you need to continually change logic for every code change.  Don’t test implementation, test behavior.  A monkey test is a unit test that runs with no specific test in mind.  Starting out?  Check out Rspec.info or Shoulda.  Keep it as simple as possible.  Write simple tests, refactor, rinse and repeat.  Take the refactoring books written in java and rewrite it in ruby to get started. Test unit is a framework for unit testing in Ruby that encourages bad behavior.   Writing tests is hard because it means changing your style of development.  Its hard at first, but you just have to keep doing it.  Tests are there to help you because we are all human.  Non-testers are called cowboy coders, they are considered disrespectful and ultimately a liability.  Long sequences of method calls are derided as train wrecks.  Mock at the unit level.  Rails vanilla fixtures suck.  Instead use Object Daddy or Factory Girl.  Do it.  Don’t be afraid!

Tuesday Morning Session Notes

0

The Voices That Matter conference is a single track conference emphasizing short 30 minute presentations that give you a taste of a variety of topics.  Not enough time to take away more than just an overview of the latest topics in the industry.  But I’m finding it very stimulating to be in a room of truly geeky application developers.

Obie Fernandez gave a really interesting keynote talk about agile development methods at HashRocket (=>).His talk totally made you want to work there.  In particular, he mentioned an interesting product they use called PivotalTracker which is a story-based project planning tool that facilitates team collaboration.  We’ve been using Redmine lately at SBW but I really liked the look and feel of PivotalTracker.  Also of note is HashRocket’s commitment to Pair Programming: 2 people in front of one computer, 2 keyboards, 2 mice.

Ben Koski spoke about his rails shop at the NY Times.  I had a dear friend working there last year who hated the experience due to horrible office politics.  Ben mentioned in passing that his team works the same hours as the newspaper industry which sounds really very grueling and un-family friendly.

Thomas Enebo, Co-Lead for the JRuby Project claims that there is no need to know java… JRuby is “just Ruby”.  Not being a native Java developer, I haven’t found a use for JRuby yet.  Everything I’ve needed so far can be found in core or a plug-in/gem.  But perhaps JRuby makes java converts and the unfortunates working on legacy systems more at ease.

Matt Pelletier introduced us to Mongrel.  We’ve implemented Passenger at SBW, but unfortunately I haven’t had time to play with it myself.  Can you call yourself a geek when you shy away from server configuration toys?

Coby Randquist from YellowPages.com says that the community is the reason why he devlops in ruby.  AT&T Interactive promotes community participation.  If I wanna be a RoR Rockstar I’m going to need to involve myself more in community activities starting with getting back to attending Boston Ruby Group.

AllTop

0

A coworker just clued me in to an awesome news website called AllTop.com, an online magazine rack for your laptop.  The idea is to “help you explore your passions by collecting stories from ‘all the top’ sites on the web”.  

The layout is extremely classy and user friendly.  And clicking on the topic of moms brought me to moms.alltop.com with an expansive collection of blogs.  Check it out.

 

Protected by AkismetBlog with WordPress