<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"><channel><title>MagicLen</title><link>https://magiclen.org/2018/06/feed</link><description>多元化原創文章，內容包羅萬象，有程式語言、網站應用、軟體介紹、硬體介紹、作業系統、旅行遊記、專題採訪、益智問題、文學創作，以及作者們的知識分享和作品分享。</description><language>zh-TW</language><lastBuildDate>Wed, 15 Apr 2026 23:07:28 +0000</lastBuildDate><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>8</sy:updateFrequency><sy:updateBase>1970-01-01T00:00+00:00</sy:updateBase><item><title>Rust 學習之路─第二十章：不安全的Rust</title><link>https://magiclen.org/rust-unsafe</link><description><![CDATA[    <img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt="">
在最一開始的幾個章節，我們就已經了解到Rust程式語言在編譯階段時，就會進行許多檢查，使得程式在通過編譯後，進入執行階段時，能以有效又安全的方式運行。然而，在某些情況下，通常是處理跟作業系統和硬體有關的底層行為時，使用正常能夠確保安全性的Rust程式碼並無法實現出我們要的功能，此時就會需要使用到可能會讓程式變得不安全的開發方式。]]></description><category>研究分享</category><category>Rust</category><category>Rust</category><category>Rust 學習之路</category><guid>https://magiclen.org/rust-unsafe</guid><pubDate>Sat, 30 Jun 2018 09:00:50 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>Rust 學習之路─第十九章：巨集</title><link>https://magiclen.org/rust-macro</link><description><![CDATA[    <img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt="">
在上一個章節中，我們學習了許多跟文字格式化有關的巨集。在這個章節，我們將會更深入地了解巨集到底是什麼東西，以及實作巨集的方式。]]></description><category>研究分享</category><category>Rust</category><category>Rust</category><category>Rust 學習之路</category><guid>https://magiclen.org/rust-macro</guid><pubDate>Fri, 29 Jun 2018 09:00:34 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>Rust 學習之路─第十八章：格式化文字</title><link>https://magiclen.org/rust-formatted-string</link><description><![CDATA[    <img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt="">
Rust程式語言的標準函式庫中的「std::fmt」模組提供了多種巨集來格式化或是印出字串。在這個章節中，我們將會學習「format!」、「write!」、「writeln!」、「print!」、「println!」、「eprint!」、「eprintln!」巨集的詳細使用方式。]]></description><category>研究分享</category><category>Rust</category><category>Rust</category><category>Rust 學習之路</category><guid>https://magiclen.org/rust-formatted-string</guid><pubDate>Thu, 28 Jun 2018 09:00:58 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>Rust 學習之路─第十七章：物件導向程式設計</title><link>https://magiclen.org/rust-object-oriented</link><description><![CDATA[    <img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt="">
許多人會想問：Rust是物件導向的程式語言嗎？答案可以為是，也可以為不是，端看問這個問題的人對於「物件導向程式語言」定義的嚴格程度。Rust程式語言有結構體，而且可以使用「impl」關鍵字來替結構體實作特性和方法，甚至可以使用「pub」關鍵字來設定成員的存取權限，這難道不就是物件導向程式語言嗎？也許吧！但別忘了，Rust程式語言本身也提供了基本資料型態，我們先不論程式的難易度，其實可以只使用基本資...]]></description><category>研究分享</category><category>Rust</category><category>Rust</category><category>Rust 學習之路</category><guid>https://magiclen.org/rust-object-oriented</guid><pubDate>Wed, 27 Jun 2018 09:00:02 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>Rust 學習之路─第十六章：並發與並行</title><link>https://magiclen.org/rust-concurrency</link><description><![CDATA[    <img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt="">
有關於並發(concurrency)和並行(parallelism)的定義每個人可能有不一樣的解釋。筆者認為並行算是並發的子集合，所謂的「並發」，是指在某項工作結束之前，另一項工作就開始了，但這些工作可以是同時執行，也可以是交替執行。而所謂的「並行」，是並發的一種設計方式，能將工作交給不同的處理器(邏輯處理器)來執行，而達成同時執行兩項以上工作的目的。程式語言如JavaScript，雖然只支援單執...]]></description><category>研究分享</category><category>Rust</category><category>Rust</category><category>Rust 學習之路</category><guid>https://magiclen.org/rust-concurrency</guid><pubDate>Tue, 26 Jun 2018 09:00:25 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>Rust 學習之路─第十五章：智慧型指標</title><link>https://magiclen.org/rust-smart-pointer</link><description><![CDATA[    <img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt="">
相對於傳統直接使用記憶體位址來對應記憶體資料的指標，智慧型指標為一種資料結構，除了擁有基本的指標能對應記憶體資料的功能外，還可以提供其它不同的資訊以及額外的功能。例如我們先前使用過的Vec結構體和String結構體，就是智慧型指標。]]></description><category>研究分享</category><category>Rust</category><category>Rust</category><category>Rust 學習之路</category><guid>https://magiclen.org/rust-smart-pointer</guid><pubDate>Mon, 25 Jun 2018 09:00:27 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>ASUS Zenfone 5Z 和 ASUS ZenPower Duo 開箱</title><link>https://magiclen.org/asus-zenfone-5z</link><description><![CDATA[    <img src="https://magiclen.org/wp-content/uploads/2018/06/P1060008-220x162.jpg" srcset="https://magiclen.org/wp-content/uploads/2018/06/P1060008-220x162.jpg 1x, https://magiclen.org/wp-content/uploads/2018/06/P1060008-440x324.jpg 2x, https://magiclen.org/wp-content/uploads/2018/06/P1060008-660x486.jpg 3x" alt="">
由於受不了需要年年換電池且換完電池續航力也沒多好的HTC One M9，只好趁著只要台幣一萬五左右就能買到搭載驍龍845的ASUS Zenfone 5Z發佈，就趕緊預購了。]]></description><category>敗金開箱</category><category>硬體介紹</category><category>ASUS</category><category>手機</category><category>行動電源</category><category>犀牛盾</category><category>hoda</category><category>REMAX</category><category>自拍棒</category><guid>https://magiclen.org/asus-zenfone-5z</guid><pubDate>Sun, 24 Jun 2018 12:00:51 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>Rust 學習之路─第十四章：Cargo和Crates.io</title><link>https://magiclen.org/rust-cargo</link><description><![CDATA[    <img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt="">
Cargo除了可以編譯、執行、測試程式專案之外，還可以針對程式專案進行程式建構(build)時的細節調整、將不同程式專案組合成相同的工作空間(Workspace)，還能搭配Crates.io來使用，利用程式專案的相依關係快速取得Crates.io上的套件，或是反過來將我們開發完成的函式庫發佈到Crates.io上。]]></description><category>研究分享</category><category>Rust</category><category>Rust</category><category>Rust 學習之路</category><guid>https://magiclen.org/rust-cargo</guid><pubDate>Sun, 24 Jun 2018 09:00:13 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>Rust 學習之路─第十三章：閉包和迭代器</title><link>https://magiclen.org/rust-closure-iterator</link><description><![CDATA[    <img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt="">
Rust程式語言融合了多種程式設計法(programming paradigm)，以指令式程式設計(imperative programming)為主，支援函數式程式設計(functional programming)，不必明確定義出函數名稱的「閉包」和for迴圈所使用的「迭代器」和即是衍生自函數式程式設計的特性。]]></description><category>研究分享</category><category>Rust</category><category>Rust</category><category>Rust 學習之路</category><guid>https://magiclen.org/rust-closure-iterator</guid><pubDate>Sat, 23 Jun 2018 09:00:46 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>使用Node.js進行64位元的整數運算</title><link>https://magiclen.org/node-js-int64</link><description><![CDATA[    <img src="https://magiclen.org/wp-content/uploads/2017/08/nodejs-napi-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2017/08/nodejs-napi-220x162.png 1x, https://magiclen.org/wp-content/uploads/2017/08/nodejs-napi-440x324.png 2x, https://magiclen.org/wp-content/uploads/2017/08/nodejs-napi-660x486.png 3x" alt="">
JavaScript的Number採用64位元的IEEE 754標準來表示整數和浮點數數值，其中整數的安全範圍在-2^53 - 1到2^53 - 1之間。換句話說，Node.js既不能直接使用到32位元的整數，同時也無法使用64位元的整數。因此，如果要拿Node.js來做一些稍微複雜的計算，就需要撰寫額外的程式來處理資料型態的部份，進而影響到執行效能。]]></description><category>Rust</category><category>JavaScript</category><category>JavaScript</category><category>node.js</category><category>Node-API</category><category>Rust</category><category>int64-napi</category><category>TypeScript</category><guid>https://magiclen.org/node-js-int64</guid><pubDate>Fri, 22 Jun 2018 12:00:38 +0800</pubDate><dc:creator>Magic Len</dc:creator></item></channel></rss>