RubyNation 2008 wrap up

I attended RubyNation 2008 last weekend on Friday and Saturday. It was great to meet up with fellow Rubyists in the Washington DC area. It was also my first time helping to organize a conference - I think we did a pretty good job considering that we did it in a short time and the conference was sold out. We do stand on the shoulders of giants though - we had help from fellow Regional Ruby Conf organizers from around the country - Lone Star, Mountain West, etc. I also wrote a nice app (in Objective-C) to pick the prize winners that I’m codenaming Prizes.

As usual, there was the good practical technical meat from JRuby to testing to DSLs. You can find a links to the speakers and the Ruby frameworks and tools that they mentioned at my links pages (which I took with my Mac bookmarking app Webnote) to post it to both delicious and ma.gnolia.

delicious: http://delicious.com/tag/rubynation

magnolia: http://ma.gnolia.com/tags/rubynation

But, what I found more interesting is the philosophy of programming. Neal Ford who gave the opening keynote related how Ruby helps you capture the essence of your problem while avoiding the ceremony that other languages like Java make you perform and that we should learn the lore of programming. Glenn Vandenberg reminded us that we really should try to fit the tools to the problem and that there is always a benefit and cost to each. Rich Kilmer noted that Ruby is becoming mainstream and that is has grown organically (to our benefit.)

Finally, Stu wrapped up with how Ruby is good overall, but that there are some bad practices / parts of the language that could come back to bite us later especially as Ruby adoption grows. He called out: class attributes (use instance attributes on eigenclasses instead), constants (you can’t change them unlike almost everything else in Ruby), accessing instance variables directly (use accessors), and how procs are treated (he likes Giles’ L alias for lambda but solving the ugliness of using more than one block will likely need change at the VM level.)

As a programmer who lives in both the Ruby and Objective-C worlds, I had the additional takeaway of how much the Objective-C community can learn from Ruby practices. Things like testing, mocking and DSLs are under-utilized but I think have the potential for improving our apps.

Going further and thus wrapping back to Neal’s talk about the lore of programming, I think we owe it to ourselves as programmers to learn other languages, especially the “root” languages like Smalltalk and Lisp and to read “the classics”. Neal mentioned The Mythical Man-Month, Smalltalk Best Practice Patterns, and The Pragmatic Programmer. To that list, I would add Refactoring.

Thanks for everyone who spoke, attended and organized RubyNation 2008! We’ll be having another one in June 2009.

August 6, 2008. Washington DC, Ruby, Northern Virginia. No Comments.

NSCoderNight DC - I’ll be demoing Prizes.app

Tonight is NSCoderNight DC. It’s at the La Madeleine in Bethesda, MD at 7PM. (More directions to La Madeleine ).

I missed last weeks but that’s because I was getting ready for RubyNation. Part of that was making a new Mac OS X app that I’m calling Prizes.app. It lets meeting organizers who are having raffles / contests enter in a list of people’s names and then randomly pick one from the list. All in a stylish way of course. It uses Core Animation to make it more suspenseful and interesting to watch. It worked well at the RubyNation conference. So I’ll be demoing that tonight in addition to our usual group discussion of Aaron Hillegass’s Cocoa Programming for Mac OS X book.

August 5, 2008. Cocoa, Washington DC. No Comments.

RubyNation links

I’ve been posting the web pages of the RubyNation speakers and the Ruby tools and libraries that they mention using the rubynation tag. I’ve been using a private beta of my OS X bookmarking app Webnote to post it to both delicious and ma.gnolia.

delicious: http://delicious.com/tag/rubynation

magnolia: http://ma.gnolia.com/tags/rubynation

BTW, for the uninitiated, RubyNation is the Washington DC Area Ruby conference.

August 2, 2008. Washington DC, Ruby. No Comments.

Generating random numbers in Cocoa

I’m writing an application to pick prize winners for the RubyNation conference that’s coming up here in the Washington DC area. As part of that, I have to generate random numbers. So I went looking for how to generate random numbers in Cocoa. I was looking for something reasonably fast, built-in to Mac OS X, had an easy to use API, and had the most randomness. I defined a random number generation algorithm as being more random if it had a larger range of numbers that it could generate.

The basic usage of a random number generator is something like this:

  1. Seed (initialize) the random number generator
  2. Generate a random number
  3. Modulo the random number against your maximum number to get a number from 0 to your maximum number - 1.

Alright, first off I looked for Objective-C libraries. You know, maybe there was an NSRandom or something like that. There isn’t really one, so I went to look for C functions instead.

Digging into my memory banks, I remembered from my early C days that the standard C library call is srand() with a seed to initialize and then rand() to get the random number. So I looked up srand in the Apple Developer Connection (also known as ADC)
and came up with the laughable description:

rand, rand_r, srand, sranddev — bad random number generator

These interfaces are obsoleted by random(3).

Alright, so onto random. I looked up random in the ADC to see its Mac OS X Manual page. Alright, so it can generate numbers from 0 to (2**31) - 1. You can seed it with srandom() - which could be useful because the same seed will generate the same sequence of random numbers - useful for replaying a game sequence. A better seeding is to use srandomdev() which creates a state array which can’t be guessed by attackers and effectively uses the /dev/random device.

OK that seemed pretty good, but I read on and found this intriguing line:

Applications requiring cryptographic quality randomness should use arc4random(3).

Alright, so now I look up arc4random on ADC. arc4random uses the Alleged RC4 cipher, hence the ARC4. It has a range of 0 to (2**32 - 1), which is twice the range of random. It uses the /dev/urandom device. And best of all, in my opinion, it doesn’t require seeding/initializing since it initializes itself.

So the winner in my book for generating random numbers in Cocoa (really any Objective-C or C program on Mac OS X) is arc4random.

July 24, 2008. Programming, Mac OS X, Cocoa. No Comments.

NSCoderNight Washington DC tonight

NSCoderNight Washington DC is meeting again tonight, July 8, 2008 at 7pm - 10pm.
We meet every week on Tuesday nights.

Tonight we’re discussing Chapter 5 of Cocoa Programming for Mac OSX Third Edition by Aaron Hillegass.

We meet at La Madeleine Bethesda, MD.

And more info:
7607 Old Georgetown Road, Bethesda 20814
Old Georgetown & Commerce
TEL: 301-215-9142
Mon. - Thu. 6:30 AM - 10:00 PM
Fri. - Sat. 6:30 AM - 11:00 PM
Sun. 7:00 AM - 10:00 PM

And parking info:
Go past La Madeleine and either turn right onto Old Georgetown Road or
continue onto Georgetown Road.
Turn left onto Woodmont Ave.
Make a left turn into the parking garage.
Take the elevator up to the ground floor.
Cross the street and there is La Madeleine.

And don’t forget to validate your parking ticket with La Madeleine -
they’ll pay for the first hour.

July 8, 2008. Cocoa, Washington DC. No Comments.

NoVA Languages Group First Meeting Tonight - Focusing on Erlang

Our new language study group, Northern Virginia Languages aka novalanguages is having its first meeting tonight. It’ll be at 8pm in Reston, VA.

We’re going to go through Chapter 2 of Programming Erlang by Joe Armstrong. If you’re interested in Erlang, click over to the group link for more details and to RSVP.

June 16, 2008. Washington DC, Erlang. No Comments.

New Programming Language Group forming in Northern Virginia

I don’t know what it is about Northern Virginia and programming languages, but we just can’t seem to get enough of them! A new group “novalanguages” has just formed.

Here’s a brief description of the group:

Thoughts on the makeup of the group include obtaining (however you want) a book,
working through the book 1 chapter per week on one night of that week with a group of
like minded individuals. For the first one, my company Iterative Designs will sponsor it (not sure what that means just yet) and we can go from there.

It will mean meeting up and having a group to ask questions about the language we are learning and they aren’t going to give you the snub nose responses of “Don’t you know that — you n00b” that you might get in an IRC chat room.

I am thinking the first language should be something out there but semi-applicable (like an Erlang, Smalltalk, or even Lisp). Unless everyone in the group has a Mac (or can borrow one) and we can learn Cocoa/Obj-C — which would be fun given the iPhone SDK availability.

- Chris Williams

Personally, I’d be happy to learn Erlang. Chad’s been talking about it for awhile now and I got really excited about the potential of it while at MountainWest RubyConf where I saw some good presentations about it.

I’d also be interested in going through Cocoa/Objective-C. I already know it, but its always good to go back through the basics and practice, practice, practice. Plus, it’s also good to share your knowledge with others - teaching is sometimes the best way to deeply ingrain something into your brain. However, we’re already planning to go through the Cocoa Programming for Mac OS X, 3rd ed book in our NSCoder DC Night group.

Thanks to Chris Williams for setting this up!

June 4, 2008. Cocoa, Washington DC, Ruby, Northern Virginia, Erlang. No Comments.

NSCoderNight tonight in Northern Virginia

I’ve been going to the past few NSCoderNights here in Northern Virginia. We’ve met up at Panera in Tysons before (look for the Apple logos.) But tonight we’re trying a different venue: Camille’s Sidewalk Cafe near the Courthouse Metro in Clarendon, VA. More details in Jose’s blog entry Trying a new location tonite.

It’s been pretty motivating to meet up with other Cocoa Mac and iPhone developers. I think we’re going to be discussing Cocoa Programming with Mac OS X by Aaron Hillegass soon, working our way through the chapters. I was privileged to have the experience of doing technical review on that book and I’ll have a full review of it on this blog soon. Short review: if you have the 1st or 2nd edition, it will help you get caught up to the newer Cocoa APIs and so its worth getting. If you don’t, then you definitely need this book to help you with your Cocoa programming. Big Nerd Ranch uses it as a text book for their Cocoa Bootcamps!

Cocoa / Washington DC Trivia: Aaron Hillegass grew up in Northern Virginia. We actually attended the same high school, Thomas Jefferson High School for Science and Technology, though at different times.

June 3, 2008. Programming, Mac OS X, Cocoa, Washington DC. No Comments.

Registration for RubyNation is now open

East Coast Rubyists - you can now register for the Washington DC area Ruby conference RubyNation. It costs $175 and seats are limited.

We also have a new speaker, Glenn Vanderburg. He’s the Chief Scientist at Relevance, who I’ve done some work for. He recently created the Frozen Gems Generator which is handy for freezing gems for a Rails app.

May 28, 2008. Washington DC, Ruby. No Comments.

RubyNation - a Ruby conference in the Washington, DC area

I’m proud to say that we are going to have our very own Ruby conference here in the Washington, DC area! It is called RubyNation and it will be happening on August 1 - 2, 2008 at the Center of Innovative Technology in Herndon, VA. That’s probably one of the strangest shaped buildings in our area that should be hard to miss - it sort of looks like a squarish ruby with its point up.

We’ve lined up Stu Halloway, Neal Ford, David Bock, and Giles Bowkett as keynote speakers and we’ll have lots of Ruby content. I think it will be single track which is my preferred format - fewer things to think about. Plus, if you’ve got something cool you’ve been working on, you can present them during the lightning talks!



I hope to see you there!

May 27, 2008. Washington DC, Ruby. No Comments.

Older Entries