我對資工的興趣產生

我正在念交大資工所,我決定要走資工是一個漫長的過程,這篇故事想從最早開始講起,描述過往我對資工的興趣如何慢慢建立。每個人的故事都是獨一無二,但我的故事希望可以給別人一些靈感和借鏡。

Continue reading

Example of Signals by `sigaction` in Unix

Unix 中 processes 之間溝通有很多種,本篇介紹 signal 的簡易使用。可以先閱讀 Beej 的介紹。顧名思義,signal 就是程序發送和接受訊號,例如我們在使用 Shell 的時候,之所以 Ctrl-C 可以中斷程式執行,就是因為 Shell 捕捉到 Ctrl-C 發送的 SIGINT 訊號,知道有一個 interrupt signal,所以將程式中斷。

發送 signal 可以用 sigaction()signal(),不過建議使用 sigaction 因為比較新,詳細差別可以看 Stack Overflow 這篇 「What is the difference between sigaction and signal?」。

如果想觸發 signal,可以用 kill()sigqueue(),差別在於後者僅限 Linux,但後者可以藉由傳送 siginfo 加一些資訊在 signal 中。此外一些 system call 本身也會觸發 signal,例如如果嘗試 send() 到不存在的 socket,就會觸發 SIGPIPE

Continue reading

Use `mmap` to create shared objects

當我們有很多 processes 時,並想用實現 shared memory 處理共用資料時,就可以使用 shared memory,來實作。建立 shared memory 可以使用 mmap 或是 System V shmget,但根據 Stack Overflow 「How to use shared memory with Linux in C」回答,shmget 已經有點過時,mmap 則比較新和彈性。

Shared memory 讓我們可以建立一塊共用的記憶體空間,mmap 會回傳一塊記憶體空間的指標,型別是 void *,如果我們想要放資料進去,可以用 memcpy 將物件、字串或任何東西拷貝進去。我們也可以直接將 void * 轉型成物件指標,這樣就建立 shared object,不同 process 可以直接對 process 存取物件。

Continue reading

Review of “Everything in Rust” of COSCUP 2019

Review of “Everything in Rust” of COSCUP 2019

My experience with Rust Taiwan community in COSCUP 2019

Sunshine, blue sky, and sprinkles of rain — such diverse weather on August 16th-17th echoed the lively atmosphere at NTUST in Taipei, where the COSCUP was held. Participating in the conference, Rust Taiwan community hosted the “Everything in Rust” track with 11 talks, which were relevant to Rust. Speakers came from all over the world, including India, Netherlands, China, Hong Kong, and Taiwan, representing for some of the top influencers in the global Rust community. With more than one thousand attendees in COSCUP, it was the first time for these hundreds of people encountered the efflorescence of the Rust programming language.

Continue reading

台大觀察與心得(九):大四下&登出


這是我在台大的第八個學期,也是最後一個學期了。大四下對多數人而言是輕鬆寫意,學分已經修完沒有畢業壓力,但因為我轉系且一直跑去外系修課,導致自己學分到大四下還沒修滿,為此大四下還有 12 學分要修,幾乎每天都還是要去學校。

整體而言大四下對我來說滿荒誕的,好像什麼事情都沒做好,沒什麼值得驕傲的事情,有幾件值得開心的事,還有幾件比較有印象的挫折。
Continue reading

Localize the Rust Website to Traditional Chinese

Localize the Rust Website to Traditional Chinese

Record Rust Taiwan community’s work of translating the Rust website


TL;DR
I am glad to announce that the Traditional Chinese (正體中文) version of the Rust official website has been launched. Thanks to all contributors in the community. This article records our experience to achieve the work.

Continue reading

巨匠的剪影——張大千特展之心得

2019 年,適逢我國上個世紀偉大國畫家張大千先生 (1899-1983) 一百二十歲誕辰,台北故宮博物院特別開設「巨匠的剪影——張大千特展」。張大千一生充滿傳奇,生平走訪世界各地,各種書畫種類無一不臻妙境。

<墨荷四聯屏>
Continue reading

動畫<風起>心得隨筆

<風起>是日本知名動畫導演宮崎駿生平最後一部作品,內容以零式艦上戰鬥機設計者堀越二郎的生平作為主軸,穿插小說家堀辰雄的兩篇小說作品《風吹了》和《菜穗子》的劇情。 Continue reading

菜鳥程式設計師的精進之路

菜鳥程式設計師的精進之路

The Clean Coder 心得、摘要與補充


前陣子把 《The Clean Coder》(中譯: 無瑕的程式碼 番外篇-專業程式設計師的生存之道) 看完,剛好可以回答一個網路上最常看到的問題之一:

菜鳥工程師與資深工程師的差別是甚麼?

菜鳥工程師與資深工程師的差別是甚麼?

Continue reading

我在大學期間犯下最畢生難忘的錯

我在大學期間犯下最畢生難忘的錯

錯誤不可恥,可恥的是再犯同樣的錯


其實我認為我大學期間,除了課業失敗的一蹋糊塗之外,其他方面還算優秀。不得不稱讚台大是一個很棒的舞台,讓我的立足點更高,使我有機會跟各式各樣的人接觸,參加各種有趣的活動,到不同的地方工作。在這環境下,我覺得過得還算是順遂。即便如此,仍有些事件是難以忘懷的失敗,給我很大的教訓和反省,但其中一個最難忘的故事莫過於我接下來要說的。

Continue reading

Chaos

Chaos implies a disorder or complex non-linear system. It manifests any little changes could probably result in a massive transformation of the system, such as a butterfly flapping in Brazil could cause a hurricane in Texas, which is well known as the butterfly effect. The traits of chaos are in many fields, including math, physics, atmospheric science, fluid dynamics, ect., which leads Chaos to a vital research topic.

Continue reading

Browsing Websites

Browsing Websites

The technology around us affects us profoundly - emotionally, behaviorally, and cognitively. We could easily spend an enormous span not only to watch videos online but also browse websites on the internet every day. However, have you ever thought about how the sites work and what the mechanism is inside the box?

Continue reading

Revision Control

It’s a late night, and the man is still at the office, being in deep water over the crashed program. Everything goes wrong. He doesn’t even know why the code cannot run as usual. Unfortunately, he has forgotten what he had changed, regardless of the changes, which must be of paramount importance to the incident.

Continue reading

台大觀察與心得(八):大四上

在台大的日子已經進入第四年,不知不覺留在校園的日子只剩一年,讓人十分的不捨。從高中進入台大,到快要從台大畢業,這段日子我的變化很大,像是從一個物理學家變成軟體工程師,喜歡的運動從游泳變打網球。經歷了很多事情,多到我自己都常常忘記原來我曾經歷過,像是集思論壇、綠領農學市集、好幾家公司實習、參加的各種演講等等。
Continue reading