135 Matching Annotations
  1. 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 ]

  2. 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 下設定

  3. 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

  4. 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 個符號。

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

  6. 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. .

  7. Jan 2021
  8. 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

  9. 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*

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

      sscanf scanf regular expression

  11. 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.

  12. 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"

      <js>
      [1, 2, 3].some(function(el) {
      type(el);
      return el >= 2;
      });
      </js>
      12 OK 
      > <js>
      [1, 2, 3].every(function(el) {
      type(el);
      return el >= 2;
      });
      </js>
      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()

      Obsoleted

    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

  13. 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

      L"tkcourse"

    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

      we use : PRO_FILE_LIST_LATEST_SORTED

    3. ProLine filter

      . .prt .asm but no foreign file types

    4. than PRO_NAME_SIZE characters

      32

    1. 個人現金提存款在十萬人民幣(約四十二.五萬台幣)以上者進行登記,並向中國人行報告

      目前轉帳限額5W還好。

    1. You are late to get married. 你這是太晚才結婚。(感覺好像晚婚不好) I choose to get married later in life. 我選擇晚一點再結婚。

      晚婚用 later 比較客氣