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 / 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 / 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 / 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 / gif2png.go
Last active July 17, 2018 02:00
Golang pkg "image/gif" cookbook.
package main
import (
"fmt"
"image"
"image/draw"
"image/gif"
"image/png"
"os"
"strings"
@linw1995
linw1995 / animation-of-rgb-circles.markdown
Last active June 6, 2017 14:22
Animation of RGB Circles
@linw1995
linw1995 / animation-of-rgb-circles-svg-css.markdown
Last active February 14, 2018 12:48
Animation of RGB Circles (SVG&CSS)
@linw1995
linw1995 / dizzy-circles.markdown
Last active June 11, 2017 11:47
Dizzy Circles
@linw1995
linw1995 / Packaging fonts in configuration profiles for installing on iOS.py
Created June 16, 2017 12:29
Packaging fonts in configuration profiles for installing on iOS
# coding: utf-8
import re
import hashlib
import sys
from base64 import b64encode
from random import choice
items = ['8', '9', 'a', 'b']
names = sys.argv
@linw1995
linw1995 / WaterMark.go
Last active February 8, 2023 06:48
Using golang to mark the picture
package main
import (
"bytes"
"fmt"
"strings"
"io/ioutil"
"os"
"path"
@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)