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
this program counts the letter | |
>,[>+++++ | |
+++[-<------ | |
--- --- | |
>]< | |
->+ | |
<[>-<[-]]>[ | |
<<+>>[-]]<,][ | |
-]+ +++ | |
++[- <++ |
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
(in /home/daniel/Dev/rbx) | |
Running 472 tests...................................................... | |
In TestChannel::test_receive_causes_event_block: | |
./vm/test/test_channel.hpp:106: Error: Assertion failed: chan->waiting->empty_p() | |
........................................................................................................................................................................ | |
In TestInstructions::test_push_my_field: | |
vm/instructions.rb:659: Error: Expected (task->calculate_sp() == 0), found (1 != 0) | |
...................................................................................................... | |
In TestNativeFunction::test_find_symbol_in_library: | |
./vm/test/test_nativefunction.hpp:66: Error: Assertion failed: ep |
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
diff --git a/vm/profiler.cpp b/vm/profiler.cpp | |
index 17353d2..05b13b6 100644 | |
--- a/vm/profiler.cpp | |
+++ b/vm/profiler.cpp | |
@@ -19,8 +19,15 @@ | |
#else | |
-#define current_time() ((uint64_t)clock()) | |
-#define METHOD "clock" |
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
(in /home/daniel/Dev/rbx) | |
CC vm/primitives.cpp | |
In file included from vm/primitives.cpp:20: | |
vm/gen/primitives_glue.gen.cpp: In static member function ‘static bool rubinius::Primitives::accessvariable_allocate(rubinius::VM*, rubinius::Executable*, rubinius::Task*, rubinius::Message&)’: | |
vm/gen/primitives_glue.gen.cpp:17: error: jump to label ‘fail’ | |
vm/gen/primitives_glue.gen.cpp:10: error: from here | |
vm/gen/primitives_glue.gen.cpp:12: error: crosses initialization of ‘rubinius::MethodContext* current’ | |
vm/gen/primitives_glue.gen.cpp:17: error: jump to label ‘fail’ | |
vm/gen/primitives_glue.gen.cpp:4: error: from here | |
vm/gen/primitives_glue.gen.cpp:12: error: crosses initialization of ‘rubinius::MethodContext* current’ |
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
# Feeling Lispy? | |
number = 1234 | |
(def method_missing m ,s ,*a ,&b | |
(s.send m ,*a ,&b) end) | |
# Ruby 1.8.6 w/ ActiveSupport | |
(puts (reverse (join (collect (in_groups_of (reverse (Array (chars (String number)))) ,3) ,&:join) ,","))) | |
# Ruby 1.8.7+, no ActiveSupport dependency |
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
# colored prompt, with git support | |
PS1='\[\033[38m\]\u@\h \[\033[94m\]\W\[\033[95m\]$(__git_ps1)\[\033[37m\]$\[\033 | |
[00m\] ' | |
# If this is an xterm set the title to user@host:dir | |
case "$TERM" in | |
xterm*|rxvt*) | |
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%.local}: ${PWD/$HOME/~}\007"' | |
;; | |
*) |
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
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
function parse_git_dirty { | |
git diff --quiet HEAD &>/dev/null | |
[[ $? == 1 ]] && echo "*" | |
} | |
function parse_git_branch { |
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
def coerce_to_array(v) | |
if v.IS_A?(Array) # internal test, not #is_a? method call | |
v | |
elsif v.respond_to?(:to_ary) # replace with to_a for 1.9 | |
result = v.to_ary | |
if result.IS_A?(Array) | |
result | |
else | |
raise TypeError | |
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
@classmethod | |
def get_page(cls, app_id, bookmark=None): | |
pagesize = 15 | |
first_fetch = not bookmark | |
if first_fetch: | |
ascending = False | |
date = None | |
elif bookmark.startswith('-'): # we're moving backwards | |
ascending = False | |
date = str_to_date(bookmark[1:]) |
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
module Foo | |
BAZ = 100 | |
module Bar | |
def self.baz | |
BAZ | |
end | |
end | |
end | |
puts Foo::Bar.baz |
OlderNewer