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
-- output 2 | |
module TestHash where | |
import GHC.Int | |
import Data.HashTable as HashTable | |
import Data.Maybe as Maybe | |
hash :: IO (HashTable Int32 Int32) | |
hash = new (==) id |
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
implicit def envToTreeMap(env: Env) = env.map | |
abstract class Val | |
case class Num(n: Int) extends Val | |
case class Cls(f: Val => Val) extends Val | |
case object Err extends Val | |
abstract class Expr | |
case class Lit( n: Int) extends Expr |
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
// https://scripting.dev.java.net/servlets/ProjectDocumentList | |
// javac JRuby.java | |
// java -cp .:jruby-engine.jar:jruby.jar JRuby rloader.rb Loader # => 40 | |
// java -cp .:jruby-engine.jar:jruby.jar JRuby rloader.rb Loader2 # => 80 | |
import javax.script.ScriptContext; | |
import javax.script.ScriptEngine; | |
import javax.script.ScriptEngineManager; | |
import javax.script.ScriptException; |
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
the intro of computer programming | |
瘛箄��餉蝔� | |
2009-09-15 till 2009-09-20 | |
�� 摨� | |
0. �桃� | |
���啣神�祆�憭扯銝�銝�����嗆�銝虫��臬����摮詻�蝣箏�摰儔嚗� | |
銋��仿���閬牧�镼輯�銝�敺�蝘飛�極蝔��舀摮詻��舀�閮勗���嚗� | |
��憭�撠�摮詻����飛��祆�敹蛛�雿撠�嚗悅撠犖撠�衣�撘� |
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
#!/bin/sh | |
gem install rake | |
rake app:install | |
./start.sh |
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
From 10b0c3e55b93eced792af87abfeef3aba2039134 Mon Sep 17 00:00:00 2001 | |
From: Lin Jen-Shin <[email protected]> | |
Date: Fri, 11 Dec 2009 11:49:08 +0800 | |
Subject: [PATCH] [rakelib/vm.rake] ruby 1.9 compatibility, due to Array#to_s semantic change | |
--- | |
rakelib/vm.rake | 2 +- | |
1 files changed, 1 insertions(+), 1 deletions(-) | |
diff --git a/rakelib/vm.rake b/rakelib/vm.rake |
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
require 'aasm' | |
class Cat | |
include AASM | |
attr_writer :stomach | |
# how would you like to read the state? | |
# database? memcache? | |
def aasm_read_state |
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
Function.prototype.curry = function(){ | |
var slice = Array.prototype.slice, | |
args = slice.apply(arguments), | |
that = this | |
return function(){ | |
var aa = args.concat(slice.apply(arguments)) | |
if(that.arity == aa.length) | |
return that.apply(null, aa) | |
else |
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://github.com/cardinalblue/rest-graph | |
# in controller: | |
def rest_graph_log duration, url | |
logger.debug("DEBUG: RestGraph: spent #{duration} requesting #{url}") | |
end | |
# and use this to enable logging: | |
def rest_graph_create | |
@rg = RestGraph.new(:error_handler => method(:rest_graph_authorize), |
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
// clang -emit-llvm -c -o shuffle.bc shuffle.c | |
// llvm-dis < shuffle.bc | less | |
// llc -march=c -o shuffle.cbe.c shuffle.bc | |
// clang -emit-llvm -c -o shuffle.cbe.bc shuffle.cbe.c | |
// llvm-dis < shuffle.cbe.bc | less | |
// llc -march=c -o shuffle.cbe.cbe.c shuffle.cbe.bc | |
// wdiff -w (set_color red) -x (set_color normal) -y (set_color green) -z (set_color normal) shuffle.cbe.c shuffle.cbe.cbe.c | less --raw | |
#include <stdio.h> |