Skip to content

Instantly share code, notes, and snippets.

Avatar
😍
🐰 🦊

Shu W. Nakamura woodyZootopia

😍
🐰 🦊
View GitHub Profile
@woodyZootopia
woodyZootopia / FM.py
Last active Jun 18, 2020
Interactive plot of FM
View FM.py
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
from scipy.fft import fft
fig = plt.figure()
Ts = 3e-6 # should be less than 1/fmax/2
n = 30000
fc = 3e4
@woodyZootopia
woodyZootopia / main.py
Last active Jun 1, 2020
interactive fourier transform
View main.py
import numpy as np
import matplotlib.pyplot as plt
from scipy.fft import fft
fig = plt.figure()
time_range = 100
# initialize wave
f = 10*np.cos(np.arange(time_range)*4*np.pi/time_range)
View tex.snippets
global !p
texMathZones = ['texMathZone'+x for x in ['A', 'AS', 'B', 'BS', 'C',
'CS', 'D', 'DS', 'E', 'ES', 'F', 'FS', 'G', 'GS', 'H', 'HS', 'I', 'IS',
'J', 'JS', 'K', 'KS', 'L', 'LS', 'M', 'MS','N', 'NS', 'O', 'OS', 'V', 'W', 'X', 'Y', 'Z']]
texIgnoreMathZones = ['texMathText']
texMathZoneIds = vim.eval('map('+str(texMathZones)+", 'hlID(v:val)')")
texIgnoreMathZoneIds = vim.eval('map('+str(texIgnoreMathZones)+", 'hlID(v:val)')")
@woodyZootopia
woodyZootopia / vovnet.py
Created Jul 9, 2019
Keras Implementation of VoVNet
View vovnet.py
# define VoVNet
# If you use TPU, only compatible with TensorFlow v.1.13 or earlier
import os
import tensorflow as tf
from tensorflow.contrib.tpu.python.tpu import keras_support
from tensorflow.keras.layers import Conv2D, BatchNormalization, Activation, MaxPooling2D, Dense, GlobalAveragePooling2D, Concatenate, Input
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.callbacks import History, LearningRateScheduler
@woodyZootopia
woodyZootopia / .bashrc
Last active Jan 10, 2019
latexmk creates pdf and bring it to the directory where .tex file exists.
View .bashrc
fetchlatexpdf ()
{
~/.zsh_functions/fetchlatexpdf.sh $@
}
ltxmkandfetchpdf ()
{
~/.zsh_functions/latexmk.sh $@
}
alias cleantextmp="rm -rf ~/.tmp/tex"
@woodyZootopia
woodyZootopia / .latexmkrc
Last active Nov 21, 2018
latexmk creates pdf in the current directory automatically.
View .latexmkrc
#!/usr/bin/perl
$latex = 'platex -interaction=nonstopmode -synctex=1 -halt-on-error';
$latex_silent = 'platex -interaction=batchmode';
$dvips = 'dvips';
$bibtex = 'pbibtex';
$makeindex = 'mendex -r -c -s jind.ist';
$dvipdf = 'dvipdfmx %O -o %D %S';
$pdf_previewer = 'open -a Skim %S';
$preview_continuous_mode = 1;
$pdf_mode = 3;