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
# 出版社記号を取り出す | |
# ISBN-10を想定 | |
CREATE TEMP FUNCTION | |
stripPublisherID(a STRING) | |
RETURNS STRING | |
LANGUAGE js AS """ | |
if(!a.length==10)return null; | |
if(!a.startsWith('4'))return null; | |
let ln = 0; |
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
def create_index(es, index): | |
es.indices.create(index='negima-' + index, body={ | |
"settings": { | |
"number_of_shards": 2, | |
"number_of_replicas": 0, | |
"refresh_interval": "30s", | |
"analysis": { | |
"analyzer": { | |
"wakachi": { |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import isbnlib | |
TRY_ISBN_DIRECT = ["direct"] # 直接 | |
TRY_ISBN_10 = ["i10"] # ISBN10桁で検索 | |
TRY_ISBN_13 = ["i13"] # ISBN13桁で検索 | |
TRY_ISBN_13_10 = ["i13", "i10"] # ISBN10桁と13桁で検索 |
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
def initialize_camera(cap, role): | |
logger.info("カメラ[%s]を初期化しています" % role) | |
# 新しいV4K対応 | |
cap.set(cv2.CAP_PROP_FPS, 15) | |
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640) | |
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480) | |
cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G')) | |
for x in range(1,50): |
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
# -*- coding: utf-8 -*- | |
# MIT | |
""" | |
参考スキーマ | |
mapping = { | |
"unitrad-doc": { | |
"properties": { | |
"source": {"type": "keyword"}, |
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 requests | |
from email.utils import formatdate | |
import hmac | |
import hashlib | |
import base64 | |
import json | |
secret_key="xxxxxxxxx" | |
userid="xxxxxx" | |
keyword = "ryuuji+yoshimoto" |
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
Taskkill /IM chrome.exe | |
timeout 1 | |
start /max "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" |
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
# coding: utf-8 | |
import pyperclip as clip | |
import random | |
import time | |
keywords = """村上海賊の娘 | |
村上春樹 | |
1Q84 | |
中津川市 |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |