Mac OS X 10.6.8 (Leopard) 32 bit
ruby -e 'puts RUBY_PLATFORM'
i386-darwin10.8.0
| // Get property by name: "performSelector:" | |
| - (void)encodeWithCoder:(NSCoder *)encoder { | |
| for(int i=0; i<kFieldCount; i++) { | |
| NSString *fieldName = [[NSString alloc]initWithFormat:@"field%d", i+1]; | |
| //NSString *field = [self performSelector:sel_getUid([fieldName UTF8String])]; | |
| NSString *field = [self valueForKey:fieldName]; | |
| [encoder encodeObject:field forKey:fieldName]; | |
| [fieldName release]; | |
| } |
Installed: 1.3.4 manually
wfeng@ca2:~$ /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.3.4
built by gcc 4.4.5 (Debian 4.4.5-8)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module --with-http_gzip_static_module --with-cc-opt=-Wno-error --add-module=/usr/local/src/passenger-3.0.14/ext/nginx
| require 'bundler/setup' | |
| require 'mechanize' | |
| require 'open-uri' | |
| agent = Mechanize.new | |
| # agent.set_proxy 'localhost', 3128 | |
| # login | |
| agent.get('https://www.codeschool.com/users/sign_in') do |page| | |
| result = page.form_with(:action => '/users/sign_in') do |form| |
| require "mechanize" | |
| require "sinatra" | |
| require "stringio" | |
| class MedalScraper | |
| def initialize | |
| @sports = { | |
| 'archery' => 'Archery', | |
| 'athletics' => 'Athletics', | |
| 'badminton' => 'Badminton', |
| require "open-uri" | |
| def download | |
| if $*[0] == nil or $*[1] == nil or $*[2] == nil | |
| abort "用法示例:ruby #$0 开始数 结束数 存放的目录 EX:如ruby #$0 200 300 d:\\ " | |
| end | |
| time = Time.now | |
| threads = [] | |
| for i in $*[0]..$*[1] | |
| exports = "http://blog.ntjy.net/my_blogs/" + i.to_s |
| <?php | |
| $now = time(); | |
| ?> | |
| <html> | |
| <head> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script> | |
| <script type="text/javascript"> | |
| // we will add our javascript code here |
| wfeng@mbp ~ which hg | |
| /usr/local/share/python/hg | |
| Mercurial.configure do |conf| | |
| conf.hg_binary_path = "/usr/local/share/python/hg" | |
| end | |
| repo = Mercurial::Repository.open("/Users/wfeng/work_local/www/betslip") | |
| repo.branches.active.collect { |b| { :name => b.name, :hash_id => b.hash_id, :selected => ["HEAD", "default"].include?(b.name) } } |
| <?php | |
| function change_value_1(array $o) { | |
| $o['b'] = 5; | |
| } | |
| function change_value_2(array $o) { | |
| $o = array(); | |
| $o['b'] = 5; | |
| } |
| <?php | |
| // debug log full | |
| function _dbg_logf() { | |
| $args = func_get_args(); | |
| _dbg_log_core(true, $args); | |
| } | |
| // debug log standard | |
| function _dbg_log() { |