Skip to content

Instantly share code, notes, and snippets.

View godfat's full-sized avatar

Lin Jen-Shin (godfat) godfat

View GitHub Profile
-- 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
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
// 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;
the intro of computer programming
瘛箄��餉蝔�
2009-09-15 till 2009-09-20
�� 摨�
0. �桃�
���啣神�祆�憭扯銝�銝€�€����嗆�銝虫��臬����摮詻€�蝣箏�摰儔嚗�
銋��仿���閬牧�镼輯�銝�敺�蝘飛�極蝔€��舀摮詻€��舀�閮勗���嚗�
�€�憭�撠�摮詻€����飛��祆�敹蛛�雿撠€�嚗悅撠犖撠�衣�撘�
#!/bin/sh
gem install rake
rake app:install
./start.sh
From 10b0c3e55b93eced792af87abfeef3aba2039134 Mon Sep 17 00:00:00 2001
From: Lin Jen-Shin <godfat@godfat.org>
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
require 'aasm'
class Cat
include AASM
attr_writer :stomach
# how would you like to read the state?
# database? memcache?
def aasm_read_state
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
# 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),
// 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>