sum1(1, 2, 3) == 6
1 1
2 2
3 Fizz
4 4
| open FSharp.Data | |
| open System.Threading | |
| ["http://bbc.co.uk"; "http://www.google.co.uk"] | |
| |> List.map (fun str -> | |
| async { | |
| let! html = Http.AsyncRequestString(str) | |
| return sprintf "bbc len %d" html.Length | |
| } | |
| ) |
| open System.Threading | |
| type ChatMessage = | |
| | SendMessage of string | |
| | GetContent of AsyncReplyChannel<string list> | |
| let agent = MailboxProcessor.Start(fun agent -> | |
| let rec loop (state : string list) = async { | |
| printfn "List length is now %d" state.Length |
| let numberToTokiPona num = | |
| let rec addNum num str = | |
| if num >= 2 then addNum (num-2) (str + "twu ") | |
| else if num = 1 then addNum (num-1) (str + "wan ") | |
| else str | |
| if num > 0 then addNum num "" | |
| else "ala" | |
| (numberToTokiPona 19) |> printfn "%s" |
| """ | |
| Extremely crude example of a timing attack | |
| """ | |
| import time | |
| import timeit | |
| actualPassword = '0BEA0239' | |
| def checkpassword(passwd): |
| (ns tokichat.core | |
| (:use org.httpkit.server) | |
| (:gen-class)) | |
| (defn handler [req] | |
| (with-channel req channel | |
| (on-close channel (fn [status] | |
| (println "channel closed"))) |