Python2.6で試した。 preforkサーバはlistenした後にforkして、それからacceptすればよいみたい? server.py import os import sys import socket import signal child_processes = [] def main(host, port, children): signal.signal(signal.SIGTERM, accept_sigterm) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((host, port)) s.listen(1) # fork for i in range(children): pid = os.fork() if pid != 0: # parent sys.stdout.write('chi
Redis: under the hood October 18, 2010 How does the Redis server work? I was curious to learn more about Redis’s internals, so I’ve been familiarizing myself with the source, largely by reading and jumping around in Emacs. After I had peeled back enough of the onion’s layers, I realized I was trying to keep track of too many details in my head, and it wasn’t clear how it all hung together. I decid
A Wikibookian suggests that this book or chapter be merged into SQL Dialects Reference. Please discuss whether or not this merge should happen on the discussion page. You may have read a bunch of short articles with the same name on the web, but they were just snippets of information you needed. It's time to put it all together. You have a project in MySQL and suddenly you find out that you need t
前回「Google Mobile Proxy」を紹介したが、毎回この簡素なトップページにURLを入力するのはかなりツラい。多少なりともラクをできるよう工夫しないかぎり、落ちてから再起動したほうがマシ、ということにもなりかねない。 最初に紹介するのは、もっとも基本的な対処法。特に仕掛けらしいものはなく、Google Mobile Proxyのサイトへアクセスするとき、開きたいページをURLとして指定するだけだ。たとえば、首相官邸ホームページを対象にするときには、「?u=」に続けて件のサイトのURL(http://www.kantei.go.jp/)を指定すればOK。これをブックマークに登録しておけば、次回からすばやくアクセスできるはず。 http://www.google.co.jp/gwt/n?u=http://www.kantei.go.jp/ 前回お伝えするのを失念していたが、一度Go
Getting Started This document outlines the steps that are necessary in order to make your AJAX application crawlable. Once you have fully understood each of these steps, it should not take you very long to actually make your application crawlable! However, you do need to understand each of the steps involved, so we recommend reading this guide in its entirety. Overview of Solution Briefly, the sol
最新リリース 2019-09-10にリリースされた2.1.5が最新安定版リリースです。 変更点 ダウンロード 環境毎のインストール方法です。 Debian Ubuntu CentOS 7 CentOS 8 FreeBSD それ以外 環境毎のアップグレード方法です。 Debian Ubuntu CentOS FreeBSD milter managerとは milter managerはmilterを使って効果的に迷惑メール対策(スパムメール対策・ウィルスメール対策)を行うフリーソフトウェアです。 milter managerはmilterをサポートしているSendmailやPostfixといったMTAと一緒に使うことができます。Ubuntu、CentOS、FreeBSDなどのプラットフォーム上で動作します。 milter managerの紹介 README サポート メーリングリストで質問
pythonでデーモンを書きたいと思って、調べてみると「Pythonでprefork型のデーモンを書く」という記事を見つけました。この内容が素晴しくて、プロセスもデーモンも初心者な僕でも処理の大枠を理解できました。 それで、デーモン化する為のモジュールってあるんじゃないのと思いpypiを見てみると、複数のモジュールが登録されていました。その中で一番リッチな機能を持つDaemonContextを使ってみる事にしました。 インストールはeasy_installで一発です。 $ easy_install python-daemon 使い方も簡単でDaemonContextオブジェクトを作成して、そのwith構文中がDaemon化されます。 #!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import with_statement
ZeroMQ is a messaging library, which allows you to design a complex communication system without much effort. It has been wrestling with how to effectively describe itself in the recent years. In the beginning it was introduced as ‘messaging middleware’ later they moved to ‘TCP on steroids’ and right now it is a ‘new layer on the networking stack’.I had some trouble understanding ZeroMQ at first a
Code and comments on web development, Django, Python and things (un)related. Logging to syslog in Python I was trying to use the standard Python logging module to write messages to syslog. The logging module has a SysLogHandler class which can log to a local or remote syslog daemon. With no host specified, SysLogHandler uses localhost which is what I wanted. I tried to use SysLogHandler, but it ju
村上春樹『1Q84』 『1Q84』があれほど売れ、あれほど話題になったのに、文藝評論家たちはこの小説の社会性をあまり論じていないような気がする。唯一この小説を1960年代から70年代、80年代、90年代を経由して現在に至る社会的文脈の中で、かつ連合赤軍からオウム真理教まどの「若者の反乱」の文脈の中で論じたのは社会学者の大澤真幸だけだ(『THINKING「O」 』〈4号〉 特集:もうひとつの1Q84、左右社)。 ところが大沢の分析ですら、『1Q84』が東京論でもあることをなぜか指摘していない。『1Q84』では村上春樹にしては珍しく実在の地名が多数登場する。そして「高円寺」にこだわっている。この小説は天吾と青豆という二人の男女が主人公だが、高円寺は天吾の住んでいる場所だし、登場人物たちは磁場に引き寄せられるように高円寺に集まってくる。対して青豆は「高円寺」とは(特に1984年当時には)まったく
Welcome to Flask¶ Welcome to Flask’s documentation. Get started with Installation and then get an overview with the Quickstart. There is also a more detailed Tutorial that shows how to create a small but complete application with Flask. Common patterns are described in the Patterns for Flask section. The rest of the docs describe each component of Flask in detail, with a full reference in the API
Javaにはlog4j、.NETにはlog4netがあるように当然Pythonにもログ機能(以下からloggingとします。)は存在しますが、Pythonの場合は標準ライブラリにすでに組み込まれています。 今回はその機能を使用したサンプルを紹介します。 loggingではいくつかのログ出力方式を指定することが可能ですが、今回はログファイルのサイズ指定とローテート指定の行える「RotatingFileHandler」を使用してサンプルを作成します。 その他のログ出力方式は、Python用ロギング機能 を参照してみてください。 今回は、ログ出力用のプログラムファイル(log.py)と設定ファイル(log.conf)を作成します。 注) 設定ファイルを使用せずにプログラムファイルで設定を行うことも可能ですが、一般的にログ設定ファイルを作成しますので今回は設定ファイルを作成します。 また、logg
เข้าสู่ระบบ99 เล่นสล็อตออนไลน์กับเรา รับโบนัสมากมาย รางวัลแจ็คพอตทุกวัน หลากหลายเกม ง่ายต่อการชนะ ท่านทุกท่านสามารถเข้าสู่ระบบ 99 เพื่อเล่นสล็อตออนไลน์ได้อย่างง่ายดายและสะดวกสบาย ทางเรามีเกมสล็อตให้เลือกเล่นมากมาย ทั้งเกมสล็อตคลาสสิก สล็อตออนไลน์ สล็อตมือถือ และอีกมากมาย ทุกท่านสามารถเข้ามาเล่นได้ตลอด 24 ชั่วโมง ไม่ว่าจะเป็นกลางวันหรือกลางคืน lucky99+เข้าสู่ระบบ ทางเรายังมีโบนัสมากมายให้ทุกท่านได้
Python用単体テストフレームワークであるPikzieのバージョン0.9.7をリリースしました。 変更点一覧 ハイライト Cutter、UxUと同じように、ついにPikzieでもデータ駆動テストをサポートしました。 データ駆動テスト前 例えば、今までこのように書いていたテストがあるとします。 test_prime.py: import pikzie def test_zero(): assert_false(is_prime(0)) def test_unit(): assert_false(is_prime(1)) def test_small(): assert_true(is_prime(2)) def test_square(): assert_false(is_prime(4))
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く