This file contains hidden or 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 unittest | |
| import tempfile | |
| import firebirdsql | |
| values_with_null = [ | |
| (1, 1), | |
| (2, 2), | |
| (3, 4), |
This file contains hidden or 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 unittest | |
| import tempfile | |
| import minipg | |
| import firebirdsql | |
| class TestCovarSamp(unittest.TestCase): | |
| def test_pg(self): | |
| connection = minipg.connect( |
This file contains hidden or 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 unittest | |
| import tempfile | |
| import firebirdsql | |
| values_with_null = [ | |
| (1, 1), | |
| (2, 2), | |
| (3, 4), |
This file contains hidden or 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
| /* | |
| * Redistribution and use in source and binary forms, with or without | |
| * modification, are permitted provided that the following conditions are met: | |
| * 1. Redistributions of source code must retain the above copyright notice, | |
| * this list of conditions and the following disclaimer. | |
| * 2. Redistributions in binary form must reproduce the above copyright | |
| * notice, this list of conditions and the following disclaimer in the | |
| * documentation and/or other materials provided with the distribution. | |
| * 3. The name of the author may not be used to endorse or promote products | |
| * derived from this software without specific prior written permission. |
This file contains hidden or 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 python2.7 | |
| from __future__ import print_function | |
| import datetime | |
| import time | |
| import paho.mqtt.client as mqtt # https://pypi.python.org/pypi/paho-mqtt/ | |
| topic = "foo/bar" | |
| if __name__ == '__main__': | |
| client = mqtt.Client(protocol=mqtt.MQTTv311) |
This file contains hidden or 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 python2.7 | |
| from __future__ import print_function | |
| import paho.mqtt.client as mqtt # https://pypi.python.org/pypi/paho-mqtt/ | |
| topic = "foo/bar" | |
| def on_connect(client, userdata, flags, respons_code): | |
| print('connect:status {0}'.format(respons_code)) | |
| client.subscribe(topic) |
This file contains hidden or 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
| CREATE TABLE test_rank ( | |
| i integer, | |
| s varchar(1) | |
| ); | |
| INSERT INTO test_rank (i, s) VALUES (1, 'A'); | |
| INSERT INTO test_rank (i, s) VALUES (2, 'B'); | |
| INSERT INTO test_rank (i, s) VALUES (2, 'b'); | |
| INSERT INTO test_rank (i, s) VALUES (3, 'D'); | |
| INSERT INTO test_rank (i, s) VALUES (4, 'E'); |
This file contains hidden or 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
| CREATE TABLE employee ( | |
| id integer, | |
| department varchar(16), | |
| salary decimal(4, 2) | |
| ); | |
| INSERT INTO employee (id, department, salary) VALUES (1, 'R & D', 10.00); | |
| INSERT INTO employee (id, department, salary) VALUES (2, 'SALES', 12.00); | |
| INSERT INTO employee (id, department, salary) VALUES (3, 'SALES', 8.00); | |
| INSERT INTO employee (id, department, salary) VALUES (4, 'R & D', 9.00); |
This file contains hidden or 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
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| How to write python database driver | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| - https://pycon.jp/2016/ja/schedule/presentation/13/ | |
| - https://www.youtube.com/watch?v=ax2WmQ_MSXs | |
| - https://togetter.com/li/1028521 | |
| ======================================== | |
| Preface |
This file contains hidden or 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 | |
| """ | |
| Wikipedia の dump ファイルから、 page を切り出して title と text を抽出 | |
| https://dumps.wikimedia.org/jawiki/ にある | |
| https://dumps.wikimedia.org/jawiki/YYYYMMDD/jawiki-YYYYMMDD-pages-articles.xml.bz2 がデータソース | |
| $ bzcat < jawiki-YYYYMMDD-pages-articles.xml.bz2 | ./ja_wikipedia_title_text.py | |
| https://dumps.wikimedia.org/jawiki/latest/jawiki-latest-pages-articles.xml.bz2-rss.xml |