有些內容使用中英雙語,有些只有英文或中文。歡迎使用與分享任何內容,但先來信告知並標示此部落格為出處。
Some parts use both Chinese and English, but some parts use only one language. Feel free to share, but please contact me first and list this blog as your reference.

2014年5月17日 星期六

Design Patterns 筆記 - Categories 分類條列

初學Design Pattern,如有謬誤或超級大錯還請指教。
如不知道什麼是 Design Patterns,可先閱覽一下這篇:Design Patterns 筆記 - Overview

0. 是 Design Pattern 熱身,嚴格而言不是標準 Design Pattern。
1. ~ 3. 是GOF(四人幫)著作中的分類
4. 是由 Sun(昇陽) Java Center 所提出

Design Patterns 筆記 - Simple Factory Pattern 簡單工廠

初學Design Pattern,如有謬誤或超級大錯還請指教。

如不知道什麼是 Design Patterns,可先閱覽一下這篇:Design Patterns 筆記 - Overview
想知道其他種 Design Patterns,請看這篇:Design Patterns 筆記 - Categories 分類條列

另外,如果不懂Java的介面,可以參考這一篇:JAVA - 什麼是介面?
===================================

前述:

以下內容主要從 tutorialspoint 的 Design Patterns - Factory Pattern 翻譯而來。
在網站上只有單純寫 Factory Pattern,但依王者歸來:品味Java的21種設計模式中,
此篇應該是 Simple Factory Pattern 簡單工廠,嚴格而言不是標準的 Design Pattern,
在GoF中的著作沒有。(非 Factory Method 也不是 Abstract Factory)

另外,tutorialspoint 居然沒有Factory Method....之後我應該會找其他資料,再寫一篇

2014年5月15日 星期四

JAVA - What's interface? (English version)

There's the Chinese version for this article. 這邊有中文版的文章

Originally, I was going to learn the Design Patterns,
but I suddenly realize that interface is so important.
Because I didn't use Java for a ling time, I just reviewed the interface for Design Patterns!

Long to short. The interface is for designing.
We can first design the method with name and return type, and without the detailed content.
And these methods must be implemented latter!

Sounds like abstract method?
Though they don't have the abstract key word, they are abstract!
(We can simultaneously pack many abstract stuffs.)

Many class can implement a same interface;
A class also can implement many interfaces at one time.
Because the Java doesn't have Multiple Inheritance, we can achieve similar effect by interfaces.

Let's look following examples. It's very simple, and may not show the brilliant part of interfaces.
But...at least it can run! Learning is from easy to difficult.

Design Patterns 筆記 - Overview

重新學習JAVA中,想到大學旁聽課程時老師提到的 Design Patterns (設計模式),這是前輩們花很多時間總結的各種"輪子",對於物件導向新手而言是提升能力的捷徑!

以下內容主要從 tutorialspoint 的 Design Patterns Tutorial in JAVA翻譯而來,
輔佐一些額外資訊,請各位看官不吝惜指教。

維基百科云:「Design Patterns 是對軟體設計中普遍存在(反覆出現)的各種問題,所提出的解決方案。」

Design Patterns 代表有經驗的物件導向(object-oriented)程式開發者所用的最好的實踐方式
Design patterns 是軟體開發者在設計軟體中出現的一般性問題,所提出的解決方法。
無數的軟體開發者經過長時間的嘗試、走了許多彎路,才得到這些模式。

2014年5月14日 星期三

JAVA - 什麼是介面? What's interface? (中文)

There's the English version of this article. 這邊有英文版的文章

原本要學習 Design Patterns (設計模式),結果驚覺 JAVA 的 interface超重要,
因為JAVA實在太久沒用了...為了 Design Patterns 先來複習一下interface!

2014年5月13日 星期二

失業種類與失業率計算

還沒工作就在想失業...
不過先知道失業的情形應該會比較容易找到工作吧~~(鬼扯

失業人口: 適齡工作人口(15歲)的勞動力中(非軍人、非學生、
               非監管人口),無就業的人口。


                失業人口
失業率 = ----------------- X 100%
                勞動人口


2014年5月11日 星期日

Google Code Jam - Round 1C 2014 - Problem B.Reordering Train Cars (for small input)

The following program is my ACcepted code for
GCJ-Rounc 1C 2014 - B.Reordering Train Cars (for small input)

This program is only correct for the small input.
It's a for everybody to learn and discuss.
If there is any mistake or comment, please let me know.  :D

此乃 GCJ-Round 1C 2014 - Reordering Train Cars 的AC code!
這份程式只在小的測試資料是正確的!
大的我當時沒解出來 QQ
歡迎一同討論學習,如有錯誤與任何建議請留言 : )

前往 Google Code Jam!

Google Code Jam - Round 1C 2014 - Problem A. Part Elf (for small and large)

The following program is my ACcepted code for
GCJ-Round 1C 2014-  A. Part Elf.

This program is correct for the small and large input.
It's a for everybody to learn and discuss.
If there is any mistake or comment, please let me know.  :D

此乃 GCJ-Round 1C 2014-  A. Part Elf.的AC code!
這份程式在小跟大的測試資料都是正確的!
歡迎一同討論學習,如有錯誤與任何建議請留言 : )

TED Open Translation Project - TED翻譯字幕,增廣見聞、學習語言、傳播知識!

我想很多人多少都看過TED演講!
如不知那是什麼,請看維基百科~

TED演講(TED Talks)主題無所不包!
另外也有各地TED粉絲自己舉辦的 TEDxTalks。

TED分享很多棒的想法與思考,但可惜的是影片雖多,
但不是人人都能輕鬆接收資訊,因為很多都是外文影片!

雖然很多影片也有官方公布的翻譯字幕! 但是總體而言比例算少的,
所以TED有一個翻譯計劃 TED Open Translation Project,希望人人一起幫忙。

資訊時代可以靠團隊合作完成大目標! We can accomplish wonder. 
一起加入TED翻譯誌工的行列吧!