This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 641e1e0bebdea1cf5ad4e156afe0ecb6a91241c4 Mon Sep 17 00:00:00 2001 | |
From: Mike Dalessio <mike@csa.net> | |
Date: Fri, 13 May 2011 08:53:49 -0400 | |
Subject: [PATCH] Test for table join across databases (connections). | |
--- | |
.../test/cases/associations/join_model_test.rb | 11 +++++++++++ | |
1 files changed, 11 insertions(+), 0 deletions(-) | |
diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------- ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux] ---------- | |
# --- | |
# warnings: [] | |
# | |
# ruby: | |
# engine: mri | |
# version: 1.8.7 | |
# platform: x86_64-linux | |
# libxml: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user system total real | |
json 3.260000 0.030000 3.290000 ( 3.320897) | |
xml (noko-dom) 21.080000 0.040000 21.120000 ( 21.412431) | |
xml (via Nokogiri DOM parsing) came in at only 6.4x slower than JSON. | |
codes at https://github.com/flavorjones/fairy-wing-throwdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define session-ruby | |
source ~/.gdb/session-ruby | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Tired of Rails constructing SQL queries to keep loading the same | |
# small set of records over and over again? | |
# | |
# Well, cache those records in memory using ActiveHash! | |
# * https://github.com/zilkey/active_hash | |
# | |
require 'active_record' | |
require 'active_hash' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo: foo.o | |
$(CC) foo.o -g -o foo -lxml2 | |
foo.o: foo.c | |
$(CC) foo.c -g -Wall -c -o foo.o -I/usr/include/libxml2 | |
clean: | |
rm -f foo foo.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require 'rubygems' | |
require 'nokogiri' | |
html = "<html><body><div>hello</div></body></html>" | |
doc = Nokogiri::HTML html | |
div = doc.at_css "div" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# String Encoding, Nokogiri and You: A Primer | |
## First: A Few Thing To Consider | |
1. It is common for HTML pages to declare | |
1. Without information instructing it differently, Nokogiri's core library ([libxml2][]) will | |
[libxml2]: http://xmlsoft.org/ | |
[meta-bug]: https://bugzilla.gnome.org/show_bug.cgi?id=579317 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require "rubygems" | |
gem "faker" | |
gem "sqlite3-ruby" | |
gem "hitimes" | |
require "fileutils" | |
require "sqlite3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xml file: | |
--- | |
<match> | |
<id>1053</id> | |
<name>Южная Африка - Мексика</name> | |
<start>2010-06-11 18:00:00</start> | |
<status>finished</status> | |
<stage>Групповой этап</stage> | |
<stadium>Соккер Сити</stadium> | |
<judge>Равшан Ирматов</judge> |