You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
# coding=utf8 import paho.mqtt.client as mqtt def on_connect(client, userdata, rc): print("Connected with result code "+str(rc)) client.subscribe("a/b") def on_message(client, userdata, msg): print(msg.topic+" "+str(msg.payload)) if __name__ == '__main__': client = mqtt.Client(client_id="spam", clean_session=True, protocol=mqtt.MQTTv311) client.on_connect = on_connect client.on_message = on_messag
The OpenRoss image proxy service provides a way of serving dynamically resized images from Amazon S3 in a way that is fast, efficient, and auto-scales with traffic. We have hosted the source for this service at Github. Motivation At Lyst we scrape, and have scraped, millions of products that all have at least one image. In our infancy, we saved all product images with 10 preset sizes, and then ren
概要 まずは先に二つの記事をどうぞ DynamoDB HTTP API が独特な仕様なので紹介 Python の JSON Schema ライブラリを使ってみる さて、 最近は JSON を受け取って JSON を返す、この仕組みを実装する事が多いのですが、HTTP ベースとなると色々辛くなってきます。URL の設計、メソッドの選択などなど。もう面倒くさいから URL や メソッドは統一してしまいます。 機能判定は HTTP の独自定義したヘッダーを使う X-Amz-Target: DynamoDB_20120810.PutItem X-<会社名?>-Target: サービス名_日付.機能名 URL は / のみ メソッドは POST のみ 全てのやりとりは JSON で バリデーションは Req/Res 両方を JSON スキーマを使う とにかく頑張らない仕組みを作ります。 ライブラリの
from flask import Flask app = Flask(__name__) import json_schema import json schema = { "name": { "type": "string", "required": True }, "age": { "type": "number", "required": True "maximum": 120, "minimum": 0 } } @app.route("/") @json_schema.validate("POST", schema) def index(): if request.is_post: data = json.loads(request.data) print data["name"] print data["age"] return "Hi! "+data["name"] else
TwitterやFacebookは社外の人たちとコミュニケーションを取るのには便利ですが、社内の人たちのコミュニケーションにはあまり向きません。いちいち友だち申請なんてやるのも面倒でしょう。 そこで紹介したいのがBootcamp、エンタープライズ向けのソーシャルネットワークシステムです。社内コミュニケーションの一環にいかがでしょう。 Bootcampの使い方  Bootcampの主な機能はTwitterライクなツイート、ブログそしてQ&Aとなっています。システムとしてはDjango 1.6.5、Python 2.7、Bootstrapの組み合わせになっています。システムはシンプルなので、カスタマイズできる余地が大きそうです。 BootcampはPython/Django製のオープンソー
Djangoのセッションデータは、settings.SESSION_ENGINEで指定されたクラスによって保存されます。 Django 1.5.3より前のバージョンでは、セッションデータのオブジェクトをシリアライズ、デシリアライズする処理は、ここで指定されるバックエンドクラスに任されていました。 デフォルトでは、pickleモジュールでダンプして、ハッシュ値+base64エンコードした文字列になっていました。 Django 1.5.3以降では、このpickleモジュールでダンプしていた部分が分離され、新たにsettings.SESSION_SERIALIZERという設定項目が追加されました。 SESSION_SERIALIZER Django 1.5.3以降の1.5系では、settingsにSESSION_SERIALIZERを指定しない場合は従来通りpickleモジュールが使用されます。
Go beyond crash reporting, error tracking, logging and error monitoring. Get instant and accurate alerts — plus a real-time feed — of all errors, including unhandled exceptions. Our automation-grade grouping uses machine learning to reduce noise and gives you error signals you can trust. A better way to discover errors Instantly see the impact of crashes and errors with metadata — like which custo
MoviePy documentation# Date: Jan 26, 2025 Version: Useful links: Binary Installers | Source Repository | Issues & Ideas | Q&A Support | MoviePy is the Python reference tool for video editing automation! It’s an open source, MIT-licensed library offering user-friendly video editing and manipulation tools for the Python programming language.
cramという便利なものがあります。これは語弊のある言い方をするとRubyでいうcucumber/turnipのようなテストツールです。サンプルを見たほうが早いと思いますが、普通にMarkdownとかを書く感じでテストを書けて、コマンドの想定される出力と実際のものを比較してtrue/falseを判定するみたいなやつです。想定と実際の出力とのdiffがなければグリーン、期待と違えばレッドです。 Vagrantのテストというとserverspecが勢いありますが、cramはもっと生っぽいテストをかけます。serverspecではshould be_enabledのように、書くのは簡単だけど実際に何をテストしているのかはソースコードを見ないとわからないので、テストがこけた場合の原因調査がちょっと厄介です(例えばRedhat系ならchkconfigの結果を見ています)。とはいえcramでパッケージ
経緯 機種変更したあとに古いほうのiPhone4Sを売ろうと思っていたら、なんとなく時間がたってしまった。いまさら売るのもめんどくさいし何かに有効活用したいので、セールのときに買っていたPythonistaをインストールしたらいろいろやれると思った。思ったので調べました。 Pythonista iPhoneやiPadでpythonスクリプト(Pythonista1.5ではpython2.7系)を実行できるPythonistaというアプリがあっていろいろできてたのしいです。有料です。いまは700円でした。 日本語で紹介しているサイト http://hitoriblog.com/?p=20698 http://kainokikaede.hatenablog.com/entry/2014/01/30/214921 Pythonistaに含まれていないモジュールをいれる Pythonistaには標
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く