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 List where | |
data List a | |
= Null | |
| Node (List a) a | |
deriving (Show, Eq) | |
build = build' Null | |
where | |
build' Null [] = Null |
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 Sum where | |
a [] = 0 | |
a (x:xs) = x + a xs | |
b xs = b' 0 xs | |
where | |
b' q [] = q | |
b' q (x:xs) = b' (q + x) xs |
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
a [] = 0 | |
a (x:xs) = x + a xs | |
b xs = b' 0 xs | |
where | |
b' a [] = 0 | |
b' a (x:xs) = b' (a+x) xs | |
c xs = foldl (+) 0 xs |
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
# vim: syn=sh: | |
# | |
# Sleep before doing a command | |
SleepDo() { | |
local time="$1" | |
shift | |
sleep "$time" | |
eval "$@" | |
} |
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 Test where | |
data Range | |
= FromTo Integer Integer | |
deriving (Eq, Ord) | |
instance Show Range where | |
show (FromTo x y) = show x ++ " --> " ++ show y | |
x --> y |
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
update_interval 1 | |
#out_to_x no | |
out_to_console yes | |
temperature_unit fahrenheit | |
#temperature_unit celsius | |
TEXT | |
${uptime_short}\ | |
::: ${mem}\ | |
::: ${mixer}%${if_mixer_mute} (M)${endif}\ |
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
// author: Brian Mock <mock.brian@gmail.com> | |
#include <stdio.h> | |
typedef unsigned int uint; | |
double clamp(double, double, double); | |
uint pack_rgb(uint, uint, uint); | |
uint shade_color(uint, double); | |
void unpack_rgb(uint, uint*, uint*, uint*); |
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
-------------------- Brian Mock ----------------------- | |
module Lab3 where | |
import List | |
-------------------- Problem 1 ----------------------- | |
(==>) = flip ($) | |
integerToDigit (i + 1) = digits !! 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
#!/usr/bin/env ruby | |
# | |
# Ruby ruby ruby! | |
# | |
def fibo(a=1, b=1) | |
n = 0 | |
yield 0, a | |
yield 1, b | |
loop do | |
a, b = b, a + b |
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 <Foundation/Foundation.h> | |
#define I(n) [NSNumber numberWithInt:(n)] | |
int | |
main(int argc, char *argv[]) { | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
NSArray *ary = [NSArray arrayWithObjects: | |
I(4), I(5), I(1), I(0), I(6), nil | |
]; |