原创 git 隨想

1 所有內容都在本地 便宜快速的本地分支 因爲是本地的所以是分散的2 git 很省空間 git 很快 3 緩衝區功能 4 githubgit f

原创 rails tip 1

環境 2.2.2call_back 中的操作和相應的action 是在同一個數據庫事務下的。一個save 及類似指令將會發起一個事務,如果rails 檢測到某個model 對象中的全部屬性並無改變(參閱ra

原创 Answer to Best of Ruby Quiz, quiz 4 "the animal quiz"

[["an elephent", true]]$stack = []def input gets.chompend# convert_answer_to_questiondef c_a_t_q(key) "Is it a/an #{k

原创 RubyKaigi 2008:標準化與Ruby 1.9 路線圖

逆向翻譯 原文地址:[url]http://www.infoq.com/cn/news/2008/07/rubykaigi[/url]This is the second part news about

原创 編程隨感

1 在你覺得需要寫註釋的時候寫註釋: 首先你需要爲方法,類或者模塊起個簡單易懂的名字 如果必須通讀一個方法的代碼才能瞭解它做什麼,那麼開發人員先要投入大量時間和精力才能使用它。反過來說:只需要短短几行註

原创 掃雷:面向對象分析與設計(第三版)

即使冒着被板磚砸飛的風險,我也要說:   Object-Oriented Analysis and Design with Applications (3rd Edition)   對於ruby程序員(也許再加上使用敏捷的團隊)並不實用

原创 發現一個可以使用ruby提交的acm網站

https://www.spoj.pl/不僅能使用ruby,還可以使用python/perl/lisp等幾乎你能叫得出名的編程語言進行提交缺點:1 每個語言的版本都低了些,ruby是1.8.52 題庫的

原创 Answer to Best of Ruby Quiz quiz 03

Answer to "GEDCOM Parser" version 1require "rexml/document"include REXMLGlobal_pattern = /\S+/Id_patter

原创 ruby沉思錄(1)

module A def fine p "cool" end def right p "hello" fine p "ok" endendclass B include A def fine p

原创 rails test prescription 隨感

controller測試 1 看一個普通,基本的用戶請求是否能引發預計的ActiveRecord正常工作,需要的數據是否傳給了view 2 檢測controller是否能夠適當地處理不合格式的請求 3 檢測權限系統是否正常工作

原创 ruby沉思錄(2)

begin# raise "fine"# raise ArgumentError, "ok"# raise SignalException exitrescue => e p "cool" p e.messageendp "c

原创 Answer to Best of Ruby Quiz quiz 03 version 2

-- 差距很大,前一版本有很多冗餘邏輯#! /usr/bin/rubyrequire ' rexml/document 'doc = REXML::Document.new "<gedcom/>"stack