This file contains hidden or 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
# -*- encoding: utf-8 -*- | |
def map_apply(proc, args): | |
# return [f(x) for f, x in zip(proc, args)] | |
return map(lambda f,x:f(x), proc, args) # map(apply, proc, args) doesn't work like this | |
class FieldConverter: | |
def __init__(self, *args): | |
self._converters = args | |
def conv_proc(f): | |
def _wrap(conv_proc_to_num): |
This file contains hidden or 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
--- costly_labels.eryk.out 2016-01-26 15:41:09.000000000 +0900 | |
+++ costly_labels.out 2016-01-26 15:31:07.000000000 +0900 | |
@@ -4,10 +4,10 @@ | |
Case #4: 37158990 | |
Case #5: 33205878 | |
Case #6: 35572006 | |
-Case #7: 32836925 | |
+Case #7: 33164452 | |
Case #8: 14232217 | |
Case #9: 15 |
This file contains hidden or 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
diff -ru click-5.1/click/_termui_impl.py click-5.1-naoyat/click/_termui_impl.py | |
--- click-5.1/click/_termui_impl.py 2015-08-17 20:16:32.000000000 +0900 | |
+++ click-5.1-naoyat/click/_termui_impl.py 2015-11-08 16:54:04.000000000 +0900 | |
@@ -128,7 +128,18 @@ | |
def format_eta(self): | |
if self.eta_known: | |
- return time.strftime('%H:%M:%S', time.gmtime(self.eta + 1)) | |
+ t = self.eta | |
+ seconds = t % 60 |
This file contains hidden or 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
$ echo "Cerēs erat dea frūmentī." | python latin.py -s |
This file contains hidden or 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 python | |
# -*- coding: utf-8 -*- | |
from pylab import * | |
S = 0.1 | |
ALPHA = 0.1 | |
BETA = 9 | |
def sub(xs, ts): |
This file contains hidden or 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
amō indicative active present sg 1 | |
amās indicative active present sg 2 | |
amat indicative active present sg 3 | |
amāmus indicative active present pl 1 | |
amātis indicative active present pl 2 | |
amant indicative active present pl 3 | |
amābam indicative active imperfect sg 1 | |
amābās indicative active imperfect sg 2 | |
amābat indicative active imperfect sg 3 | |
amābāmus indicative active imperfect pl 1 |
This file contains hidden or 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
# s|^■||g | |
# s| : | |g | |
s|《 .* 》||g | |
s|{ .* }||g | |
s|〔 .* 〕||g | |
s|[ .* ]||g | |
s|( .* )||g | |
s|〈 .* 〉||g | |
s|【 .* 】||g |
This file contains hidden or 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 python | |
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
import Image # PIL | |
from myutil import save_or_show | |
from graph_tool.all import * |
This file contains hidden or 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 Queue | |
class Edge(object): | |
def __init__(self, u, v, w): | |
self.source = u | |
self.sink = v | |
self.capacity = w | |
def __repr__(self): | |
return "%s->%s:%s" % (str(self.source), str(self.sink), self.capacity) |
This file contains hidden or 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 python | |
# -*- coding: utf-8 -*- | |
# | |
# add_noise.py - 割合を指定して画像にノイズを付加 | |
# | |
# usage: python add_noise.py <orig> <noise-rate> [<output>] | |
# | |
import sys | |
import random |