Skip to content

Instantly share code, notes, and snippets.

this program counts the letter
>,[>+++++
+++[-<------
--- ---
>]<
->+
<[>-<[-]]>[
<<+>>[-]]<,][
-]+ +++
++[- <++
@mernen
mernen / rake vm:test on Ubuntu 8.04 32-bit
Created August 7, 2008 14:25
Rubinius/cpp: rake vm:test on Ubuntu 8.04 32-bit
(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
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"
(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’
# 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
@mernen
mernen / gist:39566
Created December 24, 2008 02:30
bashrc: colored and fairly compact PS1, and title
# 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"'
;;
*)
@mernen
mernen / .bashrc
Created January 15, 2009 00:41 — forked from henrik/.bashrc
Slightly optimized version, and with niftier branch indicator
# 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 {
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
@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:])
module Foo
BAZ = 100
module Bar
def self.baz
BAZ
end
end
end
puts Foo::Bar.baz