Ruby On Cheap ruby block templating
by Alistair,
November 22, 2008 17:34
That's cool thanks. I was p...
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
That is the best way unless...
Ruby On Bindings on caller
by Tj Holowaychuk,
November 22, 2008 15:48
Cool thanks! not overly pra...
1 2 3 4
def capitalize_args(bind) eval("local_variables", bind).each do |var| var = eval(var, bind) ...
1
/^(?!www\.)(?:\w+\.)*example\.com$/
Ruby On Shortest regular expression...
by Daniel Schierbeck,
November 21, 2008 12:17
This ought to do it.
1 2 3 4
require 'uri' module URI ...
Ruby On Shortest regular expression...
by Tj Holowaychuk,
November 21, 2008 07:53
I would maybe consider exte...
1 2 3 4
module NameAssociation def self.extended(object) object.instance_eval(<<-EOS, '(__NAME_ASSOCIATION__)', 1) ...
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_...
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 ...
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...
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 ...
C# On Check type is XML Serializable
by sbehnke.myopenid.com,
November 20, 2008 16:22
That's an interesting use o...
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 ...
1 2 3 4
private static bool canBeXmlSerialized(object @object) { return @object is IXmlSerializable || @object.GetType().IsSerializable; ...
C# On Check type is XML Serializable
by Elij,
November 20, 2008 01:55
If you have an instance at ...
1 2 3 4
/* Lets say we have two numbers: 27 and 145 (just two random values) into two separate variable */ int min = 27; // 00011011 binary 8bit for 27 ...
C On How to find max, min of thr...
by Eineki,
November 20, 2008 00:52
It is quite simple, once yo...
C On How to find max, min of thr...
by Tien Dung,
November 20, 2008 00:01
Hi Eineki, please explain h...
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...

I believe it is the same no...