aksでチープな構成のk8sクラスタを組む
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
検証 |
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
# 素数テストの対象の数をリストで用意する | |
target_numbers = range(2, 11) | |
# 素数を入れるリストを用意する | |
prime_numbers = [] | |
for target in target_numbers: | |
# 素数ではないですフラグを用意する | |
is_not_prime_number = False | |
# 素数テスト(2から、テスト対象の数までで割り切れるか) |
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
バイナリ ⇔ 文字列 の相互変換をするだけなので楽 | |
http://www.cipa.jp/std/documents/j/DC-008-2012_J.pdf | |
ページ49 / 195のUserComment参照 | |
UserCommentフィールドの値を バイナリ⇔文字列型 の変換する関数の実装 | |
piexif/_helper.pyに実装 | |
引数、返り値などは下記のような具合に |
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
与えられるデータをexifのフォーマットに沿った形にしないといけないので仕様の理解が必要。 | |
さらに単体テストがむずい書き方をしてしまっているのでちょっとむずい。 | |
公式ドキュメント(http://www.cipa.jp/std/documents/j/DC-008-2012_J.pdf)に記載のある型の値の読み書きはできるようになっている。 | |
しかし扱える型の拡張がどこかで行われているようで、「〇〇型を追加してくれ」と要望がたまにくる。 | |
なのでMITの資料(https://www.media.mit.edu/pia/Research/deepview/exif.html)に沿って以下の型の読み書きができるように機能を拡張する。 | |
・SignedByte | |
・SignedShort | |
・Double |