Skip to content

Instantly share code, notes, and snippets.

View ml_learning.graphviz
digraph G {
subgraph cluster_gc {
label = "general concepts";
training_vs_testing -> overfitting_and_verification;
regularization
}
linear_regression -> persception_learning;
logistic_regression -> linear_regression;
View understand_subtyping_variance.md

你可能其實不懂繼承 - 什麼是 Covariance 跟 Contravariance

在近代高等程式語言快(ㄏㄨˋ)速(ㄒ一ㄤ)演(ㄔㄠ)化(ㄒㄧˊ)的狀況下,很多 strong type 的程式語言都開始有了 generic 的設計, 舉例來說:

(這只是大略分類)

  • Mobile: Swift, Kotlin
  • Frontend: Flowtype, TypeScript
  • 後端語言:Python (pyre), Scala, C#, Java (沒錯!現在連 Java 都有)
View my_programming_learning_retro.md

Programming 學習經驗回顧

突然覺得可以分享一下自己學程式語言的經驗,也許可以啟發一些學生或是已經在業界但是想不斷增進自己能力的工程師朋友們。 (實在太久沒寫文了,文筆差請見諒)

真。小時後

我最早接觸程式語言的時間大概是小學五六年級,當時 Flash 正在起飛,版本應該是 Flash 4 升 5 的中間。 沒記錯的話應該是這程式語言演變成 ActionScript 之前。 某天去逛書店的時候看到有一本大約是 200 元專門講 Flash 遊戲設計的雜誌。

View gist:15a11388dd747821ed184ad9e77ce261
rayshih-mbp:vue-react rayshih$ cat test.jsx
export default () => {
const items = [1, 2, 3];
return (
<ul>
<li v-for="item in items">
There is something todo with {item}
</li>
</ul>
View swift_tensor_lr.swift
import TensorFlow
print(Tensor(3))
// y = - 3 * x + 7
let indices = -10...10
let xs = indices.map { x -> Float in Float(x) }
let ys = indices.map { x -> Float in Float(x) * (-3) + 7 + Float.random(in: -1.0...1.0) }
@rayshih
rayshih / Main.purs
Last active Sep 30, 2018
DFS/BFS by Writer
View Main.purs
module Main where
import Prelude
import Data.String (joinWith)
import Control.Monad.Eff.Console (logShow)
import Data.List (List(..), fromFoldable)
import Data.Monoid (class Monoid)
import Control.Monad.Writer (execWriter, tell)
import TryPureScript (render, withConsole)
@rayshih
rayshih / Main.purs
Created Sep 2, 2018
Typelevel N Queen in PureScript
View Main.purs
module Main where
import Prelude
import Effect (Effect)
import Effect.Console (log)
import Data.Ord (abs)
import Data.List (List(Nil), range, (:), length)
import Data.Traversable (traverse)
@rayshih
rayshih / Main.purs
Last active Sep 1, 2018
Practice N Queen problem in term level PureScript
View Main.purs
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (logShow, CONSOLE)
import Data.Ord (abs)
import Data.List (List(Nil), mapWithIndex, range, (:), filter, length, foldl)
import Data.Foldable (all)
import Data.Traversable (traverse)
View Main.purs
module Main where
import Prelude
import Control.Monad.Eff.Console (log)
import TryPureScript (render, withConsole)
data Weekday = Monday
| Tuesday
| Wednesday
@rayshih
rayshih / FPNineNine.kt
Last active Apr 6, 2018 — forked from chartsai/NineNine.kt
FP NineNine
View FPNineNine.kt
package ninenine
// ----- Data -----
sealed class NineNine
data class Item(val x: Int, val y: Int): NineNine()
data class Col(
val x: Int,
val n: Int
): NineNine() {
val items =