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 os | |
import zipfile | |
import xml.etree.ElementTree as xml | |
''' | |
book.xlsx/ | |
|- _rels/ | |
|- xl/ | |
| |- drawings/ | |
| | | |- _rels/ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<!-- | |
ボタンを連続3回クリックしたときのログ | |
counter: 0, 2000 |
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
#include <iostream> | |
#include <vector> | |
#include <openssl/evp.h> | |
#include <openssl/ossl_typ.h> | |
// OpenSSL v1.1.1d | |
// https://www.openssl.org/docs/man1.1.1/man7/crypto.html | |
// https://www.openssl.org/docs/man1.1.1/man3/EVP_CIPHER_CTX_new.html | |
bool Encrypt(const unsigned char * key, |
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
#include <fstream> | |
int main () { | |
std::ifstream fs("/file"); | |
const std::string data((std::istreambuf_iterator<char>(fs)), std::istreambuf_iterator<char>()); | |
} |
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
/** | |
* Simple HTTP Server | |
* | |
* $ node server.js # current folder is www root | |
* $ node server.js www # www is www root | |
* | |
*/ | |
var http = require('http'); | |
var fs = require('fs'); |
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 argparse | |
# とりあえずdescriptionを指定してあれば良い感じ。 | |
# https://docs.python.org/2.7/library/argparse.html#argparse.ArgumentParser | |
p = argparse.ArgumentParser(description='command line sample') | |
# 簡単なオプション類 |
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 -*- | |
'''optparseを用いているが、これはPython 2.7でdeprecated | |
optparseではなく、argparseを使う | |
''' | |
from optparse import OptionParser | |
# optionの定義 | |
p = OptionParser() |
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 -*- | |
"""jsonファイル読み込み""" | |
import json | |
# ファイルから読み込み | |
# jsのobjectはpythonのdictとして読み込まれる | |
# https://docs.python.org/2.7/library/json.html?highlight=json#json-to-py-table |
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 -*- | |
"""datetimeとISO 8601文字列の変換""" | |
import datetime | |
# datetimeからISO 8601を得る | |
d = datetime.datetime(2014, 11, 11, 9) | |
print d.isoformat() # 2014-11-11T09:00:00 |
NewerOlder