Skip to content

Instantly share code, notes, and snippets.

View ChihChengLiang's full-sized avatar

Chih Cheng Liang ChihChengLiang

View GitHub Profile
@ChihChengLiang
ChihChengLiang / list.md
Last active August 29, 2015 14:01
Great things I've seen recently

Agenda

  1. ML/DM question--> ML/DM Solutions
  2. Real world problem --> ML/DM question

#Workflow

  1. ask question
  2. collect data
import numpy as np
def run():
# create a column vector
col_vec = np.array([[1], [2]])
print "column vector"
print col_vec
# create a row vector
row_vec = np.array([[1, 2]])
@ChihChengLiang
ChihChengLiang / Street Fighting Mathematics.md
Created May 29, 2014 07:21
Street Fighting Mathematics

Description

這份文件是節錄edx的一門課程Street Fighting Math(SFM)上的精華內容,供沒修過這堂課的朋友一睹其樂趣。英文文字的部份是直接由課程內容剪下貼上。這份文件數學的部份會寫得非常隨意,重意不重形。

課程網址 https://www.edx.org/course/mitx/mitx-6-sfmx-street-fighting-math-1501#.U4bhk1T_QjA

有關這門課:

這門課和其他MOOC不同的地方主要在於課程內容都是閱讀材料,配合一些網頁上的互動元件,授課影片非常稀少。課程的目標是傳授估算的數學技巧。大部分在學校的課程強調嚴謹(rigor),但解決真實世界問題的時候嚴謹可能導致很多冤枉路(課程中稱為屍僵 rigor mortis ),而估算可以指引正確的道路。

教授提供了一個比較好想像的例子:

原文
ループが書けなくなる(或いは再帰依存症)レベル10
http://d.hatena.ne.jp/yuki_neko_nyan/20090217/1234850409
level 0
不會寫遞迴,也沒辦法用遞迴思考。只覺得用迴圈寫就好了。
level 1
開始學習遞迴,但只要一用遞迴思考就覺得煩。有時還會忘了寫終止條件。覺得實在太麻煩了還是想寫迴圈就好。
package example
import common._
object Lists {
/**
* This method computes the sum of all elements in the list xs. There are
* multiple techniques that can be used for implementing this method, and
* you will learn during the class.
*
<!DOCTYPE html>
<html>
<head>
<title>Judge</title>
</head>
<body>
{% block layout %} {% endblock%}
@ChihChengLiang
ChihChengLiang / bhansen.m
Last active August 29, 2015 14:10
play around Bruce E. Hansen "Least Squares Model Averaging" Econometrica (2007)
% http://www.ssc.wisc.edu/~bhansen/progs/joe_08.html
% http://www.ssc.wisc.edu/~bhansen/progs/ecnmt_07.html
octave:2> A=load("dat.txt")
A =
6.00000 4.01000 2.48000
5.90000 3.96000 2.43000
5.60000 3.99000 2.80000
5.20000 4.12000 2.96000
sudo -aG chihchengliang docker
sudo adduser chihchengliang docker
# docker外面的8080可以連到docker裡面的8787
docker run -p 8080:8787
docker ps -a
["#copy-user-button","#copy-password-button"].map (id)->
copybtn = new ZeroClipboard $(id)
copybtn.on 'ready', (readyEvent) ->
$(id).attr("data-original-title", "click to copy")
.tooltip()
copybtn.on 'aftercopy', (event) ->
$(id)
.attr("data-original-title", "copied")
.tooltip "show"