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
# Downloads a file from a given URL to the current directory. | |
function wget($url) | |
{ | |
$path = $url.Substring($url.LastIndexOf('/') + 1) | |
$dir = pwd | |
$location = [System.IO.Path]::Combine($dir, $path) | |
$client = new-object System.Net.WebClient | |
$client.DownloadFile($url, $location); | |
} |
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 Specialization = | |
type ITyped<'T1,'T2> = | |
abstract member Run<'T3> : 'T1 -> 'T2 | |
type private Function<'T1,'T2> = delegate of 'T1 -> 'T2 | |
let Specialize<'T1,'T2> (algorithm: ITyped<'T1,'T2>) = | |
let aT = typeof<ITyped<'T1,'T2>> | |
let def = aT.GetMethod("Run").GetGenericMethodDefinition() | |
let dT = typeof<Function<'T1,'T2>> |
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 fac = function | |
| 0 -> 1 | |
| n -> fac (n - 1) * 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
def readFile(path): | |
f = open(path, 'r') | |
r = map(lambda x: x.strip(), f.readlines()) | |
f.close() | |
return r | |
animals = readFile('animals.txt') |
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
Require Import Coq.Lists.List. | |
(** The only list of length zero is the empty list. *) | |
Lemma length_zero : forall (a : Type) (x : list a), | |
length x = 0 <-> x = nil. | |
Proof. | |
intros; split; intro. | |
induction x; auto; discriminate. | |
rewrite H; compute; auto. | |
Qed. |
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
Html.ActionLink<MyController>("Click me!", x => x.MyAction(1,2,3)) |
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 Action = | |
| HomePage | |
| AboutUs | |
| BlogHomePage | |
| Blog of BlogId |
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
Router.Infer<'T>() : Router<'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
Html.ActionLink<MyController>("Click me!", x => x.MyAction(1,2,3)) |
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 [Href (ctx.Link (Blog 5))] [Text "Next blog"] |