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
# A Simple Makefile for LaTeX | |
# Author: Lester James V. Miranda | |
# E-mail: ljvmiranda@gmail.com | |
# Default variables which can be edited via the terminal | |
BUILDDIR = _build | |
COMPILER = pdflatex | |
PROJECT = main | |
BIBLIOGRAPHY = bibliography |
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
-- プログラミングHaskellのパーサコンビネータの実装をMaybeモナドを使うようにしてみた | |
-- Programming in Haskell : 8 Chapter | |
module Parsing where | |
import Char | |
import Monad | |
infixr 5 +++ | |
newtype Parser a = Parser {getParser :: String -> Maybe (a,String)} |
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.pyplot as plt | |
import numpy as np | |
from matplotlib.backends.backend_pdf import PdfPages | |
with PdfPages('multipage.pdf') as pp: | |
for i in range(0, 10): | |
fig = plt.figure() | |
ax1 = fig.add_subplot(211) | |
ax2 = fig.add_subplot(212) | |
x = np.linspace(0, 10) |
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 Totalsizeof | |
importall Base | |
export totalsizeof | |
# Helper: Pointer cache is used to break circular references in objects and avoid double countings | |
is_seen!(x, ptr_cache) = in(pointer_from_objref(x), ptr_cache) || (push!(ptr_cache, pointer_from_objref(x)); false) | |
# Helper: Catch types without size method | |
sizeof_catch(x) = try sizeof(x) catch 0 end |
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
# assume the following directory structure where contents of doc/ | |
# and source/ are already checked into repo., with the exception | |
# of the _build directory (i,e. you can check in _themes or _sources | |
# or whatever else). | |
# | |
# proj/ | |
# source/ | |
# doc/ | |
# remove doc/_build/html if present |
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/python | |
import os | |
from flask import Flask, Response, request, abort, render_template_string, send_from_directory | |
import Image | |
import StringIO | |
app = Flask(__name__) | |
WIDTH = 1000 |
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 pandas import Series | |
s = Series({ | |
4: 89.00, | |
6: 109.99, | |
8: 149.14, | |
10: 218.99, | |
12: 239.09, | |
14: 279.99, | |
16: 329.99, | |
18: 409.99, |
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 "Raymond Hettinger - Beyond PEP 8 -- Best practices for beautiful intelligible code - PyCon 2015" | |
# Bad code | |
import jnettools.toolselements.NetworkElement, \ | |
jnettools.tools.Routing, \ | |
jnettools.tools.RouteInspector | |
ne=jnettools.tools.elements.NetworkElement( '171.0.2.45' ) | |
try: |
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
package main | |
import ( | |
"encoding/csv" | |
"fmt" | |
"io" | |
"os" | |
) | |
// documentation for csv is at http://golang.org/pkg/encoding/csv/ |
OlderNewer