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 collections import Counter | |
from random import sample | |
def try_boy(): | |
result = [] | |
child = sample(("Boy", "Girl"), 1)[0] | |
result.append(child) | |
if child == 'Girl': | |
result.extend(try_boy()) |
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
// Satoh's shoe rack OpenSCAD file | |
shoe_rack_height = 780 - 200; | |
support_width = 45; | |
support_thick = 15; | |
module shoe_rack_support(x, y) { | |
translate([x, y, 0]) { | |
cube([support_width, support_thick, shoe_rack_height]); | |
} |
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 | |
# requirement: mecab | |
crfpp="CRF++-0.58" | |
crfpp_googlecode="https://crfpp.googlecode.com/files/" | |
cabocha="cabocha-0.68" | |
cabocha_googlecode="https://cabocha.googlecode.com/files/" |
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 | |
mecab="mecab-0.996" | |
mecab_python="mecab-python-0.996" | |
mecab_googlecode="https://mecab.googlecode.com/files/" | |
if ! type curl > /dev/null; then | |
downloader='wget ' | |
else | |
downloader='curl -O ' |
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
""" | |
classes for vertex, rectangle | |
""" | |
class Vertex(object): | |
def __init__(self, x, y, z): | |
self.x = x | |
self.y = y | |
self.z = z | |
def __add__(self, other): |
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
""" | |
classes for vertex, rectangle | |
""" | |
class Vertex(object): | |
def __init__(self, x, y, z): | |
self.x = x | |
self.y = y | |
self.z = z | |
def __add__(self, other): |
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
GRID = (40, 40) | |
BUS_STRIPE = 10 | |
class Wave(object): | |
@classmethod | |
def clk(cls, num): | |
ret = [] | |
for i in range(num): | |
ret.append((i + 1) % 2) | |
return ret |
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
GRID = (24, 16) | |
BUS_STRIPE = 3 | |
class Wave(object): | |
@classmethod | |
def clk(cls, num): | |
ret = [] | |
for i in range(num): | |
ret.append((i + 1) % 2) | |
return ret |
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 re | |
import sys | |
re_v = re.compile('(\s+)(reg|wire)(\s+)(\w+)\s*(\[\d+:0\]);') | |
for line in sys.stdin: | |
line = line[:-1] # to remove new line | |
result = re_v.search(line) | |
if result: | |
g = result.groups() |
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 cmath import exp, sin, cos, pi | |
N = 512 | |
PADDING = 16 | |
global old_x, old_y | |
old_x, old_y = 0, N | |
def circle(x, y, r): | |
hr = r / 2 | |
oval(x - hr, y - hr, r, r) |
OlderNewer