Skip to content

Instantly share code, notes, and snippets.

void goal(){
expr();
}
void expr(){
term();
exprPrime();
}
void exprPrime(Token t){

A+

alt tag

A*

alt tag

2014

| ES | EF | LS | LF ----|----|----|----|---- A | 0| 4 | 0 | 4 B| 4|7|4|7 C|4|12|11|19 D|7|16|7|16 E|7|14|9|16

@haider92
haider92 / REGEX
Last active August 29, 2015 14:13
2010
====
(0* 1 0* 1 0*) | ( 1* 0 1* 0 1*)*
2011
====
(-)? ([0-9])+ ('.' ([0-9])+)?
2011R
=====
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
void * handler(void* setin) {
int sig;
sigset_t set = (sigset_t *) setin;
while(1) {
sigwait(&set, &sig);
data Tree t = Empty | Root t (Tree t) (Tree t)
deriving (Eq, Ord, Show)
insert :: (Ord a) => a -> (Tree a) -> (Tree a)
insert a Empty = Root a Empty Empty
insert a (Root x left right)
| a == x = (Root x left right)
| a < x = Root x (insert a left) right
| a > x = Root x left (insert a right)
import org.w2mind.net.Action;
import org.w2mind.net.Mind;
import org.w2mind.net.RunError;
import org.w2mind.net.State;
public class SkeletonChessMind
implements Mind {
int a = 8;
public void endrun() throws RunError { }
data BinTree t = Empty | Root t (BinTree t) (BinTree t)
deriving (Eq, Ord, Show)
myTree = Root 5 (Root 1 (Empty) (Root 3 Empty Empty))
(Root 7 Empty Empty)
insert :: Ord a => a -> BinTree a -> BinTree a
insert new Empty = Root new Empty Empty
insert new (Root n left right)
| new > n = Root n left (insert new right)
/**
* The following program is based of the first CA213 continuous exam.
* It is wrote from memory so it may have a few errors, but it is mostly
* the same.
*
* The exam required you to:
* 1) Create a interface Printable with method put.
* 2) Modify the given Date class to implement Printable and to have a put
* method
* 3) Create a program, PastDates which reads in dates from the console. Stores
@haider92
haider92 / mean.hs
Created February 4, 2014 17:11 — forked from imduffy15/mean.hs
mean :: [Int] -> Int
mean [] = error "Empty List"
mean a = (mean' (listSum a) (length a))
mean' :: Int -> Int -> Int
mean' sum length = div sum length
listSum :: Num a => [a] -> a
listSum [] = 0
listSum (a:as) = a + (listSum as)