Skip to content

Instantly share code, notes, and snippets.

View nakagami's full-sized avatar

Hajime Nakagami nakagami

View GitHub Profile
@nakagami
nakagami / DjangoCongress2018.rst
Last active June 2, 2023 06:22
DjangoCongressJP 2018 の発表資料(2018-05-19)

データーベースバックエンドを読む、そして書く(Reading database backend, and writing it)

About this document

These are materials for DjangoCongress JP 2018 (May 19, 2018).

日本の歴史に名を残す詐欺商法の記憶

2018/01/13 の #rettypy https://retty.connpass.com/event/74299/ のコーヒータイムに、最近はやりのビットコインに危険を感じる、という話をした。

ビットコインの計算安全性については理解できるが、(それと、ビットコインの時価総額が今後どうなるかはさておいて)よくわからないまま他人に現金を渡して、証書と交換するような詐欺も起きているのではないか? 時価総額の小さいマイナーな仮想通貨に(これからはこれが儲かりますよと言われて)群がる人たちとかいそう。

いろいろ話すうちに、過去に日本で起きた経済詐欺について、知らない人が多いということに気づいた。

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

リバーシとさめがめと pythonanywhere

Profile

#!/usr/bin/env python3
################################################################################
# MIT License
#
# Copyright (c) 2017 Hajime Nakagami<nakagami@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#!/usr/bin/env python3
################################################################################
# MIT License
#
# Copyright (c) 2017,2020 Hajime Nakagami<nakagami@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@nakagami
nakagami / ibm_db_sample.sh
Last active July 8, 2017 07:52
DB2 command sample
#/bin/sh
db2 connect to test user db2admin using secret
db2 "select * from project where majproj='OP2010'"
db2 "select * from vstafac2 where projno='OP2010'"
db2 terminate
@nakagami
nakagami / ibm_db_sample.py
Last active January 22, 2020 15:45
Sample code to access DB2 via ibm_db by python3
#!/usr/bin/env python3
import os
import ibm_db # pip install ibm_db
conn_s = "DATABASE={};".format(os.environ['DB2_DATABASE'])
conn_s += "HOSTNAME={};".format(os.environ['DB2_HOST'])
conn_s += "PORT={};".format(os.environ['DB2_PORT'])
conn_s += "PROTOCOL=TCPIP;"
conn_s += "UID={};".format(os.environ['DB2_USER'])
conn_s += "PWD={};".format(os.environ['DB2_PASSWORD'])
@nakagami
nakagami / nthprime.py
Last active April 30, 2017 07:37
N 番目の素数を探す(Find Nth prime)
import math
def _is_prime_slow(prime_candidate):
for i in range(2, prime_candidate - 1):
if prime_candidate % i == 0:
return False
return True
@nakagami
nakagami / HowToWritePythonNoSQLDatabaseDrivers.rst
Last active March 8, 2018 07:27
PyConJP2017 にプロポーザルとして提出した資料(落選)

How to write python NoSQL database driver

Python データーベースドライバーの作り方(NoSQL編)

Profile