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
<?php | |
error_reporting(E_ALL); | |
define( '_JEXEC', 1 ); | |
define( 'JPATH_BASE', realpath(dirname(__FILE__) .'/' ) ); | |
define( 'DS', DIRECTORY_SEPARATOR ); | |
// PREPARE | |
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' ); |
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 GameState where | |
import qualified Control.Monad.State as ST | |
-- define our data structure w/o any special state information | |
data GameState = GameState { | |
gs_camera_x :: Float, | |
gs_camera_y :: Float, | |
gs_camera_z :: Float | |
} |
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
#lang racket | |
(define shapes '(((0 0) (0 110) (220 0 ) (220 110)) | |
((1 1) (1 111) (221 1 ) (221 111))) | |
) | |
(define (get-lines shape output) | |
;; do we have enough elements to build a pair? | |
(if (> (length shape) 1) | |
;; ... more than one element (build pair and recurse) |
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
(* | |
The following is an attempt at verifying Armstrong's axioms[1] of functional dependencies. | |
These include: Reflexivity, Transitivity, Augmentation, Union, Decomposition, and | |
Pseudotransitivity. These appear to hold, and should be considered valid axioms. | |
[1] http://en.wikipedia.org/wiki/Armstrong's_axioms | |
*) | |
Theorem dep_reflexivity : | |
forall a:Prop, |
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
<?php | |
class Matcher { | |
private $cases = array(); | |
function __construct($target, $source) { | |
$this->target = $target; | |
$this->source = $source; | |
} | |
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 Main where | |
import Control.Concurrent (forkIO, threadDelay) | |
import Control.Monad | |
-- from package "HTTP" | |
import Network.HTTP | |
import Network.HTTP.Headers | |
import Network.HTTP.Base |
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
<?php | |
/** Lambda abstraction */ | |
class Lambda | |
{ | |
function __construct($v, $body) { | |
$this->v = $v; | |
$this->body = $body; | |
} | |
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
/** Desc: Using Simpson's rule to calculate integrals in Scala. | |
* Date: March 11, 2013 | |
* Author: Garrett Bluma | |
*/ | |
object Simpson | |
{ | |
def sum(term:Double=>Double, a:Double, next:Double=>Double, b:Double):Double = | |
if (a > b) 0.0 | |
else term(a) + sum(term, next(a), next, b); |
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
/** Using Simpson's rule to calculate integrals in Felix | |
* Date: March 11, 2013 | |
* Author: Garrett Bluma | |
h/3 (y_0 + 4y_1 + 2y_2 + 4y_3 + 2y_4 + ... + 2y_{n-2} + 4y_{n-1} + y_n) | |
where h = (b - a)/n for some even integer n | |
y_k = f(a + kh) |
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
-- Using Simpson's rule to calculate integrals in Idris. | |
-- Date: March 11, 2013 | |
-- Author: Garrett Bluma | |
module Simpson | |
mysum : (Float -> Float) -> Float -> (Float -> Float) -> Float -> Float | |
mysum term a next b = | |
if (a > b) |