Tuesday, September 20, 2011

yaml.dump() exception lead to corrupt data

A long .yml file. yaml.load() then edit then yaml.dump() to same file. If yaml.dump() throw exception, the original file might be corrupt.

Thursday, September 1, 2011

低级错误搞死了Eclipse

非常低级的错误,晕乎乎的午后所犯:
while (it.hasNext()) {
     size++;
}
程序一运行Eclipse就死了,系统也没有响应了。晕了半天才回过神:死循环。 遂改之:
while (it.hasNext()) {
     size++;
     it.next();
}
世界安静了。