Currently supports:
- Insertion (insert)
- Search (search, node)
- Printing (to_s)
git clone at:
http://github.com/giancarlo/algorithms.git
Please don't interrupt. Just sit back and listen.
http://github.com/giancarlo/algorithms.git
PJF.replace("h2");
PJF.replace("#topmenu UL > LI");
PJF.replace("h1", { size: 20, color: [255, 0, 0] });
source /opt/intel/Compiler/11.0/069/bin/iccvars.sh ia32icc -vicc with a configure script use ./configure CC=iccKernel.block_given? will tell you if a block was passed.
def test
a = 42
yield(a) if block_given?
end
yield or Proc.call like this:
def test(&block)
a = 42
yield(a) # or block.call(a,b)
end
yield calls and passes the arguments to the block.block.arity will tell you the number of arguments a block can accept
def recursive_function(&block)
# Do stuff
recursive_function(&block)
# pass to other functions accepting blocks
10.times &block # will run block 10 times
end
def bl(&block)
yield
end
def test
bl { return }
puts "Hello" # this will not be executed.
end
break to return a value inside a block and stop iterating.
def bl(&block)
(0..10).each &block
end
def test
# This block will stop iterating at 5 and return true.
bl { |x| (break true) if (x == 5); false }
end
<script language='javascript' src='http://www.url.com/Scripts/shCore.js'></script>
<script language='javascript'>
window.onload = function() {
dp.SyntaxHighlighter.ClipboardSwf = 'http://www.url.com/Scripts/clipboard.swf';
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
}
</script>
<link href='http://www.url.com/Styles/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/>
<pre name='code' class='language'>
code;
</pre>
<script language='javascript' src='http://www.url.com/Scripts/shBrushXml.js'></script>
.icon-name {
display: block; height: 32px; width: 32px;
background: transparent url(icon.png) -(x)px -(y)px no-repeat;
cursor: pointer;
}
Kernel.trap('INT') { code }hsetroot -fill ~/Desktop/desktop.jpg &
xcompmgr &
rxvt &
docker &URxvt*depth: 32
urxvt*background: rgba:0000/0000/0000/cccc
URxvt*background: rgba:0000/0000/0000/cccc
URxvt*foreground: green
set tabstop=2:wqCtrl+Q:tabe file # Opens File
:tabn # goes to next tab
:tabp # goes to previous tab
:q # closes current tab
gt # will take you to the next tab
gT # will take you to the previous tab
Ctrl+N Ctrl+P:grep args
:makeset background=dark # if your console background is dark..
syntax onset nusplit
vsplit # Vertical SplitCtrl+W+(direction)open fileclose/regex:number*
VALUE obj;
obj = rb_obj_alloc(Class); // Allocate space and create new instance
rb_obj_call_init(obj, 0, 0); // We call the initialize method for the object
VALUE rb_define_class("name", parent_class);
VALUE rb_define_class_under(module_or_class, "name", parent_class);
rb_define_method(class, "name", c_function, argc)
VALUE function( int argc, VALUE* args, VALUE instance );
VALUE function( VALUE instance, VALUE array_of_arguments);
rb_iv_get(instance, "variable");
rb_iv_set(instance, "variable", new_value);
rb_raise(exception_object, string_message);rb_eArgError
rb_eEOFError
rb_eException
rb_eFatal
rb_eFloatDomainError
rb_eIndexError
rb_eInterrupt
rb_eIOError
rb_eKeyError
rb_eLoadError
rb_eLocalJumpError
rb_eNameError
rb_eNoMemError
rb_eNoMethodError
rb_eNotImpError
rb_eRangeError
rb_eRegexpError
rb_eRuntimeError
rb_eScriptError
rb_eSecurityError
rb_eSignal
rb_eStandardError
rb_eStopIteration
rb_eSyntaxError
rb_eSysStackError
rb_eSystemCallError
rb_eSystemExit
rb_eThreadError
rb_eTypeError
rb_eZeroDivError