1
2
rows_in_order = [1,2,3,4,5,6,7]
side == :white ? rows_in_order : rows_in_order.reverse

Ruby On Easy - descending range

by Andrew Skegg, August 01, 2008 05:00 Star_fullStar_fullStar_full
3f7fc5fbdbb40cf38d5bf94f265b343c Talk

Ruby On render partial layout

by DG, August 01, 2008 04:57

Hi Jeremy
Thanks for your e...

51224bdd17878b3b19e8987e9bb336a2 Talk
1
rows_in_order = side == :white ? (0..7) : (0..7).to_a.reverse

Ruby On Easy - descending range

by mvanholstyn, August 01, 2008 04:17 Star_fullStar_fullStar_fullStar_full
F9ac05fdd57915983ccea58699e1f942 Talk
1
2
3
4
require "set"

pools = {1 => [1,2,3], 2=> [3,4,5], 3=> [5,6,7]}  
...

Ruby On Find the Intersection of Ar...

by badcarl, August 01, 2008 04:06

Here is another way. Keep ...

Aedd89a10aba3a46576ea4f604146c65 Talk
1
2
3
4
byes, heard = 0, true
while byes < 3 do
  puts "Huh?! Speak up, sonny!" unless heard
...

Ruby On Exercise: Deaf Grandma

by Wolfbyte, August 01, 2008 03:11

@Maciej Piechotka - Yep you...

861f311cc4a077c439099d0e5d251e73 Talk

Ruby On Find the Intersection of Ar...

by AviFlombaum, August 01, 2008 02:21

badcarl - thanks! That's aw...

Fafb062f6e8c394dd6b0689c13db2b88 Talk
1
2
3
4
require "rubygems"
require "facets/enumerable/probability"

...

Ruby On Find the Intersection of Ar...

by badcarl, July 31, 2008 23:06 Star_fullStar_fullStar_full
Aedd89a10aba3a46576ea4f604146c65 Talk

Ruby On Find the Intersection of Ar...

by AviFlombaum, July 31, 2008 22:14

Nice! However, the issue wi...

Fafb062f6e8c394dd6b0689c13db2b88 Talk
1
2
3
pools = {1 => [1,2,3], 2=> [3,4,5], 3=> [5,6,7]}
rej = Hash.new {0}
pools.values.flatten.sort.reject! {|elem| rej[elem]++ != 1}

Ruby On Find the Intersection of Ar...

by Maciej Piechotka, July 31, 2008 22:03

May be something like that

1e8f141e7857d397d8020ed3b759e88a Talk
1
2
3
4
# Ruby 1.8.6
pools = {1 => [1,2,3], 2 => [3,4,5], 3 => [5,6,7]}
values = pools.values.flatten
...

Ruby On Find the Intersection of Ar...

by Jeremy, July 31, 2008 21:59 Star_fullStar_fullStar_full

Here are a couple of option...

5170ca260dbd2cdfd5a887a4dba7636f Talk
1
2
3
length = ARGV.last ? ARGV.last.to_i : 140
chars = %w{< > + - . , [ ] [-] ,[.,] >,[.>,] [->+<] >[-]<[->+<]}
puts Array.new(length) {chars[rand(chars.length)]}.join[0, length]

Ruby On Brainfuck Generator in Ruby

by JonM1827, July 31, 2008 21:11

I'm sure there is a much mo...

Fcd45b7de93cc8fa417fa43426973e06 Talk
1
2
3
4
length = ARGV.last ? ARGV.last.to_i : 140

chars = %w{< > + - . , [ ] [-] ,[.,] >,[.>,] [->+<] >[-]<[->+<]}
...

Ruby On Brainfuck Generator in Ruby

by mattgauger, July 31, 2008 20:57

Cool, I'm learning lots in ...

311c342bfd324eb9d3603222f7f36f24 Talk
1
2
3
4
# generate_bf.rb
# (copyleft) Matt Gauger 2008
# Randomly generates a brainfuck program
...

Ruby On Brainfuck Generator in Ruby

by JonM1827, July 31, 2008 20:37

and that is why I need to l...

Fcd45b7de93cc8fa417fa43426973e06 Talk
1
2
3
4
# generate_bf.rb
# (copyleft) Matt Gauger 2008
# Randomly generates a brainfuck program
...

Ruby On Brainfuck Generator in Ruby

by Maciej Piechotka, July 31, 2008 20:31 Star_fullStar_fullStar_fullStar_fullStar_full

A little bit different work...

1e8f141e7857d397d8020ed3b759e88a Talk
1
2
3
length = 140
program = ""
...

Ruby On Brainfuck Generator in Ruby

by JonM1827, July 31, 2008 20:20

I'm sure there are much bet...

Fcd45b7de93cc8fa417fa43426973e06 Talk

Ruby On Exercise: Deaf Grandma

by houston b-g, July 31, 2008 20:08

@Wolfbyte - You're absolute...

33b53c3fda38b2464e11ebcddefa6235 Talk

Java On Closing database connection...

by Marco Valtas, July 31, 2008 19:06

Hi, you should probably use...

B8d457d2c39911ea4c74ba7d66b9c3f7 Talk
1
2
3
4
class User
  named_scope :older_than, lambda { |u| { :conditions => ['age > u', u.age] } }
end
...

Ruby On How to make instance variab...

by Jeremy, July 31, 2008 14:21

If you're using Rails 2.1, ...

5170ca260dbd2cdfd5a887a4dba7636f Talk

Ruby On render partial layout

by Jeremy, July 31, 2008 14:08

Partials don't use the layo...

5170ca260dbd2cdfd5a887a4dba7636f Talk

Ruby On How to make instance variab...

by danielharan, July 31, 2008 13:51

Persistent storage by addin...

880cbab435f00197613c9cc2065b4f5a Talk
1
2
3
class MyaccountController < ApplicationController
  before_filter :load_users, :only => [ 'account_details', 'show_email_box', 'show_mobile_box' ]
...

Ruby On How to make instance variab...

by Fabien Jakimowicz, July 31, 2008 13:33 Star_fullStar_fullStar_fullStar_full

You can use a before filter...

Be1e3ee645d23c95ba650c21bc885927 Talk
1
2
3
4
class MyaccountController < ApplicationController

  before_filter load_users, :only => [ :account_details, :show_email_box, :show_mobile_box ]
...

Ruby On How to make instance variab...

by rafeco, July 31, 2008 13:31

You could create a before_f...

Df2e97f18b5802e199d4920552a52d34 Talk

Ruby On Exercise: Deaf Grandma

by Wolfbyte, July 31, 2008 12:55

@houston b-g - You are corr...

861f311cc4a077c439099d0e5d251e73 Talk

PHP On Object with Field names as ...

by Ishkur, July 31, 2008 06:45

Going with that the previou...

6dc0e9a07bcff97ac9b111f36e12f1f6 Talk

Bash On Memory usage script

by JonM1827, July 31, 2008 04:32

Thanks a lot for the sugges...

Fcd45b7de93cc8fa417fa43426973e06 Talk