Skip to content

Instantly share code, notes, and snippets.

@carlosgaldino
carlosgaldino / gist:3291725
Last active October 8, 2015 06:28
Topics: Blue pill x Red pill talk
** Execute vm/test/runner
Running 1 tasks using 3 parallel threads
1: GN vm/test/runner.cpp
1: CC vm/test/runner.cpp
In file included from vm/test/runner.cpp:3322:
./vm/test/test_pointer.hpp: In member function ‘void TestPointer::test_read_long()’:
./vm/test/test_pointer.hpp:89: error: no matching function for call to ‘rubinius::Pointer::read_long(rubinius::VM*&)’
vm/builtin/ffi_pointer.hpp:62: note: candidates are: rubinius::Integer* rubinius::Pointer::read_long(rubinius::VM*, rubinius::Object*)
./vm/test/test_pointer.hpp: In member function ‘void TestPointer::test_write_long()’:
./vm/test/test_pointer.hpp:97: error: no matching function for call to ‘rubinius::Pointer::read_long(rubinius::VM*&)’
set fuoptions=maxvert
function ToggleFullScreen()
if exists("s:old_columns")
set columns=s:old_columns
set nofu
unlet s:old_columns
else
let s:old_columns=&columns
set columns=84 fu
def flatten(arr)
out = []
arr.each do |a|
if a.is_a?(Array)
out += flatten(a)
else
out << a
end
end
# Este é um exemplo encontrado na última edição do Programming Ruby do Dave Thomas, página 53.
# testa o método que converte uma string em um array de palavras
def test_empty_string
assert_equal([], words_from_string(""))
assert_equal([], words_from_string(" "))
end
def test_single_word
assert_equal(["cat"], words_from_string("cat"))
@carlosgaldino
carlosgaldino / gist:11023688
Created April 18, 2014 03:35
type inference in haskell
lengthOf x
| length x == 0 = "0"
| otherwise = length x
{--
lengthOf.hs:3:17:
Couldn't match expected type `[Char]' with actual type `Int'
In the return type of a call of `length'
In the expression: length x
In an equation for `lengthOf':

Keybase proof

I hereby claim:

  • I am carlosgaldino on github.
  • I am carlosgaldino (https://keybase.io/carlosgaldino) on keybase.
  • I have a public key whose fingerprint is 761C C1E1 ED5E 9CE0 611D ECA8 24D3 CE8E 2906 1EF5

To claim this, I am signing this object: