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://elm-lang.org/edit/examples/Reactive/Position.elm | |
//https://github.com/evancz/Elm/blob/master/elm/elm-runtime-0.7.2.js | |
try { | |
if (Elm.Main) throw new Error("Module name collision, 'Main' is already defined."); | |
Elm.Main = function () { | |
var $op = {}; | |
for (Elm['i'] in Elm) { | |
eval('var ' + Elm['i'] + '=Elm[Elm.i];'); | |
} |
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://groovy.codehaus.org/Using+the+Delegating+Meta+Class | |
Each groovy object has a metaClass that is used to manage the dynamic nature of the language. | |
This class intercepts calls to groovy objects to ensure that the appropriate grooviness can be added. | |
For example, when an object is constructed, the MetaClass's invokeConstructor()is called. | |
One feature of the invokeConstructor allows us to create groovy objects using a map argument | |
to set the properties of the object (new X([prop1: value1, prop2: value2])). | |
*/ |
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://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher | |
//https://twitter.com/r0aTzdg73QLawWw/status/290907958118842368 | |
//https://gist.github.com/1385585 | |
var vigenere = (function() { | |
var map = Array.prototype.map; | |
var canon = function(str){ return map.call(str.toUpperCase(),function(c){return c.charCodeAt(0)-65})} | |
return function(source, key) { | |
source = canon(source); | |
key = canon(key); |
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://download.dojotoolkit.org/release-1.0.3/dojo-release-1.0.3/dojo/_base/Deferred.js | |
// | |
// 02-Nov-2007 | |
// | |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
dojo.provide("dojo._base.Deferred"); | |
dojo.require("dojo._base.lang"); |
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
.text | |
.globl Main_init | |
.globl Int_init | |
.globl String_init | |
.globl Bool_init | |
.globl Main.main | |
Object_init: | |
addiu $sp $sp -12 | |
sw $fp 12($sp) | |
sw $s0 8($sp) |
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
-- example of static and dynamic type differing for a dispatch | |
Class Book inherits IO { | |
title : String; | |
author : String; | |
initBook(title_p : String, author_p : String) : Book { | |
{ | |
title <- title_p; | |
author <- author_p; |
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
# FrameBot del caller en fp | |
# self del caller en s0 | |
# ReturAddress en ra | |
# Argumento en sp + 1 | |
# Mediante prima nos referiremos a los valores del callee | |
Base.recite: | |
#Preparamos el Frame |
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
-- init-order-super.cl | |
-- Superclass attribute initializers must be evaluated before subclass | |
-- attribute initializers. | |
class Base inherits IO | |
{ | |
recite( value : Int ) : Object | |
{ | |
{ |
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
class SymbolTable { | |
private Stack tbl; | |
public SymbolTable() { tbl = new Stack();} | |
public void enterScope() { tbl.push(new Hashtable());} | |
public void exitScope() { | |
if (tbl.empty()) { Utilities.fatalError("existScope: can't remove scope from an empty symbol table.");} | |
tbl.pop(); |
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
{- This is mine -} | |
data Symbol = Symbol { id :: Int | |
, str :: String | |
} | |
data Program = Program { classes :: Classes} | |
data Class_ = Class_ { name :: Symbol | |
, parent :: Symbol |