Kuihao

@Kuihao

Language expression magician. My blog: https://kuihao.github.io/blog

Joined on Oct 14, 2020

  • 關於 selfPython Class 裡的 self 會回傳物件本身 (根據物件位址並自動 derefference 為物件)。 self 有點類似 linux kernel 的 macro 中的 container_of,或 linux kernel 的 macro 中 list_entry​​​​​​​​// list_entry 就是 container_of, ​​​​​​​​// 放在 list.h 中,作為 list API 為了命名統一而重新命名 ​​​​​​​​// 用來獲取「封裝 `struct list_head` 的 ​​​​​​​​// container (也是一個 `struct`) 的『address』」 ​​​​​​​​#define list_entry(ptr, type, member) \ ​​​​​​​​ container_of(ptr, type, member) 所以用 linux kernel 的風格來理解的話,==self 就是 The object of object_entry==。<br>由以下程式碼印出 self 訊息,可見 self 就是存於位址 (0x7ffbf95e94c0) 的 calss A 的物件。我所說的 object_entry 就是那段記憶體位址 (0x7ffbf95e94c0)。​​​​​​​​class A(): ​​​​​​​​ def __init__(self): ​​​​​​​​ print(self)
     Like  Bookmark
  • 本文乃下方來源之個人心得整理: Ref1: 黃子嘉,線性代數及其應用 (下) 第五版 Ref2: Stanford University 電機系上課簡報,Supervised Learning via Empirical Risk Minimization Ref3: 台部落 理解L1,L2 範數在機器學習中應用 阪本龍一 2019-03-07 13:04 Ref4: Hung-yi Lee,Tips for Deep Learning Definition ==Norm 的定義就是向量的長度 (length)==
     Like  Bookmark
  • ==本教學用途: "我" 無密碼 ssh 至遠端==我 (本地): 需要 generate RSA private & public key 遠端: 需要把我的 public key 加進 authorized_keys 本文章乃修改此來源撰寫而成 只要三步驟,輕鬆完成設定 本教學本機端是 windows,遠端是 linux ubuntu,不同作業系統的命令可能不互通,請自行更換相應操作的命令 本機端先設定下方命令會自動生成 .ssh 資料夾並依回答生成 id_rsa (私鑰) 與 id_rsa.pub (公鑰)ssh-keygen -t rsa
     Like  Bookmark
  • Open Terminal on your Mac. Install Homebrew by running the following command:/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" This will download and install Homebrew, which is a package manager for macOS. Once Homebrew is installed將Homebrew加入到您的PATH環境變數中,以便您可以在終端機中使用Homebrew命令。您可以運行以下命令來實現這一點:(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/kuihaochang/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" 請注意,這裡假設您的使用者名稱為"kuihaochang",如果不是,請將上述命令中的使用者名稱替換為您的使用者名稱。 然後,您可以運行brew help命令,以開始使用Homebrew。您也可以查看Homebrew的更多文檔,了解如何使用Homebrew。brew help 完成上述步驟後,您已經成功地安裝了Homebrew。您可以使用Homebrew安裝其他軟件包,例如Git,Node.js等。 Then you can use it to install Git by running the following command:
     Like  Bookmark
  • Related: Jupyter 新增虛擬環境為新 kernel 來源: ref. ipython doc https://jupyter.org/install 安裝 Jupyter (Jupyter Lab, Jupyter Notebook) 首先要有安裝 jupyter notebook/lab,兩者挑一個安裝即可, 我建議用 conda 建一個只用來建制 Jupyter Server 的環境, 以方便管理
     Like  Bookmark
  • 本站更新紀錄 2021/11/18 新增 Colab 版本 Flower 單機模擬版 2021/11/18 新增 Colab 版本 Flower 單機模擬版 2021/10/18 新增 SOTA non-iid dataset source 2021/10/09 新增「Flower FedAvg 程式碼」解說 & Linux GPU trouble shooting 2021/10/01 進階篇 撰寫完成
     Like 2 Bookmark
  • Ref.: https://pytorch.org/docs/stable/generated/torch.optim.lr_scheduler.OneCycleLR.html 參數說明 torch.optim.lr_scheduler.OneCycleLR() ==optimizer,== ==max_lr,==最大學習率 可以使用 div_factor 和 final_div_factor 參數來指定初始學習率和最小學習率 ==初始學習率==: initial_lr = max_lr/div_factor ==最小學習率==: min_lr = initial_lr/final_div_factor
     Like  Bookmark
  • This page is edited from Auther: 辛西 (Cynthia)【Git】使用 SSH 金鑰與 GitHub 連線 Make a local ssh dir in linux mkdir ~/.ssh chmod 700 ~/.ssh Use Git RSA Generator to make rsa ssh key (private & public keys) ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
     Like 1 Bookmark
  • :::info Latex 數學式: https://hackmd.io/@sysprog/B1RwlM85Z Hackmd 各種嵌入語法: https://hackmd.io/s/features-tw ::: 假設 令 Classes 數量: C Softmax:
     Like 1 Bookmark
  • C99 2007 7.20.3 Memory management functions 提到: The order and contiguity of storage allocated by successive calls to the calloc, malloc, and realloc functions is unspecified. The pointer returned if the allocation succeeds ==is suitably aligned== so that ==it may be assigned to a pointer to any type of object== and then used to access such an object or an array of such objects in the space allocated (until the space is explicitly deallocated). The lifetime of an allocated object extends from the allocation until the deallocation. Each such allocation shall yield a pointer to an object disjoint from any other object. The pointer returned points to the start (lowest byte address) of the allocated space. If the space cannot be allocated, a null pointer is returned. If the size of the space requested is zero, the behavior is implementation-defined: either a null pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object.
     Like  Bookmark
  • contributed by < kuihao > 實驗環境 gcc version$ gcc --version 輸出:gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 lscpu$ lscpu
     Like  Bookmark
  • Reference: https://www.learncodewithmike.com/2020/01/python-module-and-package.html Q: Why I can't call parent file as relative path? A: 在 Python 中,相對路徑的使用是很嚴格的,首先必須搞懂 Package (套件) and Module (模組) 之間的差異。因為一個主執行程式,只能用絕對路徑來 import package,而只有 package 中 Module 與 Module 之間的 import 才有絕對路徑與相對路徑的選擇。相對路徑是檔案之間的相對位置沒錯,但是轉為執行程序 (process) 的時候,只能有一個絕對、唯一的參照點,也就是一個固定的根目錄 (即 package 的最上層位置)。我們任一個欲執行的 python 主程式 (下以 main.py 代稱),main.py 需使用絕對位置導入 package,因為 main.py 本身並不是一個 package,只有身為 package 才能使用相對路徑來任意執行底下的 module。 import package 可以想成把 package 掛到 (mount) 至 main.py。 若要執行任何一個用相對路徑定義的 module,則必須固定執行的路徑於 package 的最頂位置,你不可能站在任意 module 的位置去執行 module,因為只有 package 才能用相對路徑進行內部 import,而 module 不是 package。 故直接執行 child-module(其使用相對路徑導入其他 module) 是不可能間接執行 parents or grandparents。
     Like  Bookmark
  • 2022/04/18 Description Installed ubuntu 20.04 LTS desktop, but Wifi, BlueTooth and wired ethernet all wouldn’t’ work. Solved Ethernet Setting IP Download intel iwlwifi firmware support linux
     Like  Bookmark
  • 本文編修自: https://medium.com/@scofield44165/ubuntu-20-04%E4%B8%AD%E6%96%B0%E5%A2%9E%E6%96%B0%E9%85%B7%E9%9F%B3%E8%BC%B8%E5%85%A5%E6%B3%95-add-chinese-chewing-in-ubuntu-20-04-5ce78563638b 介紹 chewing 是 Jserv 有共同維護的輸入法 安裝 官網: http://chewing.im/download.html
     Like  Bookmark
  • Ref.: Returning a view versus a copy Ref.2: SettingwithCopyWarning: How to Fix This Warning in Pandas SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy 狀況 pandas DataFrame 沒注意好就跳警告,就算用了所謂的 df.copy(deep=True) 還是修不好?
     Like  Bookmark
  • Ref.: What do you call the two components resulting from filtering? 過濾器: filter A rule to get set A (欲獲得集合 A 的規則) 濾出的東西 (符合過濾條件): filtrate The set A which is filtered by the rule. (集合 A)
     Like  Bookmark
  • Ref: https://english.stackexchange.com/questions/238495/first-floor-vs-ground-floor-usage-origin
     Like  Bookmark
  • 透過以下命令可以找到 themes json 檔案所存放的路徑 $ Get-PoshThemes -list 可從返回的訊息找到檔案路徑 (Themes location): Themes location: C:\Users<username>\AppData\Local\oh-my-posh\themes 2. 參考官方的教學、範例主題進行更改 3. 對當前畫面套用自定義主題的 json 檔案 (假設檔案路徑為 MyPoshTheme.omp.json) oh-my-posh init pwsh --config MyPoshTheme.omp.json | Invoke-Expression
     Like 1 Bookmark
  • 根據官方解法 Steps: 下載 Meslo LGM NF 字型 Oh My Posh was designed to use Nerd Fonts. Nerd Fonts are popular fonts that are patched to include icons. We recommend Meslo LGM NF, but any Nerd Font should be compatible with the standard themes. 開啟 Winsdows Terminal 的 settings.json 將 powershell 的 font 底下的 face 改成 "Meslo LGM NF"
     Like  Bookmark
  • 總結 儲存(No Change) 要先歸零才能存 0|A -> A 0^A -> A 取反(Not, binary, 互補數) !A
     Like  Bookmark