Code makes the world a better place

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

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

Record Rust Taiwan community’s work of translating the Rust website
紀錄 Rust 台灣社群將 Rust 官網翻譯成正體中文的過程


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