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
I hacked up methodmissing's promise to rename it to ExtPromise. Then I edited the benchmark program like so: | |
require "benchmark" | |
require "ext/promise/promise" | |
require "promise" | |
TESTS = 1000 | |
Benchmark.bmbm do |results| | |
# Picked inspect instead of undefined, as the pure-ruby promise will raise an | |
# exception on undefined instead of return the promise value |
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
ben:promising-future ben$ rake bench; rake1.9 bench; jrake bench | |
(in /Users/ben/Repos/promising-future) | |
Rehearsal ---------------------------------------------------------- | |
Nothing 0.000000 0.000000 0.000000 ( 0.004472) | |
Nothing(Promise) 0.010000 0.000000 0.010000 ( 0.009008) | |
Nothing(Future) 0.120000 0.050000 0.170000 ( 0.168207) | |
A method 0.000000 0.000000 0.000000 ( 0.005997) | |
A method(Promise) 0.010000 0.000000 0.010000 ( 0.012526) | |
A method(Future) 0.130000 0.040000 0.170000 ( 0.171445) | |
#== 0.000000 0.000000 0.000000 ( 0.004996) |
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
module SXP | |
module Grammar extend Parallax::Grammar | |
LPAREN = char('(') | |
RPAREN = char(')') | |
INTEGER = term(/^([+-]?\d+)/) { |s| s.to_i } | |
STRING = term(/^"([^"]+)"/) { |s| s } | |
SYMBOL = term(/^([\w\d_-]+)/) { |s| s.to_sym } | |
Atom = INTEGER | STRING | SYMBOL | |
List = LPAREN << +Atom >> RPAREN |
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
#!/usr/bin/env ruby -rubygems | |
# | |
# Simple Ruby interface for evaluating Common Lisp code, for use with RSpec. | |
# Written in August 2010 by Arto Bendiken <http://ar.to/> | |
# | |
# This is free and unencumbered software released into the public domain. | |
require 'open4' # `sudo gem install open4` | |
require 'sxp' # `sudo gem install sxp` |
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
UNLICENSE | |
---- | |
http://unlicense.org/ | |
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any |
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
#!/usr/bin/env ruby -rubygems | |
# | |
# Simple Ruby interface for evaluating Common Lisp code, for use with RSpec. | |
# Written in August 2010 by Arto Bendiken <http://ar.to/> | |
# | |
# This is free and unencumbered software released into the public domain. | |
require 'open4' # `sudo gem install open4` | |
require 'bert' | |
require 'bert/decode' |
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 File.join(File.dirname(__FILE__), 'spec_helper') | |
DAWG = RDF::Vocabulary.new('http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#') | |
MF = RDF::Vocabulary.new('http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#') | |
QT = RDF::Vocabulary.new('http://www.w3.org/2001/sw/DataAccess/tests/test-query#') | |
RS = RDF::Vocabulary.new('http://www.w3.org/2001/sw/DataAccess/tests/result-set#') | |
describe SPARQL::Grammar::Parser do | |
file = File.expand_path('./spec/dawg-test-suite/data-r2/manifest-syntax.ttl') | |
url = RDF::URI("file://#{file}") |
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
#!/usr/bin/env ruby1.9 | |
# local spira bug fix for bnode objects with Types::Any | |
$:.unshift '~/repos/spira/lib' | |
require 'spira' | |
require 'rdf/n3' | |
require 'rdf/isomorphic' | |
DAWG = RDF::Vocabulary.new('http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#') | |
MF = RDF::Vocabulary.new('http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#') | |
QT = RDF::Vocabulary.new('http://www.w3.org/2001/sw/DataAccess/tests/test-query#') |
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
* Demonic Noodles | |
* | |
* Author: Maciej Konieczny <[email protected]> | |
* Website: http://gist.github.com/639250 | |
* License: public domain <http://unlicense.org/> | |
* Background: My first Fortran program; written as a Programming | |
* Paradigms assignment. We were supposed to generate | |
* a creature picture in Fortran 77. | |
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
/* | |
filename: basic.css | |
http://unlicense.org/ | |
author: gregory tomlinson | |
*/ | |
*{ padding:0; margin:0; } | |
h1,h2,h3,h4,h5,h6,input,textarea,select,option, body { | |
font-family:Arial, sans-serif; |