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
module Main where | |
import Prelude | |
type Geo = | |
{ | |
lat :: Number, | |
lon :: Number | |
} |
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
#r "node_modules/fable-core/Fable.Core.dll" | |
open Fable.Core | |
// Grid abstarct (Middle Layer) | |
type GridLineTypes = | |
| None = 0 | |
| Solid = 1 |
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.org | |
// See the 'F# Tutorial' project for more help. | |
open WEEK3 | |
open Monoid | |
type BivalAccumulator = { | |
V1: int Option | |
V2: int Option |
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
let iris = Frame.ReadCsv("c:/dev/.data/mnist/mnist_train.csv") | |
//let iris = Frame.ReadCsv("c:/dev/.data/iris.csv") | |
let keys = iris.ColumnKeys |> Seq.toArray | |
let x = iris.Columns.[keys.[1..784]] | |
let mu = x |> Stats.mean | |
let std = x |> Stats.stdDev | |
let norm = | |
x | |
|> Frame.mapRowValues (fun r -> (r.As<float>() - mu) / std) |
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
let val = moment("2016-04-02T22:39:51Z", moment.ISO_8601).isValid(); |
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
///<reference path="../node_modules/retyped-es6-shim-tsd-ambient/es6-shim.d.ts" /> | |
import {Component, provide, ApplicationRef, DynamicComponentLoader, Injector} from 'angular2/core'; | |
import {bootstrap} from 'angular2/platform/browser'; | |
import {Observable} from "rxjs/Rx"; | |
import {AppDispatcher} from "./app-dispatcher" | |
import {AppEP} from "./end-points/app-ep" |
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
#docker log by container name | |
dlog_f() { | |
docker logs --tail=100 $1 | |
} | |
alias dlog=dlog_f | |
dcu_f() { | |
docker-compose -f $1 up | |
} |
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 list1 = Immutable.fromJS([{a: 10}, {a : 20}]); | |
var list2 = Immutable.fromJS([{a: 10}, {a : 20}]); | |
//var list2 = list1.merge(list2); | |
var list3 = list1.mergeDeep(list2); | |
var newVal = [{a: 10}, {a : 20}]; | |
var list4 = list1.update(function (value) { | |
var nv = Immutable.fromJS(newVal); | |
return Immutable.is(list1, newVal) ? value : nv; |
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 ABRecord = Immutable.Record({a:1, b:2, c : null}); | |
var myRecord1 = new ABRecord(Immutable.fromJS({a:2, b: 4, c: { d: ["one"]}})); | |
var myRecord2 = new ABRecord(Immutable.fromJS({a:2, b: 4, c: { d: ["one"]}})); | |
console.log(Immutable.is(myRecord1, myRecord2)); | |
console.log(myRecord1.c.get("d").get(0)); | |
/// | |
var NestedRecord = Immutable.Record({d : null}); | |
var ABRecord1 = Immutable.Record({a:1, b:2, c : null}); |
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
//root fields as immutables but nested not | |
var map10 = Immutable.Map({a:1, b:2}); | |
var map20 = Immutable.Map({a:1, b:2}); | |
console.log(Immutable.is(map10, map20)); | |
var map1 = Immutable.Map({a:1, b:2, c:[3,5], d: {e : 1}}); | |
var map2 = Immutable.Map({a:1, b:2, c:[3,5], d: {e : 1}}); | |
console.log(Immutable.is(map1, map2)); |