Pages

Mar 12, 2015

Use pdb to debug Python code

use pdb to debug python code:


some (not all) commands of pdb:
h: see the entire help list

l: l(ist) [first [,last]]
List source code for the current file.
Without arguments, list 11 lines around the current line or continue the previous listing.
With one argument, list 11 lines starting at that line.
With two arguments, list the given range; if the second argument is less than the first, it is a count. 

s:
Execute the current line, stop at the first possible occasion
(either in a function that is called or in the current function).

c: 
Continue execution, only stop when a breakpoint is encountered.

b: 
b(reak) ([file:]lineno | function) [, condition]

p: p expression
Print the value of the expression.

for more information: https://docs.python.org/2/library/pdb.html

Feb 18, 2015

The definitions of "Implication" and "Axiom"

Def: An "implication" p => q is true if p is false or q is true.

Truth table
p      q    p => q    q => p    p <=> q
-------------------------------------------
T     T       T            T               T
T     F       F            T               F
F     T       T            F               F
F     F       T            T               T

False implies everything is true
ex: pig flies => I'm a kind   True!


Think about the following statement:
"This statement is false"

If the statement is false, then the statement is true (which is a contradiction!)



Def: an "axiom" is a proposition that is assumed to be true.
ex: if a = b and b = c, then a = c

Jan 19, 2015

Jan 16, 2015

台北,咱們後會有期!

13多年前,我一個人到台北念書,畢業後就留在台北工作,
現在離開台北,真的非常不捨,許多的回憶、朋友都在這裡,我想有機會還是會回來的。
台北,咱們後會有期!
See you, Taipei

Jan 15, 2015

Stay tuned

英文書信中如果想要對方等候進一步的消息,可用"stay tuned"

Ex:

Thank you for your reply.

We will pass your image to our client for final approval. Once approved, we would like you to provide the original image to us.

For your information, the usage of the image will be valid online globally for 2 years, mainly on AAA’s website and Facebook. The starting period will start from January 20XX.

Please stay tuned!


Best Regards,
XXX

Jan 9, 2015

淺談雲端運算

2012年時,為了想讓人更容易了解什麼是雲端運算,於是就把當時我對雲端運算的了解整理並寫成文章 -「淺談雲端運算」,沒想到今天一看,國內居然有10篇論文引用它,真是欣慰,沒辦法對國內證券產業雲端服務應用盡到什麼心力,但還是能幫助國內學生快速了解雲端運算,也算是一點小小的貢獻吧。