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
| source :rubygems | |
| gem "eventmachine", "0.12.10" | |
| gem "rack" |
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
| /* | |
| ## 对象健身操 | |
| http://www.infoq.com/cn/minibooks/thoughtworks-anthology | |
| ###规范 | |
| 1. 方法只使用一级缩进。 | |
| 1. 全部符合要求 | |
| 1. 大部分通过方法提取做到,有的带yield的语句块不好提取,幸好一些Linq方法可以用来抽象一些集合操作。 | |
| 1. 所有方法都尽量控制在5行以内,不包含空行和括号单独占的行 |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <string.h> | |
| struct stock5Min | |
| { | |
| unsigned short monthDay; // 月日 | |
| unsigned short hourMin; // 小时, 分钟 |
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
| # Postgresql 9.1 conf | |
| # by http://www.postgresql.org/docs/9.1/interactive/monitoring-stats.html#MONITORING-STATS-FUNCS-TABLE | |
| # | |
| # Server specific parameters | |
| # Example: psql.pg_stat_get_bgwriter_timed_checkpoints | |
| # | |
| UserParameter=psql.pg_stat_get_bgwriter_timed_checkpoints,psql -d neiron -t -c "SELECT pg_stat_get_bgwriter_timed_checkpoints() FROM pg_database WHERE datname='${1-"neiron"}'" | |
| UserParameter=psql.pg_stat_get_bgwriter_requested_checkpoints,psql -d neiron -t -c "SELECT pg_stat_get_bgwriter_requested_checkpoints() FROM pg_database WHERE datname='${1-"neiron"}'" | |
| UserParameter=psql.pg_stat_get_bgwriter_buf_written_checkpoints,psql -d neiron -t -c "SELECT pg_stat_get_bgwriter_buf_written_checkpoints() FROM pg_database WHERE datname='${1-"neiron"}'" | |
| UserParameter=psql.pg_stat_get_bgwriter_buf_written_clean,psql -d neiron -t -c "SELECT pg_stat_get_bgwriter_buf_written_clean() FROM pg_database WHERE datname='${1-"neiron"}'" |
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
| !------------------------------------------------------------------------------- | |
| ! Xft settings | |
| !------------------------------------------------------------------------------- | |
| Xft.dpi: 96 | |
| Xft.antialias: false | |
| Xft.rgba: rgb | |
| Xft.hinting: true | |
| Xft.hintstyle: hintslight |
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
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns | |
| Compress 1K bytes with Zippy 3,000 ns | |
| Send 2K bytes over 1 Gbps network 20,000 ns | |
| Read 1 MB sequentially from memory 250,000 ns | |
| Round trip within same datacenter 500,000 ns | |
| Disk seek 10,000,000 ns |
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
| The basic idea here is to substantiate the claims made by this square post: | |
| http://corner.squareup.com/2011/06/postgresql-data-is-important.html | |
| In PostgreSQL, and MySQL (MyISAM and InnoDB) I create millions of rows and then add | |
| and remove columns and add and remove indexes. For columns without defaults this is | |
| basically free in PostgreSQL and O(n) in MySQL. For adding indexes its at best O(n) | |
| everywhere, but with PostgreSQL it claims not to do any locking that would otherwise | |
| prevent table interaction. | |
| Also, PostgreSQL has _awsome_ documentation (it has real examples!). I always get |
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
| #################### | |
| # centos 5.8 | |
| # post installation | |
| # adapted from | |
| # https://github.com/jedi4ever/veewee/tree/master/templates/CentOS-5.7-i386-netboot | |
| #################### | |
| yum -y install sudo | |
| /usr/sbin/groupadd vagrant |
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 | |
| import sys | |
| import urllib | |
| from HTMLParser import HTMLParser | |
| class FlvcdParser(HTMLParser): | |
| def handle_starttag(self, tag, attrs): | |
| if tag == "a": |