Code Review and Hacking

Lets get our hack on.

We will be paring up to practice some ruby with a problem from Project Euler. The exercises are specifically picked to be fully grokable by the newbies and meta-hackable by the experienced. 

Special Bonus Level: Bring out your code! Bring your code in to be reviewed! While people are working through a the project Euler exercises folks can pair up for some crazy code reviewin'. 

Join or login to comment.

  • tim

    great fun -- smart folks -- helpful too

    September 1, 2011

  • Ryan S.

    It is in MRI 1.8.7-p352:


    ruby-1.8.7-p352 :002 > [1,2,3].reduce(0){|sum,n| sum + n}
    => 6

    September 1, 2011

  • Ben M.

    I liked the exercises, direct learning

    September 1, 2011

  • LisaSchaefer PhD C.

    I thought that Inject was a poor word to describe how it worked. - Reduce isn't any better - So I asked if Inject had "a synonym...or an alias." The context was how Inject compares to how Java or C works.
    Sean explained how Inject works by psuedocode. Kind of like a swap sort. However I'll leave it to someone else to create a Swapsort alias.
    Anyway, this is all good info. Especially since I'm running Ruby 1.8 and I had previously thought that Inject was a method of Array.

    September 1, 2011

  • Ryan S.

    First time I've participated in a "hacking" session such as this... pretty good experience, if not a bit basic (which was great for some of the newer ruby programmers in attendance).

    September 1, 2011

  • Jim G.

    I believe reduce is only available in ruby 1.9 and there is no alias for inject in 1.8

    September 1, 2011

  • Ryan S.

    Entirely possible you understood the question correctly and I did not. I hadn't seen this until I came to Ruby.

    September 1, 2011

  • Sean M.

    The alias for inject was my bad. What I thought the question was, is inject known as a common command in in different languages like Java and C.

    August 31, 2011

  • Ryan S.

    Fun night... for what it's worth, someone asked if Enumerable#inject had an alias, and the answer given was "no"... but indeed Enumerable#reduce is an alias to inject.

    August 31, 2011

  • Sean M.

    Hey all, after the last meeting when we were out for drinks and talking about podcasts, the Skeptics Guide the Universe came up. Here is a simple program to download all the SGU podcasts:
    https://gist.github.com/1178151
    This may be a bit easier to work through for the people who are newer to ruby.

    August 29, 2011

  • Ali I.

    Here's an app I'm working on:
    http://stormy-flower-289.heroku.com/

    It gets songs from the Billboard top charts and creates YouTube playlists that you can view on the site. Works best in Firefox 5 and Safari 5...can't say for sure in other browsers. Definitely not IE. The code:
    https://github.com/alimi/video_playlist
    https://github.com/alimi/yt_data_api video_playlist is the project for the app. yt_data_api is a gem I wrote to access the YouTube Data API. Still committing...

    August 26, 2011

  • LisaSchaefer PhD C.

    Help! I'm trying to run code that I stole, but it's old and doesn't work! It doesn't even have a gemfile.

    August 23, 2011

  • Christopher S.

    I was looking into code that we could use for a sample code review, just in case no one wants to have their code scrutinized. And I came across some example code that I was working with last weekend, and thought it would make a great code review fodder. This is Amazon's sample ruby code for generating a Simple Payment form:

    https://gist.github.com/1163030

    If you have code you want to have reviewed, please post a link -- so we can read over it in advance.

    August 22, 2011

  • Sean M.

    I just realized that that problem might be a little difficult for everyone. If you are new to Ruby, try one of these:
    http://projecteuler.net/index.php?section=problems&id=1
    http://projecteuler.net/index.php?section=problems&id=2

    August 22, 2011

  • Sean M.

    Hey all! I thought I would send out an example problem for everyone to work on in case you don't have your own code or if you wanted to work on something that others have worked on to get a different perspective.
    http://puzzlenode.com/puzzles/21

    August 22, 2011

15 went

Our Sponsors

  • New Relic

    Application performance monitoring

  • Clean Ruby

    Get the ebook by Jim Gay about Ruby, OOP, and DCI

  • O'Reilly

    Discounts on print and ebooks.

People in this
Meetup are also in:

Sometimes the best Meetup Group is the one you start

Get started Learn more
Rafaël

We just grab a coffee and speak French. Some people have been coming every week for months... it creates a kind of warmth to the group.

Rafaël, started French Conversation Group

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy