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.
- https://github.com/nakagami
- 結婚して以来25年間、千葉県船橋市在住
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 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 |
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 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 |
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
#/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 |
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 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']) |
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 math | |
def _is_prime_slow(prime_candidate): | |
for i in range(2, prime_candidate - 1): | |
if prime_candidate % i == 0: | |
return False | |
return True | |