Skip to content

Instantly share code, notes, and snippets.

View rayshih's full-sized avatar

Ray Shih rayshih

View GitHub Profile
digraph G {
subgraph cluster_gc {
label = "general concepts";
training_vs_testing -> overfitting_and_verification;
regularization
}
linear_regression -> persception_learning;
logistic_regression -> linear_regression;

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

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

(這只是大略分類)

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

Programming 學習經驗回顧

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

真。小時後

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

@rayshih
rayshih / gist:15a11388dd747821ed184ad9e77ce261
Created July 29, 2019 02:53
demo of babel plugin vue-react
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>
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 September 30, 2018 14:50
DFS/BFS by Writer
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 September 2, 2018 18:24
Typelevel N Queen in PureScript
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 September 1, 2018 11:30
Practice N Queen problem in term level PureScript
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)
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 April 6, 2018 23:13 — forked from chartsai/NineNine.kt
FP NineNine
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 =