Skip to content

Instantly share code, notes, and snippets.

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

yassu yassu

💭
👨‍💼
  • JP
View GitHub Profile
require 'fileutils'
BASE_FILENAME = 'basefilename'
AUTHOR = 'yassu'
LATEX = 'latex'
DVIP = 'dvipdfm'
VIEW = 'evince'
def get_last_tag()
-- 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
@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):
@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 / 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 / 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 / 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 / vimrc
Created January 11, 2015 01:18
vimrc file for prezen of 2014-1-11
""" Plugins {{{
"" NeoBundle {{{
set nocompatible " Be iMproved
filetype off " Required!
if has('vim_starting')
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
call neobundle#rc(expand('~/.vim/bundle/'))
@yassu
yassu / analyse.py
Created October 29, 2014 09:55
analyse_twit
from datetime import datetime
from math import sqrt
from json import load as _json_load
import numpy as np
from scipy import stats # for regression line
import pylab
def get_datetime(s_date):
year, month ,day = s_date.split('/')
@yassu
yassu / anime.py
Created October 16, 2014 10:42
only one graph by matplotlib
import pylab as p
p.ion()
x = p.arange(0, 2*p.pi, 0.01)
a = 10
curve = lambda t: (t, p.sin(x+t/10.0))
line, = p.plot(x, p.sin(x))