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
let rec separate = function | |
| [] -> ([],[]) | |
| []::xs -> ([],[]) | |
| (x::xs)::ys -> let (M,N) = separate ys | |
(x::M, xs::N) | |
let rec trans = function | |
| [] -> [] | |
| x::xs -> let (q, w) = separate (x::xs) in | |
if List.length(q) = 0 then [] else [q] @ trans 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
let rec separate = function | |
| [] -> ([],[]) | |
| []::xs -> ([],[]) | |
| (x::xs)::ys -> let (M,N) = separate ys | |
(x::M, xs::N) | |
let rec trans = function | |
| [] -> [] | |
| x::xs -> let (q, w) = separate (x::xs) in | |
if List.length(q) = 0 then [] else [q] @ trans 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
//////////Problem 6 | |
let rec powerset = function | |
| [] -> [[]] | |
| h::t -> List.fold (fun xs t -> (h::t)::t::xs) [] (powerset 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
type 'a stream = Cons of 'a * (unit -> 'a stream) | |
let rec upfrom n = Cons(n, fun () -> upfrom(n+1)) | |
let t = upfrom 0 | |
let rec take n (Cons(x,xsf)) = if n=0 then [] else x::(take (n-1) (xsf())) | |
(*Here's the map function, the rest is just to set it up or demonstrate it*) | |
let rec map f (Cons(x,xsf)) = Cons( (f x), fun() -> map f (xsf())) | |
take 10 (map (fun x -> x+x) 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
let rec inner xs ys = match (xs,ys) with | |
| (x::xs,y::ys) -> (x*y) + inner xs ys | |
| _ -> 0 | |
let rec separate = function | |
| [] -> ([],[]) | |
| []::xs -> ([],[]) | |
| (x::xs)::ys -> let (M,N) = separate ys | |
(x::M, xs::N) |
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
type Exp = | |
Num of int | |
| Neg of Exp | |
| Sum of Exp * Exp | |
| Diff of Exp * Exp | |
| Prod of Exp * Exp | |
| Quot of Exp * Exp | |
let rec evaluate = function | |
| Num n -> Some n |
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 Interpret = begin | |
(* e -> term to replace in | |
x -> identifier string | |
t -> id replacement *) | |
let rec subst e x t = match e with | |
| ID s when s=x -> t | |
| IF (p,v,f) -> IF (subst p x t, subst v x t, subst f x t) | |
| APP (e1,e2) -> APP (subst e1 x t, subst e2 x t) | |
| FUN (id,c) when id=x -> FUN (id,c) |
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
LoadModule auth_cas_module modules/mod_auth_cas.so | |
#CASDebug On | |
CASLoginURL https://auth.fiu.edu/cas/login | |
CASValidateURL https://auth.fiu.edu/cas/serviceValidate | |
CASAllowWildcardCert On | |
CASValidateServer Off | |
CASCookiePath /var/run/mod_auth_cas/ | |
CASTimeout 36000 | |
CASIdleTimeout 3600 |
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
<Connector port="443" | |
maxHttpHeaderSize="8192" | |
maxThreads="150" | |
minSpareThreads="25" | |
maxSpareThreads="75" | |
enableLookups="false" | |
disableUploadTimeout="true" | |
acceptCount="100" | |
scheme="https" | |
secure="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
def find_mystery(length, mystery): | |
boxes = range(1, length+1) | |
step = int(sqrt(length)) | |
count = 0 | |
for t in range(0, length+1, step): | |
count = count+1 | |
if t >= length: | |
print "Now checking %d and that is outta range" % t | |
else: |
OlderNewer