/^(\d[ -\.]?)?(\d{3}[ -\.]?)?\d{3}[ -\.]?\d{4}(x\d+)?$/

Ruby On Phone number regex

by halogenandtoast, October 31, 2008 18:07

Little less complex, same r...

B066cb3c505933f832faa83238489a89 Talk
Event.find(:all, :conditions =>
                    "(strftime('%m%d', 'now') between strftime('%m%d', starts_at) and strftime('%m%d', ends_at)) or (strftime('%m%d', ends_at) <= strftime('%m%d', starts_at))")

Ruby On Yearly recurring event

by halogenandtoast, October 30, 2008 19:45

This was a pain to figure o...

B066cb3c505933f832faa83238489a89 Talk

Ruby On Simplest way to find the na...

by halogenandtoast, October 28, 2008 21:40

Unfortunately, no. You may ...

B066cb3c505933f832faa83238489a89 Talk
import java.util.Scanner;
import java.util.Random;

...

Java On Guessing Game

by halogenandtoast, October 27, 2008 15:34

Reduced your code a bit, no...

B066cb3c505933f832faa83238489a89 Talk
<?php
function array_to_tablerows($ary, $max) {
	return empty($ary) ? null : "<tr>".implode("</tr><tr>", array_map(create_function('$a', 'return "<td>".implode("</td><td>", $a)."</td>".((count($a) % '.$max.' == 0) ? null : "<td colspan=\"".('.$max.' - count($a))."\">&nbsp;</td>");'), array_chunk($ary, $max)))."</tr>";
...

PHP On Array To Tablerows

by halogenandtoast, October 26, 2008 22:41 Star_fullStar_fullStar_full

Okay had to try and make a ...

B066cb3c505933f832faa83238489a89 Talk
<?php
function array_to_tablerows($ary, $max) { return array_create_table($ary, 0, $max); }
function array_create_table($ary, $idx, $max) {
...

PHP On Array To Tablerows

by halogenandtoast, October 26, 2008 21:03

Here is the shortest I coul...

B066cb3c505933f832faa83238489a89 Talk
class Person
  attr_reader :name, :children
  
...

Ruby On Person#children depth-first...

by halogenandtoast, October 23, 2008 00:39

slightly less bulky, looks ...

B066cb3c505933f832faa83238489a89 Talk