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
.dynamic-toc > * { | |
margin-top: 0px; | |
margin-bottom: 0px; | |
} | |
.dynamic-toc > * br { | |
display: none; | |
} | |
.dynamic-toc > *:first-child { |
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
{-# LANGUAGE StandaloneDeriving, GeneralizedNewtypeDeriving #-} | |
module Map where | |
import Data.Functor.Compose | |
import Data.Monoid | |
import Prelude hiding (lookup) | |
newtype TMap k v = TMap (k -> v) |
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
;; F-Algebra recursion schemes: | |
(defprotocol Functor | |
"Functor" | |
(fmap [xs f])) | |
(defn cata [alg f] (alg (fmap f (partial cata alg)))) | |
(defn ana [coalg a] (fmap (coalg a) (partial ana coalg))) |
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
#include <iostream> | |
#include <functional> | |
#include <memory> | |
#include <assert.h> | |
// Based on Bartosz Milewski's immutable list class. | |
// http://bartoszmilewski.com/2013/11/13/functional-data-structures-in-c-lists/ | |
// Defined externally to List because it needs to be independent from the size parameter. | |
template <typename T> |
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
diffuseM :: Colour -> Material () (BSDF Colour) | |
diffuseM col = proc () -> do | |
out <- diffuse -< col -- Get diffuse shading | |
shad <- traceM <<< getInidentRay -< () -- Test path to light | |
returnA -< maybe holdout (\(_,_,_,e) -> if e then out else holdout) shad -- Set BSDF to black if in shadow |
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
\begin{landscape} | |
\begin{longtable}{|l|p{120pt}|p{120pt}|p{120pt}|p{120pt}|} | |
\caption{Functional Requirements} \\ | |
\hline | |
\textbf{ID} & \textbf{What} & \textbf{How} & \textbf{Test} & \textbf{Expected Result} \\ \hline | |
\endfirsthead | |
\multicolumn{4}{c}% | |
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\ | |
\hline | |
\textbf{ID} & \textbf{What} & \textbf{How} & \textbf{Test} & \textbf{Expected Result} \\ \hline |
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
trait Monoid { | |
static fn mempty() -> self; | |
fn mappend(other: self) -> self; | |
} | |
impl int: Monoid { | |
static fn mempty() -> int { 0 } | |
fn mappend(other: int) -> int { self + other} | |
} |
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
module Main where | |
import Criterion.Main | |
-- We're going to use this constant as a known prime to test our functions with. | |
testPrime :: Int | |
testPrime = 16127 | |
-- And a known non-prime as well. | |
testNonPrime :: Int |
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
Build LeapC of project LeapC with configuration Debug | |
CompileC build/LeapC.build/Debug/LeapC.build/Objects-normal/x86_64/leap_controller.o ../src/leap_controller.cpp normal x86_64 c++ com.apple.compilers.gcc.4_2 | |
cd /Users/tom/Documents/LeapC/xcode | |
setenv LANG en_US.US-ASCII | |
/Developer/usr/bin/gcc-4.2 -x c++ -arch x86_64 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -Wuninitialized -Wshorten-64-to-32 -DDEBUG=1 -isysroot /Developer/SDKs/MacOSX10.6.sdk -fvisibility-inlines-hidden -mmacosx-version-min=10.6 -gdwarf-2 -iquote /Users/tom/Documents/LeapC/xcode/build/LeapC.build/Debug/LeapC.build/LeapC-generated-files.hmap -I/Users/tom/Documents/LeapC/xcode/build/LeapC.build/Debug/LeapC.build/LeapC-own-target-headers.hmap -I/Users/tom/Documents/LeapC/xcode/build/LeapC.build/Debug/LeapC.build/LeapC-all-target-headers.hmap -iquote /Users/tom/Documents/LeapC/xcode/build/LeapC.build/Debug/LeapC.build/LeapC-project-headers.hmap -F/Users/tom/Documents/LeapC/xcode |
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
test :: Int -> [Int] | |
test f | |
| f <= 0 = [] | |
| otherwise = f : test (f-1) |
NewerOlder