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 blocks, array syntax, loops, arrays
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 () {
...
List<String> content = resource.getContent(ArrayList.class);
Java Type Safety
by https://www.google.com/accounts/o8/id?id=AItOawnvtFGh-r9ibK5ZHTYiZh2UzxDww7-bwI0,
January 25, 2012 07:44,
No refactoring
Is there a way to make this...
if $0 == __FILE__
total = 0
...
Ruby Euler Problem 2 solution
by https://www.google.com/accounts/o8/id?id=AItOawkD4xFlDWBQgag82x1DXUSXIYd_s8Ca8B4,
January 24, 2012 18:43,
3 refactorings
Sorry if I shouldn't be pos...
package BST; import exceptions.DuplicateItemException; ...
Java first BST
by orangelight.myopenid.com,
January 18, 2012 14:13,
5 refactorings
hi,
so i'm still a new p...
<?php $location = htmlspecialchars($_SERVER['HTTP_REFERER']); $email = strtolower(mysql_real_escape_string($_REQUEST['email'])); ...
PHP php refactoring
by openid.aol.com/zaknaji,
January 15, 2012 23:31,
8 refactorings
Just completed this a week ...
// First layer initialization with OpenLayers (removed 2 through 6 for cleanliness... but they are hii_2, hii_3,...,hii_6)
hii_1 = new OpenLayers.Layer.MapServer("Land Cover","../../cgi-bin/mapserv.exe",{
map:'C:/ms4w/Apache/htdocs/hii/hii_landcover.map'},{
...
JavaScript Multiple jQuery Sliders &am...
by https://www.google.com/accounts/o8/id?id=AItOawkpq_fK9eTyv4kT_L9oOdZmIj8FDIXXM58,
January 13, 2012 22:18,
3 refactorings, tagged with OpenLayers, jQuery
I am having trouble refacto...
When /^I request test urls with headers "([^"]*)" "([^"]*)"$/ do |accept, headers|
header_map = create_header_map_from_string(headers)
test_urls = load_fixture("test-urls1.txt")
...
Ruby Looping over a file
by https://www.google.com/accounts/o8/id?id=AItOawnvtFGh-r9ibK5ZHTYiZh2UzxDww7-bwI0,
January 11, 2012 09:15,
1 refactoring
The puts doesn't happen unt...
v
PHP Templating Engine
by https://www.google.com/accounts/o8/id?id=AItOawmqeWYiB7S-kJBQrA90kF0hQwFF-sWnQfI,
January 10, 2012 17:13,
1 refactoring, tagged with engine, templating, php
gdg
</head>
<body>
<% ra...
#include <stdio.h> int main () ...
C Test
by https://www.google.com/accounts/o8/id?id=AItOawkZuzVMryYKOU8sDRj12k_5P2R4U4Yf5Rw,
January 10, 2012 00:58,
1 refactoring
It is just for Test.
public void setPageOption(String key, String value){
if (key==null) return;
Boolean boolValue = value==null? null: "true".equals(value);
...
Java Too many if statements
by https://www.google.com/accounts/o8/id?id=AItOawnvtFGh-r9ibK5ZHTYiZh2UzxDww7-bwI0,
January 04, 2012 03:17,
5 refactorings
Too many if statements. Wan...
from itertools import product def breadth_first_product(*args): """Works like itertools.product but iterates "breadth first". ...
Python Breadth first cartesian pro...
by abrakadabra42.myopenid.com,
January 02, 2012 17:28,
17 refactorings, tagged with iterators, cartesian product
There must be an easier way...
# Example Solution A :: longer, uses 1 fewer process
curl -s -i http://git.io -F "url=$URL" | awk '/Location: /{print x=$2}END{exit!x}'
...
Bash git.io data filter with pro...
Is there an awesomer shorte...
# Start of file, showing the name of the application # Size, and all relevent parts of the title ...
Ruby Address Book
by https://www.google.com/accounts/o8/id?id=AItOawkiJON4MFJ9bopD8IvwQ1pbpH3ag7yrtnI,
December 28, 2011 07:36,
5 refactorings, tagged with methods, regexp, regular expression, ruby
This is a fairly simple add...
if(Mouse.isButtonDown(0))
{
if((x > 2 + dragAmtX) && (x < 2 + width + dragAmtX) && (y > 60 + dragAmtY) && (y < 60 + height + dragAmtY))
...
Java Draggable Box
by https://www.google.com/accounts/o8/id?id=AItOawmst0sW9xXK8PoImFIqsiW5GmqKEarDFMo,
December 23, 2011 11:14,
1 refactoring, tagged with click, mouse, draggable, game, box, drag
Hey.
I've been trying to m...
package templates.processing; /** ...
Java A template processor
by https://me.yahoo.com/a/UxwSweltzI.mL3Ern1_X5ctF3TgdC9M0VFPJD2fC3Q--,
December 23, 2011 08:06,
3 refactorings
I think this can be made mu...
class Competitor
{
public $CompetitorID;
...
PHP Make a repository DRYer
I need suggestions on how t...
ALPHA = ('a'..'z').to_a
def nextAlpha letter
...
Ruby String Incrementing
by caustic-interface.myopenid.com,
December 20, 2011 18:24,
11 refactorings
It's intended to increment ...
protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
GWportalDataContext db = new GWportalDataContext();
...
C# Refactor LINQ queries
by klim8d.myopenid.com,
December 19, 2011 04:39,
4 refactorings, tagged with LINQ speed C# asp.net performance
Hello, my other thread went...
protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
GWportalDataContext db = new GWportalDataContext();
...
C# Refactor LINQ selection
I hope someone could refact...
#imported modules import os import random ...
Python final course program
by ruok1212.myopenid.com,
December 14, 2011 17:35,
3 refactorings
I cant get my program to wo...
SELECT p.pid, p.filename, AVG(v.vote) as avgv, COUNT(v.vote) as avgc FROM wp_ngg_pictures p LEFT JOIN wp_nggv_votes v ON (p.pid = v.pid) ...
PHP SQL Query Optimization
by https://www.google.com/accounts/o8/id?id=AItOawmyRuor7Z0aC0QytK3lMrz5h5jH73-dECw,
December 13, 2011 21:03,
3 refactorings, tagged with optimization, speed, sql
This SQL query is currently...
Public Sub advanceperiod()
If currentgamerow.period < 3 Then
currentgamerow.period = currentgamerow.period + 1
...
VB.NET needs better workflow proce...
by TK3,
December 13, 2011 20:36,
2 refactorings
Should I be using a state m...
def battle # do something if result=self.save ...
Ruby Unnecessary assignment near...
by https://www.google.com/accounts/o8/id?id=AItOawldXGtOvAVQC5k5Z7Y71zO75UzIQ98K5a0,
December 12, 2011 07:36,
5 refactorings, tagged with observers, return
It feels like the assignmen...
>> %w(Pending Processing Executed Canceled).each_with_index.map {|v, i| i}
=> [0, 1, 2, 3]
Ruby Get array of indexes from g...
Using it :in validates_incl...
x should be ["a","c","e"] i...