- 児島 孝典
- (株) 144Lab
- ソフトウェア開発のお仕事
- Go, Python
- Twitter: max747
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
FROM centos:7 | |
ARG PYTHON_VERSION=3.6.4 | |
ARG BUILD_DIR=/usr/local/src | |
RUN yum -y update && \ | |
yum -y install vim wget xz make gcc zlib-devel bzip2 bzip2-devel \ | |
xz-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel \ | |
libffi-devel ncurses-devel gdbm-devel | |
WORKDIR ${BUILD_DIR} |
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
max747@Kojima-no-MacBook-Pro|~/devel/go/src/github.com/max747/httptest | |
) go test -v | |
=== RUN Test1 | |
2016/04/16 12:07:17.358588 [Kojima-no-MacBook-Pro.local/qhEp2eAttw-000001] Started GET "/%E3%81%82%E3%81%84%E3%81%86" from 127.0.0.1:55148 | |
2016/04/16 12:07:17.358674 [Kojima-no-MacBook-Pro.local/qhEp2eAttw-000001] Returning 200 in 61.58µs | |
--- PASS: Test1 (0.00s) | |
main_test.go:36: map[foo:あいう] | |
Path: /あいう | |
RawPath: | |
EscapedPath: /%E3%81%82%E3%81%84%E3%81%86 |
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
package main | |
import ( | |
"testing" | |
) | |
type Foo struct { | |
a int | |
b int | |
} |
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 zmq | |
import functools | |
import random | |
import sys | |
from multiprocessing import Pool | |
class Client(object): | |
def __init__(self, client_id, addr): | |
self.ctx = zmq.Context() |
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
// 日付フォーマット | |
"%04d/%02d/%02d".format(2012, 11, 1) | |
"%04d/%02d/%02d" format (2012, 11, 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
# coding: utf-8 | |
import os | |
from sqlalchemy import create_engine, Column, Integer, String, DateTime, ForeignKey | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import sessionmaker, relationship | |
basedir = os.path.dirname(os.path.abspath(__file__)) | |
url = "sqlite:///{}".format(os.path.join(basedir, "db.sqlite")) | |
engine = create_engine(url, echo=True, encoding="utf-8") |
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: utf8 | |
def decodehist(_in, out): | |
change = False | |
for _c in _in.read(): | |
c = ord(_c) | |
if c != 0x83: | |
d = c^32 if change else c | |
out.write(chr(d)) |