Skip to content

Instantly share code, notes, and snippets.

View linw1995's full-sized avatar
🎯
Focusing

林玮 (Jade Lin) linw1995

🎯
Focusing
View GitHub Profile
@linw1995
linw1995 / one-dimension.py
Last active May 22, 2017 11:08
Metropolis-Hasting Algorithm
# coding:utf-8
# one-dimensional Metropolis-Hasting Algorithm
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
def q(x):
return mlab.normpdf(x, 0, 2)
@linw1995
linw1995 / Monte Carle Intergation.go
Last active May 27, 2017 11:12
Monte Carlo method applied to approximating the value of π.
package main
import (
"fmt"
"math"
"math/rand"
)
func f(x float64) float64 {
return math.Sqrt(1 - x*x)
@linw1995
linw1995 / linePoints-plotutil.go
Created June 4, 2017 04:53
Example plots of "gonum/plot"
package main
import (
"math/rand"
"github.com/gonum/plot"
"github.com/gonum/plot/plotter"
"github.com/gonum/plot/plotutil"
"github.com/gonum/plot/vg"
)
@linw1995
linw1995 / animation-of-rgb-circles.markdown
Last active June 6, 2017 14:22
Animation of RGB Circles
@linw1995
linw1995 / dizzy-circles.markdown
Last active June 11, 2017 11:47
Dizzy Circles
@linw1995
linw1995 / combineZipFile.py
Created July 20, 2017 06:52
把多个zipfile整合成一个
import zipfile
import glob
filenames = glob.glob('./*.zip')
with zipfile.ZipFile('output.zip', mode='w') as output:
for filename in filenames:
with zipfile.ZipFile(filename) as subZipFile:
for fn in subZipFile.namelist():
data = subZipFile.read(fn)
output.writestr(fn, data)
@linw1995
linw1995 / .jsbeautifyrc
Created August 11, 2017 04:39
VSCode React Development Workplace Settings
// this file should place in you project root.
{
"e4x": true,
"brace_style": "collapse,preserve-inline",
"break_chained_methods": true,
"max_preserve_newlines": 2,
"indent_size": 2
}
@linw1995
linw1995 / settings.xml
Last active August 18, 2017 14:52
ConEmu Settings
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2017-08-09 23:40:40" build="161022">
<value name="ColorTable00" type="dword" data="00e7fdfd"/>
<value name="ColorTable01" type="dword" data="00ffe5d4"/>
<value name="ColorTable02" type="dword" data="0000af00"/>
<value name="ColorTable03" type="dword" data="0087af00"/>
<value name="ColorTable04" type="dword" data="000000dd"/>
<value name="ColorTable05" type="dword" data="00ff089a"/>
@linw1995
linw1995 / hfm.py
Created September 24, 2017 13:32
Huffman Encoding and Data Compression.
from collections import Counter
import argparse
from heapq import heapify, heappop, heappush
from itertools import count
from six import int2byte, byte2int
def huffman_tree(seq: list, frq: list) -> list:
''' 哈夫曼树 '''
@linw1995
linw1995 / README.md
Created November 17, 2017 05:35
ubuntu如何启用IPv6。ubuntu how to enable IPv6.

ubuntu how to enable IPv6

sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 net.ipv6.conf.default.disable_ipv6=0 net.ipv6.conf.all.disable_ipv6=0