This file contains hidden or 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
| // Learn more about F# at http://fsharp.net | |
| // See the 'F# Tutorial' project for more help. | |
| open System.IO | |
| open SevenZip | |
| open System | |
| SevenZipCompressor.SetLibraryPath(@"path/to/7z.dll") | |
| let dir = @"files/path/..." |
This file contains hidden or 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
| open System | |
| open Prelude | |
| open System.Text.RegularExpressions | |
| open System.IO | |
| open System.Windows | |
| let sw = Diagnostics.Stopwatch() | |
| ///////////////////////////////////////////////////////////// | |
| let countsymbols (s : string) = |
This file contains hidden or 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 Variable = Strings of float | Number of float * float * float | |
| type Probability = Map<string , Map<string,Variable> * float> | |
| let inline pairAdd (a,b) (c,d) = a + c , b + d | |
| let inline div (a,b) = if b = 0. then a else a / b | |
| let strOfVar = function Strings(n) -> n | _ -> 0. |
This file contains hidden or 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
| open FSharp.Data | |
| let data = WorldBankData.GetDataContext() | |
| let scoreArr = [| | |
| "Household final consumption expenditure per capita (constant 2000 US$)", (-7.5, 50000.); | |
| "Intentional homicides (per 100,000 people)", (-20., 1000.); | |
| "Fixed broadband Internet subscribers (per 100 people)", (9.5, 100.); | |
| "Burden of customs procedure, WEF (1=extremely inefficient to 7=extremely efficient)", (6., 7.); | |
| "CPIA transparency, accountability, and corruption in the public sector rating (1=low to 6=high)", (6., 6.); | |
| "GINI index", (-5., 100.); |
This file contains hidden or 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
| var injectMathJax = document.createElement('script'); | |
| var typeSet = document.createElement('script'); | |
| var style=document.createElement('style'); | |
| //modified: css https://github.com/christianp/mathjax-bookmarklet/blob/master/bookmarklet.js | |
| style.innerText = '.MathJax .mn {background: inherit;} .MathJax .mi {color: inherit;} .MathJax .mo {background: inherit;}'; | |
| injectMathJax.type = 'text/javascript'; | |
| injectMathJax.src = 'https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'; |
This file contains hidden or 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 HyphTree = | |
| | Node of (int [] option) * Map<char, HyphTree> | |
| | Empty | |
| let insertpattern tree pattern = | |
| let chars = pattern |> Seq.filter (Char.IsNumber >> not) |> Seq.toArray | |
| let points = Text.RegularExpressions.Regex.Split(pattern, "[.a-z]") |> Array.map (fun c -> let b, i = Int32.TryParse c in if b then int i else 0) | |
| let rec bt t = function | |
| | i when i = chars.Length -> Node(Some points, Map.empty) | |
| | i -> |
This file contains hidden or 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
| open System | |
| open FSharp.Data | |
| type GplusPost = FSharp.Data.JsonProvider<"gplusposttemplate.json"> | |
| type GplusSearch = FSharp.Data.JsonProvider<"gplusSearchTemplate.json"> | |
| type GplusCommentList = FSharp.Data.JsonProvider<"gplusCommentListTemplate.json"> | |
| let googlePlusFunc key url parse (mapItems) (next) takeAtATime maxtake query = | |
| let download token choice = | |
| try |
This file contains hidden or 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
| Algeria | 5.86 | 0.93 | |
|---|---|---|---|
| Angola | 5.09 | 0.88 | |
| Argentina | 6.39 | 0.66 | |
| Australia | 8.67 | 0.32 | |
| Austria | 7.73 | 0.55 | |
| Azerbaijan | 5.6 | 0.495 | |
| Bangladesh | 5.07 | 1.0 | |
| Belgium | 7.51 | 0.33 | |
| Brazil | 6.52 | 0.865 | |
| Bulgaria | 5.73 | 0.335 |
This file contains hidden or 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
| LEARNED STRATEGY | |
| Move | Move Probability | |
| ---- | ---------------- | |
| R | 0 | |
| P | 0.999 | |
| S | 0 | |
| T | 0 | |
| LEARNED STRATEGY VS FIXED ADVERSARY |
This file contains hidden or 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
| STRATEGY VS STATIC ADVERSARY | |
| Move | Move Probability | |
| -------- | ---------------- | |
| Rock | 0 | |
| Paper | 1 | |
| Scissors | 0 | |
| STRATEGY VS STATIC ADVERSARY | |
| Player 1 | Player 2 | Prob 1 | Prob 2 | Joint Prob | Player 1 Util | Player 2 Util |
OlderNewer