Skip to content

Instantly share code, notes, and snippets.

View rowpsmo1859's full-sized avatar
๐Ÿ’œ

rowpsmo1859

๐Ÿ’œ
View GitHub Profile
@rowpsmo1859
rowpsmo1859 / latency.txt
Last active August 29, 2015 14:09 — forked from jboner/latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@rowpsmo1859
rowpsmo1859 / latency.txt
Last active August 29, 2015 14:22 — forked from jboner/latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@rowpsmo1859
rowpsmo1859 / YearConverter.fsx
Created November 30, 2015 13:50
Converts Human Years to Cat Years or TimeLord Years
let readInput = System.Console.ReadLine
[<Measure>] type HumanYear
[<Measure>] type CatYear
[<Measure>] type TimeLordYear
let averageCatLifeSpan = 15<HumanYear>
let averageHumanLifeSpan = 80<HumanYear>
let averageTimeLordLifeSpan = 7000<HumanYear>
@rowpsmo1859
rowpsmo1859 / MonoFsharpCentos6.sh
Last active June 5, 2017 23:02
Install Fsharp on Centos6
#Set the terminal session with super user privileges
sudo -s
#Install dependencies for compiling code
yum install bison gettext glib2 freetype fontconfig libpng libpng-devel libX11 libX11-devel glib2-devel libgdi* libexif glibc-devel urw-fonts java unzip gcc gcc-c++ automake autoconf libtool make bzip2 wget
#Download Mono, extract the files, make, and make install
cd /usr/local/src
wget http://download.mono-project.com/sources/mono/mono-5.0.1.1.tar.bz2
tar jxf mono-4.3.2.467.tar.bz2

Test Org File

First Header

**SubHeader ***SubSubHeader

  • Plain List 1
  • Item 2
  • Item 3

Plain lists

  • this works
  • 2nd item
@rowpsmo1859
rowpsmo1859 / monoSigInt.fs
Created April 8, 2016 19:17
Handle Sigint on Unix using Mono
//This is to handle the unix ctrl+c signal
let handleSigInt () =
let quitApplication () =
Async.CancelDefaultToken()
async {
let mutable signals =
[|
new Mono.Unix.UnixSignal (Mono.Unix.Native.Signum.SIGINT)
new Mono.Unix.UnixSignal (Mono.Unix.Native.Signum.SIGTERM)
|]
@rowpsmo1859
rowpsmo1859 / learningMailboxes.fsx
Created April 29, 2016 17:53
Example of reprogrammable 'actors' or 'Mailboxes'
let behavior () = printfn "1"
type Actions =
| Run
| Learn of (unit->unit)
| Die
let mailbox =
MailboxProcessor.Start(fun inbox ->
let rec loop learnedBehavior =
@rowpsmo1859
rowpsmo1859 / DiscriminatedUnionWithMembers.fsx
Created June 16, 2016 14:13
Example of a discriminated union type with member functions attached
type test =
| One
| Two
member this.Add =
let number =
match this with
| One -> 1
| Two -> 2
(fun secondNumber -> number + secondNumber)
@rowpsmo1859
rowpsmo1859 / App.elm
Created October 5, 2016 19:50
Example app for Elm 0.17
module App exposing (..)
import Html exposing (Html, h1, text)
import Html.App
type alias Model = String
init : ( Model, Cmd Msg )
init =
( "Hello", Cmd.none )
#I "../NeuralFish"
#load "NeuralFish_dev.fsx"
open NeuralFish.Types
open NeuralFish.Core
open NeuralFish.EvolutionChamber
open NeuralFish.Exporter
type SquareId = int