1
2
3
4
module Enumerable
  # Sorts the enumeration by mapping the
  # values in the enumeration through the given block.
...

Ruby sort_by_multiple

by Sporkmonger, September 05, 2008 13:11, 12 refactorings, tagged with speed, sorting

require "benchmark"
data_s...

56ee28134dd0776825445e3551979b14 Talk
1
2
3
feed = RssParser.run("http://ws.audioscrobbler.com/1.0/user/me/recenttracks.rss")
  song1 = feed[:items][0][:title]
...

Ruby Think this needs a loop

by juo100@gmail.com, September 06, 2008 19:54, 3 refactorings, tagged with ruby, loop, noob

Im new to Ruby, I think it ...

B543a43dc8cb0aae562278484db60d25 Talk
1
2
3
4
	function create_link($string) {

		$input = media_title($string);
...

PHP Prepare links - friendly URLs

by Memf, September 04, 2008 05:57, 2 refactorings, tagged with php, short, friendly, friendly urls, url, URLs, prepare, code, memforis, function, memf, links, create link

Please help shorten the cod...

71367d98df2bf14cbf704e7741eb402d Talk
1
2
3
4
private string getMD5String(string PlainText)
{
   System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create();
...

C# Cryptography with MD5

by acidmind, September 01, 2008 13:19, 1 refactoring, tagged with MD5;C#;

This is a simple example of...

78f078ded4ae388e490c240c038c7f28 Talk
1
2
3
4
  def time_summary(klass,group_operator,field,from,to,step)
    data_with_missing_counts(klass.find(
      :all, 
...

Ruby Rails Active Record Time Su...

by sebastiana.myopenid.com, September 03, 2008 14:31, 1 refactoring, tagged with rails, chart, sumary

Give a count or sum group o...

Avatar Talk
1
2
3
import System.IO
import Data.Word
...

Haskell Raytracer in haskell

by jaggederest, September 01, 2008 21:23, No refactoring, tagged with haskell, raytracer, vector, linear algebra

This is my first serious ha...

69c54cc530fa953e144771c03eccc5a9 Talk
1
2
3
4
#!/usr/bin/ruby
DVD_SIZE=4294967296
CD_SIZE=734003200
...

Ruby DVD Directory Archiver

by seal-7.blogspot.com, September 03, 2008 14:26, No refactoring, tagged with bash, shell, spaghetti, monkey patch

Originally made to move cal...

Avatar Talk
1
2
3
4
class Planet(object):
	all = []
	@classmethod
...

Python Pythonify my code

by knutimus.myopenid.com, September 03, 2008 14:27, No refactoring, tagged with planet

The get method just doesn't...

Avatar Talk
1
2
3
4
-module(prime).
-export([main/0, print_if_prime/0]).

...

Erlang Experimental Prime Number G...

by evilteach.blogspot.com, September 03, 2008 14:28, No refactoring

I wrote this as an exercise...

0bd5c1d9900046057ef1a31a12734a3a Talk
1
2
3
4
def test_web_browser()
  if request.env["HTTP_USER_AGENT"][/Firefox\/3/]=="Firefox/3"
    return "Firefox3"
...

Ruby Code to detect the web browser

by dcadenas.blogspot.com, August 28, 2008 17:19, 16 refactorings

This is not my code but I w...

Acad2552784135c09b17c00853f5a6f8 Talk
1
2
3
4
data = data.gsub("\xA0", " ")
data = data.gsub("\x99", "(TM)")
data = data.gsub("\x97", "-")
...

Ruby simplify multiple gsub

by kenr, August 27, 2008 01:10, 11 refactorings, tagged with strings

I could put the search/repl...

60997be4fbb4f5719d6eb68a1eadee9a Talk
1
2
3
4
try:
    if options.input_file:
        infile = open(options.input_file, 'r')
...

Python Your average file filter...

by agnul, August 27, 2008 17:22, 4 refactorings

From the useless speculatio...

Ee62f45441fbf8409dfd4adaa40a74aa Talk
1
2
3
comment_type = translation.class.to_s == "Project" ? "project" : "header"
if comment = translation.find_comment_by_type(comment_type)
...

Ruby Too many assignments and co...

by vrish88, August 29, 2008 20:12, 4 refactorings, tagged with rails

This seems like a very long...

F7b2fe18bb8705a677051523cf62d30f Talk
1
2
3
4
desc 'Prints out the status codes and their named symbols. Limit by specifying `code=`, with one or more digits or with the start of a named code.'
task :status_codes do
  require 'action_controller/status_codes'
...

Ruby A Rails rake task to lookup...

by alloy, August 29, 2008 09:33, 3 refactorings, tagged with rails rake statuscodes

This is a rake task that wi...

Avatar Talk
1
2
3
4
using System.Security.Cryptography;

public class CryptographyRSA()
...

C# Cryptography with RSA and B...

by acidmind, August 29, 2008 12:20, 2 refactorings, tagged with Cryptography;RSA;Base64

This is a simple example of...

78f078ded4ae388e490c240c038c7f28 Talk
1
2
3
4
#!/usr/bin/python
# -*- coding: utf-8 -*-

...

Python Query TinyUrl the fastest way

by kael, August 25, 2008 18:44, No refactoring, tagged with python, http, tinyurl, urllib, urllib2

I'm looking for the fastest...

Ec5a58db4acc016568e0293d283cbc2d Talk
1
2
3
4
#!/usr/bin/python
# -*- coding: utf-8 -*-

...

Python Base64 image encoding and i...

by kael, August 25, 2008 19:05, No refactoring, tagged with python, image, base64, hash, sha224

Is this a correct a way to ...

Ec5a58db4acc016568e0293d283cbc2d Talk
1
2
3
4
#!/usr/bin/python
# -*- coding: utf-8 -*-

...

Python Parse XML from Yahoo weathe...

by kael, August 26, 2008 17:27, No refactoring, tagged with python, dom, xml, rss

Is there a more efficient w...

Ec5a58db4acc016568e0293d283cbc2d Talk
1
2
3
4
<?php
class PropertyHandler 
{
...

PHP Base class for easy class p...

by antelopelovefan.com/id, August 28, 2008 12:35, No refactoring, tagged with php class properties

This class lets you handle ...

040ffc7f3327b05f01c54a8bef3ba60a Talk
1
2
3
class Administration::ReportsController < Administration::HomeController
...

Ruby has_many :through collectio...

by kain, August 30, 2008 01:53, No refactoring, tagged with Ruby on Rails, rails, ruby, has many through

This is an attempt to make ...

25e782eb7e799e78d781b0026fc6a4d8 Talk
1
2
3
4
-module(prime).
-export([main/0, print_if_prime/0]).

...

Erlang Experimental Prime Number G...

by evilteach.blogspot.com, August 31, 2008 21:13, No refactoring, tagged with erlang, Prime Numbers

The is the results of an ex...

0bd5c1d9900046057ef1a31a12734a3a Talk
1
2
3
              <%if @user.city.blank?%>
...

Ruby Default value for user column

by DG, August 19, 2008 08:57, 5 refactorings

Hi,
- In users table city ...

51224bdd17878b3b19e8987e9bb336a2 Talk
1
2
3
4
def ask_words 
	array = []
	puts 'Enter words, blank row quits.'
...

Ruby Method for sorting

by onwinning.blogspot.com, August 19, 2008 17:14, 5 refactorings, tagged with noob, sorting, sort

This is exercise from Chris...

Avatar Talk
1
2
3
4
class Test
  @@tries=0
  attr_reader :num
...

Ruby Code transactions

by John Sietsma, August 20, 2008 07:14, 5 refactorings, tagged with transact, rails

In a Rails controller I'm s...

37ce1520d319fa8095d05aa475951616 Talk
1
2
3
<?php
function loadModel($model)
...

PHP model loader

by Ishkur, August 21, 2008 14:16, 5 refactorings, tagged with model loading

I'm doing a lot of work wit...

6dc0e9a07bcff97ac9b111f36e12f1f6 Talk