# chip away at the bonuses play through amounts
bet_through_credit_remaining = self.wager
self.user.bonuses.ranked.each do |bonus|
...
Ruby apply a credit over an orde...
by philrosenstein.myopenid.com,
October 21, 2011 15:14,
15 refactorings, tagged with rails, activerecord, array, 2.3.x
example: if the credit is ...
a = {}
a["test"] = [] if a["test"].nil?
a["test"] << 5
Ruby Fill Array or create it
How can I write this in a c...
input = [9,9,9,9,9,9,9,9,9,9,9,9] input.uniq == 9 ...
Ruby Test if array contains the ...
by astropanic.myopenid.com,
May 23, 2011 07:50,
11 refactorings, tagged with speed, array, uniqueness
How I can check all element...
a = ["a", "b", "c", "d"] b = [1, 0, 0, 1] ...
Ruby Reject and merge two arrays
I want to collect all the e...
def disease_search(query)
treatment_results = Array.new
symptom_results = Array.new
...
Ruby Messy Blocks
by https://www.google.com/accounts/o8/id?id=AItOawncqSogDKAQLilNnxoB32ZKr-9LXu8x3WA,
April 06, 2011 02:50,
6 refactorings, tagged with array, rails activerecord, blocks
This is a really ugly metho...
def disease_search(query)
treatment_results = Array.new
symptom_results = Array.new
...
Ruby Messy Blocks
by https://www.google.com/accounts/o8/id?id=AItOawncqSogDKAQLilNnxoB32ZKr-9LXu8x3WA,
April 06, 2011 02:50,
4 refactorings, tagged with array, rails activerecord, blocks
This is a really ugly metho...
# http://www.ruby-forum.com/topic/163649 class Array ...
Ruby Randomized array pairs to s...
The purpose of this code is...
openid_mapping = {
:email => ["email", "http://axschema.org/contact/email"],
:name => ["fullname", "http://axschema.org/namePerson"]
...
Ruby Hash + Array refactor
by Oriol,
August 19, 2010 17:56,
29 refactorings, tagged with ruby, hash, array, openid, sreg, axschema
This actually works but I w...
<?php
public function get_usd_value($date)
{
...
PHP What is bad in this code?
by https://www.google.com/accounts/o8/id?id=AItOawk89fkb9x-moiNmY07jOpKHwIT1tUTiK6M,
August 17, 2010 15:53,
2 refactorings, tagged with php, array, array string loop each
I know that variable naming...
def array_to_params(param_name, params)
unless params.is_a?(Array)
result = "&#{param_name}[0]=#{params}"
...
Ruby Generate post query for array
I need to post some array u...
grouped = [] arr = [#<Foo id: 1, status_id: 2, profile_id: 3>,#<Foo id: 2, status_id: 2, profile_id: 3>,#<Foo id: 3, status_id: 1, profile_id: 3>] arr_copy = arr ...
Ruby group objects in array
I'm looking for an optimal ...
void freeArray(int **a, int m) {
int i;
for (i = 0; i < m; ++i) {
...
C Freeing memory of a Multidi...
Is this the correct way to ...
User has_many Students Student has_one ReportCard ReportCard has_many Metrics ...
Ruby Ruby - Chained collect stat...
Is there a better way to do...
y_max = 10 arr_data.each do |arr| ...
Ruby 2D array manipulation
by asmega.myopenid.com,
September 12, 2009 13:10,
1 refactoring, tagged with ruby, iterate, array, each, if, break, first
an array within array itera...
tmp = reply.case.users.map(&:email)
tmp.delete(reply.created_by.email)
tmp.join(',')
...
Ruby Remove element from array
by serek.openid.pl,
September 03, 2009 12:12,
3 refactorings, tagged with array, remove, remove element from array
I wanted to remove specific...
/** * Generates a multi-column table from an array * ...
PHP Generate table from array
This function generates a m...
def self.all_leaves
leaves = []
Category.roots.each do |category|
...
Ruby array iteration
i dont find a better way to...
class Array # does a kind of ZIP compression for integer arrays # examples: ...
Ruby compressing an array of int...
I've written a small method...
procedure CopyIntoArray(var DestArray: Array of Byte; SourceArray: Array of Byte; StartIndex: integer); var i: integer; ...
Delphi Array Helper Functions
To get this Section started...
$(document).ready(function(){
// get the text file to be parsed
$.get('test-data.txt', function(textData){
...
JavaScript Split text into unordered l...
Using jQuery, I'm trying to...
# sum an an array's elements def sum_row(a) sum = 0 ...
Ruby Conditionally deleting colu...
I needed to read in a CSV f...
Hi.
I want to get the ar...