1
2
3
4
  def make_activation_code
    counter = 0
    loop do
...

Ruby restful_auth

by davidhq, May 13, 2008 22:00, 8 refactorings, tagged with restful authentication

make_activation_code and ma...

4057d36ea1505c263efbdbdc0bf511cd Talk
1
2
3
4
def save_feed  
  @feed = FeedTools::Feed.open('http://losangeles.craigslist.org/apa/index.rss')
     @feed.items.each_with_index do |item,i| 
...

Ruby RSS model method

by Deepak Gole, May 12, 2008 10:17, 2 refactorings, tagged with FeedTools

Its very simple method whic...

51224bdd17878b3b19e8987e9bb336a2 Talk
1
2
3
4
class WhoIsQuery
    query = ARGV[0]
    puts "Querying whois with #{query} ..."
...

Ruby Whois refactoring

by MexicanHacker, May 12, 2008 15:19, 1 refactoring, tagged with whois rubyize-this

I'm new to ruby and I make ...

7a1f5bc20a17bba473d54617d9893466 Talk
1
2
3
4
class Article < ActiveRecord::Base

  # Find all articles in the given date range based on the published_at field
...

Ruby Building a dynamic date range

by claytonlz, May 08, 2008 23:45, 2 refactorings, tagged with date range, date

I've got a route that handl...

E17d936d4535519716b6e810052feac5 Talk
1
2
3
4
using System;
using System.Collections.Generic;
using System.Linq;
...

C# Pointers in C#

by Andre Steenveld, May 06, 2008 10:39, 1 refactoring, tagged with Unsafe, C#, pointers, unmanaged

I am trying to work out how...

Avatar Talk
1
2
3
4
#!/bin/bash
for ((i=0;i<=17;i+=1))
         do
...

Bash For Loop using Awk

by roxannspencerolsen.blogspot.com, May 08, 2008 20:38, 1 refactoring

I an working on a script th...

Avatar Talk
1
2
3
4
import java.util.Scanner;

public class AsciiSquare
...

Java ascii square

by kefestetayyus.blogspot.com, May 09, 2008 12:44, No refactoring, tagged with java, ascii, square, basic

Simply prints a square with...

Avatar Talk
1
2
3
4
<% @purchase_order.grants.each do |grant| %>
  <table>  
    <tbody>
...

Ruby Please help me simplify thi...

by schof, May 01, 2008 14:04, No refactoring, tagged with ruby rails each loop

Is there a way in Ruby to p...

Cfaf074970ce958900608fceaac38543 Talk
1
2
3
4
/*
 *		Progetto di Grafica 2008 - Gnesa Gianni (Gnix)
 *
...

C Chair

by Gnix, May 02, 2008 10:08, No refactoring

This code draw a chair and ...

077b12f1039dceb830c2b83be8dcbd1b Talk
1
2
3
4
<?php
	function username($user_id = null) {

...

PHP get username from database

by Memf, April 26, 2008 16:49, 3 refactorings, tagged with php get username exists id

<?php

71367d98df2bf14cbf704e7741eb402d Talk
1
2
3
class UserMailer < ActionMailer::Base 
  def signup_notification(user)
...

Ruby before_filter in model???

by Jeaf, April 21, 2008 11:19, 2 refactorings, tagged with Ruby on Rails

I have to call the setup_em...

99b003c2a01aa0dc3b0fe7c5d72f56a0 Talk
1
2
3
4
class CampaignsController < ApplicationController
  before_filter :load_campaign_or_redirect, :except => [:index, :sent, :new, :queued, :create, :processing]

...

Ruby Step-REST uuuuugly controller

by Pożycz Badge, April 23, 2008 16:01, 2 refactorings

Proably it's possible to cl...

Avatar Talk
1
2
3
4
n=16
s="1"
s1=""
...

Ruby Verber's puzzle

by timurv, April 22, 2008 08:51, 1 refactoring, tagged with verber

1
11
21
1211
111221
31...

E775d684d712540a4b76849b3026e70f Talk
1
2
3
4
class VotingSystem  
  #Hello, I am Rodger the old and unhappy programmer. the variable nbrOfVotes is an array of 2 dimensions. The first dimension contains the number of votes for the answer "YES, IT SUCKS"... and the other dimension contain the number of votes for the answer "NO, IT DOESN'T SUCK". In the near future there will be other possible answers... but I don't care! I retire in 2 days!
  @@nbrOfVotes = Array.new
...

Ruby Rubyize this : 6th edition

by FrankLamontagne, April 17, 2008 00:20, 8 refactorings, tagged with rubyize-this, ruby, fun

Ouch... this guy badly need...

364d0e86994a268906392f6b6146af38 Talk
1
2
3
4
   def self.valid?(key)
       h=find_by_key(key)
 
...

Ruby Better Nest Ifs

by pcorral.myopenid.com, April 13, 2008 03:02, 6 refactorings

Any idea about better code?

82c793022ec1bce6ea7573bc27b2340b Talk
1
2
3
4
def hashify(object_array)
		h = Hash.new
		object_array.each do |x|
...

Ruby Less typing same functionality

by lusis.myopenid.com, April 09, 2008 16:40, 4 refactorings, tagged with ruby nagios

I know this can be done but...

Avatar Talk
1
2
3
4
require 'erb'

# GOAL: render the template with the following vars
...

Ruby Given a hash of variables, ...

by mislav, April 12, 2008 15:12, 3 refactorings, tagged with erb, singleton, metaclass, metaprogramming, hash, render

This works. Now, is there a...

8f93a872e399bc1353cc8d4e791d5401 Talk
1
2
3
4
   def assigned_to_id=(user_id)
     if user_id == ""
       if self.ticket_assigment != nil-
...

Ruby WTF

by prekitt.myopenid.com, April 09, 2008 19:56, 1 refactoring, tagged with Ruby on rails activerecord

There's got to be a better ...

477f578e4349b6022de8517f8457a650 Talk
1
2
3
4
<?php
if (count($argv) != 3)
	die("Usage: $argv[0] <RSS feed URL> <output dir>\n");	
...

PHP Download all audio enclosur...

by hubfactor, April 11, 2008 20:48, No refactoring, tagged with php, rss, simplexml, curl, xpath

Given an RSS feed and an ou...

Ed9c50a6db8b5e078b5ef84306a8477c Talk
1
2
3
4
void CopySourceTables(List<TableNameResult> tables, int id)
{
    // Execute the "Copy" Command on the Server for Each Table.
...

C# Common StProc Code

by robzyc, April 02, 2008 12:53, 8 refactorings, tagged with C#

Hi guys, following my previ...

Ff95c7c3ca3d629881699497de8fd99e Talk
1
2
3
4
bool Do_People_Still_Read_This
{
     // Not sure what to put here? "return true;" or "return false;" ?
...

C# Since I Cannot Message Peop...

by robzyc, March 31, 2008 11:03, 4 refactorings, tagged with question

Didn't/couldn't see how to ...

Ff95c7c3ca3d629881699497de8fd99e Talk
1
2
3
class Race < ActiveRecord::Base
  
...

Ruby Help generating abbreviatio...

by Michael Filbin, April 06, 2008 16:16, 2 refactorings, tagged with abbreviation, string, model, attribute

Hi all,

I am attempting ...

14b8667b3bdf64068647b96c26001e0d Talk
1
2
3
4
class JobBoard < ActiveRecord::Base
  has_many :job_board_postings
  
...

Ruby Ruby has_finder on has_many ?

by danielharan, April 01, 2008 16:10, 1 refactoring, tagged with has_finder rails

This smells... one of the m...

880cbab435f00197613c9cc2065b4f5a Talk
1
2
3
4
from random import random as _
eval(compile("\n".join(
	["(lambda %s:" % (chr((121 - ((25 - (ord("z") - y)))))) 
...

Python Random number generator

by dbr, April 02, 2008 10:11, 1 refactoring, tagged with random, number

It works okay, but I think ...

Efdad317c297a2aee89ef435995dbdb6 Talk
1
2
3
4
require 'benchmark' 

def euler_chain_size(start)
...

Ruby Euler 14

by Jeff, April 04, 2008 00:30, 1 refactoring, tagged with Euler14

The problem description is ...

196b781eef85b7ce609fd12234cc1f39 Talk