Wednesday, May 20, 2015

國際新聞:英國總理 David Cameron 在女王演講中,揭露對極端主義活動的新限制措施




國際新聞:英國總理 David Cameron 在女王演講中,揭露對極端主義活動的新限制措施

言論自由與國家安全中間的這條線真的不容易劃。

Q1. 極端主義如何定義?誰有權決定?
Q2. 怎樣界定極端主義與言論自由的界線?
Q3. 是否真的有國家存續的問題?

我們搬凳子看英國這個老牌民主國家,在愛爾蘭獨立運動的內戰多年之後,如何處理眼前的困境。
以及對言論自由的影響。

http://www.theguardian.com/uk-news/2015/may/13/counter-terrorism-bill-extremism-disruption-orders-david-cameron

新聞評論:柯P翻臉啦!北市府宣布:大巨蛋停工

柯P翻臉啦!北市府宣布:大巨蛋停工


大巨蛋興建前一定有做環境影響評估,而且捷運以及古蹟應該都有列入評估。關於現況,我一些疑惑與想法:

1. 為何興建到一半會出現比原本評估還要嚴重的問題?

2. 假設,不存在這些問題的修正辦法(或是修正的辦法昂貴或是修正的辦法極為昂貴),今天捷運沒有安全問題,那麼古蹟與大巨蛋誰重要?

3. 續 2,假設,那麼,捷運的妥善性與數百億的投資之間,誰重要?

第一題的答案我猜想北市府與遠雄應該都清楚,也有很多專業的評估,只是是否有追溯到根源,避免再次發生的後續追蹤呢?

第二題是假設性的問題。答案其實由價值觀決定,如果人民的價值觀以經濟利益為主要取向,那答案就昭然若揭。同時,我們也知道,以後當錢遇到古蹟時,會有什麼結果。

第三題也是假設性的問題,在現今的社會大部分的人會認同,捷運是個高運量的運輸系統,有安全問題,當然是不用談。這其實也反映出,大多數人已經認可,人的性命比錢重要。不過,如果財團老闆不坐捷運又剛好沒有同理心,那麼如果他的工程團隊認為出事的機率低,他當然會覺得拼一拼無妨。


Tuesday, September 18, 2012

台灣的困境


首先道歉, 小弟的文筆不好, 邏輯也不順, 寫這篇文章只是希望有幾個人可以看到, 可以想想, 如果影響到一些人, 就已經算是功德圓滿了。

--- 正片開始 ---

對於台灣的現況, 我的想法是, 台灣的現況不是一個可以用幾張 A4 作答的問答題. 這是一個陷入負循環中的一個環境, 要想把它轉正很困難, 絕不是幾個政策, 換幾個人, 幾年可以改變的.

在這裡, 每個環節都有它的問題, 而每個問題都貢獻了現況, 每個問題都不一樣, 解法也都不一樣, 因此雖然有許許多多的debate試著想要幫助這片土地上的人們, 但還沒有什麼共識與結論.

對於全部的問題, 我試著思考, 發現我的腦袋不夠, 沒辦法理解那麼多東西, 那麼多的專業. 因此, 我想找一個簡單通俗的方式, 讓大家了解每個人都在這條船上, 舵也是每個人共同掌握的, 每個人的一點點心力貢獻, 就可以完全改變現況, 也許船還是很慢, 但至少方向會對.

前面提到了, 不同的問題有不同的處理方法, 但這樣的討論無窮無盡, 而且治標不治本. 我對於台灣的問題的歸納, 只有兩個字 "鬆了".

在這個小小的島上

學生, 老師, 公務員, 上班族, 管理階層, 大老闆, 軍人, 商人, 政客, ...各行各業

"""大家都有一個權利, 就是不要讓自己成為整個環節中的鬆了的螺絲."""

只舉學生為例, 自己或身邊的同學, 看到這篇文的你, 看過多少次考試作弊? 做弊的學生本身當然有些責任, 但環境是更大的問題, 學生會作弊可能是受到家長的不合理期望, 同儕的壓力, 老師的期望..., 事實上, 現在每個環節都在採用這樣的思考模式, 覺得因為別人 (環境) 如何如何, 所以自己沒得選擇.

當彭明輝教授 (我個人很尊敬他) 指出政府的對於研究的管理方式不對時, 真是一針見血, 但告訴政府 "你這樣做不對, 應該這樣做才對" 是沒辦法解決真正的問題的, 因為真正的問題是執行者的心態, 他們的心態是 "我只是個公務員, 我只想準時下班", "我是個民主政治中的政治人物, 選票才是最重要的, 所以我口頭得應付得很漂亮, 但還是得顧選票", 只要這些鬆掉了的心態沒有改變, 再多的金玉良言也改變不了這片土地.

幾乎每個環節你都可以找到這種由於舵已經不正, 因此船怎麼開都不會直的現象。因為列舉太多只會更加的自曝其短 (畢竟所知不多), 所以, 其它的就省下來不一一列舉了。

請讓我直接跳到結論: 要讓這片土地改變, 我們真正的目標應該是心。

我想說的是, 改變必須由人的內心開始 (我猜想這時一定有人會覺得有個屁用, 然後就關掉browser), 每個人的一點點改變都不會帶來太大的影響, 但如果多數人的心態調整過來了, 這艘船一定不會離航道太遠的。如果每個人都願意相信這一點點改變雖然輕如鴻毛, 兩千三百萬根鴻毛在一起也不會太輕的!

每個人的心都將自己的本份視為理所當然, 把工作時的發條上緊, 願意多動腦筋把工作 (本份) 做好。如果, 每個做老闆的都認真思考將公司航向更寬廣的藍海而不是汲汲營營的榨取員工剩餘價值, 每個工務員都能視民如親, 每個員工都能將公司資源與上班時間視為自己私人時間一樣珍惜, 如果每個雙親都能付出時間學習做個好雙親, 每個學生都能誠實面對自己的學習成果, 老師都不放棄學科成績不好的學生, ...

最後, 請千萬不要誤會, 由 "鬆了" 變 "緊" 完全沒有叫大家卯起來上班的意思, 而是做事的態度的一點點改變. 大家在到公家機關辦事的時候, 你們會期望公務員要加班做嗎? (好啦, 還是有人恨不得健保局或中油員工加班) 不會, 你只會希望他們有友善的態度, 有願意主動幫助民眾解決問題的心態, 我相信這樣公部門就會有很大的改善了 (至少對我而言是這樣)。我們只是一個小島, 只有這些人, 也沒什麼資源, 更談不上有錢 (跟中國的有錢人比比看吧), 人是我們最大的資源, 如果人們的心的方向不對了, 那什麼事也對不了。

--- 正片結束 ---

Tuesday, August 23, 2011

Android patched QEMU NAT code architecture

Personal Project Android patched QEMU NAT

Intro: The emulator of Android SDK comes from Qemu and is modified to support features such as bandwidth shaping. It is good to most developers, but it seems to be lacking some features, I guess some people out there are also interested in tweaking it to fit your needs.

Technical Background:

Because Qemu runs guest OS, it naturally needs to manipulates packets when it is under NAT mode. And to provide some small utilities, it has tcp/udp IP support in itself by using SLiRP, which was originally designed for PPP back in 90s.

Three pictures are attached in case you want to know the key points of NAT of UDP in Android. Sorry, TCP is not my interest at the moment.




Friday, November 26, 2010

A Simple Flowchart for XML Parsing

I forget things easily. So I'd like to keep a note for my recent study about XML Document parsing and framing. Framing is easier as it is a controllable data source I provide. So I will focus on the parsing part of it.

I hereby is showing a flow chart I just drew for the XML parsing procedure. I guess I must have made some errors in it and it is not qualified to be good enough. However, like I said, this is a note I am trying to keep. If you know what can be improved, please don't hesitate.


Some notes that everyone should know:
  1. The most frustrating thing I found is there is *NO* single package that can provide me parsing, framing, validating, data-binding code generation in C language while this is the language we used in most embedded systems.
  2. Some of the steps in this flowchart be merged into one single step.
  3. There are commercial products available with all the needed functions. Even with HTTP client/server in case you need to use XML over Web.
  4. Links on Wikipedia about data-binding: http://en.wikipedia.org/wiki/XML_data_binding.
  5. The most comprehensive list of resources about XML data binding: http://www.rpbourret.com/xml/XMLDataBinding.htm

ps. Drawn with Dia 0.97.1 Windows version.

Saturday, November 13, 2010

Android ListActivity Problem

I met these error messages last night and found the cause was I did not read document thorough. :)

11-12 14:33:19.976: WARN/ActivityManager(73): Launch timeout has expired, giving up wake lock!
11-12 14:33:20.164: WARN/ActivityManager(73): Activity idle timeout for HistoryRecord{44f542b8 com.demo.wally/.listview}

ListActivity is another kind of Activity that has a built-in ListView. I called the method: setContentView, under a ListActivity context, so I was destined for this problem.

In this ListActivity, a fullscreen ListView is used. To customize my own screen, I need to either take advantage of possible ListView options or create another view with ListView in it and use a normal Activity to create data adapters, and so on.

Friday, November 12, 2010

XML File Indentation

I copied contents from a PDF file (I can't find its original version with proper indentation) and pasted into an XML file. The resulting file is flat with no indentation at all. After trying to fix it using vim and other text editors. I decide to give it a try to find a formatter. And I found one:


Useful to me a least.

Thursday, November 11, 2010

Cookie Flag: HttpOnly

Today when I am trying to understand how cookies work in libcurl (). I found some cookies from Google has a strange flag behind it: HttpOnly.

I know this is a common sense to every web developer. As an embedded system engineer that never dealt with any web programming in last 9 years, I think I am eligible to not knowing it...

Anyway, it is shown by an example source code of libcurl as:

[1]: .google.com.tw TRUE / FALSE 1352547231 PREF ID=id_removed:FF=0:TM=1289474431:LM=1289475431:S=oLGFV.....
[2]: #HttpOnly_.google.com.tw TRUE / FALSE 1305286631 NID 40=T9tf9Y.....

This #HttpOnly_ confused me. After some research, I found that because malicious Javascript code may be able to access other website's cookies and transfer them to its site. This is a cookie theft as described in Wikipedia (http://en.wikipedia.org/wiki/HTTP_cookie#Cookie_theft).

This flag blocks cookies flagged as HttpOnly being accessed by any scripts from originating website and hence prevents injected malicious code from sending important cookies to another site.

Wednesday, September 01, 2010

Python PyGtk + Multi-thread

I chose Python language to make UI development easier. With Glade, a buggy but still functionally okay utility, I can design UI in a short time and load it up with my Python program.

I am doing some socket operations in this program, but found that multi-threading in this program seems to be malfunctioning. And the socket accept action never returns and continue and running my code. After some hours research, I found that GTK will lockout all other threads if I do not perform proper init.

So here is the trick when using PyGtk + multi-thread:

1. import gtk
2. gtk.gdk.threads_init()

With these two lines of code, the thread works happily. Note that multi-threaded applications need to add UI related actions to GTK main loop instead of touching them directly.