2012年8月21日 星期二

[Python] 算複利小程式

"""Compound Interest"""

max_month = 20 * 12;
curr_month = 0;
money = 58390;
saving = 0;
rate = 0.05 / 12;

while (curr_month < max_month):
    curr_month += 1;
    saving = saving * (1 + rate);
    saving += money;


[Perl] 算複利小程式

use strict;
use warnings;

my $max_month = 20 * 12;
my $curr_month = 0;
my $money = 58390;
my $saving = 0;
my $rate = 0.05 / 12;

while ($curr_month < $max_month) {
    $saving = $saving * (1 + $rate);
    $saving += $money;

print "$saving\n";

2012年8月17日 星期五

Anímate y habla

1. Laura levantó a las ocho en punto.
2. Laura lavó las manos a las ocho y cinco.
3. Laura desayunó a las ocho y veinte.
4. Laura salió de casa a las ocho y treinta y cinco
5. Laura saludó a su estudiante de español a las ocho y cincuenta.
6. Laura deció adiós a su estudiante de español a las dos de la tarde.
7. Laura comió a las dos y media.8. Laura trabajó a las siete y quince.
9. Laura cenó las nueve de la noche.
10. Laura fue a dormir a las once y media de la noche.

2012年8月15日 星期三

[News] Deaths spotlight Taiwan's 'overwork' culture

20 March 2012 Last updated at 00:54 GMT

Deaths spotlight Taiwan's 'overwork' culture
By Cindy Sui
BBC News, Taipei

Taiwanese labour activists rallied at the Council of Labour Affairs in Taipei last year

Working hard is ingrained in Taiwanese society. But recent deaths attributed to overwork are leading people to question the culture for the first time.

The deaths of nearly 50 workers last year were blamed on working more overtime than allowed by law. This figure was as much as four times higher than the previous year, according to the Council of Labor Affairs (CLA).

There have been many high-profile cases over the past two years. They include:
  • Hsu Shao-pin, 29, an engineer at Nanya Technology, who worked 99 hours of overtime monthly, six months before he died. His parents found him slumped over his desk at home in 2010. He had died from a heart attack.
  • Chiang Ding-kuo, 29, a security guard for Chien Hsiang Security Service, suffered a stroke while working in 2010. In the nine years before he died, he worked 288 to 300 hours a month.
  • Hsieh Ming-hung, 30, an engineer for smartphone maker HTC, died in his dormitory in February. He worked an average of 68 hours of overtime monthly.

Investigators tasked by the government to look into what caused deaths related to overwork found that the victims generally had congenital conditions, especially heart problems. They also had high-risk factors, such as being overweight and being a smoker, which had been aggravated by too much work.

Many of them were in their late 20s to 40s.

'Finding loopholes'

The companies generally do not dispute the CLA's findings. They are only obliged to pay a relatively small fine for violating overtime laws. The labour insurance bureau compensates the victims' families for up to 3.75 years of their salary.

We've had these cases all along, including migrant workers who died from overwork. But in the past, some people thought it was just a regular heart attack.”Sun Yu-lianSecretary-general, Taiwan Labor Front

"We've had these cases all along, including migrant workers who died from overwork. But in the past, some people thought it was just a regular heart attack," said Sun Yu-lian, secretary-general of Taiwan Labor Front.

"What's different about the recent cases is that the families dare to speak out."

Although Taiwan's labour law mandates that workers should not do more than 46 hours of overtime a month, some could be exempted from this if they agree to it.

"There are laws, but there are problems with the laws being followed. It has to do with the local culture," said Peng Feng-me, a specialist at the CLA's labour safety and health department.

"Taiwan's employers don't follow the laws. They find loopholes because they think no one will check."

Based on CLA data, the number of overwork cases is disproportionately low compared to Taiwan's work force and to similar economies like Japan and South Korea, leading many to believe the problem is under-reported.


Taiwan ranks among the top countries with the longest working day, based on statistics.

On average, Taiwanese employees work about 2,200 hours annually - that is 20% more than Japan and the US, 30% more than the UK and 50% more than Germany, according to government data.

A government study in 2010 found that 80% of the big Taiwanese tech companies being investigated violated overtime laws.

But some officials say that conditions have improved.

"In recent years, we've made changes in the law to let workers have more recreation time," said Lo Chih-chiang, who until recently was a spokesman for the president's office.

Most workers now get two days off a week. The government has also threatened to increase fines and even jail employers. It also set up a hotline for violation reports and even lowered the maximum work hours for certain occupations.

But many still see 12-hour work days as the norm, with some managers even giving up annual holidays.

Working hard in Taiwan is important to economic development, employers maintain

Susan Tai, who juggles 10-hour working days with caring for a baby, said leaving work early was not an option. "My colleagues would resent me and my boss would think I don't have enough work to do," she said.

Too late

Many also argue that Taiwan has to work so much to stay competitive.

Lin Bing-bin, who heads a business association, said that working hard in Taiwan is important to economic development.

"We, employers, agree we should raise workers' benefits, but we should not forget the hard-working attitude is a very important, basic factor of a country's economic development," said Mr Lin.

"The laws can be revised to be more strict and complete, but they shouldn't be too inflexible. If they are too strict, it could hurt Taiwan's economic development."

Trade unions are nearly non-existent or too weak to help pursue financial compensation. Many are also doubtful that the government will severely punish violators.

The problem with existing laws is the penalties are too light, analysts say. "Stepping up fines or jailing is too late - the worker has already died," Taiwan Labor Front's Mr Sun said.

But some companies, especially those with reported overwork-related deaths, are beginning to take notice. HTC banned employees from working past midnight after an engineer died, local media report. Nanya Technology now requires workers to get permission to work overtime, said vice-president Pei Lin Pai.

Mr Lo from the president's office said that as Taiwan seeks to "create a knowledge and innovation-based economy", "working hard will take on a new meaning". This means that long hours may not necessarily be the norm, but having time to recharge and be more creative should be factored in.

But while the prevailing culture continues, more workers have been reporting violations anonymously.

[Perl] Subroutines

sub subroutine()
    die '[ERROR] &subroutine should get exactly one argument file' 
        if (@_ != 1);

    my $file = $_[0];
    die '[ERROR] File not found: '. $file unless (-f $file);
    open(FILE, '<' . $file);
    while (my $line = <FILE>) {
        chomp ($line);
        # ...


為了避免寫爛CODE,盡早培養好習慣才是 ((請搜尋 good practice))

2012年8月13日 星期一

Rafa Nadal Facebook Message

Antes de ir a dormir, os dejo una foto de esta tarde. Después del entreno matinal, en la playa con mis primos.

Before going to sleep, I would like to share a photo taken this afternoon. After this morning training session, on the beach with my cousins.

  • antes de hacer algo > before doing sth
    • antes de salir del coche, asegúrese de que están las ventanillas cerradas > before you get o before getting out of the car, make sure that the windows are closed
  • después de (con sentido temporal) after;
    • lo saludé después del funeral > I said hello to him after the funeral


  1. 豚馬 (http://www.tunuma.com/),跟老闆新開的大業鍋物
  2. 高雄鳳山小陽春牛肉麵
  3. 雲林四湖上禮拜吃的辦桌
  4. 今天中午吃的丹堤簡餐
  6. 台北公館蕭家乾麵的豬腳飯、控肉飯
  7. 高雄立林鐵板燒
  8. 正忠排骨飯 ((配清心青茶,當兵很愛這味))
  9. Pizza Hut ((其他種 pizza 都普普通通))
  10. 茄子咖哩


2012年8月7日 星期二


普通新聞稿,許多媒體以颱風總結,其實下什麼結論都無所謂,我也不會當真。媒體沒義務教導大家什麼是 CPI,CPI 對民眾有什麼意義,講太多反而失焦 (某方面的焦)。我們最終會幫 CPI 找到她的位置。
  1. 7月份消費者物價總指數(CPI)為109.68(95年=100),較上月漲0.38%(經調整季節變動因素後漲0.25%),較上年同月漲2.46%,1-7月平均,較上年同期漲1.61%。
  2. 月份躉售物價總指數(WPI)為110.24(95年=100),較上月跌0.08%(經調整季節變動因素後漲0.13%),較上年同月跌1.71%,1-7月平均,較上年同期漲0.18%。

  • 可支配所得最低20%家庭:2.76%
  • 可支配所得中間60%家庭:2.48%
  • 可支配所得最高20%家庭:2.26%





工作時,我常陷入自我的狀態,自私的以為別人按照我的邏輯運轉。最後往往發現,如此簡單的設計限制,32-bit 可以 64-bit 不可以,居然也能討論一天。



因為捕魚的事,原本熟悉搭帳篷的工作被耽誤了,很好,大家都不要睡,繼續研究怎麼用登山杖捕魚。我對工作並不熱衷 ((還有其他要事要做)),但也沒那麼冷感。我只是想好好搭帳篷。好啦,是有那麼擺老不耐煩。雖然有些事那麼屎,有些事很有趣,就算再怎麼難過,早上至少有摸,這樣就足夠了!

2012年8月6日 星期一

















2012年8月5日 星期日

[Introduction to Commutative Algebra] Exercise 1.1

作者:Atiyah & Macdonald


Exercise 1.1: Let x be a nilpotent element of a ring A. Show that 1+x is a unit of A. Deduce that the sum of a nilpotent element and a unit is a unit.
Proof: x^n = 0 for some n > 0. So (-x)^n = 0 for that n. It means 1 - (-x)^n = (1 - (-x))(1 + (-x)^2 + ... + (-x)^{n-1}) = (1 + x)(1 + (-x)^2 + ... + (-x)^{n-1}) = 1. That is, 1 + x is a unit of A.

Next, all we need to do is to prove u+x is a unit where u is a unit and x is a nilpotent. It is trivial since u+x = u(1+u^{-1}x). u^{-1}x is nilpotent. Also, a unit multiplies by a unit is also a unit. ((uv)(v^{-1}u^{-1}) = 1.)


2012年8月4日 星期六


screen (de cine, televisión, ordenador)
  • la pequeña pantalla -> the small screen, television
  • la pantalla grande -> the big screen
  • mostrar en pantalla -> to show on the screen
  • una estrella de la pantalla -> a TV/movie star
  • pantalla (acústica) -> baffle
  • pantalla de cristal líquido -> liquid crystal display
  • pantalla gigante -> big screen
  • pantalla plana -> flat screen
  • pantalla de radar -> radar screen
  • pantalla táctil -> touch screen

Pantalla bloqueada (bloquear = to block)
Pantalla de inicio (inicio = start; beginning)
Ambas (= both)

iPhone 桌布設定西語教學。

2012年8月3日 星期五


2012-07-27 大屯主峰
2012-07-07 ~ 09 閂山 (#17)、鈴鳴山 (#18)、無明山西峰 (永生難忘,唉)

2012-06-28 ~ 29 畢祿山 (#15)、羊頭山 (#16) 鋸齒連峰、石門山、合歡主峰
2012-06-23 北插天山水源地 (摸摸行)
2012-06-17 棚集山
2012-06-03 大屯主峰、面天山、向天山 (龍頭教官地圖課)

2012-05-26 ~ 27 桃山、品田山 (#14) (公司雜事煩心)
2012-05-19 劍潭山、文間山、剪刀石山、金面山 (公司系統上線)
2012-05-07 松羅湖 (眼鏡蛇)

2012-04-20 檜山 (見到死去的青蛇,好久沒走新的中級山)
2012-04-14 ~ 15 合歡北峰、合歡西峰 (#13) 下華崗
2012-04-08 北插天山
2012-04-04 七星山南峰、主峰

2012-03-24 劍潭山
2012-03-17 ~ 18 郡大山 (#11)、望鄉山、西巒大山 (#12)
2012-03-11 大屯主峰

2012-02-26 ~ 2012-03-01 馬來西亞婆羅洲神山 (神奇)
2012-02-19 七星山主峰
2012-02-11 北插天山水源地 (摸摸行)
2012-02-05 北插天山水源地 (摸摸行)
2012-02-01 石碧潭山、中坑山、牛欄窩山、下橫坑山、雞寮坑山、南何山、南何山南峰、沙坑山、二確山、大肚山 (飛沙縱走)

2012-01-28 七星山主峰
2012-01-15 八仙山、佳保台山
2012-01-07 ~ 08 華崗上合歡主峰 (#10)(刺激) 

2011-12-31 ~ 2012-01-01 北大武山 (#9)
2011-12-17 ~ 18 奇萊北峰 (#7)、奇萊主峰 (#8)
2011-12-11 深按頭山 (大咖家後院)
2011-12-02 ~ 04 桃山 (#5)、詩崙山、喀拉業山 (#6)

2011-11-29 南插北峰(上宇內山)、南插天山、魯培山
2011-11-19 金面山、剪刀石山
2011-11-12 桃源谷下草嶺古道
2011-11-06 天母古道
2011-11-05 露門山西北稜縱走波露山東轉東北稜 

2011-10-29 ~ 30 立鷹山、三角山、櫻櫻山、合歡北峰 (#4)、武法奈尾山
2011-10-23 多崖山、北插天山(滿月圓瀑布、小樂佩、傳統路O形)(摸摸行)
2011-10-16 七星山主峰
2011-10-15 鳶嘴山連走稍來山
2011-10-08 ~ 09 東模故山東北稜 (可怕)

2011-09-24 ~ 25 波露山東轉東北稜
2011-09-17 ~ 18 露門山西北稜、大保克山北稜
2011-09-10 滿月圓山、北插天山西北稜、多崖山

2011-08-27 七星山主東峰
2011-08-19 ~ 22 雪山主峰 (#3)、雪山東峰 (#2) 訪翠池
2011-08-14 竹篙山
2011-08-13 卡保山、逐鹿山
2011-08-07 拉卡山
2011-08-06 組合山、樂佩山
2011-08-03 象山六巨石

2011-07-27 南勢角山
2011-07-24 七星山主東峰
2011-07-23 外鳥嘴山、蓮包山
2011-07-16 逐鹿山
2011-07-09 七星山主東峰

2011-06-26 東眼山
2011-06-25 新山夢湖 (未至新山)
2011-06-24 獅仔頭山前峰
2011-06-18 逐鹿山、卡保山
2011-06-14 仙跡岩
2011-06-05 石筍尖
2011-06-04 夫婦山

2011-05-29 面天山、向天山、向天池
2011-05-28 天母古道
2011-05-21 塔曼山
2011-05-14 小獅山

2011-04-23 猴山岳
2011-04-03 北插天山 (人生第一次爬中級山,也是一個人自己爬)

2011-03-05 大屯主南西峰

2010-12-18 七星山主峰
2010-07-18 草嶺古道
2010-03-07 石門山 (#1)(莫名其妙開始爬百岳)


來源:清晨土石流 興隆路寶來社區 急撤離 ((自由時報 – 2012年8月3日 上午4:38))
  • 台北市文山區興隆路三段寶來社區一百五十多名住戶
  • 木柵路五段象頭埔老聚落十六戶居民進行撤離
  • 指南路三段四十巷也因山坡土石滑落至馬路

2012年8月2日 星期四

df - display free disk space

$ df -g
Filesystem    1G-blocks Used Available Capacity iused    ifree %iused  Mounted on
/dev/disk0s2        112   19        92    18% 5055819 24356549   17%   /
devfs                 0    0         0   100%     628        0  100%   /dev
map -hosts            0    0         0   100%       0        0  100%   /net
map auto_home         0    0         0   100%       0        0  100%   /home

還算乾淨的 MacBook Air 128G 硬碟使用狀況大約如此,還有 92G-blocks。

2012年8月1日 星期三














Now, a few words on looking for things. When you go looking for something specific, your chances of finding it are very bad. Because, of all the things in the world, you're only looking for one of them. When you go looking for anything at all, your chances of finding it are very good. Because, of all the things in the world, you're sure to find some of them.

Almost a century ago, Werner Heisenberg formulated one of the great principles of quantum physics, which describes the behavior of particles at atomic and smaller scales: one can accurately determine the position of a particle OR one can accurately determine its motion, but one cannot determine both accurately at the same time.

Reference: http://www.porcupine.org/forensics/forensic-discovery/chapter1.html