1 2 3 4
openid_mapping = { :email => ["email", "http://axschema.org/contact/email"], :name => ["fullname", "http://axschema.org/namePerson"] ...
1 2 3 4
# Initial attributes Hash # attributes = { ...
Ruby Ruby Hash Extraction Using ...
by notbrain.myopenid.com,
February 24, 2010 23:13,
7 refactorings, tagged with ruby, rails, regex, hash, block
I'm looking for a better wa...
1 2 3 4
#include <stdio.h> #include <stdint.h> #include <stdlib.h> ...
C Simple SHA Hashing
Dear All, I'm a new C progr...
1 2 3 4
pages.keys.each do |k| logger.debug "Pages for #{k} channel:" ...
Ruby Can this be less clunky?
"pages" is a Hash and conta...
1 2 3
so whats so magical about this Hash?
...
Ruby Magical Hash
by michal.hantl.myopenid.com,
October 08, 2009 07:32,
8 refactorings, tagged with ruby, hash, nested hash
Yesterday i wrote this neat...
1 2 3 4
def get_roles() roles = [] store = {} ...
Ruby Loop through Activerecord r...
by jeremypeterson.myopenid.com,
September 30, 2009 13:40,
1 refactoring, tagged with rails, hash, total values
I have a Contributor and Pr...
1 2 3 4
# call-seq: # StatisticsUtils.merge_sum(hash1, hash2, ...) -> merged_hash # ...
Ruby Total the values in multipl...
This is obviously not very ...
1 2 3 4
require 'hpricot' class Parser ...
Ruby Create a Hash from XML usin...
With ruby you could use REX...
1 2 3 4
s = "The green hat is the twin of the green hat" h = Hash.new(0) s.split.each do |w| ...
Ruby Count words in a string
This is a coding question I...
1 2 3 4
class Array def to_h hash = {} ...
Ruby Conversion from the 2d arra...
Conversion from the 2d arra...
1 2 3 4
def translation_links lang = [ %w[en english us], ...
Ruby nested array to set of html...
i have a simple array that ...
1 2 3 4
FIELDS = [ 'first', 'last', 'band' ] DATA = [['Kurt', 'Cobain', 'Nirvana'], ['Jimi', 'Page', 'Led Zeppelin'], ...
Ruby Map fields array and data a...
First posting here. I just ...
1 2 3 4
#!/usr/bin/python # -*- coding: utf-8 -*- ...
Python Base64 image encoding and i...
Is this a correct a way to ...
1 2 3 4
pools = {1 => [1,2,3], 2=> [3,4,5], 3=> [5,6,7]} intersection = [] pools.each do |k,v| ...
Ruby Find the Intersection of Ar...
Find the intersection of ar...
1 2 3 4
times.each do |time| events.each do |event| if time.strftime("%I:%M %p") == event.datetime.strftime("%I:%M %p") ...
Ruby two for loops cleanup?
times is an array of dateti...
1 2 3 4
module Keys_to_Meths def method_missing(meth, *args) if meth.to_s[-1] == 61 #if last char is an equal sign ...
Ruby Hash.keys_to_attr
/no comment/
>_>
1 2 3 4
require 'net/http' require 'rubygems' require 'xmlsimple' ...
Ruby Parsing XML from a Web Service
I'm working with a web serv...
1 2 3 4
require 'erb' # GOAL: render the template with the following vars ...
Ruby Given a hash of variables, ...
by mislav,
April 12, 2008 15:12,
3 refactorings, tagged with erb, singleton, metaclass, metaprogramming, hash, render
This works. Now, is there a...
1 2 3 4
class Hash def fetch_all(key) results = [] ...
Ruby Recursive Hash#fetch
I wanted a Hash#fetch that ...
1 2 3 4
<table class="charge"> <tr> <td colspan="100%" class="mainHeader"><%=@label.label%></td> ...
Ruby Iterating through a nested ...
by mwilliams,
January 31, 2008 18:21,
2 refactorings, tagged with rails, view, table, hash, nested hash, iterator, iterate, ruby, Ruby on Rails
Good afternoon. I have a n...
This actually works but I w...