Skip to content

Instantly share code, notes, and snippets.

View yassu's full-sized avatar
💭
👨‍💼

yassu yassu

💭
👨‍💼
  • JP
View GitHub Profile
@yassu
yassu / mkja2slides.py
Created January 20, 2015 09:33
A script for make japanese slides by using markdown
#!/usr/bin/env python
"""
A script for make japanese slides by using markdown
"""
from tempfile import NamedTemporaryFile
from os import system, remove
from sys import exit
from optparse import OptionParser
from os.path import isfile
@yassu
yassu / simple_analyser.py
Created February 8, 2015 00:44
class for very simple statics
from copy import deepcopy
from math import sqrt
import numpy as np
from scipy import polyfit
from pylab import *
class SimpleAnalyser:
def __init__(self, datas):
@yassu
yassu / image_analyse.py
Last active August 29, 2015 14:17
Simple analyser for Imagefiles
from os import walk
from os.path import isfile, isdir
from sys import argv
from math import sqrt
import numpy as np
from progressbar import ProgressBar, Percentage, Bar
from PIL import Image
MAX_SIZE = 1000
@yassu
yassu / alpha_n_plus_beta_n.py
Created March 26, 2015 06:50
If alpha + beta = X and alpha*beta=Y, plot graph of each alpha^n + beta^n
"""
A very simple 'animation' of a 3D plot
"""
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import numpy as np
import time
def generate(X, Y, count=10):
@yassu
yassu / reading_vimrc_stat.py
Last active August 29, 2015 14:18
statics for reading vimrc of vim-jp by using archive file at https://github.com/vim-jp/reading-vimrc/blob/gh-pages/_data/archives.yml
from yaml import load as _yaml_load
from sys import argv
from numpy import std
archives = _yaml_load(open('archives.yml'))
class VimrcStat():
def __init__(self, member_name):
-- n is a square number or not
isSquare:: Int -> Bool
isSquare n = t*t == n
where t = round(sqrt (fromIntegral(n)))
-- "n = c*c + (n-c*c)" is square split or not
isSquareSplit:: Int -> Int -> Bool
isSquareSplit n c = isSquare (n - c*c)
-- return whether n is splittable as two square number or not
require 'fileutils'
BASE_FILENAME = 'basefilename'
AUTHOR = 'yassu'
LATEX = 'latex'
DVIP = 'dvipdfm'
VIEW = 'evince'
def get_last_tag()
\documentclass{article}
\usepackage{amsmath, amssymb}
\usepackage{amsthm}
\newcommand{\RR}{\mathbf{R}}
\begin{document}
We define diffeomorphism $\phi \colon \RR^2 \to \RR^2$ by identify:
\[
\phi(x, y) = (x, y).
\]
from timeit import timeit
N = 10**9
eq_plus = """
a = 1
a += 2
"""
subst_plus = """