<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Seke on Medium]]></title>
        <description><![CDATA[Stories by Seke on Medium]]></description>
        <link>https://medium.com/@sekewei?source=rss-301bb0515bf5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*8G-Gj041qf4fn_j1</url>
            <title>Stories by Seke on Medium</title>
            <link>https://medium.com/@sekewei?source=rss-301bb0515bf5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 08:39:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sekewei/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[how to call Java classes in a web page by cheerpj]]></title>
            <link>https://medium.com/@sekewei/how-to-call-java-classes-in-a-web-page-by-cheerpj-f03d0adf6571?source=rss-301bb0515bf5------2</link>
            <guid isPermaLink="false">https://medium.com/p/f03d0adf6571</guid>
            <category><![CDATA[java-class]]></category>
            <category><![CDATA[java-virtual-machine]]></category>
            <category><![CDATA[webassembly]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Seke]]></dc:creator>
            <pubDate>Sat, 03 Oct 2026 05:58:36 GMT</pubDate>
            <atom:updated>2026-10-03T06:38:45.739Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/306/1*vNaEEXeaZXwdMy1d5aUHWQ.png" /><figcaption>網頁呼叫 Java 堆疊類別檔範例</figcaption></figure><h3>🚀 在瀏覽器中直接執行 Java：CheerpJ v3 實作指南</h3><p>長期以來，Java Applets 因為安全性與插件問題早已退出歷史舞台。但隨著 WebAssembly (Wasm) 技術的成熟，現在網頁安裝如下 <strong>CheerpJ v3</strong> 套件庫，就可以在瀏覽器中直接呼叫 Java Bytecode 類別檔，完全不需要再安裝其他套件。 ☕️</p><pre>&lt;script src=&quot;https://cjrtnc.leaningtech.com/3.0/cj3loader.js&quot;&gt;&lt;/script&gt;</pre><h3>🏗️ 核心架構與原理</h3><p>CheerpJ v3 的運作原理並非將 Java 轉譯為 JavaScript，而是建立了一個 <strong>WebAssembly 虛擬機</strong> 。它在瀏覽器中模擬了 JVM (Java Virtual Machine) 的環境，直接讀取並執行 Java 的 Bytecode (.class 檔案)。</p><p>其整合流程可分為三個階段：</p><ul><li><strong>編譯階段：</strong> 將 Java 原始碼編譯為 <strong>Java 8</strong> 版本的 Bytecode (Major version 52)。這是關鍵，因為 CheerpJ v3 目前對 Java 8 的相容性最穩定。</li><li><strong>部署階段：</strong> 將編譯後的 .class 檔案放置於 Web 伺服器上（如 GitHub Pages），使其能透過 HTTP 請求獲取。</li><li><strong>執行階段：</strong> 在前端 HTML 中載入 CheerpJ Runtime，初始化虛擬檔案系統，並將遠端路徑映射到虛擬的 /app/ 目錄中。</li></ul><h3>🛠️ 技術實作：類別初始化與資料交換</h3><p>在 v3 版本中，我們使用 <strong>Library Mode</strong> API。由於 Java 執行環境是異步載入的，所有操作都必須在 async 函數中進行。</p><h4>1. Java 類別初始化 (Initialization)</h4><p>初始化過程分為：啟動 Runtime → 定義路徑 → 獲取類別 → 實例化對象。</p><pre>async function init() { <br>  // 1. 初始化 CheerpJ 環境 <br>  await cheerpjInit(); <br><br>  // 2. 定義類別路徑 (Classpath) <br>  const lib = await cheerpjRunLibrary(&quot;/app/&quot;); <br><br>  // 3. 從 Library 中獲取 Java 類別 (Class) <br>  const MyClass = await lib.MyClass; <br><br>  // 4. 實例化 Java 對象 (Instance) <br>  const instance = await new MyClass();<br><br>  return instance; <br>}</pre><h4>2. DOM 與 Java 類別的資料交換 (Data Passing)</h4><p>由於 JavaScript 是單線程，為了不讓其卡住，CheerpJ 將 Java 方法呼叫封裝為 <strong>Promise</strong> (承諾）。Promise 物件代表一個現在 尚未完成 (pending)，但在未來會 完成 (fullfilled)，或 失敗 (rejected）的非同步操作及其結果。因此，傳遞資料時必須使用 await 指令。</p><p><strong>👉 從 DOM 傳送到 Java：</strong> 直接將 JS 變數作為參數傳入 Java 方法。</p><pre>// 假設從 input 獲取值並傳給 Java 的 push 方法 <br>const val = document.getElementById(&quot;myInput&quot;).value; <br>const result = await stack.push(val); // 將 JS 字串傳入 Java</pre><p><strong>👉 從 Java 回傳至 DOM：</strong> 接收 Java 方法的返回值，並使用 DOM API 更新畫面。</p><pre>// 呼叫 Java 的 pop 方法並獲取回傳值 <br>const poppedValue = await stack.pop(); <br><br>// 將結果顯示在網頁上 <br>document.getElementById(&quot;out&quot;).textContent = &quot;彈出值: &quot; + poppedValue;</pre><h3>🌟 實作範例</h3><p>以下建立了一個簡單的 Stack (堆疊) 操作 Demo，展示如何將 Java 的資料結構邏輯直接封裝在網頁中：</p><ul><li><strong>GitHub 儲存庫：</strong> <a href="https://github.com/sekewei/cheerpj">sekewei/cheerpj</a> 📂</li><li><strong>線上 Demo：</strong> <a href="https://sekewei.github.io/cheerpj/cheerpj-v3.html">點此體驗 Java 在瀏覽器執行</a></li></ul><p>在這個範例中，所有的邏輯（Push, Pop, Peek）都是由後端編譯的 MyStack3.class 處理，前端僅負責 UI 互動與結果顯示。這證明了網頁可以在不撰寫任何後端 API 的情況下，將既有的 Java 邏輯直接移植到靜態網頁中。 ✨</p><p><em>#Java #WebAssembly #CheerpJ #Frontend #WebDev #JVM</em></p><p><em>Originally published at </em><a href="https://seke-blog.blogspot.com/2026/10/how-to-call-java-classes-in-web-page-by.html"><em>https://seke-blog.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f03d0adf6571" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[why thrashing occurs in virtual memory systems]]></title>
            <link>https://medium.com/@sekewei/why-thrashing-occurs-in-virtual-memory-systems-2bcb88ced9d3?source=rss-301bb0515bf5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2bcb88ced9d3</guid>
            <category><![CDATA[thrashing]]></category>
            <category><![CDATA[virtual-memory]]></category>
            <dc:creator><![CDATA[Seke]]></dc:creator>
            <pubDate>Mon, 13 Jan 2025 06:48:59 GMT</pubDate>
            <atom:updated>2025-01-13T06:52:34.015Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Pup9b-5UWOEYwHb5" /><figcaption>Photo by <a href="https://unsplash.com/@itx_zissu?utm_source=medium&amp;utm_medium=referral">Zishan khan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>依據現代電腦的<a href="https://zh.wikipedia.org/zh-tw/%E5%86%AF%C2%B7%E8%AF%BA%E4%BC%8A%E6%9B%BC%E7%BB%93%E6%9E%84">馮紐曼運算架構</a>，CPU始終只能從記憶體讀取資料執行，不能直接從硬碟讀取資料。因此，程式常受限於記憶體的容量限制而無法載入執行。可是明明電腦系統的硬碟容量常是記憶體的上千倍，難道不能克服困難，<strong>將硬碟當成記憶體使用</strong>嗎?</p><p><strong>虛擬記憶體</strong> (Virtual Memory)就是這樣一個應急措施，可將硬碟分一塊<strong>置換空間</strong> (Swap Space)，當成記憶體用。其明顯好處是從此電腦不再受記憶體的容量限制，再大、再多的程式也可執行。只要硬碟夠大，頂多暫時存放在硬碟的置換空間，要用時再搬進記憶體執行即可。</p><p>但記住虛擬記憶體始終只是一個應急措施，不能當成常態使用。理由是資料在記憶體和硬碟之間搬移 (swapping) 時，要花費很久的等候時間，互動式用戶將等的不耐煩，故只適合非不得已偶一為之。例如，記憶體的批次用戶較多，可暫時挪到硬碟休息，先讓互動用戶使用記憶體。</p><p>採用虛擬記憶體有一個副作用是如果管理不好，分配給程式的實體記憶體不夠，須要先將暫時不用的程式<strong>從記憶體搬出</strong>到硬碟 (page out)，才能騰出空間，讓須要的程式碼從硬碟<strong>搬回到記憶體</strong> (page in) 執行。萬一記憶體極端不足情況下，很可能剛搬出的程式，等下又要再搬入，造成所謂的<strong>掙扎</strong> (<strong>thrashing</strong>) 現象。出現此反常現象時，系統效能將變極差，只見硬碟不斷亮燈，苦苦忙著將資料從記憶體搬出搬進，I/O使用率陡升，而CPU卻坐等資料搬好，閒閒沒事幹，CPU使用率陡降。</p><p>註: 上述 掙扎現象的英文 <strong>thrashing</strong> 查字典有如下諸多意思:</p><blockquote>掙扎，輾轉，擺盪，振盪，顛簸，抖動，猛移，往復移動，頻繁置換；<br> 徒勞，作虛功，無進展，白費力氣，原地踏步；打敗，痛打，窮忙，窮打，窮追猛打</blockquote><p>常見直譯有 輾轉，擺盪，甚至意譯 窮忙，作虛功，也都很傳神。<br> 選擇<strong> 掙扎 </strong>則兼有直譯及意譯，猶如泳者奮力浮水，離水之魚奮拍入水之勢。</p><p><em>Originally published at </em><a href="https://seke-blog.blogspot.com/2019/03/thrashing-in-operating-systems.html"><em>https://seke-blog.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bcb88ced9d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaFX可以不使用場景建立器嗎?]]></title>
            <link>https://medium.com/@sekewei/javafx%E5%8F%AF%E4%BB%A5%E4%B8%8D%E4%BD%BF%E7%94%A8%E5%A0%B4%E6%99%AF%E5%BB%BA%E7%AB%8B%E5%99%A8%E5%97%8E-e480b5a21ac7?source=rss-301bb0515bf5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e480b5a21ac7</guid>
            <category><![CDATA[javafx]]></category>
            <category><![CDATA[scene-builder]]></category>
            <dc:creator><![CDATA[Seke]]></dc:creator>
            <pubDate>Sat, 09 Nov 2024 10:12:35 GMT</pubDate>
            <atom:updated>2024-11-13T04:49:06.532Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*YXSGIhyLqaJbOl8-vhwZug.png" /><figcaption>不用場景建立器的 JavaFX 簡易範例輸出</figcaption></figure><p>一般建置 <a href="https://gluonhq.com/products/javafx/">JavaFX</a> 圖形介面，多數利用 Gluon公司釋放的 <a href="https://gluonhq.com/products/scene-builder/">SceneBuilder</a> 場景建立工具，先產生視窗配置檔 .fxml，再由程式載入套用。學過 Swing 圖形介面的人可能會想，是否程式可以像 Swing 寫法，不利用視窗配置檔，直接由程式建立 JFrame 視窗，再以指令配置元件。答案是可以的。以下取材自 <a href="https://copilot.microsoft.com/">Copilot</a> 輸出常見的 JavaFX 測試範例，展示如何不載入配置檔，簡單建立 JavaFX 視窗互動按鈕的寫法。</p><pre>// JavaFX_noscenebuilder.java<br>// 展示如何不用場景建立器(SceneBuilder)，配置元件位置，<br>// 直接用程式部署元件的 JavaFX 視窗程式寫法<br>//<br>// 命令列編譯指令<br>// &gt; javac -classpath &quot;…\javafx-sdk-xx\lib\javafx-swt.jar;…;.&quot; \<br>// JavaFX_noscenebuilder.java<br>//<br>// 命令列執行指令<br>// &gt; java --add-modules javafx.controls,javafx.fxml \<br>// -classpath . \<br>// --module-path &quot;…\javafx-sdk-xx\lib\javafx-swt.jar;…&quot; \<br>// JavaFX_noscenebuilder<br>//<br><br>// 引用 JavaFX 套件<br>import javafx.application.Application;<br>import javafx.scene.Scene;<br>import javafx.scene.control.Button;<br>import javafx.scene.layout.StackPane;<br>import javafx.stage.Stage;<br><br>// JavaFX 視窗類別須繼承自 javafx.application.Application<br>public class JavaFX_noscenebuilder extends Application <br>{<br><br>  @Override<br>  // 舞台啟動方法，接收舞台參數 primaryStage，建立場景<br>  public void start(Stage primaryStage) <br>  {<br>    primaryStage.setTitle(&quot;Hello World!&quot;); // 設定舞台標題<br><br>    Button btn = new Button(); // 建立按鈕<br>    btn.setText(&quot;Say &#39;Hello World&#39;&quot;); // 設立按鈕顯示字串<br>    // 設定按鈕事件處理器，列印歡迎字串<br>    btn.setOnAction(event -&gt; System.out.println(&quot;Hello World!&quot;));<br><br>    StackPane root = new StackPane(); // 建立堆疊面板，當場景根節點<br>    root.getChildren().add(btn); // 將按鈕加入堆疊面板的小孩容器<br><br>    // 在場景根節點root下，建立300x100場景<br>    Scene scene = new Scene(root, 300, 100);<br>    primaryStage.setScene(scene); // 設定舞台場景<br>    primaryStage.show(); // 顯示舞台<br>  }<br><br>  // 測試主程式<br>  public static void main(String[] args) <br>  {<br>    // 載入JavaFX執行期環境，建立應用程式物件，呼叫 start()啟動舞台及場景<br>    Application.launch(args);<br>  }<br>}</pre><p>註: 編譯及執行 JavaFX 程式所須參考的套件如下</p><ol><li>JavaFX xx -javafx-swt.jar</li><li>JavaFX xx -javafx.base.jar</li><li>JavaFX xx -javafx.controls.jar</li><li>JavaFX xx -javafx.fxml.jar</li><li>JavaFX xx -javafx.graphics.jar</li><li>JavaFX xx -javafx.media.jar</li><li>JavaFX xx -javafx.swing.jar</li><li>JavaFX xx -javafx.web.jar</li><li>JDK yy</li></ol><p><em>Originally published at </em><a href="https://seke-blog.blogspot.com/2024/11/how-to-write-javafx-application-without.html"><em>https://seke-blog.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e480b5a21ac7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[免費 R 語言線上課程]]></title>
            <link>https://medium.com/@sekewei/r%E8%AA%9E%E8%A8%80%E7%82%BA%E7%B5%B1%E8%A8%88-%E9%86%AB%E7%99%82-%E9%87%91%E8%9E%8D%E7%95%8C%E5%B8%B8%E7%94%A8%E7%9A%84%E8%85%B3%E6%9C%AC%E8%AA%9E%E8%A8%80-%E5%92%8Cpython%E8%AA%9E%E8%A8%80%E4%B8%80%E6%A8%A3-%E4%B9%9F%E6%9C%89%E7%9C%BE%E5%A4%9A%E7%A4%BE%E7%BE%A4%E5%8F%8A%E5%85%8D%E8%B2%BB%E5%A5%97%E4%BB%B6%E5%8F%AF%E4%BE%9B%E9%81%B8%E7%94%A8-%E8%8B%A5%E6%83%B3%E8%87%AA%E5%AD%B8%E6%94%B6%E7%9C%8B%E5%85%B6%E4%B8%AD%E6%96%87%E7%89%88%E7%B7%9A%E4%B8%8A%E8%AA%B2%E7%A8%8B-%E4%BE%9D%E6%93%9A%E4%B8%80%E8%88%AC-%E9%86%AB%E5%AD%B8-%E5%95%86%E5%AD%B8-%E5%85%B6%E4%BB%96%E9%A0%98%E5%9F%9F-%E5%8F%AF%E5%8F%83%E8%80%83%E5%A6%82%E4%B8%8B%E8%B3%87%E6%BA%90-24bab835806f?source=rss-301bb0515bf5------2</link>
            <guid isPermaLink="false">https://medium.com/p/24bab835806f</guid>
            <category><![CDATA[online-courses]]></category>
            <category><![CDATA[r]]></category>
            <category><![CDATA[programming-languages]]></category>
            <dc:creator><![CDATA[Seke]]></dc:creator>
            <pubDate>Thu, 10 Oct 2024 15:16:36 GMT</pubDate>
            <atom:updated>2024-10-11T11:10:37.380Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kz-_LewyT1O_WfMP" /><figcaption>Photo by <a href="https://unsplash.com/@crisdinoto?utm_source=medium&amp;utm_medium=referral">Cris DiNoto</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>R 語言為統計，醫療，金融界常用的腳本語言，和 Python 語言一樣，也有眾多社群及免費套件可供選用。若想自學收看其中文版線上課程，依據一般，醫學，商學，其他領域，可參考如下資源:</p><p>🟢一般領域</p><ol><li>2020 — 五分鐘R語言系列，17集，1.8小時<br><a href="https://www.youtube.com/playlist?list=PLghWJf3e_h2GMPHNGbT4TN-kdfEvQgmPu">https://www.youtube.com/playlist?list=PLghWJf3e_h2GMPHNGbT4TN-kdfEvQgmPu</a></li><li>2022–hiskio-R 語言與統計分析，10章，3.5小時<br><a href="https://hiskio.com/courses/67/">https://hiskio.com/courses/67/</a></li></ol><p>🔵醫學領域</p><ol><li>2020-劉品崧-慈濟-R基礎課程，9單元，2.2小時<br><a href="https://www.youtube.com/@%E8%A1%9B%E7%94%9F%E7%A6%8F%E5%88%A9%E8%B3%87%E6%96%99%E7%A7%91%E5%AD%B8%E4%B8%AD%E5%BF%83/playlists">https://youtube.com/@user-vd8nk3hu2w</a></li><li>2023-林嶔-國防-R語言程式設計導論，14課，11小時<br><a href="https://www.youtube.com/watch?v=CmTUq6U_KLQ&amp;list=PLVkhT_zlSH2CVz98EAaOPhrPpgmwd8yi4">https://www.youtube.com/watch?v=CmTUq6U_KLQ&amp;list=PLVkhT_zlSH2CVz98EAaOPhrPpgmwd8yi4</a></li></ol><p>🟠商學領域</p><p>2021-黃偉恆&amp;王价輝-逢甲-數據科學與R程式語言實作 (9週)<br><a href="https://www.openedu.tw/course?id=1515">https://www.openedu.tw/course?id=1515</a></p><p>🟡其他領域</p><ol><li>Coursera: R相關中文免費課程<br><a href="https://www.coursera.org/search?query=R%20&amp;language=Chinese%20%28China%29&amp;sortBy=BEST_MATCH">https://www.coursera.org/search?query=R%20&amp;language=Chinese%20%28China%29&amp;sortBy=BEST_MATCH</a></li><li>Udemy: R相關免費課程,但似無中文<br><a href="https://www.udemy.com/courses/search/?price=price-free&amp;q=R">https://www.udemy.com/courses/search/?price=price-free&amp;q=R</a></li></ol><p><em>Originally published at </em><a href="https://sekesite.wordpress.com/2024/09/08/online-courses-about-r-programming-in-chinese/"><em>https://sekesite.wordpress.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24bab835806f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[監看Linux主機CPU及GPU好工具]]></title>
            <link>https://medium.com/@sekewei/%E7%9B%A3%E7%9C%8Blinux%E4%B8%BB%E6%A9%9Fcpu%E5%8F%8Agpu%E5%A5%BD%E5%B7%A5%E5%85%B7-2e942e3be788?source=rss-301bb0515bf5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e942e3be788</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[cpu]]></category>
            <category><![CDATA[monitoring-software]]></category>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Seke]]></dc:creator>
            <pubDate>Tue, 17 Sep 2024 11:58:23 GMT</pubDate>
            <atom:updated>2024-09-20T00:26:47.216Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hlnY_cEICEbojcJb" /><figcaption>Photo by <a href="https://unsplash.com/@thisisengineering?utm_source=medium&amp;utm_medium=referral">ThisisEngineering</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>若擔心主機遭入侵挖礦，想隨時用手機 App 透過 ssh 連線監視 Linux 機器的資源使用及硬體溫度，可考慮如下作法。</p><p>(1) set up a monitor account on Linux 建立主機端監視用帳號user_name</p><pre>$ sudo adduser - home=/home/user_name user_name   # 建立user_name監視用帳號<br>$ grep user_name /etc/passwd                      # 檢視帳戶檔的user_name記錄<br>$ sudo edquota -p source_user user_name           # 套用source_user配額到user_name<br>$ sudo quota -u user_name                         # 檢視 user_name 硬碟配額</pre><p>(2) set up .ssh store for client public keys 建立主機端目錄，存放App端公鑰</p><pre>$ mkdir -p ~/.ssh &amp;&amp; chmod 700 ~/.ssh  # 建立金鑰庫目錄，設定只給自己用的權限<br>$ cat &gt;&gt; ~/.ssh/authorized_keys        # 放入App端產生之公鑰到主機授權金鑰庫<br>$ chmod 600 ~/.ssh/authorized_keys     # 設定金鑰庫權限</pre><p>(3a) set up <a href="https://play.google.com/store/apps/details?id=com.deskangel.daremote&amp;hl=zh_TW&amp;gl=US"><strong>DaRemote</strong></a> App for Android 設定Android App<br> Configure Name, Host, User, Key/Password 設定主機<br> Monitor CPU/Memory/Disk/Network including CPU temperature 監視資源<br> Use Shell Terminal 使用終端機</p><p>(3b) set up <a href="https://apps.apple.com/tw/app/servercat/id1501532023"><strong>ServerCat</strong></a> App for iOS 設定 iOS App<br> ServerCat<br> Status: Temperature 監視主機資源<br> Monitor CPU/Load Memory/Swap Upload/Download Read/Write<br> including core usage, threads, memory,<strong> GPU memory</strong>, CPU/<strong>GPU temperature</strong>, disk usage</p><p>Configure Host/+/ 設定受監視主機<br> Name, Host, Port, User, Password, SSH Key<br> Execute/Select host 執行上傳公鑰指令</p><p>Copy the Shell Command from KeyChain Store to 從金鑰鏈儲存庫產生指令<br> Send the Public Key to the remote host 拷貝公鑰到主機<br> cmd: echo ‘ssh-ed25519 xxxxxxxxxxxx ‘ &gt;&gt; !/.ssh/authorized_keys</p><p>Execute<br> Mange KeyChain/+/ 管理登入金鑰<br> Configure a new SSH Authentication Key Pair 產生公私金鑰對<br> Generate 2048 bit RSA Key, or<br> Generate ED25519 Key (<strong>Recommended 推薦，因產生之公鑰較短，好貼上</strong>)</p><p>Copy SSH Authentication Key to Server 拷貝指令，將公鑰放入授權金鑰庫<br> echo ‘ssh-ed25519 xxxxxxxxxxxx ‘ &gt;&gt; !/.ssh/authorized_keys</p><p><em>Originally published at </em><a href="https://seke-blog.blogspot.com/2023/04/apps-for-monitoring-cpu-and-gpu.html"><em>https://seke-blog.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e942e3be788" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CPU burst and IO burst]]></title>
            <link>https://medium.com/@sekewei/cpu-burst-and-io-burst-6db94b6dbe76?source=rss-301bb0515bf5------2</link>
            <guid isPermaLink="false">https://medium.com/p/6db94b6dbe76</guid>
            <category><![CDATA[burst]]></category>
            <category><![CDATA[cpu]]></category>
            <dc:creator><![CDATA[Seke]]></dc:creator>
            <pubDate>Sun, 15 Sep 2024 05:55:22 GMT</pubDate>
            <atom:updated>2024-10-02T03:26:00.252Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qRWB1adFRTlKCrhZ" /><figcaption>Photo by <a href="https://unsplash.com/@christianw?utm_source=medium&amp;utm_medium=referral">Christian Wiediger</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>作業系統講到行程排班使用 CPU 時，<br>常提到行程一生使用資源會在 CPU burst 及 IO burst 交替之中度過。</p><p>那到底什麼是 burst?<br>如果查 burst 原義，比較接近的大概是<br><a href="https://www.britannica.com/dictionary/burst">https://www.britannica.com/dictionary/burst</a><br> a short period of producing or doing something that begins suddenly<br>也就是短期突發作某事。</p><p>引申用到 CPU/IO burst 就是指一段連續使用 CPU/IO 時間。<br>若硬要口語化翻譯，大概可考慮如下幾種譯法:</p><p>連續 CPU 使用期、連續 IO 使用期<br> CPU 連用期、IO 連用期<br> CPU 使用期、IO 使用期<br> CPU 期、IO 期</p><p>這和一般簡化為 CPU 時間或 IO 時間相較，意義上更為明確。</p><p><em>Originally published at </em><a href="https://seke-blog.blogspot.com/2013/10/cpu-burst-and-io-burst.html"><em>https://seke-blog.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6db94b6dbe76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[何謂單/雙線路及單/雙源頭網路拓樸]]></title>
            <link>https://medium.com/@sekewei/%E4%BD%95%E8%AC%82%E5%96%AE-%E9%9B%99%E7%B7%9A%E8%B7%AF%E5%8F%8A%E5%96%AE-%E9%9B%99%E6%BA%90%E9%A0%AD%E7%B6%B2%E8%B7%AF%E6%8B%93%E6%A8%B8-ec08b7964efe?source=rss-301bb0515bf5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec08b7964efe</guid>
            <category><![CDATA[network-topology]]></category>
            <dc:creator><![CDATA[Seke]]></dc:creator>
            <pubDate>Sun, 15 Sep 2024 05:41:52 GMT</pubDate>
            <atom:updated>2024-09-15T05:41:52.384Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u3i7t30g03WaY2OR" /><figcaption>Photo by <a href="https://unsplash.com/@alinnnaaaa?utm_source=medium&amp;utm_medium=referral">Alina Grubnyak</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>在設計企業廣域網路連線拓樸，討論如何從企業端連向 ISP (Internet Service Provider) 端 ，或輻輳 (spoke) 端連向軸心 (hub) 端時，常根據源頭 (source or home or ISP) 個數，及線路 (link) 個數，將連線拓樸依其可靠度/成本分成四類如下:</p><p>1.single homed = single-link single-source 單線路，單源頭拓樸<br>2.dual homed = dual-link single-source 雙線路，單源頭拓樸<br>3.single multi-homed = single-link multiple-source 單線路，多源頭拓樸<br>4.dual multi-homed = dual-link multiple-source 雙線路，多源頭拓樸</p><p>單線路單源頭( single homed) 拓樸的成本最低，但是可靠度最差。<br>雙線路多源頭 (dual multi-homed) 拓樸的可靠度最佳，但是成本最高。</p><p>四類連線拓樸的各種實例可參考如下網頁介紹:<br> <a href="https://datapacket.com/blog/multihomed-network-vs-single-homed-network">https://datapacket.com/blog/multihomed-network-vs-single-homed-network</a></p><p><em>Originally published at </em><a href="https://seke-blog.blogspot.com/2019/01/what-are-singledual-homedmulti-homed.html"><em>https://seke-blog.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec08b7964efe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Active versus passive multiprogramming]]></title>
            <link>https://medium.com/@sekewei/active-versus-passive-multiprogramming-f255372ebe90?source=rss-301bb0515bf5------2</link>
            <guid isPermaLink="false">https://medium.com/p/f255372ebe90</guid>
            <category><![CDATA[multi-programming]]></category>
            <dc:creator><![CDATA[Seke]]></dc:creator>
            <pubDate>Sat, 14 Sep 2024 16:06:46 GMT</pubDate>
            <atom:updated>2024-10-02T03:20:09.984Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WtGg98MVmDTlMmGn" /><figcaption>Photo by <a href="https://unsplash.com/@afgprogrammer?utm_source=medium&amp;utm_medium=referral">Mohammad Rahmani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>多元規劃</strong> (multiprogramming) 是作業系統演進史上，一項早期重大發明。早期電腦的記憶體一次只放一支程式，遇到程式執行I/O指令，等候I/O結果，CPU就閒置浪費掉。因此，利用多元規劃技術，<strong>在記憶體放進多支程式</strong>，遇程式等I/O時，就將CPU分配給其他程式使用，如此即可提升CPU使用率 (utilization)。</p><p>至於為何將技術取名為多元規劃，讓人從字面不易猜透其義? 猜測可能是參考當時流行的線性規劃 (linear programming)，整數規劃 (integer programming) 等最佳化技術的命名。顧名思義，<strong>多元 </strong>指的是記憶體一次載入多支程式，<strong>規劃 </strong>指的是安排多支程式執行。而某種意義上，這也的確是讓CPU使用率提升的一種最佳化技術。如果對多元用語的語義不明有芥蒂，也許稱為 <strong>多程式規劃 </strong>會更一目暸然。一個電腦系統的 <strong>多元規劃度 </strong>(degree of multiprogramming) 為放進記憶體的程式數量，其值越高，表示CPU有越多程式可執行，越有利於提升CPU使用率。</p><p>多元規劃依據作業系統排班器對CPU的掌控程度分為兩種。<strong>主動式多元規劃</strong> (active multiprogramming) 的排班器利用計時器主動打斷程式的執行， 給定時間一到，即強迫程式讓出CPU，改跑其他程式，以防止CPU遭程式霸佔；<strong>被動式多元規劃 </strong>(passive multiprogramming) 的排班器則只能被動等候程式作I/O，或志願讓出CPU，才能重新取得CPU分配給其他程式，容易造成CPU遭程式霸佔。</p><p><em>Originally published at </em><a href="https://seke-blog.blogspot.com/2019/03/multiprogramming-in-operating-systems.html"><em>https://seke-blog.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f255372ebe90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[在 Windows 安裝 Ubuntu 子系統及 ssh 遠端登入服務]]></title>
            <link>https://medium.com/@sekewei/%E5%9C%A8-windows-%E5%AE%89%E8%A3%9D-ubuntu-%E5%AD%90%E7%B3%BB%E7%B5%B1%E5%8F%8A-ssh-%E9%81%A0%E7%AB%AF%E7%99%BB%E5%85%A5%E6%9C%8D%E5%8B%99-04cb80f3a381?source=rss-301bb0515bf5------2</link>
            <guid isPermaLink="false">https://medium.com/p/04cb80f3a381</guid>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[windows-subsystem-linux]]></category>
            <dc:creator><![CDATA[Seke]]></dc:creator>
            <pubDate>Sat, 14 Sep 2024 15:51:28 GMT</pubDate>
            <atom:updated>2024-11-13T04:44:24.806Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*gLDGxu4M2EQaTTpU130ubg.png" /></figure><p>傳統一台 Windows 主機若要同時跑 Linux 作業系統，不是要安裝 <a href="https://www.cygwin.com/">Cygwin</a> 套件，就是要透過 <a href="https://www.virtualbox.org/wiki/Downloads">VirtualBox</a> 等虛擬機軟體安裝 Linux。現在 Windows 的 <a href="https://learn.microsoft.com/zh-tw/windows/wsl/">WSL</a> (Windows Subsystem for Linux) 技術逐漸成熟，可以在 Windows 環境中，啟用 Linux 子系統，方便雙方資料共享，及執行 Linux 程式和指令。以下簡短摘要步驟，說明如何透過 Microsoft Store 微軟商店，安裝 Ubuntu 22.04.1 LTS 作業系統。若須要，也可順便安裝ssh服務供遠端登入本機。</p><ol><li>啟動 Windows 的 Linux 子系統 (WSL) 功能<br> 控制台/程式集/程式和功能: 開啟或關閉 Windows 功能<br> 勾選: Windows 子系統 Linux</li><li>安裝 Ubuntu 作業系統<br> Microsoft Store: 找尋安裝 Ubuntu 22.04.1 LTS，建立帳戶<strong>myuser</strong></li><li>啟動 Ubuntu 作業系統 WSL終端機，依如下任一方法:<br>- 建立如下桌面捷徑圖示，再作點選:<br> 目標: C:\Windows\System32\wsl.exe<br> 開始位置: \\wsl$\Ubuntu-22.04\home\<strong>myuser<br>-</strong> 使用 SearchBox: ubuntu2204<br>- 進入 CMD 終端機，再下指令 wsl.exe 進入 WSL 終端機。</li><li>若須要，可順便安裝 ssh 終端機登入服務，供遠方登入本機之用</li></ol><p>4.1.安裝 ssh 服務<br> WSL終端機執行如下指令:</p><pre>$ sudo apt remove openssh-server<br>$ sudo apt install openssh-server<br>$ sudo service ssh start</pre><p>4.2.設定 ssh 服務於 Windows 開機時自動啟動</p><p>4.2.1. 設定權限，允許不輸入密碼即可啟動服務<br> WSL終端機執行如下指令:</p><pre>$ sudo vim /etc/sudoers<br>%sudo ALL=NOPASSWD: /usr/sbin/service ssh start</pre><p>4.2.2. Windows 工作排程器設定如下開機任務<br> 設定工作排程器 (Task Scheduler)，開機時自動啟動:<br> Basic Task<br> Trigger: When the computer starts<br> Program: <strong>C:\Windows\System32\wsl.exe<br> </strong>Argument: <strong>sudo /usr/sbin/service ssh start</strong></p><p>參考: <a href="https://www.howtogeek.com/746532/how-to-launch-cron-automatically-in-wsl-on-windows-10-and-11/">https://www.howtogeek.com/746532/how-to-launch-cron-automatically-in-wsl-on-windows-10-and-11/</a></p><p>4.3.設定金鑰目錄權限，拷貝遠方客戶公鑰進來，供登入本機核對身份用<br> WSL終端機執行如下指令</p><pre>$ mkdir ~/.ssh # 家目錄下建立金鑰目錄<br>$ chmod 700 ~/.ssh # chmod 指令只對/根目錄 (wslfs) 有效，對/mnt/c (drvfs)掛載目錄無效<br>$ scp -p user@host:.ssh/*pub . # 拷貝遠方既有.pub公鑰到本機個人金鑰目錄，供身份核對之用</pre><p>註:</p><ol><li>若想要知道或切換目前 <a href="https://learn.microsoft.com/zh-tw/windows/wsl/compare-versions">WSL 版本</a>，可於CMD或WSL終端機使用如下指令。</li></ol><pre>$ wsl.exe -l<br>Windows 子系統 Linux 版發佈:<br>Ubuntu-22.04 (預設值)<br><br>$ wsl.exe -l -v<br>NAME STATE VERSION<br>* Ubuntu-22.04 Running 1<br><br>$ wsl.exe --set-default-version 2</pre><p>2. 不從微軟商店，直接從CMD命令列也可查詢及安裝Linux，指令如下:</p><pre>$ wsl.exe --list --online<br>以下是可安裝之有效發佈的清單。<br>使用 &#39;wsl --install -d &lt;Distro&gt;&#39; 安裝。<br><br>NAME                            FRIENDLY NAME<br>Ubuntu                          Ubuntu<br>Debian                          Debian GNU/Linux<br>kali-linux                      Kali Linux Rolling<br>Ubuntu-18.04                    Ubuntu 18.04 LTS<br>Ubuntu-20.04                    Ubuntu 20.04 LTS<br>Ubuntu-22.04                    Ubuntu 22.04 LTS<br>Ubuntu-24.04                    Ubuntu 24.04 LTS<br>OracleLinux_7_9                 Oracle Linux 7.9<br>OracleLinux_8_7                 Oracle Linux 8.7<br>OracleLinux_9_1                 Oracle Linux 9.1<br>openSUSE-Leap-15.6              openSUSE Leap 15.6<br>SUSE-Linux-Enterprise-15-SP5    SUSE Linux Enterprise 15 SP5<br>SUSE-Linux-Enterprise-15-SP6    SUSE Linux Enterprise 15 SP6<br>openSUSE-Tumbleweed             openSUSE Tumbleweed<br></pre><p><em>Originally published at </em><a href="https://seke-blog.blogspot.com/2022/12/how-to-install-ubuntu-as-subsystem-of.html"><em>https://seke-blog.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04cb80f3a381" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[何謂類別及物件]]></title>
            <link>https://medium.com/@sekewei/%E4%BD%95%E8%AC%82%E9%A1%9E%E5%88%A5%E5%8F%8A%E7%89%A9%E4%BB%B6-8ea8f643379c?source=rss-301bb0515bf5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ea8f643379c</guid>
            <category><![CDATA[methods]]></category>
            <category><![CDATA[objects]]></category>
            <category><![CDATA[class]]></category>
            <dc:creator><![CDATA[Seke]]></dc:creator>
            <pubDate>Sun, 08 Sep 2024 11:20:45 GMT</pubDate>
            <atom:updated>2024-10-06T04:57:12.667Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*TSq-hS5ZY23NVZ3kXHTurA@2x.jpeg" /></figure><p>一般對程式的認知，不外是利用一群指令，可對資料作運算。傳統非物件程式語言視<strong>方法</strong>為程式結構主體，內含諸多指令，負責運算資料。物件導向語言則相對重視資料本身，視<strong>資料</strong>為主體，稱為物件，而和資料相關的運算，則附屬於資料，稱為物件方法。</p><p>由於不同類型的資料及運算可以包裝成不同物件，因此，每個物件皆有一個型別，稱為<strong>類別</strong>。類別可想成是物件的模版，一個類別可以產生無數物件。<br>類別定義了物件的長相及能力，分別稱為</p><ol><li>狀態: 資料儲存處，又稱為欄位，屬性，或物件變數<br>狀態本身也可以是另一個物件。 狀態一般宣告為私密等級，不允許外界直接存取。 若要讓外界存取，通常會提供公開存取方法，供統一管制資料進出之用。</li><li>行為: 對狀態之運算，又稱為函數，訊息，或物件方法<br>行為一般宣告為公開等級，允許接收外界呼叫傳來的訊息，直接啟動資料的運算。</li></ol><p>舉例說明: 以 Java API 的掃瞄器 java.util.Scanner 物件為例，<br> 其狀態包含一可讀資料來源(Readable)物件，<br> 其行為則包含 nextInt()， nextLine() 等方法，允許外界從 Readable 物件取得一個整數，或一行字串。</p><p>物件可以視為類別的實體或個體，故類別產生物件的過程，也稱為<strong>實體化</strong>。<br>以程式觀點，實體化的 new 指令，旨在配置一塊特定型別的記憶體空間，供存放物件內容之用。物件的初始狀態則由建構子方法設定。<br>此空間的名稱即為物件名，此空間的型別即為類別名。</p><p>舉例說明: 如下兩指令可產生一個掃瞄器物件，方便從鍵盤取得整數。</p><pre>Scanner input = new Scanner(System.in);<br>int n = input.nextInt();</pre><p>其中，new 就是類別產生物件的實體化指令，後面要接類別建構方法，稱為建構子。建構子必須和類別同名，()一般會帶參數，供物件屬性填入初始值之用。new Scanner(System.in) 表示產生一塊型別為 Scanner 之物件空間。<br>其可讀資料來源設定為系統輸入流 System.in，即鍵盤，Scanner input = 表示將此物件名字取為 input。</p><p>有了物件就可呼叫其物件方法，啟動所需行為，input.nextInt() 表示呼叫input 物件的 nextInt() 方法，從鍵盤回傳一整數，int n =表示將此整數存入另一變數n格子，供後續利用。</p><p>註1: 類別及物件的內部結構分成資料成員及成員函數，其眾多別名列表如下:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0b2726f483923ec76f01f5416f38f9ef/href">https://medium.com/media/0b2726f483923ec76f01f5416f38f9ef/href</a></iframe><p>註2: 類別及物件相關名詞，中英對照如下:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/54860188a2b71fd2d91db3607d7e025b/href">https://medium.com/media/54860188a2b71fd2d91db3607d7e025b/href</a></iframe><p><em>Originally published at </em><a href="https://seke-blog.blogspot.com/2013/10/blog-post_18.html"><em>https://seke-blog.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ea8f643379c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>