This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib | |
matplotlib.use('AGG') | |
from collections import Counter | |
from matplotlib import pyplot as plt | |
from matplotlib import patches as mpatches | |
from matplotlib.lines import Line2D | |
from matplotlib_venn import venn2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randrange | |
from matplotlib import use | |
use('AGG') | |
from matplotlib import pyplot as plt | |
class MontyHallproblem: | |
def __init__(self, fname, tryN): | |
self.fname = fname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scipy.stats.distributions as dis | |
import numpy as np | |
import pylab as pl | |
from matplotlib import pyplot as plt | |
def main(): | |
plt.rc('text', aa=True, usetex=True) | |
x = np.arange(-5, 5, 0.1) | |
for i in range(1, 6): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib import use | |
use('AGG') | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.patches import Rectangle | |
from mpl_toolkits.mplot3d import Axes3D | |
from mpl_toolkits.mplot3d.art3d import Poly3DCollection, Line3DCollection | |
class cube_fig: | |
def __init__(self, fname, rectangle): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Control.Monad.Fix (fix) | |
import Data.Bool (bool) | |
import Data.Tuple.Extra (first, second, dupe, (***)) | |
import Data.Maybe (maybe) | |
import Graphics.Rendering.Chart.Backend.Cairo | |
import Graphics.Rendering.Chart.Easy | |
import System.IO (IOMode (..), withFile, hGetLine, hIsEOF) | |
import System.Exit (exitFailure) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from livereload import Server, shell | |
from sys import argv | |
class live_view: | |
def __init__(self): | |
self.sv = Server() | |
self.is_run = False | |
def __enter__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/preprocessor/seq/for_each.hpp> | |
#include <boost/preprocessor/variadic/to_seq.hpp> | |
#include <functional> | |
#include <iostream> | |
#include <iterator> | |
#include <sstream> | |
#include <tuple> | |
#include <type_traits> | |
namespace dhu_grad { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euf | |
# set exported tagspaces json file path | |
# e.g. json_name="$HOME/.config/tag-lib.json" addtag -show | |
declare json_name | |
help_message() { | |
echo "Usage:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function fix_metadata() { | |
i="$1" | |
fname="$2" | |
line="$3" | |
if [ "`echo "$line" | grep 'Title'`" ]; then | |
sed -i -e "${i}s/Title/title/g" "$fname" | |
elif [ "`echo "$line" | grep 'Tags'`" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://mtunn.wordpress.com/odroid-u2★セットアップ/radikoの録音・再生(archlinux)/ | |
pid=$$ | |
wkdir='/var/tmp' | |
playerurl=https://radiko.jp/apps/js/flash/myplayer-release.swf | |
playerfile="${wkdir}/player.swf" | |
keyfile="${wkdir}/authkey.png" | |
auth1_fms="${wkdir}/auth1_fms_${pid}" | |
auth2_fms="${wkdir}/auth2_fms_${pid}" |