| __author__ = 'KIM_TPDN' | |
| from logitechlcd import LogitechLcd | |
| from time import sleep | |
| if __name__ == '__main__': | |
| lcd = LogitechLcd('朝鮮民主主義人民共和国') | |
| lcd.set_text(0, '文字数は全角1文字=半角2文字') | |
| lcd.set_text(1, '換算で、1行あたり半角29文字') | |
| lcd.set_text(2, '文字数が一定を超えるとはみ出る') | |
| lcd.set_text(3, '김정일 【ハングル対応】金正日') |
| import select | |
| import datetime | |
| import psycopg2 | |
| import psycopg2.extensions | |
| from sqlalchemy import create_engine, text | |
| engine = create_engine("postgresql+psycopg2://vagrant@/postgres") |
| #!/bin/sh | |
| if git rev-parse --verify HEAD >/dev/null 2>&1 | |
| then | |
| against=HEAD | |
| else | |
| # Initial commit: diff against an empty tree object | |
| against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
| fi | |
RDBMS-based job queues have been criticized recently for being unable to handle heavy loads. And they deserve it, to some extent, because the queries used to safely lock a job have been pretty hairy. SELECT FOR UPDATE followed by an UPDATE works fine at first, but then you add more workers, and each is trying to SELECT FOR UPDATE the same row (and maybe throwing NOWAIT in there, then catching the errors and retrying), and things slow down.
On top of that, they have to actually update the row to mark it as locked, so the rest of your workers are sitting there waiting while one of them propagates its lock to disk (and the disks of however many servers you're replicating to). QueueClassic got some mileage out of the novel idea of randomly picking a row near the front of the queue to lock, but I can't still seem to get more than an an extra few hundred jobs per second out of it under heavy load.
So, many developers have started going straight t
| 日時: | 2025-05-13 |
|---|---|
| 作: | 時雨堂 |
| バージョン: | 2025.3 |
| URL: | https://shiguredo.jp/ |
言語
| from datetime import datetime | |
| from sqlalchemy import Column, Integer, DateTime, ForeignKey | |
| from sqlalchemy.orm import relationship | |
| from sqlalchemy.ext.declarative import declared_attr | |
| from flask_security import current_user | |
| class AuditMixin(object): | |
| created_at = Column(DateTime, default=datetime.now) | |
| updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now) |
| Notes on how to use AWS SNS: | |
| 1. Subscribe an HTTP endpoint (i.e. http://myhost/sns_endpoint) on AWS Console | |
| 2. AWS will send subscription confirmation right away | |
| 3. SNS_controller responds to subscription confirmation by sending confirmation using Fog. | |
| 4. Once AWS is happy, you can start sending notifications to your end point via SNS. |