[rails-oceania] Re: Algorithm Problem

2009-03-31 Thread Torm3nt
God I LOVE you guys! lol That's the exact term I needed - cartesian product. Simple google search got me exactly what I needed. AHHH. I could hug you all! :D Kirk On Wed, Apr 1, 2009 at 4:12 PM, Xavier Shay wrote: > > I solve exactly the same problem you're trying to with the below method >

[rails-oceania] Re: Algorithm Problem

2009-03-31 Thread Xavier Shay
I solve exactly the same problem you're trying to with the below method (cartesian product) There's a few implementations around the net, I'd be surprised if there isn't one for PHP. Julian Doherty wrote: > So you basically want a cartesian product of an arbitrary list of lists? > > The Ruby

[rails-oceania] Sydney roro meetup Reminder: Wednesday 8th April

2009-03-31 Thread Keith Pitty
Hi, Just a quick reminder that the next Sydney roro meeting is on Wednesday 8th April at: Trinity Bar - 505 Crown St, Surry Hills, NSW 2010 http://tinyurl.com/6emfna (upstairs) Currently we have three people stepping up to present: Lightning Talks: * Myles Byrne - "Git Ninja Moves wi

[rails-oceania] Re: Algorithm Problem

2009-03-31 Thread Julian Doherty
So you basically want a cartesian product of an arbitrary list of lists? The Ruby facets gem does that: http://facets.rubyforge.org/git?p=facets.git;a=blob;f=lib/core/facets/array/product.rb;h=f890ddc0ddd7e7f5076f207d0cc126b7bf34ceea;hb=HEAD Heres what the Ruby code looks like (works for an arbitr

[rails-oceania] Re: Algorithm Problem

2009-03-31 Thread Alex Pooley
I think Mark's answer was correct given the example you initially gave. However, if you want to iterate over groups of dissimilar sets without hard coding the looping to a fixed 'n' then I think you're after something like a multi-dimension iterator.I wrote one for Java here: http://www.alexpooley

[rails-oceania] Re: Algorithm Problem

2009-03-31 Thread Mark Ratjens
without knowing PHP or your data structure ... can you build an array of arrays, option group x option? Recursive iteration through the arrays can work then Torm3nt wrote: Yeah variable number of option groups, currently working with PHP. On Wed, Apr 1, 2009 at 1:07 AM, Mark Ratjens wro

[rails-oceania] Re: Algorithm Problem

2009-03-31 Thread Torm3nt
Yeah variable number of option groups, currently working with PHP. On Wed, Apr 1, 2009 at 1:07 AM, Mark Ratjens wrote: > OK ... so how many option groups? are they variable? what language are you > trying to express this in? > > Torm3nt wrote: > > Unfortunately it doesn't quite work that straig

[rails-oceania] Re: Algorithm Problem

2009-03-31 Thread Mark Ratjens
OK ... so how many option groups? are they variable? what language are you trying to express this in? Torm3nt wrote: Unfortunately it doesn't quite work that straight forward when the number of the different option groups = n =P On Wed, Apr 1, 2009 at 12:52 AM, Mark Ratjens wrote:

[rails-oceania] Re: Algorithm Problem

2009-03-31 Thread Torm3nt
Unfortunately it doesn't quite work that straight forward when the number of the different option groups = n =P On Wed, Apr 1, 2009 at 12:52 AM, Mark Ratjens wrote: > > Hmm ... what idioms are we allowed then? :-) > > Iterate over the sizes >    within each size >       iterate over the colours

[rails-oceania] Re: Algorithm Problem

2009-03-31 Thread Mark Ratjens
Hmm ... what idioms are we allowed then? :-) Iterate over the sizes within each size iterate over the colours make a combination and stow it somewhere Does that make sense? Either that or get some sleep :-) Torm3nt wrote: > This may seem rather simple to some, but being la

[rails-oceania] Algorithm Problem

2009-03-31 Thread Torm3nt
This may seem rather simple to some, but being late at night it's driving me up the wall.. The context behind this is I'm trying to create all unique product options for a product. Consider: We have two product option groups, size and colour. Size contains: S, M, L, XL Colour contains: red, bl

[rails-oceania] Re: Rails 2.3 broke my script/server

2009-03-31 Thread Tomas Varsavsky
The problem was that I had Rack 0.9.1 as a dependent gem in my environment.rb which conflicted with the version of Rack that is bundled with Rails 2.3.2. I had added rack 0.9.1 as a dependency because Rspec 1.2.2 needs it. I moved the Rack dependency to test.rb and now everything works. --~--~---