1
2
3
4
require 'rubygems'
require 'linguistics'

...

Ruby On Displaying numbers to words.

by ytse.myopenid.com, November 27, 2008 17:18

Done ...cheers

Ea0b4e0dce47a1d4bba05b1bdffdc2d7 Talk
1
1.upto(1_000_000) { |number| puts Linguistics::EN.numwords(number) }

Ruby On Displaying numbers to words.

by Adam, November 27, 2008 17:13

You want to print numbers f...

A8d3f35baafdaea851914b17dae9e1fc Talk
1
2
3
4
require 'rubygems'
require 'linguistics'

...

Ruby On Displaying numbers to words.

by ytse.myopenid.com, November 27, 2008 17:10

Yes this is prety much what...

Ea0b4e0dce47a1d4bba05b1bdffdc2d7 Talk
1
2
3
4
# http://www.deveiate.org/projects/Linguistics/
require 'linguistics'

...

Ruby On Displaying numbers to words.

by Adam, November 27, 2008 15:42
A8d3f35baafdaea851914b17dae9e1fc Talk
1
2
3
4
name = 'nicholas'
(1..10).each { |i| puts i,name }

...

Ruby On Ruby simple loop

by Nicholas, November 27, 2008 10:54
88d5b5bbfe4d0f1b3eee552d7852b3c6 Talk
1
named_scope :with_description, :conditions => "description IS NOT NULL and description NOT REGEXP '[[:blank:]]'

Ruby On Doing a 'blank?' in named_s...

by kivanio, November 26, 2008 19:45

maybe work.

33f343b266312d482c1ec35785d18df3 Talk
1
2
3
def row(&block)
  tag :div, capture(&block), :class => 'row'
end

Ruby On Cheap ruby block templating

by Alistair, November 24, 2008 10:54

Nice Adam. I'm ended up usi...

95d8510ef03567cd7d014d4790116b0d Talk
1
2
3
def field_row(&block)
  content_tag(:div, :class => :field_row, &block)
end

Ruby On Cheap ruby block templating

by Adam, November 24, 2008 04:38
A8d3f35baafdaea851914b17dae9e1fc Talk

Ruby On Cheap ruby block templating

by Jeff Berg, November 22, 2008 17:38

I believe it is the same no...

33763c130a29de64914e684ded67f02f Talk

Ruby On Cheap ruby block templating

by Alistair, November 22, 2008 17:34

That's cool thanks. I was p...

95d8510ef03567cd7d014d4790116b0d Talk
1
2
3
4
  def label_block(caption)
    concat("<label>")
    concat("<span>#{caption}</span>")
...

Ruby On Cheap ruby block templating

by Jeff Berg, November 22, 2008 17:29 Star_fullStar_fullStar_fullStar_full

That is the best way unless...

33763c130a29de64914e684ded67f02f Talk

Ruby On Bindings on caller

by Tj Holowaychuk, November 22, 2008 15:48

Cool thanks! not overly pra...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
def capitalize_args(bind)
  eval("local_variables", bind).each do |var|
    var = eval(var, bind)
...

Ruby On Bindings on caller

by tmpr, November 22, 2008 11:12
Avatar Talk
1
/^(?!www\.)(?:\w+\.)*example\.com$/

Ruby On Shortest regular expression...

by Daniel Schierbeck, November 21, 2008 12:17 Star_fullStar_fullStar_fullStar_fullStar_full

This ought to do it.

5da4c52f43677f395aff5bde775593c2 Talk
1
2
3
4
require 'uri'

module URI
...

Ruby On Shortest regular expression...

by Tj Holowaychuk, November 21, 2008 07:53 Star_full

I would maybe consider exte...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
module NameAssociation
  def self.extended(object)
    object.instance_eval(<<-EOS, '(__NAME_ASSOCIATION__)', 1)
...

Ruby On Similar virtual attributes ...

by Adam, November 21, 2008 06:12
A8d3f35baafdaea851914b17dae9e1fc Talk
1
2
3
4
module ChildAccessor
  def attr_child_accessor(obj,attr_name)
    child_name = obj.name.downcase
...

Ruby On Similar virtual attributes ...

by Josh N, November 21, 2008 05:55

removed string based class_...

60888d58de3bf08cbc0c73e67fd6fd86 Talk
1
2
3
4
class SchoolYear < ActiveRecord::Base
  has_many :semesters
end
...

Ruby On Arrays, loops, strings...

by Adam, November 21, 2008 05:23

I get the feeling you would...

A8d3f35baafdaea851914b17dae9e1fc Talk
1
2
3
4
results = %w[first second third forth].map do |semester|
  (1..5).map {|n| "pdp_#{semester}_semesters.objetive_#{n} AS #{semester}_objetive_#{n}"}
end
...

Ruby On Arrays, loops, strings...

by Josh N, November 21, 2008 04:34 Star_fullStar_fullStar_fullStar_full

Putting it on one line whil...

60888d58de3bf08cbc0c73e67fd6fd86 Talk
1
2
3
4
# a module that code gens the attributes
module ChildAccessor
  def attr_child_accessor(obj,attr_name)
...

Ruby On Similar virtual attributes ...

by Josh N, November 21, 2008 03:08

This solution may be overki...

60888d58de3bf08cbc0c73e67fd6fd86 Talk

Ruby On Arrays, loops, strings...

by Ceritium, November 20, 2008 22:11

testing...

7841fbf022cfe78bff34942b50c483e1 Talk
1
2
3
  LETTERS = ('A'..'Z').entries + ['All']
...

Ruby On Creating an alphabetic for ...

by starshine, November 20, 2008 17:17

Thanks so much for this! I ...

Avatar Talk
1
2
3
4
class Publication < ActiveRecord::Base

  def publisher_name
...

Ruby On Similar virtual attributes ...

by Spreelanka, November 20, 2008 15:12

no doubt there is a better ...

Avatar Talk
1
/(?<part>(w(?!ww)|w(?=[a-z0-9]{3,})|[a-vx-z0-9])[a-z0-9]*)\.example\.com/

Ruby On Shortest regular expression...

by troethom, November 19, 2008 18:58

Did a little logical thinki...

628b75cc5fce9ab14d9e8584a0b3681c Talk
1
2
3
4
require File.dirname(__FILE__) + '/memcached'

class Object
...

Ruby On Caching Methods

by Tj Holowaychuk, November 19, 2008 18:11

Added transparent hard cach...

F1e3ab214a976a39cfd713bc93deb10f Talk