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
class H | |
def [](k) k end | |
def []=(k, v) [k, v] end | |
end | |
a = H.new | |
a[123] = 2 | |
p (a[123] += 2) | |
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
%w{a b}.each do |name| | |
File.open(name,'w') do |f| | |
10000.times {|n| f.puts n } | |
end | |
end | |
a = File.open('a') | |
b = File.open('b') | |
a.reopen(b) | |
a.gets | |
a.reopen(b) |
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
a = File.open('a') | |
b = File.open('b') | |
a.reopen(b) | |
a.gets | |
a.reopen(b) | |
p a.gets |
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
/* 'Alnum': [[:Alnum:]] */ | |
static const OnigCodePoint CR_Alnum[] = { | |
471, | |
0x0030, 0x0039, | |
0x0041, 0x005a, | |
0x0061, 0x007a, | |
0x00aa, 0x00aa, | |
0x00b5, 0x00b5, | |
0x00ba, 0x00ba, |
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
/* 'C': Major Category */ | |
static const OnigCodePoint CR_C[] = { | |
25, | |
000000, 0x001f, | |
0x007f, 0x009f, | |
0x00ad, 0x00ad, | |
0x0600, 0x0603, | |
0x06dd, 0x06dd, | |
0x070f, 0x070f, | |
0x17b4, 0x17b5, |
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
/* 'C': Major Category */ | |
static const OnigCodePoint CR_C[] = { | |
25, | |
000000, 0x001f, | |
0x007f, 0x009f, | |
0x00ad, 0x00ad, | |
0x0600, 0x0603, | |
0x06dd, 0x06dd, | |
0x070f, 0x070f, |
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
class Object | |
def backtrace | |
Backtrace.new | |
end | |
end | |
class Backtrace | |
class Line | |
attr_reader :file, :line, :name | |
def initialize(line) |
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 47db9f7a55d8f938648c5751c0092cd3c2ae9558 Mon Sep 17 00:00:00 2001 | |
From: Run Paint Run Run <runrun@runpaint.org> | |
Date: Wed, 5 Aug 2009 06:45:31 +0100 | |
Subject: [PATCH] unicode.c: Add U+2064 (INVISIBLE PLUS) to Cf category | |
--- | |
enc/unicode.c | 30 ++++++++++++++++-------------- | |
1 files changed, 16 insertions(+), 14 deletions(-) | |
diff --git a/enc/unicode.c b/enc/unicode.c |
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
h = {'foo' => 'bar'} | |
h.compare_by_identity | |
p h.compare_by_identity? #=> true | |
h['foo'] = 'glark' | |
p h #=> {"foo"=>"bar", "foo"=>"glark"} | |
j = h.dup | |
p j #=> {"foo"=>"glark"} | |
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
doc(String, :slice, :[]) do | |
<<EOF | |
(Fixnum offset) => String or nil | |
Returns a substring of one character from _offset_. If _offset_ is | |
negative it's counted from the end of _self_. Returns _nil_ if _offset_ | |
falls outside of _self_. | |
NewerOlder