178 Matching Annotations
  1. Last 7 days
    1. It can return an object of the class.

      這句話莫名其妙,如果能 return object of the class 也就是某個 instance 也就是有 self 了,矛盾! staticmethod 就是拿不到 self 才叫 static 不是嗎?

    1. you only have to know the ‘Type’ of a model to understand how you can invoke that model (input signature) and what response you can expect from it (output signature).

      所謂 signature 就是 input / output 的東西就叫 signature

  2. Aug 2022
    1. 注意:如果“使它成為我的主顯示器”選項為灰色,則表示您要設置為主顯示器的顯示器已經是主顯示器。

      錯!鬼扯。答看看這裡 https://hyp.is/Xj87RBd9Ee2gfVPBdzK9lg/answers.microsoft.com/en-us/windows/forum/all/main-display-is-suddenly-greyed-out/028c0cf2-9710-4c92-8475-e74cef1963a8 ,不是 driver 不是 Intel 而是 Microsoft 他媽的亂搞沒有人知道的操作步驟。

    2. 使它成為我的主顯示器”選項為灰色
    1. 如果你發現「使其成為主顯示器」呈現灰階無法選取,那表示你得進入顯示卡的設定區域調整 ( 如 Intel, AMD 的內建顯示卡調整設定 )。

      錯!鬼扯。答看看這裡 https://hyp.is/Xj87RBd9Ee2gfVPBdzK9lg/answers.microsoft.com/en-us/windows/forum/all/main-display-is-suddenly-greyed-out/028c0cf2-9710-4c92-8475-e74cef1963a8 ,不是 driver 不是 Intel 而是 Microsoft 他媽的亂搞沒有人知道的操作步驟。

  3. Jul 2022
  4. Jun 2022
    1. 若無前一日 K 值或 D 值,可以 50% 代入計算。

      rsv_ = kd.stoch().fillna(50)

    1. preds = aml.leader.predict(wine_test) from h2o.estimators.glm import H2OGeneralizedLinearEstimator

    1. 3 This answer is not useful Show activity on this post. XGBoost is not supported on Windows, see the limitations in the H2O documentation.

      試試看 conda install py-xgboost

  5. May 2022
  6. Apr 2022
    1. Preferences: Open Keyboard Shortcuts

      左下角的齒輪 > Keyboard Shortcuts Ctrl+K Ctrl+S > 右上角轉成 json 就是 keybindings.json 了。也可以用 Ctrl-shift-p command pallet 敲下 "keyboard shortcuts" 應該也可以找到該設定。

    1. Broad support for Azure VM types including GPUs and persisted low-level customization such as installing packages and drivers makes advanced scenarios a breeze. You can also use setup scripts to automate customization

      這就是 compute instance 與 compute cluster 的差別了!後者比較死,供產品上線使用。當要加掛新的 AI module 還得跑 function() 去做 (一做整個 cluster 所有 container 全做) 而前者就是一台 VM 用 terminal 去 pip install ,供開發使用。

    2. fully configured and managed development environment

      不是 compute cluster 不是 CPU 而是整台 VM 用於 Azure ML notebook 就是 compute instance.

  7. Jan 2022
    1. conda config --append envs_dirs /path/to/the/parent_dir

      My desktop min an 的實例是這樣下的: conda config --append envs_dirs "C:\Program Files" 不用給名子 (Orange) 放心, conda 會自己找到有打過 conda venv 的 subdirectories.

    1. pandas 1.3.3 to_feather giving ArrowMemoryError

      I tried pandas 1.3.0 and upgraded to 1.3.5 both have the same problem on VS Code jupyternotebook. Then I tried Jupyter lab on Chrome and the problem went away! The error message "ArrowMemoryError: realloc of size 788529152 failed", "ArrowMemoryError: malloc of size 417714368 failed",ArrowMemoryError: malloc of size 1291583808 failed" , "ArrowMemoryError: realloc of size 587202560 failed" were showing weired size number so I believe there's a bug in VS Code v1.63.2.

    1. Tuple[int, ...]

      type notation 時,意思很明白。表示整個 tuple 都是 同質的 int.

    1. 這個問題只會發生在 Chrome 上的 jupyter lab 頁面。My workaround 就是退出 Google Chrome 再進來即可。感謝 Workrona 這麼做原來的工作都還在不會中斷,因此並不麻煩。

  8. Dec 2021
    1. [(0,0), (0,1), (1,1), (2,2), (3,3), (4,3)]

      這條 path 上每個點上兩個數字代表 pattern1 與 pattern2 上的 index. 把兩個 pattern 兩兩相關,對齊起來。

    1. open the Network tab in Google Chrome, select the request I want to repeat, and click Copy as cURL

      OMG! it's real!!! I have tried.

  9. Nov 2021
    1. z.getDatasource("datarobot_api")['token']

      An authentication dialog will popup I guess?

    2. assembled dataset.

      What does it mean? Combined many datasets together?

    1. df.as_matrix()

      df.as_matrix() was deprecated after version 0.23.0. Use df.values instead. but df.values has memory problem for large data

    1. 單次不驗證 SSL

      Moved to LBB2 trying to clone "hubble2-nearest-neighbors" from Patric's GitLab got this error ((C:\Program Files\Orange) C:\Users\8304018\Documents\GitHub>git clone Cloning into 'hubble2-nearest-neighbors'... fatal: unable to access '': SSL certificate problem: self signed certificate) fixed by this option.

  10. Oct 2021
    1. notepad.runMenuCommand('TextFX Edit', 'Delete Blank Lines')

      TextFX 已經改很多了,要照實際抄才行。 notepad.runMenuCommand("TextFX Tools", "T:Word Count") # 要加上 T: 才行,空格都要正確,但是大小寫不分

    2. Notepad.menuCommand(menuCommand)

      executes built-in menu commands (not plugins)

      notepad.menuCommand(MENUCOMMAND.EDIT_DUP_LINE) really duplicates the active line.

    3. Notepad.getNppDir()

      notepad.getNppDir() 'C:\Program Files (x86)\Notepad++'

    4. getEncoding

      Most of them are cookie !!!

      notepad.getEncoding()<br> Npp.BUFFERENCODING.COOKIE .txt file notepad.getEncoding() Npp.BUFFERENCODING.COOKIE buffer new 1 file notepad.getEncoding() Npp.BUFFERENCODING.UTF8 1.py

    5. Notepad.getCurrentLang()

      notepad.getCurrentLang() Npp.LANGTYPE.TXT 指的是 programming language

    6. Gets the filename of the active document

      actually the full path name

  11. Aug 2021
    1. forNonBlank(e, v, eNonBlank, eBlank)

      Python equivalent: result = eBlank if isBlank(e) else eNonBlank

    2. forEachIndex(e1, i, v, e2)

      [(index+1)+"."+value for index,value in ["anne", "ben", "cindy"]]

    3. forRange(n from, n to, n step, v, e)

      C language equivalent: for (v=from; v<=to; v+=step) e;

    4. forEachIndex([ "anne", "ben", "cindy" ], i, v, (i + 1) + ". " + v)

      [(index+1)+"."+value for index,value in ["anne", "ben", "cindy"]]

    5. with("european union".split(" "), a, forEach(a, v, v.length()).sum() / a.length())

      Python equivalent : a = "european union".split(" "); = [v.length() for v in a] result = .sum() / a.length()

    6. filter([ 3, 4, 8, 7, 9 ], v, mod(v, 2) == 1)

      Python equivalent: [v for v in [ 3, 4, 8, 7, 9 ] if mod(v,2)==1]

    7. forEach(a, v, v.length())

      Python equivalent : [v.length() for v in a ]

  12. Jul 2021
    1. 「Fill down」功能 — 下拉式選單 → Edit Cells → Fill down


    2. 這時可以點擊「exclude」來取消選取

      稱為 exclude 想必可以 include 多個之故。

    1. All that I tried are not work for Chrome 91 on Windows 10. Two fingers horizontal swipe appears an arrow icon on left or right side start with white color. If you stop swiping then nothing happen. If you keep on then it turn to blue color then the backward/forward will happen. I guess this is the reason why the function can not be easily disabled because Google Chrome thinks user has the chance to stop it.

      Simply use Edge then this problem is gone.

    1. DataRobot gives you the choice to set constraints on the slope of feature effects.

      可以在 start 之前用 Advanced Options > Feature Constraints > Monotonicity 下設定

  13. Jun 2021
    1. how effective the model is in terms of differentiating different instances


    2. Tip: You may like to explore a dataset using different targets. There’s a simple way to streamline that work: make a copy of the project (from the Manage Projects page) and re-run it with the second target.  

      弄 QT bug title parsing 時,就是想用這招來避免大量重複創建同一個 project. 用 duplicate project 的方式就可以變出新 project 以便更改 target. 我的觀念沒錯: project, target, dataset 三者綁在一起,改了就是另一個 project 了。

    1. I ran my own POC to determine if I could use the new image classification capabilities of DataRobot to classify images sourced from audio files.

      POC is Proof of concept

  14. May 2021
    1. The PowerShell command below lets you display the Windows Firewall state on the remote machine

      把 ComputerName 的部分拿掉就可以用在 local : Remote Invoke-Command -ComputerName [ComputerName] -ScriptBlock {netsh advfirewall show allprofiles} Local Invoke-Command -ScriptBlock {netsh advfirewall show allprofiles}

    1. Syntax : app.use(path, middleware function/s)

      這個講得最好,app.use(path, func) 就是給 path 指定一個 func 就對了。其中若 path 省略,則 app 收到所有 request 都 call 這個 func.

    1. Chromosomes selection

      用上了從 OneNote2001 "Kie Codes' Genetic Algorithms explained by Knapsack Problem" 學來的 Python builtin sorted() 以及 random.choices() 超爽的感覺。本來要從 nongranded array 裡取 20% 是有點挑戰,結果又好又簡單。

    2. 題目沒講清楚,輸入 string chrom 是猜測,key 則是答案 string. 比較兩者正確率傳回。

    1. chromosome encoding

      這是個練習題,很簡單,但做了就能徹底明白文章到此表達的意義。我的答案是 insert 9,10,11 行: s = "" for i in range(size): s += get_letter() 好棒好棒! Codingame 會記得我的答案 (但不會主動執行並通過)。

    2. 56 authorised characters

      26 alphabet * 2 大小寫 = 52 再加上 4 個符號。

  15. Apr 2021
    1. 用 pandas 最好不過,因為 pandas 本來就有 support clipboard. import pandas pandas.io.clipboard.copy('hahahaha') 然後 ctrl+v 試試看 it works!!

  16. Feb 2021
    1. In JavaScript, we can use a for .. of loop.

      js> [1,2,3,4] value a a <js> for (i of pop()) type(i) </js> 1234 OK

    2. In JavaScript, we also have for .. in loops to iterate over the properties of an object.

      "in" 是 object properties; "of" 是 iterable. .

  17. Jan 2021
  18. Nov 2020
    1. In a Command Prompt window, you can attach to a running process when you launch CDB. Use one of the following commands: cdb -p ProcessID cdb -pn ProcessName where ProcessID is the Process ID of a running process or ProcessName is the name of a running process.

      ProcessName 就是 proeforth.exe

  19. Oct 2020
    1. Click download to get the installer. It looks like needs account, but it doesn't, just click download the to the step next to the login, that I already have and Google remembers it.

    1. high-order bit is 1

      以 scroll lock 實驗 : test begin [ lit hex 91 , ] GetKeyState .q cr 500 Sleep drop again ; 壓著不放就是 FF80 或 FF81 , bit 0 是 toggling.

    1. The sh library

      Will Windows be supported? There are no plans to support Windows. http://amoffat.github.io/sh/sections/faq.html

    2. x : x

      這兩個 x 可以改用 tmp 以免誤導。

    3. x

      用上面定義的 x array 代入。但不是馬上,而是 iterating 的時候才執行。

    4. geopy

      location = GoogleV3().geocode(place) main:1: UserWarning: Since July 2018 Google requires each request to have an API key. Pass a valid api_key to GoogleV3 geocoder to hide this warning. See https://developers.google.com/maps/documentation/geocoding/usage-and-billing Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\User\source\repos\PythonApplication1\playground\lib\site-packages\geopy\geocoders\googlev3.py", line 266, in geocode return self._call_geocoder(url, callback, timeout=timeout) File "C:\Users\User\source\repos\PythonApplication1\playground\lib\site-packages\geopy\geocoders\base.py", line 376, in _call_geocoder return callback(result) File "C:\Users\User\source\repos\PythonApplication1\playground\lib\site-packages\geopy\geocoders\googlev3.py", line 393, in _parse_json self._check_status(page.get('status')) File "C:\Users\User\source\repos\PythonApplication1\playground\lib\site-packages\geopy\geocoders\googlev3.py", line 423, in _check_status 'Your request was denied.' geopy.exc.GeocoderQueryError: Your request was denied.

    1. Copy Code (Ctrl+Shift+C)

      咦! ipython 也有這個功能嗎?

    2. Interactive REPL window

      哦! 又複習一遍, REPL 就是 monitor 、 console. 特別指的是類似 Node.js 的 interactive console 有個像 forth 一樣的 interpreter loop 把 JavaScript 變成 interpreter 環境。那就是 REPL。

    1. select Properties, select the Debug tab, then add -i to the Interpreter Arguments field.

      等於是 python -i , 目的是為了程式跑完以後查看結果。

    1. .PDB 檔中有什麼資料?

      可以用 "c:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbh.exe" dump .pdb 的內容 e.g. dbh.exe" -v proeforth.pdb x proeforth!Pro dbh.exe" -v proeforth.pdb x proeforth!KVM dbh.exe" -v proeforth.pdb x proeforth!user*

  20. Sep 2020
    1. C 語言秘技 (1) – 使用 sscanf 模仿正規表達式的剖析功能 (作者:陳鍾誠)

      sscanf scanf regular expression

  21. Aug 2020
    1. Microsoft Windows 應用程式開發介面 (Windows API) 可針對處理字元和字串的每一個函式,各包含兩個版本:一個是單位元組字元的 ANSI 版本,另一個是雙位元組字元的 Unicode 版本

      可能就是 MessageBox 與 MessageBoxA 的差別 --> Yes! 往下看就看到了。。。

    1. depressed

      好像是說要 keyup 該 VK 才會放開?

    2. SendKeys in C++

      The demo is cool! and it works on my Window 10 64bits professional.

  22. Jul 2020
    1. http://username.github.io/repository

      It's not clear. This is an example: http://hcchengithub.github.io/project-k where username is "hcchengithub" and repository is the project name "project-k" remove the ending dot.

    1. python -m easy_install C:\Users\Prosserc\Downloads\QSTK-0.2.6-py2.7.egg

      it copy the .egg to site-package but not unzip the .egg because .egg can really run directly. The problem is data files in the .egg needs setuptools API to access and that's an extra effort besides I don't know how to know if my module is run from from .egg !! So, I want to install .egg means I want it to be unzipped to site-package. How?

    1. 請至「電腦桌面」→ 請點選「電腦」→ 「控制台」→ 請點選「地區及語言選項」→ 請點選「地區選項 選 中文(台灣)」「位置 選台灣」→ 再點選「進階」 選擇「中文(台灣)」→ 再按「確定」,重新啟動再登入E01即可。
    1. 富邦e01軟體安裝後出現亂碼?

      see my OneNote2020 "富邦e01 中文亂碼解法"

    1. JavaScrip array 超能力 "forEach" , "some" and "every"

      [1, 2, 3].some(function(el) {
      return el >= 2;
      12 OK 
      > <js>
      [1, 2, 3].every(function(el) {
      return el >= 2;
      1 OK 
    1. wcout.imbue(std::locale("chs"));// //設定語言區域為中國

      "cht" 則為台灣<br> c:\Users\8304018\Documents\GitHub\proeforth\Debug>proeforth.exe abc def 123 中文 台灣<br> Hello World!!<br>argv[0] = proeforth.exe<br> argv[1] = abc<br> argv[2] = def<br> argv[3] = 123<br> argv[4] = 中文<br> argv[5] = 台灣<br> c:\Users\8304018\Documents\GitHub\proeforth\Debug>chcp<br> Active code page: 950<br>

    1. PS C:\> pip install jupyter

      activate my venv 'playground' and do it, it works! Note! when activating 'playground' the current directory is not necessary at 'playground', I guess . . . YES!!

    2. PS C:\> python -m venv myenv PS C:\> myenv\Scripts\activate

      This does not CD to the myenv directory:

      <textarea cols=100 rows=8> Microsoft Windows [Version 10.0.18363.959] (c) 2019 Microsoft Corporation. All rights reserved. C:\Users\hcche>Documents\python_venvs\playground\Scripts\activate (playground) C:\Users\hcche> </textarea>
    1. use venv of python on windows & mac

      照這篇做,很簡單,開個 working directory "playground" and make it the current directory. 用 python -m venv playground 在當前 current directory 處建立 venv. 從此,.\script\activate.bat , .\script\deactivate.bat 就可以切換本 directory to be or not to be the activated environment 了。

    1. Go to the Project menu and choose Add Class.

      我竟然找不到,改用 search 的才找到。

    2. // 1. Use the Solution Explorer window to add/manage files // 2. Use the Team Explorer window to connect to source control // 3. Use the Output window to see build output and other messages // 4. Use the Error List window to view errors

      若找不到都在 view pull-down menu 裡面

    1. ProPath target_workspace

      workspace 的完整 URL "wtws://tkcourse/Workspace on 00-HC/"

    1. Pass NULL for a default checkout

      button 31 use NULL<br> button 41 use an Options structure

    1. The properties of the options will match the default checkout properties in Creo Parametric.

      初值照 default

    1. The called function should not populate this array with any ProValueData structures of type PRO_VALUE_TYPE_POINTER. */

      所調用的函數不應使用PRO_VALUE_TYPE_POINTER類型的任何ProValueData結構填充此數組。意思就是說,用ProValueData 但不是 PRO_VALUE_TYPE_POINTER。

      我做實驗發現奇怪現象,若 outputs 裡有個 block 的 type 是 arg1.value.type = PRO_VALUE_TYPE_POINTER; 整個 blok 就會被 skip! Caller 收不到這個 outputs[n] block.

    2. ProToolkitTaskExecute

      This function is a wrapper to call the actual ProTkdllFunction function

    3. Note:When done reading output_arguments, call ProArgumentProarrayFree to free the data.

      這就是說:用畢 output 值之後由 caller 負責 free 掉該 output argument array 的 memory. 這是對 toolkit caller 而言。 Web.Link caller 怎麼 free?

    1. typedef struct pro_server_conflicts* ProServerConflicts;

      很多 function 有 output ProServerConflicts conflict. 當它的 return ProError status 為 PRO_TK_CHECKOUT_CONFLICT 時,這個 output 才有意義,用 ProServerconflictsDescriptionGet() http://localhost:8800/Creo_3.0_Toolkit_Doc/protkdoc/api/5951.html 去查它的意義。

    1. ProValuedataWstringSet

      採用這類 function 的目的是 一、方便 二、到時可以用 ProArgumentProarrayFree() 一舉釋放乾淨。如果 ProArgument 在 static local 就用不著這個了。

    1. ProServerWorkspaceData* data /* (Out) The workspace data. */

      用完應該要 free 掉吧! ProServerworkspacedataFree() http://localhost:8800/Creo_3.0_Toolkit_Doc/protkdoc/api/5914.html 喔!不一定要,如果是在 local 宣告的 dynamic ProServerWorkspaceData 當然就不用 freee().

    1. static pfcArgValueCreateStringArgValue (string Value)

      it's a JavaScript normal string here but will be a wchar_t to the callee. Use CreateASCIIStringArgValue() for char string.

    2. static pfcArgValueCreateASCIIStringArgValue (string Value)

      use another function to pass a wchar_t * string

    3. CreateStringArgValue (string Value)

      it's wchar_t * string , according to my tests on ~\GitHub\proe\toolkit_training_Windchill\src\WcEx11.c

    1. Managing Application Arguments
    2. Task Based Application Libraries

      Read Toolkit manual's corresponding document page http://localhost:8800/Creo_3.0_Toolkit_Doc/protkdoc/manual0/Applilib.html#1

    3. pfcArgValue.discr

      This is the "ProValueDataType" in the union of "ProValueData" http://localhost:8800/Creo_3.0_Toolkit_Doc/protkdoc/api/provalue_h.html#ProValueData

    4. pfcDll.Unload()

      Just [STOP] and terminated. To remove the DLL from the auxiliary applications UI you need to click [delete] manually.

    5. pfcBaseSession.LoadProToolkitLegacyDll()


    1. typedef struct pro_argument
    2. Task Based Application Libraries
    3. ProValueData value

      This is a structure with type and an union that contains string that is a pointer only w/o the string itself.

    4. ProName label

      this is a wchar_t[200+] string with static memory

  23. Jun 2020
    1. Copies a file from local disk to a Windchill workspace;

      This function is for foreign files (none CAD files)

    2. The document which the copy will be attached to, "box7.prt" for example.

      指出誰是 primary 就表示 source_file 是它的 attachment.

    1. wchar_t* file

      Windchill 上只需檔名即可抓到 object (CAD 檔)

    2. top level object to checkout or download.

      same function for checkout and download

    3. Can be NULL.

      filename is enough, so we use NULL.

    1. conflicts

      [ ] There's a function to print the conflict thing , what's that? _

    1. The alias used by Creo Parametric to refer to the server


    2. ** data

      宣告 one star, called with &

    1. default_path

      wtpub://tkcourse or NULL

    2. shortcut_name_arr

      use NULL

    3. shortcut_path_arr

      use NULL

    4. NULL

      let's use this one

    5. allowing the user to select a directory.

      can access windchill , workspace, . . . etc

    1. p_file_name_array

      宣告 one *, call with &. so there's 2 stars.

    2. listing_option


    3. ProLine filter

      . .prt .asm but no foreign file types

    4. than PRO_NAME_SIZE characters


    1. String Identifier

      用這欄 string 指定要 select 那些東西。 Web.Link 的 Example 有