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
infixr 0 $ | |
fun f $ x = f x | |
val concat = List.concat | |
fun good_cartesian_product (xs, ys) = | |
concat (map (fn y => map (fn x => (x,y)) xs) ys) | |
fun evil_cartesian_product (xs', ys') = | |
let | |
val result = ref [] |
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ørst defineres en signatur for lister. Den indeholder nogle | |
* af de mest elementære operationer, man kan lave på lister. *) | |
signature LISTE = | |
sig | |
type 'a liste | |
val null : 'a liste -> bool | |
val empty : 'a liste | |
val cons : 'a * 'a liste -> 'a liste | |
val hd : 'a liste -> 'a | |
val tl : 'a liste -> 'a liste |
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
signature FOO = | |
sig | |
type 'a foo | |
val f : 'a -> 'a foo | |
end | |
signature BAR = | |
sig | |
structure Foo : FOO | |
val p : 'a -> bool |
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
package multiserver; | |
import java.net.*; | |
import java.io.*; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class MultiServer { | |
protected ServerSocket serverSocket = null; | |
protected boolean listening = true; |
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
import Data.String.Utils | |
cow :: String | |
cow = concatMap (++ "\n") [ | |
" \\ ^__^", | |
" \\ (oo)\\_______", | |
" (__)\\ )\\/\\", | |
" ||----w |", | |
" || ||" ] |
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
<?php | |
$recursive_array = array( | |
0 => array( | |
'name' => 'pets', | |
'category' => array( | |
0 => array( | |
'name' => 'cats', | |
'category' => array( | |
0 => array( |
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
(define (tabulate n f) | |
(define (helper m) | |
(if (= m n) | |
() | |
(cons (f m) (helper (+ m 1))))) | |
(helper 0)) | |
(define (make-table x y fill) | |
(define table (make-vector x)) | |
(tabulate x |
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
#!/usr/bin/python | |
import math | |
import random | |
import sys | |
import os | |
import pygame | |
import time | |
class UnpreparedParticle(Exception): | |
pass |
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
fun afrund n = | |
let | |
val n' = Real.trunc (n * 125.0) | |
val kr = Real.fromInt (n' div 100) | |
val ore = Real.fromInt ((n' mod 100) div 25 * 25) / 100.0 | |
in kr + ore end | |
(* Mads og Christians *) | |
fun moms n = real(round(n * 4.0 * 1.25 ))/4.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
>~:9-v | |
^ ,_$84v | |
^,,:,:,:*< |
OlderNewer