This file contains hidden or 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 = function() {} | |
function () {} | |
> print(a) | |
function () {} | |
> b = function(){} | |
function (){} | |
> b.prototype = a | |
function () {} | |
> a.my_hi = function() { print('my_hi') } | |
function () { print('my_hi') } |
This file contains hidden or 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
.arm | |
.align | |
.global initSystem | |
.global main | |
.mdata: | |
@ 4bytes *8 | |
.word 0x4430 | |
.word 0x4430 | |
.word 0x4430 |
This file contains hidden or 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
o_o:~/ $ rvm info [15:00:39] | |
__rvm_rm_rf:local:2: path: can't assign initial value for array | |
system: | |
system: | |
uname: "Darwin nancydrew 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386 i386" | |
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)" | |
zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)" |
This file contains hidden or 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
.arm | |
.align | |
.global initSystem | |
.global main | |
initSystem: | |
bx lr | |
main: | |
mov r0,#0x04000000 @ I/O space offset |
This file contains hidden or 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
o_o:bunuq/ (master✗) $ vows test/unit/speak_to_test.js --spec | |
♢ SpeakTo | |
EVENT EMIT | |
no args | |
✓ nothing happens | |
no messages | |
✓ nothing happens | |
EVENT EMIT | |
TOPIC |
This file contains hidden or 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
--- no-obsd Fri Dec 3 15:45:25 2010 | |
+++ with-obsd Fri Dec 3 15:44:13 2010 | |
@@ -42,6 +42,7 @@ | |
echo "Creating the group '$1'" | |
case "$os_type" in | |
+ "OpenBSD") groupadd "$rvm_group_name";; | |
"FreeBSD") pw groupadd -q "$rvm_group_name";; | |
"Linux") groupadd -f "$rvm_group_name";; | |
"Darwin") |
This file contains hidden or 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 MemoryWatch | |
attr_accessor :watch_string,:high_water_pids,:callback,:high_water_mb,:delay,:num_cycles,:num_over_marks,:pids | |
def initialize(options) | |
self.callback = options[:callback] || lambda {|pid| p pid} | |
self.watch_string = (options[:watch] || "this poem is a pomme").strip | |
self.delay = options[:delay] || 60 | |
self.num_cycles = options[:num_cycles] || 3 | |
self.num_over_marks = options[:num_over_marks] || 2 | |
self.high_water_mb = options[:high_water_mb] || 700 | |
self.high_water_pids = {} |
This file contains hidden or 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
require 'test/unit' | |
require 'rubygems' | |
require 'wrong' | |
require 'wrong/adapters/test_unit' | |
require 'memory_watch' | |
class MemoryWatchTest < Test::Unit::TestCase | |
def test_watches_self | |
cmd = %q{ruby memory_watch.rb --delay 999999 --num_cycles 9900000099} | |
pid = fork { %x{#{cmd}} } | |
Process.detach(pid) |
This file contains hidden or 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
test "has one user status" do | |
r = make_review_with_book | |
assert { | |
r.user_status == nil | |
} | |
us = UserStatus.make(:user => r.user, :book => r.book) | |
assert { | |
r.user_status.user == r.user | |
} | |
us2 = UserStatus.make(:user => r.user, :book => r.book) |
This file contains hidden or 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
test "has one user status" do | |
r = make_review_with_book | |
assert { | |
r.user_status == nil | |
} | |
us = UserStatus.make(:user => r.user, :book => r.book) | |
assert { | |
r.user_status.user == r.user | |
} | |
us2 = UserStatus.make(:user => r.user, :book => r.book) |