博客搬家

今天抽空搬了一下。从blogbus到wordpress。用的是一个python脚本.http://blog.huyo.org/?p=336

中间出了一些问题。第一个问题是特殊字符。删掉就好了。第二个是有一篇日志的pubDate竟然是0000-00-00。回去一查并不是。但是导出变成那样了。改过来就好了。转换程序里面加入两句python代码才发现。
发觉wordpress真的不错。
啥时候把以前blogdriver和自己的moveable type的内容也导入进来。
Advertisements

structure matters

good structure has good decoupling, high cohesion

good structure does not pop out instantly, but rather, it is distilled by continuously recfactoring, which requires time and deeper understanding

good structure enables easy, intuitive and fast assembling/creation

good structure matches the nature 

structure is orthogonal to functionality, i.e. changing structure doesn't adding or removing functions

code structure, directory structure, chapter structure, sentence structure, ….

it’s not evolving, it’s growing

grow is a better term to describe a continuous maturing system than evolution

a city, a software, a code base, 

they may grow, they may die

human's knowledge is continue growing

our understanding is continue growing, and may also be dying due to memory loss

to better understand some complex systems, we need to learn from their child/initial phase, which is simple but completed (to grow), 

evolution is a random process shaped by environment

growing is a intelligent process shaped by a goal or shaped by intelligent reaction to environment

code growing is not random

city growing is not random

understanding growing is not random

skills growing is not random

those things may also be dying

growing means stronger and stronger

dying means weaker and weaker

energy is the source for growing

ruby object array remove duplicate by attribute

http://groups.google.com/group/ruby-talk-google/msg/e34ef2cb150b971e

require 'set' 
class Array 
  def uniq_by 
    seen = Set.new 
    select{ |x| seen.add?( yield( x ) ) } 
  end 
end 

a = [ {:a=>1, :d=>1}, {:b=>2}, {:c=>3}, {:a=>1, :d=>3} ] 
p a, a.uniq, a.uniq_by{ |h| h[:a] } 
#=> [{:a=>1, :d=>1}, {:b=>2}, {:c=>3}, {:a=>1, :d=>3}] 
#=> [{:a=>1, :d=>1}, {:b=>2}, {:c=>3}, {:a=>1, :d=>3}] 
#=> [{:a=>1, :d=>1}, {:b=>2}]