2012-02-09
やったーmod_vimできたよー
Vim scriptはウェブアプリケーション記述言語やったんやー
Plack とかよくわかんないのでさくっと Apache で使えるようにしてみました。
httpd.conf はこんな感じ
LoadModule vim_module mod_vim.so DocumentRoot . Listen 8080 PidFile /tmp/pid LockFile /tmp/lock ErrorLog /tmp/error_log VimDisplay :0 VimVersion 7.2 VimEncoding UTF-8 <Location /> SetHandler vim VimExpr vimplack#handle(@@) </Location>
ビルド方法は、まあ README に書いておけよって感じですが
make top_builddir=/usr/share/apache2/build
みたいにしてください、apr-json が別途必要です。
mattnさんのサンプルはこんな感じに動いています。
% ab -n 500 -c 20 http://localhost:8080/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Finished 500 requests
Server Software: Apache/2.2.20
Server Hostname: localhost
Server Port: 8080
Document Path: /
Document Length: 348 bytes
Concurrency Level: 20
Time taken for tests: 0.587 seconds
Complete requests: 500
Failed requests: 0
Write errors: 0
Total transferred: 246500 bytes
HTML transferred: 174000 bytes
Requests per second: 851.90 [#/sec] (mean)
Time per request: 23.477 [ms] (mean)
Time per request: 1.174 [ms] (mean, across all concurrent requests)
Transfer rate: 410.14 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 22 14.0 20 229
Processing: 0 1 3.4 0 31
Waiting: 0 1 3.4 0 31
Total: 4 23 14.1 21 248
Percentage of the requests served within a certain time (ms)
50% 21
66% 22
75% 23
80% 25
90% 28
95% 32
98% 52
99% 98
100% 248 (longest request)
Enjoy!
2012-01-07
JavaScriptで任意のテキストをバイト列からラスタ画像化する、またはその逆
id:monjudoh や id:nishiohirokazu と話してて作ったんだけどとりあえず使い道なかったので共有します。
テキストをレンダリングして画像にするという話ではなく、
ということをする話です。
デモサイト:
http://moriyoshi.github.com/textimgenc/
ソースはこちら:
2011-12-18
PHP Apocalypse (と1981忘年会で) 発表してきました
HipHop for PHP (HPHP) についてのスライドです。
前も同じ事があったけども、なぜか貼れない...。
2011-10-15
Python Developers Fest 2011.10 で発表しました
最近ネタの切れが悪いと言われます…。
Package documentation より:
This package is a port of a great Perl module called Acme::AKB48 which was created by Hideo Kimura. Although I don’t have the slightest interest in AKB48, I happened to be under the impression that Python world (almost) totally lacks “Acme” essence and feel like it being worth the first Acme to be ported.





