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 f(x): | |
return 1234 + 166 * x + 94 * x * x | |
x = [2,4,5] | |
f0 = 0 | |
for j in range(3): | |
prod = 1 | |
for m in range(3): | |
if m != j: |
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
sql_text = """ | |
select * from a | |
where x = ? | |
and y = ? | |
""" | |
bind_values_text = """1, 2""" | |
sql = sql_text.replace("\n", " ") |
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 sys | |
from Crypto.Cipher import AES | |
import base64 | |
def decrypt(key, et): | |
text = '' | |
for i in range(len(et)): | |
for t in range(0x7e): | |
if (chr((((t - 0x20) + (ord(key[i % len(key)]) - 0x20)) % (0x7e - 0x20 + 1)) + 0x20) == et[i]): | |
text += chr(t) |
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
#include<iostream> | |
#include<vector> | |
#include<algorithm> | |
using namespace std; | |
uint16_t calc_crc5(uint16_t input) { | |
uint16_t crc5 = 41; // x^5 + x^3 + 1 | |
uint16_t c = input; | |
for (int i = 7; i >= 5; --i) //8ビットを計算するときはcrc5では7~5左シフトすればよい |
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
# Description | |
# A Hubot script for omikuji | |
# Commands: | |
# omikuji <item1>,<item2>,<item3> | |
module.exports = (robot) -> | |
robot.hear /omikuji\s(.+)/, (msg) -> | |
items = msg.match[1].split(/[・、,,\s,]+/) | |
item = msg.random items | |
msg.send "#{item}さんお願いします!" |
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
"name": "omikuji", | |
"version": "0.0.0", | |
"private": true, | |
"author": "mmnk", | |
"description": "omikuji", | |
"dependencies": { | |
"hubot": "^3.3.1", | |
"hubot-diagnostics": "^1.0.0", | |
"hubot-google-images": "^0.2.7", | |
"hubot-google-translate": "^0.2.1", |