1
2
3
4
var hash = new String(document.location).indexOf("#");
if(hash > 0)
{
...

JavaScript Small Javascript Code

by openid.aol.com/aviewanew, October 06, 2008 01:20, 6 refactorings, tagged with ajax, javascript, history

It's for detecting if you'r...

Avatar Talk
1
2
3
4
#include <iostream.h>

int main() {
...

C++ Simple For Loop

by goodespeler.myopenid.com, October 06, 2008 23:10, 4 refactorings

Can someone check my for lo...

B04f7f475867f6b47a59b49dfabc0daf Talk
1
2
3
Declare @Index varchar(128)
...

C# Drop all Indexes in SQL Server

by GateKiller, October 07, 2008 10:48, 3 refactorings, tagged with sql, Index

The below is some code I re...

98c852e2d9b26249745ea92c72964d3f Talk
1
2
3
4
def perm(ni):
    result = []
    
...

Python Permutation of values

by Auron, October 07, 2008 12:18, 3 refactorings, tagged with recursion, lists

Boys and girls, it's time t...

C2953d47b6de83f3217b48c3584fab1c Talk
1
2
3
4
#controller  
def search
    if params[:search]
...

Ruby Search with fulltext, ago-c...

by papricek.myopenid.com, October 07, 2008 12:52, 3 refactorings

How would you make this cod...

B04a553de1b8b45433b841bba440cc42 Talk
1
2
3
4
#include <iostream.h>
#include <stdlib.h>
#include <math.h>
...

C++ Prime or Not

by goodespeler.myopenid.com, October 08, 2008 12:38, 3 refactorings, tagged with Prime Numbers

This is a simple program to...

B04f7f475867f6b47a59b49dfabc0daf Talk
1
2
3
4
  def translation_links
    lang = [
      %w[en english us], 
...

Ruby nested array to set of html...

by seaofclouds, October 09, 2008 07:51, 2 refactorings, tagged with ruby, array, hash, translation

i have a simple array that ...

F55e8e113669f6ea7d1d99f38907ce54 Talk
1
2
3
4
def writefile(file, *linedata)
	linedata.each do |line| 	
		file << line.join(",") + "\n"
...

Ruby Parsing non-delimited text

by thepanu, October 06, 2008 07:48, 1 refactoring, tagged with parsing, non-delimited, regexp, csv

I have large text-reports f...

98edd841bbc19903cd758722d9745f0b Talk
1
2
3
4
Q = jQuery.noConflict();

Q(document).ready(function(){
...

JavaScript Toggle "Check all / Un...

by chovy.myopenid.com, October 06, 2008 20:16, 1 refactoring, tagged with javascript html jquery toggler

I have a simple toggler to ...

035687df00d162cec025302373ebc076 Talk
1
2
3
4
class SearchNestedHashByValue
  def key_for(h, str, trail=[])
    h.each_pair do |k, v|
...

Ruby Search nested hash

by jnstq, October 07, 2008 21:47, 1 refactoring, tagged with i18n

Search nested hash on their...

A4d90c6fe98bfe0b491c277c3e687031 Talk
1
2
3
4
WEEKDAYS = %w(mon tue wed thu fri sat sun)

dates = [
...

Ruby Open hours grouping

by Dmitry Polushkin, October 08, 2008 09:13, 1 refactoring, tagged with grouping, hours, weekdays

Actually I really don't kno...

832ed6ace46d61032151f4e1864c057f Talk
1
2
3
4
setDefaults = Behavior.create({
  initialize: function(obj) {
    myforms = this.element;    
...

JavaScript Highlight Selected forms, S...

by openid.aol.com/forwardfootmedia, October 10, 2008 01:49, 1 refactoring, tagged with prototype, lowpro, Ruby on Rails, javascript

The script binds itself to ...

Fbb264f64b4ce69bae04764280141faf Talk
1
2
3
4
#!/bin/ruby

characters_to_use="ABCD"
...

Ruby brute-force password cracker

by Nathan, October 10, 2008 22:29, 1 refactoring, tagged with password, brute-force, crack, combination, permutation

Just a quick-and-dirty for ...

D5145c421cd25af6fa577c15219add90 Talk
1
2
3
4
def redirect_to_current_user
  if params[:id] != current_user.login
    if params[:action] == "show"
...

Ruby Before Filter URL Redirect ...

by TimK, September 30, 2008 00:18, 5 refactorings, tagged with rails

I'm using to_param to pass ...

2722012beb9afcad75df5c9f2229fd8c Talk
1
2
3
4
$LETTER = Hash[*%w/
A .- N -.
B -... O ---
...

Ruby Morse Code Encoder/Decoder

by Druwerd, September 29, 2008 05:21, 4 refactorings, tagged with morse code

I'm trying to improve my Ru...

6ae6663a1fc5b44960f27be9d4a6f19c Talk
1
2
3
4
define("MAX_INFO_SIZE",500);
define("MAX_DATA_SIZE",100000);
define("MAX_THUMBNAIL_SIZE",10000);
...

PHP file upload validation

by lajos, October 02, 2008 04:52, 3 refactorings, tagged with upload, validation

This function validates fil...

Avatar Talk
1
2
3
4
#!/usr/bin/python

import socket,time
...

Python Connection Detection script

by matthew.scouten.myopenid.com, October 02, 2008 01:06, 1 refactoring, tagged with short python sockets

This is a Quick and Dirty s...

Avatar Talk
1
2
3
4
public static void Capitalize()
{
    TextInfo oTextInfo = CultureInfo.CurrentCulture.TextInfo;
...

C# Capitalize directory name w...

by Moonshield, October 02, 2008 01:31, No refactoring, tagged with C#, LINQ, Capitalize, Directory

I wrote a method to capital...

72f36daa501cf8f5bb861210edd9232d Talk
1
2
3
4
FIELDS = [ 'first', 'last',      'band' ]
DATA   = [['Kurt',  'Cobain',    'Nirvana'],
          ['Jimi',  'Page',      'Led Zeppelin'],
...

Ruby Map fields array and data a...

by charlesroper, September 22, 2008 15:23, 9 refactorings, tagged with array, hash

First posting here. I just ...

93fc84c261cdce2e2f1d64c8e531ecb7 Talk
1
2
3
4
  
  #
  # Convert a string to CamelCase.
...

Ruby Camelize

by Tj Holowaychuk, September 22, 2008 15:38, 7 refactorings, tagged with camelcase

I am pretty new to Ruby (on...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
  #
  # Format filesize.
  #
...

Ruby Format Filesize

by Tj Holowaychuk, September 22, 2008 15:40, 3 refactorings, tagged with filesize format

Ruby-newb coming through. I...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
module CLI
  class Session 
    
...

Ruby Interactive CLI Session

by Tj Holowaychuk, September 23, 2008 16:06, 3 refactorings, tagged with cli shell

Again I am a Ruby newb (two...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
function amortization_array($principal, $interest_rate, $start_year, $start_month, $term, $group_by = 'M, Y', $month_names){
	$periods  = $term * 12;
	$balance  = $principal;
...

PHP Mortgage Calculator

by jcapote, September 24, 2008 23:27, 3 refactorings

How would you refactor this...

9dc24638923a6aee9fd3571c14f01066 Talk
1
2
3
4
        Private Function fIsAppRunning() As Boolean
            'Looks to see if Lotus Notes is open

...

VB.NET Remove the Evil GOTO

by hcase, September 25, 2008 00:43, 3 refactorings, tagged with goto, evil, vb, lotus notes

This horrible code I inheri...

9f4136a119aa096b3b4faf1c33a7e08e Talk
1
2
3
4
#!/usr/bin/env ruby

# == Synopsis
...

Ruby Source code analysis

by Tj Holowaychuk, September 26, 2008 03:04, 3 refactorings

Small class to analyze scri...

F1e3ab214a976a39cfd713bc93deb10f Talk