1
2
3
4
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, 3 refactorings, tagged with ruby, hash, array, openid, sreg, axschema

This actually works but I w...

E4679be8d7d2484f9c0b8c4df71f4d2a Talk
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...

Avatar Talk
1
2
3
4
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
...

C Simple SHA Hashing

by mdw7.blogspot.com, December 11, 2009 15:38, 1 refactoring, tagged with hash, c, SHA1, 5 bit

Dear All, I'm a new C progr...

Avatar Talk
1
2
3
4
pages.keys.each do |k|

      logger.debug "Pages for #{k} channel:"
...

Ruby Can this be less clunky?

by bruno antunes, November 26, 2009 15:40, 4 refactorings, tagged with ruby, hash, find_all

"pages" is a Hash and conta...

1b491994d6011d720e332af6e1ffd03b Talk
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...

C2a5bc0633a2eef9274744bd273063a4 Talk
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...

Avatar Talk
1
2
3
4
  # call-seq:
  #   StatisticsUtils.merge_sum(hash1, hash2, ...) -> merged_hash
  #
...

Ruby Total the values in multipl...

by Trejkaz, July 08, 2009 00:54, 2 refactorings, tagged with short, hash, sum, merge

This is obviously not very ...

42b570f6f4312a872c2fc671e3ddc82b Talk
1
2
3
4
require 'hpricot'

class Parser
...

Ruby Create a Hash from XML usin...

by smacks, June 25, 2009 12:23, 1 refactoring, tagged with ruby, hpricot, xml, soap, hash

With ruby you could use REX...

34d2ae3f7fdcec853ec24cf85715da96 Talk
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

by andyjeffries, May 02, 2009 13:41, 16 refactorings, tagged with simple, hash, string strip

This is a coding question I...

5cb7a05b6de4a6655319db9333be429c Talk
1
2
3
4
class String
  def dasherize
...

Ruby Hash#switchify

by Tj Holowaychuk, April 08, 2009 21:26, 3 refactorings, tagged with hash, ruby, switch

Whipped this up really quic...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
class Array
  def to_h
    hash = {}
...

Ruby Conversion from the 2d arra...

by Dmitry Polushkin, October 22, 2008 09:11, 7 refactorings, tagged with 2d array, hash, convert

Conversion from the 2d arra...

832ed6ace46d61032151f4e1864c057f 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
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
#!/usr/bin/python
# -*- coding: utf-8 -*-

...

Python Base64 image encoding and i...

by kael, August 25, 2008 19:05, 2 refactorings, tagged with python, image, base64, hash, sha224

Is this a correct a way to ...

Ec5a58db4acc016568e0293d283cbc2d Talk
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...

by AviFlombaum, July 31, 2008 21:28, 13 refactorings, tagged with arrays, hash, intersection

Find the intersection of ar...

Fafb062f6e8c394dd6b0689c13db2b88 Talk
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?

by ttdavett.myopenid.com, July 31, 2008 00:11, 7 refactorings, tagged with rails, ruby, array, hash

times is an array of dateti...

F677fa685a2cfe8aff31f161062db3d3 Talk
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

by Ryguy, June 12, 2008 04:05, 3 refactorings, tagged with hash, methods

/no comment/

>_>

Ba665f86f90a1982af7b9c857418fcdb Talk
1
2
3
4
require 'net/http'
require 'rubygems'
require 'xmlsimple'
...

Ruby Parsing XML from a Web Service

by mwilliams, May 17, 2008 21:10, 3 refactorings, tagged with ruby, hash, xml, web, service

I'm working with a web serv...

4236ea6b84f4899b469e8edff4bf6d22 Talk
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...

8f93a872e399bc1353cc8d4e791d5401 Talk
1
2
3
4
class Hash
  def fetch_all(key)
    results = []
...

Ruby Recursive Hash#fetch

by Neo, March 12, 2008 14:05, 1 refactoring, tagged with nested hash, hash, fetch

I wanted a Hash#fetch that ...

E64b3f6a4b0bde29f654eca45fcbb20f Talk
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...

4236ea6b84f4899b469e8edff4bf6d22 Talk