Ideas for Tuesday's hackfest

2 views
Skip to first unread message

Dan Croak

unread,
Feb 27, 2008, 6:52:30 PM2/27/08
to boston-r...@googlegroups.com
Buenas noches,

What would people like to hack on Tuesday night? Any of these sound
appealing?

* Start writing a gem that looks for orphaned Ruby code/methods (not
being sent messages from anywhere in your program)
* Start writing a gem that implements item-based collaborative
filtering (http://www10.org/cdrom/papers/519/) ... the technique
Amazon.com uses to make product recommendations
* Start writing a gem that lets users run their own advertising
network (ActiveRecord models containing Advertisers, Advertisements
with keywords and various tracking stats, called from your web app
using Jester ... http://jesterjs.org/)

* Knock off open tickets for Shoulda (http://tammer.lighthouseapp.com/projects/5807-shoulda/tickets
)
* Knock off open tickets for another open source Ruby project

These are just things I have on my mind. What other itches need
scratching?

Dan Croak
http://thoughtbot.com
organic brains. digital solutions.


Dan Grover

unread,
Feb 27, 2008, 8:11:23 PM2/27/08
to boston-r...@googlegroups.com
> * Start writing a gem that implements item-based collaborative
> filtering (http://www10.org/cdrom/papers/519/) ... the technique
> Amazon.com uses to make product recommendations

I'd be up for this.

I'm not sure if it's been brought up before, but I just got the
O'Reily book "Programming Collective Intelligence": http://www.oreilly.com/catalog/9780596529321/

It's all about how to do things like product recommendations,
clustering, ranking, etc. I'm new to all that so I'm loving every bit
of it so far. Awesome book.


Dan Grover

Josh

unread,
Feb 27, 2008, 8:11:33 PM2/27/08
to Boston Ruby Group


On Feb 27, 6:52 pm, Dan Croak <dcr...@thoughtbot.com> wrote:
> * Start writing a gem that looks for orphaned Ruby code/methods (not  
> being sent messages from anywhere in your program)

This one sounds pretty interesting. Do you have any initial ideas for
how to go about figuring this out?

> These are just things I have on my mind. What other itches need  
> scratching?

One thing I've wanted to play around with was writing an idiomatic
Ruby wrapper for a web service. In particular, I hadn't been able to
find a del.icio.us library yet (it might just be one of those
impossible-to-google things). I'm open to other services as well.

When I say idiomatic, I mean something that feels at home in Ruby,
rather than mirroring whatever the API exposes. Think facebooker
rather than rfacebook.

- Josh

Jason Morrison

unread,
Feb 27, 2008, 8:30:58 PM2/27/08
to boston-r...@googlegroups.com
On Wed, Feb 27, 2008 at 8:11 PM, Josh <joshua....@gmail.com> wrote:
On Feb 27, 6:52 pm, Dan Croak <dcr...@thoughtbot.com> wrote:
> * Start writing a gem that looks for orphaned Ruby code/methods (not  
> being sent messages from anywhere in your program)

This one sounds pretty interesting. Do you have any initial ideas for
how to go about figuring this out?

My $0.02...

Searching method definitions against method invocations sounds a lot like the parsing+data flow analysis that one has to do for type inference.  I worked some on TI for Ruby for Google Summer of Code 2006, and have my notes at http://soc.jayunit.net/ and http://rti.jayunit.net/.  It's tricky (particularly with some of Ruby's... interesting... scoping and dispatch rules), and you can't get 100% of the cases (eval), but it's a wonderfully interesting problem.

You could also take a runtime approach, where you exercise your code and test which methods are dispatched, maybe by iterating over each class/module in ObjectSpace and replacing each method with a proxy to itself that records the dispatch.

Or maybe there's a lower-level approach... perhaps authoring this as a JRuby or Rubinius extension would give easier access to the desired information for a runtime instrumentation approach?

Jason




> These are just things I have on my mind. What other itches need  
> scratching?

One thing I've wanted to play around with was writing an idiomatic
Ruby wrapper for a web service. In particular, I hadn't been able to
find a del.icio.us library yet (it might just be one of those
impossible-to-google things). I'm open to other services as well.

When I say idiomatic, I mean something that feels at home in Ruby,
rather than mirroring whatever the API exposes. Think facebooker
rather than rfacebook.

- Josh




--
Jason Morrison
jason.p....@gmail.com
http://jayunit.net
(585) 216-5657

Dan Croak

unread,
Mar 3, 2008, 2:20:56 PM3/3/08
to Boston Ruby Group
Let's do the orphaned method identifier. It sounds like there is
interest there.

It would be nice to plan our attack before tomorrow night. I'll look
for people in the #boston.rb IRC channel tonight around 8pm.

irc://irc.freenode.net/boston.rb

Dan Croak

unread,
Mar 4, 2008, 11:11:41 AM3/4/08
to Boston Ruby Group
Hey folks,

There is some code available in the thoughtbot Subversion repository
that we may use tonight as our starting point:

https://svn.thoughtbot.com/hackfest/daddy_warbucks/

Thanks to Jon Yurek, the hackfest repo is now available to y'all, as
we discussed last week.

This hackfest will likely be an experiment in learning the tools to
analyze Ruby code rather than creating anything too useful. It should
be fun and educational, however.

I'm thinking we may want/need to use Kernel#set_trace_func so if
anyone has experience there, that may come in handy.

See you tonight at the usual place and time. Thanks once again to Jon,
Chad, and Matt, the thoughtbot owners, for providing the space and
refreshments.

7-9pm

41 Winter Street, 3rd floor
map: http://tinyurl.com/3ch9pn
Park Street T stop

Warm regards,

Dan Croak
http://thoughtbot.com
organic brains. digital solutions.

Dan

unread,
Mar 5, 2008, 1:57:52 PM3/5/08
to Boston Ruby Group
how'd you guys make out? I was bummed I had to miss it due to a family
thing.

-Dan


On Mar 4, 11:11 am, Dan Croak <dcr...@thoughtbot.com> wrote:
> Hey folks,
>
> There is some code available in the thoughtbot Subversion repository
> that we may use tonight as our starting point:
>
> https://svn.thoughtbot.com/hackfest/daddy_warbucks/
>
> Thanks to Jon Yurek, the hackfest repo is now available to y'all, as
> we discussed last week.
>
> This hackfest will likely be an experiment in learning the tools to
> analyze Ruby code rather than creating anything too useful. It should
> be fun and educational, however.
>
> I'm thinking we may want/need to use Kernel#set_trace_func so if
> anyone has experience there, that may come in handy.
>
> See you tonight at the usual place and time. Thanks once again to Jon,
> Chad, and Matt, the thoughtbot owners, for providing the space and
> refreshments.
>
> 7-9pm
>
> 41 Winter Street, 3rd floor
> map:http://tinyurl.com/3ch9pn
> Park Street T stop
>
> Warm regards,
>
> Dan Croakhttp://thoughtbot.com

Dan Croak

unread,
Mar 6, 2008, 10:59:31 AM3/6/08
to Boston Ruby Group
Kernel#set_trace_func turned out to be the highlight. There is some
working code (run the tests) at:

https://svn.thoughtbot.com/hackfest/daddy_warbucks/

We began down the road of removing the need to "register" methods but
ran out of time.

Josh

unread,
Mar 6, 2008, 12:05:19 PM3/6/08
to Boston Ruby Group
I actually committed a few changes later in the night. Now you can
register:

* Any number of methods on a class: @daddy.register
Orphanage, :orphan_count
* All methods on a class: @daddy.register Orphan

Personally, I think this is probably sufficient for what we were
trying for.

I think removing the need to register would add a certain degree of
headache as well. For example, if you trap all method calls and you
happen to use ruby-debug, the act of using next, continue, etc
actually triggers the trace function.

So if there was a way to limit it to user-defined class (and exclude
third party stuff), that would solve it. But I haven't thought of a
way to go about doing that yet.

Jacob Burkhart

unread,
Mar 6, 2008, 2:06:13 PM3/6/08
to boston-r...@googlegroups.com
If you were doing it in the context of a Rails app, you could load only those classes that Rails has loaded through it's Dependencies loading by overriding require_or_load.
Reply all
Reply to author
Forward
0 new messages