def check_condition(condition, item)
    case condition.attribute
    when :author
...

Ruby avoiding extended case stat...

by blueblank.myopenid.com, March 15, 2012 07:07, 3 refactorings, tagged with ruby, case statement

I want to avoid extending t...

55502f40dc8b7c769880b10874abc9d0 Talk
/* user properties */
var url = "zingmw";
/* user properties end */
...

JavaScript Zing JS with AJAX requests

by https://www.google.com/accounts/o8/id?id=AItOawlqFL8_2UJb8WgR5uKKAHl4uXBvgRVIslY, March 15, 2012 06:08, 2 refactorings, tagged with ajax, interface, facade

The script is included in p...

55502f40dc8b7c769880b10874abc9d0 Talk
#include <stdio.h>
	#include <stdlib.h>
	#include <string.h>
...

C Linux Shell

by https://www.google.com/accounts/o8/id?id=AItOawlNfH_H9Dh2QVh-Bdy_aEjJwD8hgAyN1ZE, March 14, 2012 21:39, 1 refactoring, tagged with linux c

This is for a class. I have...

55502f40dc8b7c769880b10874abc9d0 Talk
internal static class PasswordSaltAndHash
    {
        
...

C# password salt and hash

by https://www.google.com/accounts/o8/id?id=AItOawkvSzcZPVNSb5mjYOwoEqyN3vwh1shcI84, March 13, 2012 15:08, 8 refactorings, tagged with encryption, database, security, password, salt and hash

Is this valid and secure to...

55502f40dc8b7c769880b10874abc9d0 Talk
# Calculate the financial year, with the supplied date
  def get_financial_year(opts={})
    date = opts[:date].is_a?(Date)? opts[:date] : Time.now.to_date
...

Ruby Getting financial year

by https://www.google.com/accounts/o8/id?id=AItOawkXhagloEt9LaGYb5TnfYmraHmMC8fzlsE, March 12, 2012 22:47, 6 refactorings, tagged with rails, ruby, date

I'm trying to get the finan...

6b0e4504e14e6b9e239ffd1dc20f301c Talk
var Controller, Core, Model, Model_Event, View, Controller_Index,
  __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
  __hasProp = Object.prototype.hasOwnProperty,
...

JavaScript One Page Application

by derpderpdan, March 09, 2012 17:32, 2 refactorings, tagged with mvc, coffeescript, one page

I've recently been developi...

Ab42b02b7a759747b8f7d3bb8f176905 Talk
puts "is fruit" if (ARGV.first == 'apple') or (ARGV.first == 'banana')

Ruby conditional with many options

by https://www.google.com/accounts/o8/id?id=AItOawmZJnddTlys_mqBLOfhHu5DhAYubKj1EwY, March 07, 2012 23:00, 3 refactorings, tagged with conditionals options ruby-1.9.2

Is it not possible to write...

55502f40dc8b7c769880b10874abc9d0 Talk
This is the Python code:

def paths_rec(path,edges):
...

Python Validating a small code fro...

by melsi-habipi.myopenid.com, March 05, 2012 02:38, 2 refactorings, tagged with python php graph theory

Hello,

I have written a ...

55502f40dc8b7c769880b10874abc9d0 Talk
//actual code
if(strpos($name, 'is') === 0)
{
...

PHP Substring based on found st...

by Marco, March 01, 2012 07:28, 6 refactorings, tagged with substr php

Ok so this code removes is ...

B0c81d05e92e904579972029b750f9b9 Talk
if current_user.requested_friends.exists?(params[:friend_id]) or current_user.pending_friends.exists?(params[:friend_id]) or current_user.friends.exists?(params[:friend_id])

Ruby If statement with many OR o...

by https://me.yahoo.com/a/hrHoLLx8w4O8IV2uFy1jAKJ7B702_qruWPI-, February 21, 2012 14:01, 8 refactorings, tagged with ruby, rack

I would like to refactor th...

55502f40dc8b7c769880b10874abc9d0 Talk
$target.hasClass('widgettitle') ||
     $target.hasClass('ui-icon-minus') ||
          $target.hasClass('ui-icon-plus') ? actionOptions['toggleWidgetContent']() :
...

JavaScript Can this be improved?

by https://www.google.com/accounts/o8/id?id=AItOawmrAARXAU70eBdo7cU4o7zzc2MFl1jwFnc, February 17, 2012 15:23, 4 refactorings, tagged with javascript, jquery, jquery ui

I'm wondering if this compa...

55502f40dc8b7c769880b10874abc9d0 Talk
def fetch(subjects = current_subjects, queue = QUEUES)
      subjects.each do |s|
...

Ruby three into one

by blueblank.myopenid.com, February 15, 2012 14:11, 7 refactorings, tagged with ruby

I want to turn these three ...

55502f40dc8b7c769880b10874abc9d0 Talk
def test_condition(condition, item, test_item)
  case condition.query 
...

Ruby One or two methods?

by blueblank.myopenid.com, February 13, 2012 14:33, 3 refactorings, tagged with ruby methods

Help me improve this, it wo...

55502f40dc8b7c769880b10874abc9d0 Talk
import sys,functools

def multi_triggered(contat,lamb):
...

Python multi triggered decorator

by https://www.google.com/accounts/o8/id?id=AItOawmTNf4OM_K2oKIswc_Gh7lbXIlIGDi0Piw, February 13, 2012 07:40, No refactoring, tagged with decorator, triggered

Implements a parametric dec...

55502f40dc8b7c769880b10874abc9d0 Talk
const int MAX_PARTICLES = 16;
const int MAX_PARTICLE_SPEED = 3;
const int PARTICLE_FRAMES = 120;
...

C Simple Particle Engine for ...

by https://www.google.com/accounts/o8/id?id=AItOawl3BeAhTXKYDpKI7ld64fgVwaukoKGEuUo, February 08, 2012 21:55, 5 refactorings, tagged with game, C, struct

This took several hours ove...

55502f40dc8b7c769880b10874abc9d0 Talk
/*	SNAKE.C
 *	by plehw
 *	Feb 12
...

C Snake / Nibbles clone in C ...

by plewh, February 08, 2012 02:05, 7 refactorings, tagged with c, snake, ncurses

Self taught coder looking f...

8365bdc327827e53dd6abfb772db5320 Talk
@all_brands = Brand.find(:all).map(&:name).sort_by{|x| (-1)*x.id.length} 
    @line_items = LineItem.find(:all) # I cannot use database filter by brand here (NOSQL DB)
    @all_brands.each_with_index do |brand, ind|
...

Ruby Please improve

by https://www.google.com/accounts/o8/id?id=AItOawlHZN6xya-P41xmvSHLey27wdmmgvG24aM, February 08, 2012 01:11, 5 refactorings, tagged with ruby

In this piece of code I ass...

55502f40dc8b7c769880b10874abc9d0 Talk
-------
#shplaying.php file

...

PHP Parsing of XML data has hig...

by mattlax.myopenid.com, February 04, 2012 19:32, 6 refactorings, tagged with speed, php, curl, cpu, debug

This script simply retrieve...

Bdcc24a6af71061f368915bb415644c7 Talk
var MyNamespace = MyNamespace  || {};
MyNamespace.BingMap = {
    BingMapCredentials: 'xxxxxxxxx', // should be a default setting (null)
...

JavaScript Convert simple Javascript t...

by Chase Florell, February 04, 2012 09:12, 3 refactorings, tagged with javascript, jquery, bing maps

I've been working on a simp...

D41d8cd98f00b204e9800998ecf8427e Talk
class Company
  has_many :stores
end
...

Ruby Active Record getting uniqu...

by kibyegn.myopenid.com, February 03, 2012 01:40, 1 refactoring, tagged with rails, short clean ruby, active record

I still think I could make ...

6d071ab3b1a56ebe43df404356331163 Talk
layouts = Dir.glob("_layouts/*")
layouts.each do |layout|
  layout.gsub!(/^_layouts\/(.*)\..*$/, '\1')
...

Ruby List the files in a directo...

by Aziz Light, February 01, 2012 08:46, 4 refactorings, tagged with ruby, ruby1.9

The title says it all, I'm ...

D69bd6b89f0c9204eed89de9d7ee4632 Talk
Weeks = [["2012-01-15","2012-01-22"], ["2012-01-22","2012-01-29"], ["2012-01-29","2012-02-05"],["2012-02-05","2012-02-12"], ["2012-02-12","2012-02-19"], ["2012-02-19","2012-02-26"]]  

...

Ruby clean the code

by https://www.google.com/accounts/o8/id?id=AItOawlaTnwjQ00W1XCRaUEGIonvKgruTMebfak, January 30, 2012 03:54, 4 refactorings, tagged with ruby, rails 3

Plz help me clean the code
...

55502f40dc8b7c769880b10874abc9d0 Talk
Favour specialises in Affordable OHS Software, Recruitment Management & HR Software. We provide solutions to your OH&S and Human Resources functionality and capabilities. Visit us today to see how we can help you!

Bash ohs system, recruitment sof...

by bookerbrinley.myopenid.com, January 28, 2012 04:46, No refactoring, tagged with HR Software, OHS Software, OH&S Software, Recruitment Software, Human Resources Software, OHS System

Favour specialises in Affor...

A28e9a9bc86debda0d12ef97933de3d1 Talk
M = [["a", "b"], ["c", "d"], ["e", "f"]]

x = []
...

Ruby Array parsing in a block

by https://www.google.com/accounts/o8/id?id=AItOawmWMRp7fAci9domcwhxD3fNikoTak9bkYc, January 26, 2012 05:59, 1 refactoring, tagged with arrays, blocks, loops, array syntax

x should be ["a","c","e"] i...

55502f40dc8b7c769880b10874abc9d0 Talk
var spanish = ["arbol", "casa", "el", "la", "quintas", "es", "verde", "y", "roja"];
var english = ["tree", "house", "the", "the", "crack", "is", "green", "and", "red"];
var traductor = function () {
...

JavaScript Learning JS

by claimid.com/ompemi, January 25, 2012 11:43, 5 refactorings

that's it

55502f40dc8b7c769880b10874abc9d0 Talk