From 251430f1c7f1bef5b782d3b8006781e72cca52dc Mon Sep 17 00:00:00 2001
From: "H.C. Chen"
Date: Tue, 26 Sep 2017 12:09:33 +0800
Subject: [PATCH 01/20] improved pykb.f
---
playground/pykb.f | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/playground/pykb.f b/playground/pykb.f
index d02b8ec..74ddd20 100644
--- a/playground/pykb.f
+++ b/playground/pykb.f
@@ -6,15 +6,25 @@
s" pykb.f" source-code-header
- 取得 command line of DOS BOX cmd
- s" where processid = 4728" objEnumWin32_Process :> item().CommandLine .s
- 來看,明明是 "C:\Windows\System32\cmd.exe" (string)。而且:
- s" where CommandLine = CommandLine" objEnumWin32_Process :> atEnd()
- 傳回 false 表示有東西,而以下這樣竟然不行!
- s" where CommandLine = 'C:\\Windows\\System32\\cmd.exe'"
- objEnumWin32_Process :> atEnd() \ ==> true (boolean) 表示沒找到!
- 這還不只,若用 like 最後的 % 也不能省,真搞不懂。這麼一來想濾掉 Chrome 產生的
- cmd 眼前就沒好辦法了。通通列出來吧!試 hi 看看,不行就一個個試。
+ 【問題】
+
+ 取得 command line of DOS BOX cmd
+ s" where processid = 4728" objEnumWin32_Process :> item().CommandLine .s
+ 來看,明明是 "C:\Windows\System32\cmd.exe" (string)。而且:
+ s" where CommandLine = CommandLine" objEnumWin32_Process :> atEnd()
+ 傳回 false 表示有東西,而以下這樣竟然不行!
+ s" where CommandLine = 'C:\\Windows\\System32\\cmd.exe'"
+ objEnumWin32_Process :> atEnd() \ ==> true (boolean) 表示沒找到!
+ 這還不只,若用 like 最後的 % 也不能省,真搞不懂。這麼一來想濾掉 Chrome 產生的
+ cmd 眼前就沒好辦法了。通通列出來吧!試 hi 看看,不行就用
+
+ to processid hi
+
+ 一個個試。
+
+ s" where CommandLine like '%cmd.exe%'" list-them tib.
+ s" where name like '%python%'" list-them tib.
+
. cr
s" where CommandLine like '%cmd.exe%'" list-them tib.
From 72b1d3fe69f0833bee45f65235ec822af133eda7 Mon Sep 17 00:00:00 2001
From: "H.C. Chen"
Date: Fri, 13 Oct 2017 18:12:10 +0800
Subject: [PATCH 02/20] improved git.f (for 3hta only)
---
3hta/f/git.f | 1114 +++++++++++++++++++++++++++-----------------------
1 file changed, 601 insertions(+), 513 deletions(-)
diff --git a/3hta/f/git.f b/3hta/f/git.f
index e999f01..e9ff20c 100644
--- a/3hta/f/git.f
+++ b/3hta/f/git.f
@@ -1,15 +1,15 @@
\
-\ git.f 利用 forth 的自由語法,簡化 GitHub 使用上的困難。
+\ git.f ?? forth ?????,?? GitHub ???????
\ http://github.com/hcchengithub/jeforth.3we/wiki/jeforth.3hta-GitHub-helper----git.f
\ Video on Camdemy.com http://www.camdemy.com/media/19404
\
-\ GitHub 功能強大,而且一邊用它還會一邊給你很多建議。已經仁盡義至了,但是根本記不住。
-\ 今利用 jeforth 來管理這些命令跟建議。平時也可以簡化指令、做筆記、為每組命令添加 help
-\ message。不管 GitHub 再怎麼複雜難用,配合 jeforth 只要 study 一次就永遠不會再忘記了。
+\ GitHub ????,????????????????????????,????????
+\ ??? jeforth ???????????????????????????????? help
+\ message??? GitHub ???????,?? jeforth ?? study ????????????
\
-\ 11:36 2017-09-11 參考本程式寫成的 python multiple line input tool pykb.f
-\ 換台電腦跑就有點問題,一度以為 3hta 要 run as administrator 才可以,已證實不必。
+\ 11:36 2017-09-11 ???????? python multiple line input tool pykb.f
+\ ??????????,???? 3hta ? run as administrator ???,??????
\
js> vm.appname char jeforth.3hta != [if] ?abort" Sorry! git.f is for jeforth.3hta only." \s [then]
@@ -18,74 +18,74 @@
s" git.f" source-code-header
- \ 簡介
+ \ ??
\ ====
- \ Git 是一套分散式版本控管系統(DVCS; Distributed Version Control System)。
- \ 支援本地操作 [x] yeah sure it is.
- \ 備份容易 [x] simply copy the entire folder.
- \ 功能強大且彈性的分支與合併等等 [x] help branch
- \ 完整的 Git 版控支援、
- \ 議題追蹤與管理 [x] The 'issues' on GitHub web.
- \ 線上 Wiki 文件管理 [x] The 'wiki' on GitHub web.
- \ 友善的原始碼審核(Code Review)介面。 [x] Click on the commit code on GitHub web to see the 'diff'.
+ \ Git ????????????(DVCS; Distributed Version Control System)?
+ \ ?????? [x] yeah sure it is.
+ \ ???? [x] simply copy the entire folder.
+ \ ??????????????? [x] help branch
+ \ ??? Git ?????
+ \ ??????? [x] The 'issues' on GitHub web.
+ \ ?? Wiki ???? [x] The 'wiki' on GitHub web.
+ \ ????????(Code Review)??? [x] Click on the commit code on GitHub web to see the 'diff'.
\ How to run git shell
\ --------------------
- \ use Github for Windows to open the git shell through the [setting] button
+ \ use Github for Windows to open the git shell through the [setting] button
\ at the upper right corner. We can change default shell to dos, powershell, or linux.
- \ 中英名詞
+ \ ????
\ ========
- \ 「版本」= commit
- \ 版本控管 = tracked
- \ 【索引】或【快取】= index cache
- \ Git 版本庫 = repository
- \ cached = Staged (準備好 to commit)
- \
-
- \ 第 01 天:認識 Git 版本控管
+ \ ????= commit
+ \ ???? = tracked
+ \ ?????????= index cache
+ \ Git ??? = repository
+ \ cached = Staged (??? to commit)
+ \
+
+ \ ? 01 ?:?? Git ????
\ ===========================
- \ 「Git 的指令與參數非常多,完全超出大腦能記憶的範圍,除非每天使用,否則哪有可能一天到晚打指令進
- \ 行版控」── 哈哈!用 jeforth.3hta 可以輕鬆掌握。因為 word name 可以用中文,又有 help、comment 很方便。
- \ 「要合併多人的版本,你只要有存取共用儲存庫(shared repository)的權限或管道即可。 例如:在同一台伺服器上
- \ 可以透過資料夾權限進行共用,或透過 SSH 遠端存取另一台伺服器的 Git 儲存庫,也可以透過 Web 伺服器等方
- \ 式來共用 Git 儲存庫。」
- \ 「我覺得要寫「認識 Git 版本控管」比教大家怎麼用還難許多」。
-
- \ 第 02 天:在 Windows 平台必裝的三套 Git 工具
+ \ ?Git ?????????,????????????,??????,??????????????
+ \ ???? ??!? jeforth.3hta ????????? word name ?????,?? help?comment ????
+ \ ?????????,???????????(shared repository)????????? ??:????????
+ \ ?????????????,??? SSH ??????????? Git ???,????? Web ?????
+ \ ???? Git ?????
+ \ ????????? Git ??????????????????
+
+ \ ? 02 ?:? Windows ??????? Git ??
\ ============================================
- \ 第 1 套:Git for Windows <---- the shell tools set
- \ 第 2 套:GitHub for Windows <---- 很爛,常出問題
- \ 第 3 套:SourceTree
- \ 第 4 套:TortoiseGit
-
- \ 第 03 天:建立儲存庫 https://github.com/hcchengithub/Learn-Git-in-30-days
+ \ ? 1 ?:Git for Windows <---- the shell tools set
+ \ ? 2 ?:GitHub for Windows <---- ??,????
+ \ ? 3 ?:SourceTree
+ \ ? 4 ?:TortoiseGit
+
+ \ ? 03 ?:????? https://github.com/hcchengithub/Learn-Git-in-30-days
\ ====================
\ There are three kind of repo's
- \ 1. 在本機建立本地的儲存庫 (local repository) [x] "git init" at the repo folder
- \ 2. 在本機建立一個共用的儲存庫 (shared repository) [x] "git init --bare" at the shared repo
- \ ==> For Linux , Windows users seem don't need this.
- \ 3. 在 GitHub 或其他 Git 平台建立遠端的儲存庫 (remote repository)
+ \ 1. ??????????? (local repository) [x] "git init" at the repo folder
+ \ 2. ????????????? (shared repository) [x] "git init --bare" at the shared repo
+ \ ==> For Linux , Windows users seem don't need this.
+ \ 3. ? GitHub ??? Git ?????????? (remote repository)
\ The best way is to create on GitHub.com then clone it back to local computer
\ through the "GitHub for Windows" or "Git Shell" clone command. See 'clone' command.
-
- \ 手動建立 shared-repository
+
+ \ ???? shared-repository
\ ----------------------------
\ ~\git-demo [master]> md .\shared-repository
\ cd shared-repository
- \ 然後當場執行 git init --bare
- \ 他會在當前目錄建立所有 Git 儲存庫的相關檔案與資料夾,你必須特別注意,這個資料夾不能直
- \ 接拿來做開發用途,只能用來儲存 Git 的相關資訊,大多數情況下,你都不應該手動編輯這個資
- \ 料夾的任何檔案,最好透過 git 指令進行操作
- \ 這是一個「沒有工作目錄的純儲存庫」 -- bare repository.
- \ 再次強調,Git 屬於「分散式版本控管」,每個人都有一份完整的儲存庫(Repository)。也就是說,
- \ 當你想要建立一個「工作目錄」時,必須先取得這個「裸儲存庫」的內容回來,這時你必須使用
- \ git clone [REPO_URI] 指令「複製」(clone)一份回來才行,而透過 git clone 的過程,不但會自動
- \ 建立工作目錄,還會直接把這個「裸儲存庫」完整的複製回來。這個複製的過程,就如同「完整備份」
- \ 一樣,是把所有 Git 儲存庫中的所有版本紀錄、所有版本的檔案、...等等,所有資料全部複製回來。
- \ 手動建立工作用的 workspace
+ \ ?????? git init --bare
+ \ ??????????? Git ????????????,???????,????????
+ \ ????????,?????? Git ?????,??????,????????????
+ \ ???????,???? git ??????
+ \ ????????????????? -- bare repository.
+ \ ????,Git ???????????,?????????????(Repository)?????,
+ \ ???????????????,??????????????????,???????
+ \ git clone [REPO_URI] ??????(clone)??????,??? git clone ???,?????
+ \ ??????,????????????????????????????,?????????
+ \ ??,???? Git ????????????????????...??,???????????
+ \ ???????? workspace
\ --------------------------
\ github\git-demo [master +1 ~0 -0 !]> md git-workspaces
\ github\git-demo [master +1 ~0 -0 !]> cd .\git-workspaces
- \ 然後把 "shared repository" clone 過來
+ \ ??? "shared repository" clone ??
\ github\git-demo\git-workspaces [master +1 ~0 -0 !]> git clone ..\shared-repository
\ Cloning into 'shared-repository'...
\ warning: You appear to have cloned an empty repository.
@@ -98,7 +98,7 @@
char DESKTOP-Q94AC8A char COMPUTERNAME proc-env@ = [if] s" C:\Users\hcche\AppData\Local\GitHub\GitHub.appref-ms --open-shell" [then]
char WKS-4AEN0404 char COMPUTERNAME proc-env@ = [if] s" C:\Users\hcche\AppData\Local\GitHub\GitHub.appref-ms --open-shell" [then]
char WKS-31ENA852 char COMPUTERNAME proc-env@ = [if] s" C:\Users\hcche\AppData\Local\GitHub\GitHub.appref-ms --open-shell" [then]
-
+
value git-shell-path // ( -- str ) Command line to launch Git Shell.
/// Something like this:
/// C:\Users\hcchen\AppData\Local\GitHub\GitHub.appref-ms --open-shell
@@ -120,13 +120,13 @@
r@ :> item().ProcessId swap ( processID count | obj )
r@ js: pop().moveNext() repeat ( ... count | obj )
r> drop 1 = if else 0 then ;
-
+
: check-shell ( -- ) \ Abort if Shell is not running.
shellId not ?abort" Error! Git Shell is not running. Try 'launch-git-shell' command again." ;
-
+
: activate-shell ( -- ) \ Active Git Shell (Git Shell's powershell.exe)
500 nap shellId ?dup if ( processID )
- s' WshShell.AppActivate ' swap +
+ s' WshShell.AppActivate ' swap +
then 500 nap ; /// assume it's powershell
: activate-jeforth ( -- ) \ Come back to jeforth.3hta
1000 nap s" WshShell.AppActivate " vm.process :> processID + 500 nap ;
@@ -137,80 +137,80 @@
: ( "command line" -- ) \ Send command line to the Git Shell
- compiling if
- compile check-shell
- \ '^' and '~' 是 sendkey 的 special character 要改成 "{^}" and "{~}"
- js: push(function(){push(pop().replace(/\^/g,"{^}").replace(/~/g,"{~}"))})
- , compile activate-shell
- s' WshShell.SendKeys "' literal compile swap compile + s' {enter}"' literal
+ compiling if
+ compile check-shell
+ \ '^' and '~' ? sendkey ? special character ??? "{^}" and "{~}"
+ js: push(function(){push(pop().replace(/\^/g,"{^}").replace(/~/g,"{~}"))})
+ , compile activate-shell
+ s' WshShell.SendKeys "' literal compile swap compile + s' {enter}"' literal
compile + [compile] compile activate-jeforth
- else
+ else
check-shell
js> pop().replace(/\^/m,"{^}").replace(/~/g,"{~}") activate-shell
s' WshShell.SendKeys "' swap + s' {enter}"' + activate-jeforth
then ; immediate
-
+
: launch-git-shell ( -- ) \ Run or activate Git Shell
shellId if activate-shell else git-shell-path (fork) then
begin 500 nap shellId until 500 nap activate-shell ;
-
+
: autoexec ( -- ) \ Mimic autoexec.bat
- subst x: /d
- subst x: . x:
- s" cd " project-name + then ;
+ subst x: /d
+ subst x: . x:
+ s" cd " project-name + then ;
: cd ( <...> -- ) \ The DOS command 'change directory'.
s" cd " CR word + ;
-
+
: (cd) ( "..." -- ) \ The DOS command 'change directory'.
s" cd " swap + ;
-
+
: CLS ( <...> -- ) \ The DOS command 'Clear screen', also clear jeforth output box.
cls cls ;
/// 'er' to erase only the jeforth output box.
- /// 改大寫避免老是誤用
+ /// ?????????
: dir ( <...> -- ) \ The DOS command 'View directory'.
s" dir " CR word + ;
/// 'ls' to list repository.
-
+
: init ( -- ) \ Create a new git repository at the current directory
git init ;
/// Don't worry about re-init a git again. It's idiot-proof, it responses something like:
/// Reinitialized existing Git repository in D:/hcchen/Dropbox/learnings/github/...
-
+
: status ( -- ) \ Git status of the repository
git status ;
- : 垃圾回收 ( -- ) \ Clean garbage 清理殘留在檔案系統中的無用檔案。
+ : ???? ( -- ) \ Clean garbage ????????????????
git gc --prune ;
- /// Git 的垃圾回收機制,其實就是那些殘留在檔案系統中的無用檔案,這
- /// 個垃圾回收機制只會在這些無用的物件累積一段時間後自動執行,或你
- /// 也可以自行下達指令清空它。例如: git gc --prune 或單 git gc 亦可。
+ /// Git ???????,???????????????????,?
+ /// ????????????????????????????,??
+ /// ???????????????: git gc --prune ?? git gc ???
- : 重新封裝 ( -- ) \ Archive 老舊的 objects (files) 封裝進一個封裝檔 packfile 中。
+ : ???? ( -- ) \ Archive ??? objects (files) ???????? packfile ??
git gc ;
- /// 當一個專案越來越大、版本越來越多時,這個物件(file)會越來越多,過多的
- /// 檔案還是會檔案存取變得越來越沒效率。因此 Git 的設計有個機制可以將一群
- /// 老舊的 "物件" 自動封裝進一個封裝檔(packfile)中,以改善檔案存取效率。
- /// 重新封裝(repacking) 照理說 Git 會自動執行重新封裝等動作,但你依然可以自
- /// 行下達指令執行。例如: git gc
+ /// ?????????????????,????(file)?????,???
+ /// ???????????????????? Git ????????????
+ /// ??? "??" ??????????(packfile)?,??????????
+ /// ????(repacking) ??? Git ????????????,???????
+ /// ??????????: git gc
: clone ( <'URI'> -- ) \ New a repository, which is from URI, at the current folder
s" git clone " CR word + ;
- /// git clone 將遠端儲存庫複製到本地,並建立工作目錄與本地儲存庫,
- /// 也就是 .git 資料夾。
+ /// git clone ???????????,?????????????,
+ /// ??? .git ????
/// Example: clone https://github.com/figtaiwan/forthtranspiler
- /// clone 下來是在 current directory 之下自動 md project folder 而非以
- /// current directory 當作 project folder。本地的就是一個 "branch"。
- /// 如果本地的 github/forthtranspiler 不是空的, 則:
- /// fatal: destination path 'forthtranspiler' already exists and is
- /// not an empty directory. Local 已經有東西的就要用 pull 的, 參「第8天」。
- /// 如果你用 git clone https://balbal.git 去複製的是一個 「沒有版本」的
- /// 空白 Git 儲存庫,將會得到一個 warning: You appear to have cloned
- /// an empty repository. 警告訊息,不過這不影響你上傳本地的變更。
- /// The best way to create a new project is doing it on GitHub.com
- /// then clone it back to local computer through the "GitHub for Windows"
+ /// clone ???? current directory ???? md project folder ???
+ /// current directory ?? project folder???????? "branch"?
+ /// ????? github/forthtranspiler ????, ?:
+ /// fatal: destination path 'forthtranspiler' already exists and is
+ /// not an empty directory. Local ????????? pull ?, ???8???
+ /// ???? git clone https://balbal.git ??????? ???????
+ /// ?? Git ???,?????? warning: You appear to have cloned
+ /// an empty repository. ????,???????????????
+ /// The best way to create a new project is doing it on GitHub.com
+ /// then clone it back to local computer through the "GitHub for Windows"
/// or clone command.
@@ -250,65 +250,65 @@
to read about a specific subcommand or concept.
. ;
- \ 第 04 天:常用的 Git 版本控管指令
- \ master 代表目前工作目錄是 master 分支,也是 Git 的預設分支名稱。
- \ 「紅色」的數字都代表 Untracked (未追蹤) 的檔案,也就是這些變更都不會進入版本控管(commit)。
- \ +10 代表有 10 個「新增」的檔案
- \ ~0 代表有 0 個「修改」的檔案
- \ -0 代表有 0 個「刪除」的檔案
- \ 「綠色」的數字都代表 Staged (準備好) 的檔案,也就是這些變更才會進入版本控管(commit)。
- \ +23 代表有 23 個「新增」的檔案將被建立一個版本
- \ ~0 代表有 0 個「修改」的檔案將被建立一個版本
- \ -0 代表有 0 個「刪除」的檔案將被建立一個版本
+ \ ? 04 ?:??? Git ??????
+ \ master ????????? master ??,?? Git ????????
+ \ ?????????? Untracked (???) ???,????????????????(commit)?
+ \ +10 ??? 10 ????????
+ \ ~0 ??? 0 ????????
+ \ -0 ??? 0 ????????
+ \ ?????????? Staged (???) ???,???????????????(commit)?
+ \ +23 ??? 23 ????????????????
+ \ ~0 ??? 0 ????????????????
+ \ -0 ??? 0 ????????????????
: add ( <...> -- ) \ Add file(s) into the cache of the repo (the project)
s" git add " CR word + ;
- /// 注意,pathname 有分大小寫,靠,弄錯了沒有 warning 等你自己慢慢發現!
+ /// ??,pathname ?????,?,????? warning ????????!
/// Usage: add name1 name2 ... , wild card '*', '?' and '.' supported.
- /// 'add' 把檔案加進 tracked 且進 cache 準備 commit。原本是 tracked 或
- /// untracked 都得經過 add 才會進 cache。別以為只有新檔才需要 add 因為
- /// 即使是已經 tracked 的檔案也不會自動進 cache 故也不會自動被 commit 到
- /// 但的確 add 過的檔案從此就變成 tracked 了。
- /// "git add ." 會將所有檔案(含子目錄)加入到 working directory 的索引中。
+ /// 'add' ????? tracked ?? cache ?? commit???? tracked ?
+ /// untracked ???? add ??? cache??????????? add ??
+ /// ????? tracked ????????? cache ??????? commit ?
+ /// ??? add ????????? tracked ??
+ /// "git add ." ??????(????)??? working directory ?????
- : commit ( <...> -- ) \ Save the cache into the repository. 把 tracked files 都 commit 進 repository.
+ : commit ( <...> -- ) \ Save the cache into the repository. ? tracked files ? commit ? repository.
s" git commit " CR word + ;
/// Usage: commit [-m "Descriptions"]
- /// 先用 'add' 把檔案加進 cache 才 commit 得到它。原本是 tracked 或
- /// untracked 都得經過 add 才會進 cache。別以為只有新檔才需要 add 因
- /// 為即使是已經 tracked 的檔案也不會自動進 cache 故也不會自動被
- /// commit 到。以前 commit 好像叫做 checkin?
-
- \ 注意! pathname 有分大小寫,弄錯了不會有 warning, 靠。
- \ github\forthtranspiler [master +1 ~1 -0 !]> git add readme.md <------ 應該是 README.md 大小寫有分,但不會有任何警告!
- \ github\forthtranspiler [master +1 ~1 -0 !]> git add readme.mdddd <--- 檔案真的不存在才會有 error
+ /// ?? 'add' ????? cache ? commit ??????? tracked ?
+ /// untracked ???? add ??? cache??????????? add ?
+ /// ?????? tracked ????????? cache ???????
+ /// commit ???? commit ???? checkin?
+
+ \ ??! pathname ?????,?????? warning, ??
+ \ github\forthtranspiler [master +1 ~1 -0 !]> git add readme.md <------ ??? README.md ?????,????????!
+ \ github\forthtranspiler [master +1 ~1 -0 !]> git add readme.mdddd <--- ?????????? error
\ fatal: pathspec 'readme.mdddd' did not match any files
- \ github\forthtranspiler [master +1 ~1 -0 !]> git status <---- add 過之後用 status 查
+ \ github\forthtranspiler [master +1 ~1 -0 !]> git status <---- add ???? status ?
\ On branch master
\ Your branch is up-to-date with 'origin/master'.
\
\ Changes not staged for commit:
\ (use "git add ..." to update what will be committed)
- \ (use "git checkout -- ..." to discard changes in working directory) <------ 這個有用!
+ \ (use "git checkout -- ..." to discard changes in working directory) <------ ????!
\
- \ modified: README.md <-------------- 只說是 modified 但仍是紅色,表示 unstaged
+ \ modified: README.md <-------------- ??? modified ?????,?? unstaged
\
\ Untracked files:
\ (use "git add ..." to include in what will be committed)
\
- \ cfg.bat <------ 當然是紅色的
+ \ cfg.bat <------ ??????
\
\ no changes added to commit (use "git add" and/or "git commit -a")
- \ 我用 git add . 才終於把 readme.md 搞成 staged (綠色),從而發現大小寫有分,真的是困難重重。
- \ D:\hcchen\Dropbox\learnings\github\forthtranspiler [master +1 ~1 -0 !]> git add README.md <----- 大小寫對了
+ \ ?? git add . ???? readme.md ?? staged (??),?????????,????????
+ \ D:\hcchen\Dropbox\learnings\github\forthtranspiler [master +1 ~1 -0 !]> git add README.md <----- ?????
\ D:\hcchen\Dropbox\learnings\github\forthtranspiler [master +0 ~1 -0 | +1 ~0 -0 !]> git status
\ On branch master
\ Your branch is up-to-date with 'origin/master'.
\
\ Changes to be committed:
- \ (use "git reset HEAD ..." to unstage) <--- 很貼心,但 HEAD 又是啥意思?
+ \ (use "git reset HEAD ..." to unstage) <--- ???,? HEAD ??????
\
- \ modified: README.md <------ 綠色
+ \ modified: README.md <------ ??
\
\ Untracked files:
\ (use "git add ..." to include in what will be committed)
@@ -321,9 +321,9 @@
\ D:\hcchen\Dropbox\learnings\github\forthtranspiler [master +1 ~0 -0 !]> git status
\ On branch master
\ Your branch is ahead of 'origin/master' by 1 commit.
- \ (use "git push" to publish your local commits) <------ 實在有夠貼心,被罵夠了。
- \ 揣摩,要先 commit 然後 push 才會上網。
- \ 上哪個網?自己的,還是原來的? See ^111
+ \ (use "git push" to publish your local commits) <------ ??????,?????
+ \ ??,?? commit ?? push ?????
+ \ ????????,?????? See ^111
\ Untracked files:
\ (use "git add ..." to include in what will be committed)
\
@@ -331,27 +331,29 @@
\
\ nothing added to commit but untracked files present (use "git add" to track)
\ D:\hcchen\Dropbox\learnings\github\forthtranspiler [master +1 ~0 -0 !]>
-
- \ git rm 相對於 add 但還會真的把檔案殺掉,別用。請用咱的 untrack 、 untrack-folder 讚!
- \ git reset 就是把 tracking 全抹掉,要重新 add。
- \ git log 很有用!
+ \ git rm ??? add ??????????,??????? untrack ? untrack-folder ?!
+ \ git reset ??? tracking ???,??? add?
- : log-verbose ( -- ) \ Read the commit log, 'q' to stop.
- git log ;
+ \ git log ???!
+
+ : log-verbose ( [options...] -- ) \ Read the commit log, 'q' to stop.
+ s" git log " CR word + ;
+ /// See also 'log' command.
/// "git log -10" to see only the recent 10 commits
+ /// log-verbose origin \ to see also newer commits
- : 還原檔案 ( -- ) \ 把檔案從「最後的 commit」裡恢復回來。
+ : ???? ( -- ) \ ???????? commit???????
s" git checkout -- " CR word + ;
- /// 若要把檔案退回到指定的版本則用另一種寫法:
+ /// ????????????????????:
/// git checkout path/Gruntfile.js
last alias retrieve
last alias recall
-
- : 徹底還原 ( -- ) \ 把所有改過的都重新 checkout 回來,小心!連新加的檔案也都殺掉。
+
+ : ???? ( -- ) \ ????????? checkout ??,??!???????????
git reset --hard ;
- /// 做錯了?沒關係,只要執行 git reset --hard ORIG_HEAD 就可
- /// 以回復到上一版,然後再重新合併一次引發相同的衝突。
+ /// ???????,???? git reset --hard ORIG_HEAD ??
+ /// ???????,?????????????????
: ls ( <[-u or other options]> -- ) \ Like dir of DOS, list all files of the repository.
s" git ls-files " CR word + ;
@@ -359,142 +361,144 @@
: ls-remote ( -- ) \ 'ls' but regarding the remote repo.
s" git ls-remote " CR word + ;
- /// ls-remote 顯示特定 remote repo 的 reference 名稱。包含
- /// remote branchs 與 remote tags.
-
-
- \ 第 05 天:了解儲存庫、工作目錄、物件與索引之間的關係。<----------- 應該先閱讀這一章!
- \ 使用 Git 版本控管時,會遭遇到很多分支的狀況
- \ 使用 git checkout 切換到不同分支會將你工作目錄下的目錄與檔案都改成與要切換過去的分支
- \ 下的目錄與檔案一樣。所以,適時的保持工作目錄的乾淨,是版本控管過程中的一個基本原則。
- \ object 「物件」用來保存版本庫中所有檔案與版本紀錄
- \ index 「索引」則是用來保存當下要進版本庫之前的目錄狀態。
-
- \ 第 06 天:解析 Git 資料結構 - 物件結構
-
+ /// ls-remote ???? remote repo ? reference ?????
+ /// remote branchs ? remote tags.
+
+
+ \ ? 05 ?:??????????????????????<----------- ????????!
+ \ ?? Git ?????,???????????
+ \ ?? git checkout ?????????????????????????????????
+ \ ????????????,????????????,????????????????
+ \ object ?????????????????????
+ \ index ?????????????????????????
+
+ \ ? 06 ?:?? Git ???? - ????
+
: file-system-check ( -- ) \ check repository file system integity
git fsck ;
- /// 檢查 Git 維護的檔案系統是否完整。我上回搞亂整個 repo 之後再
- /// clone 回來成功,但 git fsck 看到一些 dangling commit, 如下者數行:
+ /// ?? Git ??????????????????? repo ???
+ /// clone ????,? git fsck ???? dangling commit, ?????:
/// dangling commit 0b8054b68a13d6e3effad469070d9535583e248c
- /// 可用 git gc 把它們清掉。
+ /// ?? git gc ??????
- \ 第 07 天:解析 Git 資料結構 - 索引結構
- \ 了解 tracked/untracked, modified/unmodified, staged/unstaged 必讀。
- \ 那張重要的 State diagram 狀態圖 好像在這裡。
+ \ ? 07 ?:?? Git ???? - ????
+ \ ?? tracked/untracked, modified/unmodified, staged/unstaged ???
+ \ ????? State diagram ??? ??????
- : add-modified ( -- ) \ 忽略 untracked 僅 cache "modified" and "deleted" files.
+ : add-modified ( -- ) \ ?? untracked ? cache "modified" and "deleted" files.
git add -u ;
- /// 'add' 把檔案加進 cache 準備 commit。原本是 tracked 或 untracked 都
- /// 得經過 add 才會進 cache。別以為只有新檔才需要 add 因為即使是已經
- /// tracked 的檔案也不會自動進 cache 故也不會自動被 commit 到。
+ /// 'add' ????? cache ?? commit???? tracked ? untracked ?
+ /// ??? add ??? cache??????????? add ???????
+ /// tracked ????????? cache ??????? commit ??
- \ 第 08 天:關於分支的基本觀念與使用方式
+ \ ? 08 ?:??????????????
- : list-branches ( -- ) \ List local branches 顯示出所有「本地分支」。
+ : list-branches ( -- ) \ List local branches ????????????
s" git branch " ;
- /// Also : list-all-branch 含 remote server 上的也列出來。
-
- : create-branch ( <...> -- ) \ Create a new branch e.g. 用來 commit 剛改的東西以供實驗。
+ /// Also : list-all-branch ? remote server ???????
+
+ : create-branch ( <...> -- ) \ Create a new branch e.g. ?? commit ??????????
s" git branch " CR word + ;
- /// * 不必先 commit,故可以 commit 到新 branch 去,新的所以可以。
+ /// * ??? commit,??? commit ?? branch ?,???????
/// git branch ...
-
- : checkout-to-new-branch ( [<...>] -- ) \ checkout to a new branch e.g. 用來 commit 剛改的東西以供實驗。
+
+ : checkout-to-new-branch ( [<...>] -- ) \ checkout to a new branch e.g. ?? commit ??????????
s" git checkout -b " CR word + ;
- /// * 不必先 commit,故可以 commit 到新 branch 去,新的所以可以。
+ /// * ??? commit,??? commit ?? branch ?,???????
/// git checkout -b ...
/// Example:
- /// checkout-to-new-branch , 從當前 version 分支出來。
- /// checkout-to-new-branch master , 指定要從 master 分支出來。
+ /// checkout-to-new-branch , ??? version ?????
+ /// checkout-to-new-branch master , ???? master ?????
: delete-branch ( -- ) \ Delete an existing branch.
s" git branch -d " BL word + ;
- /// 你不能刪除目前工作的分支,必須先切換到其他分支後,再刪除之。
- /// 沒有執行過「合併」的分支,都不能用本指令進行刪除,必須改用
- /// git branch -D feature (大寫的 -D)才能刪除該分支。
+ /// ????????????,???????????,?????
+ /// ????????????,???????????,????
+ /// git branch -D feature (??? -D)????????
: list-all-branch ( -- ) \ List all local and remote branches.
git branch -a ;
- /// git branch -a 顯示出所有「本地分支」與「遠端追蹤分支」。
- /// 本地分支 : 在透過 git branch 指令執行時所顯示的分支,這
- /// 些分支存在於本地端,而這些分支又常被稱為 主題分支 (Topic
- /// Branch) 或 開發分支 (Development Branch),就是因為這些分支
- /// 預設不會被推送到遠端儲存庫,主要用來做開發用途。
- /// 遠端分支:顧名思義,遠端分支就是在遠端儲存庫中的分支,
- /// 如此而已。你用 GitHub 是無法存取遠端分支的。
+ /// git branch -a ?????????????????????
+ /// ???? : ??? git branch ???????????,?
+ /// ?????????,?????????? ???? (Topic
+ /// Branch) ? ???? (Development Branch),????????
+ /// ?????????????,??????????
+ /// ????:????,????????????????,
+ /// ??????? GitHub ???????????
+
-
: switch-branch ( -- ) \ Switch to another branch which is existing.
s" git checkout " CR word + ;
/// "switch branch" and "switch commit" and "checkout" are the same.
- /// [ ] 不必先 commit,故現有的 cache 可以 commit 到別的 branch 去。其實
- /// 就是 checkout 某個 commit。
- /// Switch commit 到舊版,即進入了所謂的 detached HEAD 狀態,這是一種
- /// 「目前工作目錄不在最新版」的提示,你可以隨時切換到 Git 儲存庫的任
- /// 意版本,但是由於這個版本已經有「下一版」,所以如果你在目前的「舊版」
- /// 執行 git commit 的話,就會導致這個新版本無法被追蹤變更,所以建議不
- /// 要這麼做。若你要在 detached HEAD 狀態建立一個可被追蹤的版本,那麼正
- /// 確的方法則是透過「建立分支」的方式。
+ /// [ ] ??? commit,???? cache ?? commit ??? branch ????
+ /// ?? checkout ?? commit?
+ /// Switch commit ???,??????? detached HEAD ??,????
+ /// ????????????????,???????? Git ?????
+ /// ???,????????????????,?????????????
+ /// ?? git commit ??,????????????????,?????
+ /// ????????? detached HEAD ?????????????,???
+ /// ??????????????????
/// Use "git log" to see commit ID's
/// Use "checkout-to-new-branch" to switch to a new branch.
- /// 不允許改過檔案後,馬上 switch-branch 故意不管改過的檔案, error message
- /// 如下:
- /// error: Your local changes to the following files would be overwritten
+ /// ????????,?? switch-branch ?????????, error message
+ /// ??:
+ /// error: Your local changes to the following files would be overwritten
/// by checkout: bbt.html
/// Please, commit your changes or stash them before you can switch branches.
- /// [ ] 不知道 *stash* 啥意思? 好像把改過的檔案保存在 repository 之外的地方。
-
+ /// [ ] ??? *stash* ???? ??????????? repository ??????
+
last alias switch-commit // ( -- ) Switch to another commit.
last alias checkout // ( <...> -- ) "git checkout" general form
/// Switch HEAD to another commit, recall a file, .. etc.
- \ 第 09 天:比對檔案與版本差異
+ \ ? 09 ?:?????????
: diff ( <[id1] [--cached] [id2]> -- ) \ List differences between comments.
s" git diff " CR word + ;
- /// diff => 工作目錄 vs 索引
- /// diff HEAD => 工作目錄 vs HEAD (代表最新版本 or commit)
- /// diff --cached HEAD => 索引 vs HEAD
- /// diff --cached => 索引 vs HEAD
+ /// diff => ???? vs ??
+ /// diff HEAD => ???? vs HEAD (?????? or commit)
+ /// diff --cached HEAD => ?? vs HEAD
+ /// diff --cached => ?? vs HEAD
/// diff HEAD^ HEAD => HEAD^ vs HEAD
/// diff commit1 commit2 => commit1 vs commit2
- /// 執行 git diff 自動比對出 merge 之後到底哪些檔案的哪幾行發生衝突了。
- /// 從 <<<<<<< HEAD 到 ======= 的內容,代表 HEAD (當前 master 分支的最
- /// 新版)裡發生衝突的內容。從 ======= 到 >>>>>>> hotfixes 的內容,代表
- /// hotfixes 分支裡發生衝突的內容
+ /// ?? git diff ????? merge ??????????????????
+ /// ? <<<<<<< HEAD ? ======= ???,?? HEAD (?? master ????
+ /// ??)?????????? ======= ? >>>>>>> hotfixes ???,??
+ /// hotfixes ??????????
- \ 第 10 天:認識 Git 物件的絕對名稱
+ \ ? 10 ?:?? Git ???????
+
+ : log ( -- ) \ List all local commit log, 'q' to stop.
+ git log origin --pretty=oneline --abbrev-commit ;
+ /// HEAD may not be at top of the list when debugging older commit.
+ /// See also 'log-verbose' command
+
+ \ ? 11 ?:?? Git ????????????
- : log ( -- ) \ Read the simplified commit log, 'q' to stop. Also 'log-verbose'.
- git log --pretty=oneline --abbrev-commit ;
-
- \ 第 11 天:認識 Git 物件的一般參照與符號參照
-
\ HEAD, branch name, --cached are all references
- \ 在 Git 工具中,預設會維護一些特別的符號參照,方便我們快速取得常用的 commit
- \ 物件,且這些物件預設都會儲存在 .git/ 目錄下。這些符號參考有以下四個:
- \
+ \ ? Git ???,??????????????,??????????? commit
+ \ ??,???????????? .git/ ???????????????:
+ \
\ HEAD
- \ 永遠會指向「工作目錄」中所設定的「分支」當中的「最新版」。所以當你在這個分
- \ 支執行 git commit 後,這個 HEAD 符號參照也會更新成該分支最新版的那個 commit 物件。
+ \ ?????????????????????????????????????
+ \ ??? git commit ?,?? HEAD ?????????????????? commit ???
\ ORIG_HEAD
- \ 簡單來說就是 HEAD 這個 commit 物件的「前一版」,經常用來復原上一次的版本變更。
+ \ ?????? HEAD ?? commit ????????,???????????????
\ FETCH_HEAD
- \ 使用遠端儲存庫時,可能會使用 git fetch 指令取回所有遠端儲存庫的物件。這個
- \ FETCH_HEAD 符號參考則會記錄遠端儲存庫中每個分支的 HEAD (最新版) 的「絕對名稱」。
+ \ ????????,????? git fetch ?????????????????
+ \ FETCH_HEAD ??????????????????? HEAD (???) ????????
\ MERGE_HEAD
- \ 當你執行合併工作時 (關於合併的議題會在日後的文章中會提到),「合併來源」的 commit
- \ 物件絕對名稱會被記錄在 MERGE_HEAD 這個符號參照中。
- \ 心得:常見的 'origin' 就是一個 reference, 指到 GitHub。這個 origin 名稱是在 Git 版
- \ 本控管中慣用的預設遠端分支的參照名稱,主要目的是用來代表一個遠端儲存庫的 URL 位址。
-
- : reference ( "reference" -- ) \ Create or change a reference that points to a GitHub object.
+ \ ????????? (??????????????????),??????? commit
+ \ ??????????? MERGE_HEAD ????????
+ \ ??:??? 'origin' ???? reference, ?? GitHub??? origin ???? Git ?
+ \ ??????????????????,????????????????? URL ???
+
+ : reference ( "reference" -- ) \ Create or change a reference that points to a GitHub object.
BL word ( "reference" "ref-name" ) s" git update-ref " swap + s" " + swap + ;
/// Example of a pathname : refs\refName
- /// GitHub object is usually a commit. Can also be a tree
+ /// GitHub object is usually a commit. Can also be a tree
/// or something else that you can find in the .git folder.
: symbol ( "reference-pathname" -- ) \ Create (and change?) a symbolic reference.
@@ -504,112 +508,112 @@
: show-ref ( -- ) \ List all references include symbols.
git show-ref ;
- \ 第 12 天:認識 Git 物件的相對名稱
-
- \ 第 17 天:關於合併的基本觀念與使用方式
- \ 當你在工作目錄下建立分支時,可以讓你的系統依據不同的需求分別進行開發,又不互相影響。例如
- \ 你原本穩定的系統可以放在 master 分支中進行開發,而當要修正錯誤時則額外建立一個 bugfix 分支來改
- \ 正軟體錯誤,等 Bugs 修正後,在透過「合併」的方式將 bugfix 分支上的變更重新套用到 master 上面,
- \ 這就是一種主要的使用情境。事實上,執行「合併」動作時,是將另一個分支合併回目前分支,然後再手動
- \ 將另一個分支給移除,這樣才符合「兩個分支合併成一個」的概念。
- \ 在 Git 使用合併時,有一個重要的觀念是【合併的動作必須發生在同一個儲存庫中】。請回想一下,
- \ 在任何一個 Git 儲存庫中,都必須存在一個 Initial Commit 物件(初始版本),而所有其他版本都會跟這
- \ 個版本有關係,這個關係我們稱為「在分支線上的可追蹤物件」(the tracked object on the branch heads)
- \ ,所以你不能將一個儲存庫的特定分支合併到另一個毫不相干的儲存庫的某個分支裡。
- \ 合併的時候,如果兩個分支當中有修改到相同的檔案,但只要修改的行數不一樣,Git 就會自動幫你套
- \ 用/合併這兩個變更。但如果就這麼剛好,你在兩個分支裡面改到「同一個檔案」的「同一行」,那麼在合
- \ 併的時候就會引發衝突事件。當合併衝突發生時,Git 並不會幫你決定任何事情,而是將「解決衝突」的工
- \ 作交給「你」來負責,且這些發生衝突的檔案也都會被標示為 unmerged 狀態,合併衝突後你可以用 git
- \ status 指令看到這些狀態。
- \ Git 指令找出衝突的檔案:執行 git status 或執行 git ls-files -u
- \ 找到之後再用 git diff [filepath] 就可以僅比對其中一個檔案了:
+ \ ? 12 ?:?? Git ???????
+
+ \ ? 17 ?:??????????????
+ \ ?????????????,????????????????????,?????????
+ \ ???????????? master ???????,??????????????? bugfix ????
+ \ ?????,? Bugs ???,??????????? bugfix ??????????? master ??,
+ \ ????????????????,?????????,??????????????,?????
+ \ ?????????,????????????????????
+ \ ? Git ?????,??????????????????????????????????,
+ \ ????? Git ????,??????? Initial Commit ??(????),???????????
+ \ ??????,?????????????????????(the tracked object on the branch heads)
+ \ ,?????????????????????????????????????
+ \ ?????,?????????????????,???????????,Git ???????
+ \ ?/????????????????,???????????????????????,????
+ \ ?????????????????????,Git ???????????,???????????
+ \ ?????????,????????????????? unmerged ??,????????? git
+ \ status ?????????
+ \ Git ?????????:?? git status ??? git ls-files -u
+ \ ?????? git diff [filepath] ?????????????:
: merge ( -- ) \ Merge the commit(s) into the recent HEAD
s" git merge " CR word + ;
- /// 新的 GitHub for Windows 有 tutorial https://guides.github.com/introduction/flow/
- /// 圖解說明 branch > pull request > merge 的流程。
-
-
- \ 第 24 天:使用 GitHub 遠端儲存庫 - 入門篇
-
- \ Github 端一定要去建立一個 repo 才行,不能憑空就弄上去。用網頁上的功能取得 project URI。
- \ Case A. 在 GitHub 建立一個「沒有版本」的空白 Git 儲存庫,
- \ 然後透過 git clone 取得遠端儲存庫,
- \ 再建立版本後上傳
- \ Case C. 在 GitHub 建立一個「有初始化版本」的 Git 儲存庫,
- \ 然後透過 git clone 取得遠端儲存庫,
- \ 再建立版本後上傳
- \ 最簡單的方法就是利用 GitHub for Windows 工具。你只要點擊 Clone in Desktop 按鈕,(see
+ /// ?? GitHub for Windows ? tutorial https://guides.github.com/introduction/flow/
+ /// ???? branch > pull request > merge ????
+
+
+ \ ? 24 ?:?? GitHub ????? - ???
+
+ \ Github ????????? repo ??,?????????????????? project URI?
+ \ Case A. ? GitHub ????????????? Git ???,
+ \ ???? git clone ???????,
+ \ ????????
+ \ Case C. ? GitHub ????????????? Git ???,
+ \ ???? git clone ???????,
+ \ ????????
+ \ ?????????? GitHub for Windows ???????? Clone in Desktop ??,(see
\ https://www.evernote.com/shard/s22/nl/2472143/371b041f-787f-4dad-9075-98ebc870ba8b)
- \ 即可自動啟動 GitHub for Windows 工具幫你下載 Git 專案。clone 是在 local 建「新」repo.
- \ 之後就要用 pull 的從 remote 下來。
+ \ ?????? GitHub for Windows ?????? Git ???clone ?? local ????repo.
+ \ ????? pull ?? remote ???
- : push.default ( -- ) \ git push 會出現一段提示,告訴你要設定 push.default 這個選項.
+ : push.default ( -- ) \ git push ???????,?????? push.default ????.
git config --global push.default simple ;
- /// 要設定 push.default 這個選項,因為這種簡寫的 git push 方法的預設行為將會
- /// 在 Git 2.0 之後發生改變,建議你透過設定 push.default 選項的方式明確指定
- /// push 的方法。詳細說明請參見 git help config 的說明文件,搜尋 push.default
- /// 即可找到相關說明。我建議各位設定成 simple,以利跟日後的 Git 指令列工具的預
- /// 設值相同。
-
+ /// ??? push.default ????,??????? git push ?????????
+ /// ? Git 2.0 ??????,??????? push.default ?????????
+ /// push ??????????? git help config ?????,?? push.default
+ /// ????????????????? simple,?????? Git ???????
+ /// ?????
+
: push ( [] -- ) \ Upload local repo up to the remote repo
s" git push " CR word + ;
- /// 假設本地是 GitHub 上 clone 下來的,第一次 upload 所用的命令
- /// 是:git push origin master 。當你第二次建立版本時,直接執行 git push
- /// 就會自動上傳成功。
- /// git push 將本地儲存庫中目前分支的所有相關物件推送到遠端儲存
- /// 庫中。這個 origin 名稱是在 Git 版本控管中慣用的預設遠端分支的參
- /// 照名稱,主要目的是用來代表一個遠端儲存庫的 URL 位址。
+ /// ????? GitHub ? clone ???,??? upload ?????
+ /// ?:git push origin master ???????????,???? git push
+ /// ?????????
+ /// git push ?????????????????????????
+ /// ????? origin ???? Git ????????????????
+ /// ???,????????????????? URL ???
X:\forthtranspiler [jeforth.3hta]> git push
fatal: The current branch jeforth.3hta has no upstream branch.
To push the current branch and set the remote as upstream, use
-
+
git push --set-upstream origin jeforth.3hta
-
+
X:\forthtranspiler [jeforth.3hta]>
- : push到「空」遠端 ( -- ) \ 當 GitHub 上的 repo 是空的,upload 本地成果上去必須用這個。
+ : push?????? ( -- ) \ ? GitHub ?? repo ???,upload ????????????
git push -u origin master ;
- /// 在 GitHub 上新建的 repo 是空的,連預設的 master 分支都沒有。此時
- /// 下達 git push 指令時必須加上 -u 參數,才能成功地把本地儲存庫上傳
- /// 到 GitHub 上的遠端儲存庫,其指令是 git push -u origin master
-
- \ Github 端一定要去建立一個 repo 才行,不能憑空就弄上去。用網頁上的功能取得 project URI。
- \ Case B. 在 GitHub 建立一個「沒有版本」的空白 Git 儲存庫,
- \ 然後直接將現有的本地 Git 儲存庫上傳到指定的 GitHub 專案
- \ Case D. 在 GitHub 建立一個「有初始化版本」的 Git 儲存庫,
- \ 然後直接將現有的本地 Git 儲存庫上傳到指定的 GitHub 專案
-
- : remote ( <...> -- ) \ 對 GitHub 操作
+ /// ? GitHub ???? repo ???,???? master ????????
+ /// ?? git push ??????? -u ??,?????????????
+ /// ? GitHub ???????,???? git push -u origin master
+
+ \ Github ????????? repo ??,?????????????????? project URI?
+ \ Case B. ? GitHub ????????????? Git ???,
+ \ ?????????? Git ????????? GitHub ??
+ \ Case D. ? GitHub ????????????? Git ???,
+ \ ?????????? Git ????????? GitHub ??
+
+ : remote ( <...> -- ) \ ? GitHub ??
s" git remote " CR word + ;
- /// 本地若非 clone 下來的,就必須告訴本地 Git 遠端儲存庫在哪。而如
- /// 果 GitHub 上的 repo 又是空的,這時我們可以輸入:
+ /// ???? clone ???,??????? Git ??????????
+ /// ? GitHub ?? repo ????,????????:
/// git remote add origin https://bla/bla/bla.git
- /// 建立一個名為 origin 的 reference 名稱,並指向 URI 位址,也就是我們
- /// 在 GitHub 上的遠端儲存庫位址。接著就可以 push origin master。
- /// 但如果 GitHub 上的 repo 不是空的,解決的方法很簡單,只要把遠端
- /// 儲存庫的 master 分支,成功合併回我本地的分支,即可建立兩個不同版本
- /// 庫之間的關聯,這樣你就可以把本地的 master 分支推送到 GitHub 上遠端
- /// 儲存庫的 master 分支了。「合併回我本地」用 pull or fetch + merge。
- /// [ ] 疑問:怎麼不直接 merge 下來?
- /// 這個 origin 名稱是在 Git 版本控管中慣用的預設遠端分支的參照名稱,
- /// 主要目的是用來代表一個遠端儲存庫的 URL 位址。
+ /// ?????? origin ? reference ??,??? URI ??,?????
+ /// ? GitHub ??????????????? push origin master?
+ /// ??? GitHub ?? repo ????,????????,?????
+ /// ???? master ??,???????????,??????????
+ /// ??????,?????????? master ????? GitHub ???
+ /// ???? master ????????????? pull or fetch + merge?
+ /// [ ] ??:????? merge ???
+ /// ?? origin ???? Git ???????????????????,
+ /// ????????????????? URL ???
: pull ( <...> -- ) \ Get repo from GitHub and merge to local.
s" git pull " CR word + ;
- /// 將遠端儲存庫的 master 分支取回,並合併到本地儲存庫的 master 分支:
- /// 使用 git pull origin master 指令
- /// git pull 將遠端儲存庫的最新版下載回來,下載的內容包含完整的物件儲
- /// 存庫(object storage)。並且將遠端分支合併到本地分支。(將 origin/master
- /// 遠端分支合併到 master 本地分支) 所以一個 git pull 動作,完全相等
- /// 於以下兩段指令:
+ /// ??????? master ????,?????????? master ??:
+ /// ?? git pull origin master ??
+ /// git pull ??????????????,?????????????
+ /// ??(object storage)????????????????(? origin/master
+ /// ??????? master ????) ???? git pull ??,????
+ /// ???????:
/// git fetch
/// git merge origin/master
- \ 剛才成功地 merge 了遠端與本地的不同版本。 11:47 2015/8/22
- \ 在公司改了很多, 已經上了 github。回家在舊版上改了一些, commit,push 時
- \ 出現下列訊息:
+ \ ????? merge ???????????? 11:47 2015/8/22
+ \ ???????, ???? github???????????, commit,push ?
+ \ ??????:
\ C:\Users\hcche\Documents\GitHub\jeforth.3we [master]> git push
\ To https://github.com/hcchengithub/jeforth.3we.git
\ ! [rejected] master -> master (fetch first)
@@ -618,8 +622,8 @@
\ hint: not have locally. This is usually caused by another repository pushing
\ hint: to the same ref. You may want to first integrate the remote changes
\ hint: (e.g., 'git pull ...') before pushing again.
- \ hint: See the 'Note about fast-forwards' in 'git push --help' for details.
- \ 我照他講得先 pull 然後:
+ \ hint: See the 'Note about fast-forwards' in 'git push --help' for details.
+ \ ?????? pull ??:
\ C:\Users\hcche\Documents\GitHub\jeforth.3we [master]> git pull
\ remote: Counting objects: 22, done.
\ remote: Total 22 (delta 11), reused 11 (delta 11), pack-reused 11
@@ -639,26 +643,26 @@
\ 9 files changed, 1827 insertions(+), 274 deletions(-)
\ create mode 100644 3hta/money.f
\ create mode 100644 3hta/work.f
- \ 查 status :
+ \ ? status :
\ C:\Users\hcche\Documents\GitHub\jeforth.3we [master]> git status
\ On branch master
\ Your branch is ahead of 'origin/master' by 2 commits.
\ (use "git push" to publish your local commits)
- \ 照指示 push 上去就好了。以後最好記得先 pull 再開始工作,以免搞到衝突
- \ 收拾起來更費勁。
-
+ \ ??? push ????????????? pull ?????,??????
+ \ ????????
+
: fetch ( <...> -- ) \ Get repo from GitHub w/o merge.
s" git fetch " CR word + ;
- /// 將遠端儲存庫的 master 分支取回,並合併到本地儲存庫的 master 分支:
- /// 使用 git fetch 指令後再執行 git merge origin/master 合併動作。
- /// git fetch 將遠端儲存庫的最新版下載回來,下載的內容包含完整的
- /// 物件儲存庫(object storage)。 這個命令不包含「合併」分支的動作。
+ /// ??????? master ????,?????????? master ??:
+ /// ?? git fetch ?????? git merge origin/master ?????
+ /// git fetch ??????????????,??????????
+ /// ?????(object storage)? ?????????????????
+
+ \ ? 25 ?:?? GitHub ????? - ???
- \ 第 25 天:使用 GitHub 遠端儲存庫 - 觀念篇
-
- Q: 依您附圖,紅色部分都是 remotes .... 怎麼會是「本地追蹤分支」?
+ Q: ????,?????? remotes .... ?????????????
https://github.com/doggy8088/Learn-Git-in-30-days/issues/8#issuecomment-91797074
A: 2015-04-11 17:12 GMT+08:00 Yue Lin Ho :
More note: it is on day 25.
@@ -666,85 +670,85 @@
Pro Git 3.5
Remote Branches
- Remote branches are references (pointers) to the state of branches in your remote repositories.
- They’re local branches that ...
- 中文版 Pro Git 3.5
-
- 遠端分支
- 遠端分支(remote branch)是對遠端倉庫中的分支的索引。
- 它們是一些無法移動的本地分支...
- 重點在於: 雖然是用 remotes 字眼做 prefix, 但它們存在於 本地(實際上是一種 local branches)
- 它的特性是要標示遠端的版本庫有一個本地分支, 你可以這樣子想它:
- remotes/origin/master -> 遠端(remotes)版本庫(給它取名叫origin)有一個master分支
-
- 假設, 遠端版本庫有一個本地分支叫 abc
- 你clone時,
- 本地版本庫為了記錄遠端版本庫有個 abc 指到某個 commit 上,
- 會在本地版本庫會產生一個 remotes/origin/abc, 並同時也指向那個 commit 上
- 當你在本地版本庫的這個 commit 上, 或者 remotes/origin/abc 上產生一個本地分支 abc 時,
- 本地版本庫的本地分支 abc 和 remotes/origin/abc 之間會自動產生一個 "追蹤" 闗係
-
- 更詳盡的 "跟蹤" 的概念, 請參考 這裡
- 當一個本地分支(master)與遠端分支(remotes/origin/master)之間有 "跟蹤" 關係時, 才會用這個詞
- —
+ Remote branches are references (pointers) to the state of branches in your remote repositories.
+ They're local branches that ...
+ ??? Pro Git 3.5
+
+ ????
+ ????(remote branch)??????????????
+ ??????????????...
+ ????: ???? remotes ??? prefix, ?????? ??(?????? local branches)
+ ?????????????????????, ????????:
+ remotes/origin/master -> ??(remotes)???(?????origin)???master??
+
+ ??, ????????????? abc
+ ?clone?,
+ ???????????????? abc ???? commit ?,
+ ???????????? remotes/origin/abc, ???????? commit ?
+ ??????????? commit ?, ?? remotes/origin/abc ????????? abc ?,
+ ?????????? abc ? remotes/origin/abc ????????? "??" ??
+
+ ???? "??" ???, ??? ??
+ ???????(master)?????(remotes/origin/master)??? "??" ???, ??????
+ -
Reply to this email directly or view it on GitHub.
-
- : 手動加入一個「遠端儲存庫」 ( -- )
+
+ : ????????????? ( -- )
s" git remote add " CR word + ;
- /// 事實上你可以在你的工作目錄中,建立多個遠端儲存庫的參照位址。
- /// 看不太懂。see 第 25 天:使用 GitHub 遠端儲存庫 - 觀念篇
-
+ /// ??????????????,???????????????
+ /// ?????see ? 25 ?:?? GitHub ????? - ???
+
: list-uri ( -- ) \ List associated URIs on GitHub.com
git remote -v ;
-
- \ 第 26 天:多人在同一個遠端儲存庫中進行版控
+
+ \ ? 26 ?:????????????????
: ver ( -- ) \ Git version
git --version ;
- /// 請確定你的 git 版本是在 1.7.10以上。
+ /// ????? git ???? 1.7.10???
/// http://jlord.us/git-it/challenges-zhtw/get_git.html
: config ( <[...]> -- ) \ The 'git config' general
s" git config " CR word + ;
: list-config ( -- ) \ List the entire configuarations
- git config -l ;
- /// ( ^111 ) 從這裡面可以看出本 project 的 remote.origin.url
- /// 以 jeforth.3we 為例 https://github.com/hcchengithub/jeforth.3we.git
- /// 以 project-k 為例 https://github.com/hcchengithub/project-k
- /// 還可以看到好多 alias 、 diff.tool 、 merge.tool 等可以進一步探討。
+ git config -l ;
+ /// ( ^111 ) ????????? project ? remote.origin.url
+ /// ? jeforth.3we ?? https://github.com/hcchengithub/jeforth.3we.git
+ /// ? project-k ?? https://github.com/hcchengithub/project-k
+ /// ??????? alias ? diff.tool ? merge.tool ?????????
- : 設定你的名字 ( "useer-name" -- ) \ Setup the user name
+ : ?????? ( "useer-name" -- ) \ Setup the user name
s" git config --global user.name " BL word + ;
- /// 讓 Git 知道這台電腦所做的修改該連結到什麼使用者
- /// 這個用不著,灌 "GitHub for Windows" 的過程已經搞定。
-
- : 設定你的電子信箱 ( "email-address" -- ) \ Setup the user's email address
+ /// ? Git ????????????????????
+ /// ?????,? "GitHub for Windows" ????????
+
+ : ???????? ( "email-address" -- ) \ Setup the user's email address
s" git config --global user.email " BL word + ;
- /// 讓 Git 知道這台電腦所做的修改該連結到什麼使用者
- /// 這個用不著,灌 "GitHub for Windows" 的過程已經搞定。
-
+ /// ? Git ????????????????????
+ /// ?????,? "GitHub for Windows" ????????
+
: untrack ( ... -- ) \ Untrack, remove a file from repo w/o deleting it
s" git rm --cached " CR word + ;
last alias unstage
- /// 當初是 add 命令 track 進去的,用 git rm --cached filename 脫離。
-
+ /// ??? add ?? track ???,? git rm --cached filename ???
+
: untrack-folder ( ... -- ) \ Untrack, remove a directory from repo w/o deleting it
s" git rm --cached -r " CR word + ;
last alias unstage-folder
- /// 當初是 add 命令 track 進去的,用 git rm --cached -r pathname 脫離。
+ /// ??? add ?? track ???,? git rm --cached -r pathname ???
- hcchen5600 2015/04/17 21:23:33
- 昨天家裡電腦又 GitHub repository 大亂。可能是 GFW 干擾 Dropbox 同步所造成。也可能是 GitHub
- for Windows 上沒有先 commit 乾淨就按下 [Sync] button 的後果。一時心慌十分挫折。幸好公司電腦
- 的 Dropbox folder 還是先前的正常狀況,回公司 commit 上 GitHub 先修復 remote。
- 家裡的 .git 已經大亂,size 竟有 47M 正常的才 19M。修復過程: 先 md 一個暫時的 folder, 然後
- 從 GitHub 上 clone 下來。檢查 local jeforth.3we 裡 ignored 的檔案先 copy 到 temp folder,最
- 後 copy temp 過來蓋掉 local。結果 local size 變成 60M 只好這樣。裡面的垃圾以後再看怎麼清。
- ==> After「垃圾回收」command, only 27M now.
+ hcchen5600 2015/04/17 21:23:33
+ ??????? GitHub repository ?????? GFW ?? Dropbox ?????????? GitHub
+ for Windows ???? commit ????? [Sync] button ???????????????????
+ ? Dropbox folder ?????????,??? commit ? GitHub ??? remote?
+ ??? .git ????,size ?? 47M ???? 19M?????: ? md ????? folder, ??
+ ? GitHub ? clone ????? local jeforth.3we ? ignored ???? copy ? temp folder,?
+ ? copy temp ???? local??? local size ?? 60M ??????????????????
+ ==> After??????command, only 27M now.
@@ -757,199 +761,199 @@
git rm --cached -r mydirectory
==> untrack-folder ( pathname -- ) \ Untrack, remove a directory from repo w/o deleting it
-[ ] 新 project 在 github.com 上建立之後會出現下列指引:
-
- …or create a new repository on the command line
+[ ] ? project ? github.com ????????????:
+
+ .or create a new repository on the command line
echo # wiki >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/ForthHub/wiki.git
git push -u origin master
-
- …or push an existing repository from the command line
+
+ .or push an existing repository from the command line
git remote add origin https://github.com/ForthHub/wiki.git
git push -u origin master
-
- …or import code from another repository
+
+ .or import code from another repository
You can initialize this repository with code from a Subversion, Mercurial, or TFS project.
Import code
-
+
-: Digest:Git分支管理策略 ( -- ) \ Digest of the article《Git 分支管理策略》from 阮一峰的網絡日誌
-
- /* .. 是寫東西進 HTML 的 裡 */
+: Digest:Git?????? ( -- ) \ Digest of the articleGit ??????from ????????
+
+ /* .. ????? HTML ? ? */
- drop \ /* 丟掉 .. 留下來的
- drop \ /* ?? .. ???? OK \\n\\n > js> $(\\\"style\\\")[1].outerHTML .\\n OK \\n\\n > js> $(\\\"style\\\")[2].outerHTML .\\n OK \\n\\n > js> $(\\\"style\\\")[3].outerHTML .\\n OK \\n\\n[ ] 蓋過去行不行?\\n js> $(\\\".console3we\\\").length .\\n\\n\\n\",\"mode\":true,\"readonly\":false}","Study XMLHttpRequest object 2016-07-06":"{\"doc\":\"[ ] Study how to *write* files to local disk on super-chrome jeforth.3htm\\n --> 先前有找到過一個例子, 可以把網頁上的 pictures drag-drop 一下就 save 成 local file\\n Ynote: \\\"jeforth 研究 Chrome extension 存檔到本地 disk 的方法\\\" the thing is \\\"XMLHttpRequest\\\" \\n --> Study XMLHttpRequest @ http://www.w3school.com.cn/xml/xml_http.asp\\n var x =new XMLHttpRequest(); x constant xmlhttp // ( -- obj ) XMLHttpRequest object\\nxmlhttp :: open(\\\"GET\\\",\\\"a.html\\\",true)\\nxmlhttp :: send(null)\\ntry on 3hta ... error : access denied\\ntry on jeforth.3nw --> it works! \\n\\n\\nStudy XMLHttpRequest object \\nhttp://www.w3school.com.cn/xml/xml_http.asp\\n\\n> var x =new XMLHttpRequest(); x constant xmlhttp // ( -- obj ) XMLHttpRequest object\\n> xmlhttp . ==> [object XMLHttpRequest] \\\\ this is how it looks like\\n> xmlhttp :: open(\\\"GET\\\",\\\"a.html\\\",true) \\\\ try to read something from the server, a.html is not existing.\\n> xmlhttp :: send(null) \\\\ arm the instruction.\\n> xmlhttp :> readyState . ==> 4 \\\\ 4 is \\\"loaded\\\" or \\\"complete\\\"\\n> xmlhttp :> status \\\\ ==> 0 (number) \\\\ 0 is \\\"uninitialized\\\", a.html is not existing remember?\\n\\n\\\\ Try again\\n> xmlhttp :: open(\\\"GET\\\",\\\"index.html\\\",true) \\\\ now index.html is jeforth.3htm's main page\\n \\\\ the 3'rd argument Async = True 表示脚本会在 send() 方法之后继续执行,而不等待来自服务器的响应。\\n> xmlhttp :: send(null)\\n\\n\\\\ 照理說這時候要等 event xmlhttp.onreadystatechange=state_Change_event_handler; \\\\ or false if event not used\\n\\n> xmlhttp :> readyState \\\\ ==> 4 OK \\n> xmlhttp :> status \\\\ ==> 200 (number) \\\\ Bingo!! 200 is OK\\n> xmlhttp :> statusText \\\\ ==> OK (string)\\n> xmlhttp :> responseText \\\\ ==> 真的把檔案讀進來了!! Bingo !! 3nw, 3htm (super_chrome and webserver).\\n \\n \\n \\n appname \\n \\n \\n \\n\\n\\\\ 3htm/f/readtextfile.f 裡面用的是 $.get 裡面可能就是用 XMLHttpRequest.\\n\\n> xmlhttp :: open(\\\"POST\\\",\\\"222\\\",false) \\\\ 沒有 error \\n> xmlhttp :: send(\\\"1234bsdfsd\\\") \\\\ 沒有 error 但也沒效果\\n\\n\\\\ 以上 post 無效是 3nw, 3htm(super_chrome) \\n\\\\ --> 改用 3htm + webserver.f 試試看 -- same result :-(\\n\\\\ 我不瞭解 POST command 的真正意義。Server 端應該要有人把收到的 data 存成檔案。\\n\\n[ ] Server 端應該要有人把收到的 data 存成檔案。這就有點麻煩了, 還不如直接用 3nw。\\n 我以前研究過 Web server 端的程式 on 3nd, it's time to review.\\n\",\"mode\":true,\"readonly\":false}","Style for 3nw":"{\"doc\":\"
Style for 3nw
drop\\n js: outputbox.style.fontSize=\\\"1.5em\\\"\\n js: inputbox.style.fontSize=\\\"1.5em\\\"\\n editbox-style \\n .eb .box { width:90%; font-size:1.1em; /* filename */ } \\n .eb .box, .eb .ebhtmlarea { border:1px solid black; }\\n .eb .ebtextarea { font-size:1.2em }\\n .eb input { font-size:0.7em /* buttons */ }\\n .eb p { display:inline; }\\n .eb .ebname { font-size: 1em; } /* field name */\\n js: $(\\\"#ebstyle\\\")[0].innerHTML=pop() \\\\ 直接修改 ebstyle \\ncr\\n\",\"mode\":true,\"readonly\":false}","ad":"{\"doc\":\"\\n\\\\ Remove all annoying floating ad boxes. 刪除所有惱人的廣告框。\\nactive-tab :> id tabid! \\nvar divs = document.getElementsByTagName(\\\"div\\\");\\nfor (var i=divs.length-1; i>=0; i--){\\n if(divs[i].style.position){\\n divs[i].parentNode.removeChild(divs[i]);\\n }\\n}\\nfor (var i=divs.length-1; i>=0; i--){\\n if(parseInt(divs[i].style.width)<600){ // <---- 任意修改\\n divs[i].parentNode.removeChild(divs[i]);\\n }\\n}\\n\\n\",\"readonly\":true,\"mode\":true}","autoexec":"{\"doc\":\"\\njs: outputbox.style.fontSize=\\\"1.5em\\\"\\njs: inputbox.style.fontSize=\\\"1.5em\\\"\\n\",\"mode\":true,\"readonly\":false}","log of 3nw":"{\"doc\":\"[x] file input 若被 user cancel 則 sleep 得不到 stopsleeping 在那裏苦等 <--- problem!\\n> constant ff\\n> ff :> value . \\\\ ==> OK it's null string by default\\n> ff :> value . \\\\ after picking a file, it becomes a pathname\\nC:\\\\Users\\\\hcche\\\\Documents\\\\GitHub\\\\chrome-app-samples\\\\tryitnowbutton_small.png OK \\n> ff :> value . \\\\ try again but click cancel, it becomes a null string as anticipated, good!\\n> \\\\ click [cancel] clears ff.value <--- good!!\\n> ff :: onchange=function(){alert(\\\"onchange\\\")} \\\\ Add event handler, it works!\\n> \\\\ click [cancel] does not fire onchange() event unless due to the above reason that has actually been changed.\\n> ff :: oncancel=function(){alert(\\\"onCancel\\\")} <--- click [cancel] does not fire this event at all. But onchange() event got fired sometimes.\\n> ff :: onchange=function(){alert(\\\"onBigChange\\\")} \\\\ Handler can be changed and it works fine.\\n> ff :> oncancel . \\\\ ==> function (){alert(\\\"onCancel\\\")} OK check, it's there\\n> ff :> onchange . \\\\ ==> function (){alert(\\\"onBigChange\\\")} check, it's there\\n> \\\\ ff :: onabort=function(){alert(\\\"onAbort\\\")} \\\\ ==> Click cancel does not fire this either.\\n> \\\\ ff :> onabort . \\\\ ==> ff :: onabort=function(){alert(\\\"onAbort\\\")}\\n> \\\\ No, click [cancel] does not fire onabort() \\n\\n\\\\ 企圖故意製造 onchange 100% 發生的努力, 失敗了:\\n> ff :> value=\\\"dummy\\\" <--- Not allowed, see err message:\\nJavaScript error : Failed to set the 'value' property on 'HTMLInputElement': \\nThis input element accepts a filename, which may only be programmatically set \\nto the empty string.\\n\\n\\\\ 機會 : 每個 file input 都是新的, 用完馬上 remove 掉, 有機會讓所有的 cancel 都 fire \\n\\\\ onchange() event? --> 一上來馬上 cancel 因為 file.value 都是 null string 沒有變故\\n\\\\ 不會 fire onchange() event. --> 試試為 file.value 給訂初值 --> No way, see:\\n\\\\ 为安全起见,file-upload 元素不允许 HTML 作者或 JavaScript 程序员指定一个默认的文件名。\\n\\nff :> defaultValue \\\\ ==> null string.\\n constant fff\\nff :: onbeforedeactivate=function(){alert(\\\"beforeDeActivate\\\")} \\\\ <== fire when blur, 不適合.\\n\\nff :: onblur=function(){alert(\\\"onblur\\\")} <-- fired when both clicking [瀏覽] and \\nclick desk top but not clicking [cancel], shit!!!\\n\\n[x] 解決了! 3nw 會 fire oncancel() when [cancel] clicked!! Bingo!!\\nff :: onemptied=function(){type(\\\"onemptied\\\")}\\nff :: onended=function(){type(\\\"onended\\\")}\\nff :: onerror=function(){type(\\\"onerror\\\")}\\nff :: onerrorupdate=function(){type(\\\"onerrorupdate\\\")}\\nff :: onfilterchange=function(){type(\\\"onfilterchange\\\")}\\nff :: onfocus=function(){type(\\\"onfocus\\\")}\\nff :: onfocusin=function(){type(\\\"onfocusin\\\")}\\nff :: onfocusout=function(){type(\\\"onfocusout\\\")}\\nff :: onhelp=function(){type(\\\"onhelp\\\")}\\nff :: oninput=function(){type(\\\"oninput\\\")}\\nff :: onchange=function(){type(\\\"onChange\\\")}\\nff :: oncancel=function(){type(\\\"oncancel\\\")}\\n\\n3hta\\nonfocusin onfocus onfocusout \\nonfocusin onfocus onfocusout\\n\\n3nw\\nonfocus \\nonfocus oncancel\\nonfocus \\nonfocus oncancel\\n\\n[x] Answer to stackoverflow with my finding of oncancel() works!\\n http://stackoverflow.com/questions/10127492/capturing-cancel-event-on-input-type-file\\n\\n I have the same question, the solution is surprisingly very \\n easy ... at least in my case NW.js (Node-Webkit) fires oncancel \\n event if user click the [cancel] button in the file chooser \\n dialogue. You use this simple and native way if you're also on \\n NW.js (process.version is v5.11.0).\\n\\n I also tried Microsoft HTA on Windows 10, it does not fire the \\n oncancel event.\\n\\n' --- [if] --- [then] marker --- \\n\\n \\n \\n\\n\\n\\nThe above sample code, modified for jeforth, from \\nhttp://stackoverflow.com/questions/29705135/node-webkit-read-full-path-of-files-from-directory\\nworks fine, very well. No problem at all getting the full pathname on 3nw, but not on 3ce. So, \\nNW.js is really provides super power.\\n\\n\\\\ Works fine on 3nw,\\n> js> $(\\\"#fileDialog\\\").length \\\\ ==> 1 OK \\n> js> $(\\\"#fileDialog\\\")[0].value . \\\\ ==> C:\\\\Users\\\\hcche\\\\Downloads\\\\download OK \\n> js> document.getElementById(\\\"fileDialog\\\") . \\\\ ==> [object HTMLInputElement] OK \\n> js> document.getElementById(\\\"fileDialog\\\").value . \\\\ ==> C:\\\\Users\\\\hcche\\\\Downloads\\\\download OK \\n> pickFile \\n> .s\\n 0: (string) \\\\ <--- My original pickFile does not work on 3nw. Needs debug.\\n\\n\\\\ On jeforth.3ce, failed as anticipated\\n\\n > js> document.getElementById(\\\"fileDialog\\\").value .\\n C:\\\\fakepath\\\\__865.jpg OK <---- \\\"fakepath\\\" as anticipated.\\n\\n\\\\ Works fine on 3HTA.\\n\\n > js> document.getElementById(\\\"fileDialog\\\").value .\\n C:\\\\Users\\\\hcche\\\\Downloads\\\\魏月梅 全民健保核退申請書.PDF OK \\n\\n\\\\ So, pickFile can be improved by this solution from Stackoverflow.\\n\\n: pickFile ( -- \\\"pathname\\\" ) \\\\ Pick a file through web browser's GUI\\nchar input createElement ( element )\\ndup char type char file setAttribute ( element )\\ndup char id char pickfile setAttribute ( element )\\neleBody over appendChild \\\\ 要 append 才有作用。\\n( element ) js> tos().click();tos().value ( element pathname ) ;\\n\\n\\\\ 照上面這個 pickFile 實驗, 還是不行。確定傳回的 pathname 是個 \\\"\\\". 然而手動觀察 element.value 卻是\\n\\\\ 正確的 pathname. [x] 猜想, 最後一行手動看應該會是 expected pathname 無誤。\\n\\n> .s \\n 0: [object HTMLInputElement] (object) \\\\ backup\\n 1: C:\\\\Users\\\\hcche\\\\Downloads\\\\jeforth.3ce.p4.jpg (string)\\n 2: [object HTMLInputElement] (object) \\\\ to be removed\\n> removeElement\\n> js> tos(1).value . \\\\ 查看 element 的 value \\nC:\\\\Users\\\\hcche\\\\Downloads\\\\jeforth.3ce.p4.jpg OK \\\\ 竟然是對的。此時 element id 確定已經不存在了。\\n\\n\\n[x] 嘗試手動作最後一行\\n: pickFile ( -- \\\"pathname\\\" ) \\\\ Pick a file through web browser's GUI\\nchar input createElement ( element )\\ndup char type char file setAttribute ( element )\\ndup char id char pickfile setAttribute ( element )\\neleBody over appendChild \\\\ 要 append 才有作用。\\n; \\n\\n\\\\ 果然, 這行一起做, 傳回 \\\"\\\"\\n( element ) js> tos().click();tos().value ( element pathname ) ;\\n\\n\\\\ 手動分開做, 就 OK 了!!\\n( element ) js: tos().click()\\njs> tos().value ( element pathname ) ;\\n\\n[x] click() 之後, 加上一點 nap 看看, --> \\n\\n: pickFile ( -- \\\"pathname\\\" ) \\\\ Pick a file through web browser's GUI\\nchar input createElement ( element )\\ndup char type char file setAttribute ( element )\\ndup char class char pick_file setAttribute ( element )\\njs> body over appendChild \\\\ 要 append 才有作用。\\njs: tos().click() ( element ) \\\\ 回來就表示 user 已經完成操作\\n( seconds * 1000 / nap ) js> 60*1000/200 for ( element ) \\n\\tjs> tos().value if \\n\\t\\tr> drop 0 >r \\\\ break the loop\\n\\telse \\n\\t\\t200 nap .\\\" .\\\" \\\\ wait a while\\n\\tthen \\nnext ( element ) \\njs> tos().value \\\\ 即使 timeout 也不管了 ( element path ) \\nswap removeElement ; ( path ) \\n\\n\\\\ Ultimate version\\n\\n: pickFile ( -- \\\"pathname\\\" ) \\\\ Pick a file through web browser's GUI\\n\\tchar input createElement ( element )\\n\\tdup char type char file setAttribute ( element )\\n\\tdup char class char pick_file setAttribute ( element ) \\\\ for debug, clue of the element\\n\\tjs: tos().onchange=function(){execute('stopSleeping')} ( element )\\n\\tjs> body over appendChild \\\\ 要 append 才有作用。 ( element )\\n js: tos().click() ( element ) \\\\ @ HTA 回來就表示 user 已經完成操作, @ NW.js 則馬上回來。\\n\\t( minutes*60*1000 ) js> 5*60*1000 sleep ( element )\\n\\tjs> tos().value \\\\ 即使 timeout 也不管了 ( element path ) \\n\\tswap removeElement ; ( path ) \\n\\n: pickFile \\t\\t( -- \\\"pathname\\\" ) \\\\ Pick a file through web browser's GUI\\nchar input createElement ( element )\\ndup char type char file setAttribute ( element )\\ndup char class char pick_file setAttribute ( element ) \\\\ for debug, clue of the element\\n\\\\ For none 3hta only, setup the event handler\\njs> vm.appname!=\\\"jeforth.3hta\\\" if\\n\\tjs: tos().onchange=function(){execute('stopSleeping')} ( element ) then\\njs> body over appendChild \\\\ 要 append 才有作用。 ( element )\\njs: tos().click() ( element ) \\\\ @ HTA 回來就表示 user 已經完成操作, @ NW.js 則馬上回來。\\n\\\\ For none 3hta only, wait for the onchange event\\njs> vm.appname!=\\\"jeforth.3hta\\\" if\\n\\t( minutes*60*1000 ) js> 5*60*1000 sleep ( element ) then\\njs> tos().value \\\\ 即使 timeout 也不管了 ( element path ) \\nswap removeElement ; ( path ) \\n/// Works fine on 3hta and 3nw. The dialog works but returns Null string on 3htm \\n/// or C:\\\\fakepath\\\\__865.jpg on 3ce.\\n/// Through excel app's GetOpenFilename method can do the same thing:\\n/// excel.app js> pop().GETopenFILENAME <== with or w/o () both fine\\n/// Excel's GetSaveAsFilename method too.\\n\\n\\n\\n\\n[x] 3nw's js: storage.save(pathname) and js: storage.restore(pathname) work fine now.\\n[/] How about 3hta? <--- 3hta works fine already, forget it.\\n[x] 3nw should auto save and restore local storage. restore when start up, save when\\n any field is saved. So I don't need corresponding words for them.\\n\",\"mode\":true,\"readonly\":false}","node.js HTTP server":"{\"doc\":\"\\n\\\\ ~@~@~@~@~@~@~@~@~ Build Your First HTTP Server in Node.js ~@~@~@~@~@~@~@~@~\\n\\\\\\n\\\\ https://www.diigo.com/user/hcchen/b/373115646\\n\\\\ jeforth.3nw localsotrage field \\\"node.js HTTP server\\\"\\n\\\\ ~\\\\jeforth.3we\\\\3nd\\\\build_your_http_server.f \\n\\\\\\n\\n\\\\ Lets require/import the HTTP module and choose a port to listen\\n js> require('http') constant http // ( -- HTTP-object ) Get node.js http module\\n\\n\\\\ Lets define a port we want to listen to\\n 8080 constant PORT // ( -- port# ) Port number HTTP server listen to\\n\\n\\\\ We need a function which handles requests and send response\\n \\n \\n var f = function handleRequest(request, response){\\n response.end('It Works!! Path Hit: ' + request.url);\\n };f\\n constant handleRequest // ( -- func ) Request handler\\n \\n\\n\\\\ Callback triggered when server is successfully listening. Hurray!\\n \\n var f = function callback(){\\n type(\\\"Server listening on: http://localhost:\\\"+vm[context].PORT);\\n }; f\\n constant server-callback // ( -- func ) Call back function of the HTTP server\\n\\n\\\\ Create a server\\n http :> createServer(vm[context].handleRequest)\\n constant server // ( -- obj ) HTTP server object\\n\\n\\\\ Lets start our server\\n server :> listen(vm[context].PORT,vm[context][\\\"server-callback\\\"])\\n\\n\\\\ Your server should respond differently to different URL \\n\\\\ paths. This means we need a dispatcher. Dispatcher is kind \\n\\\\ of router which helps in calling the desired request handler \\n\\\\ code for each particular URL path. Now lets add a dispatcher \\n\\\\ to our program. First we will install a dispatcher module, \\n\\\\ in our case httpdispatcher. There are many modules available \\n\\\\ but lets install a basic one for demo purposes\\n\\n js> require('httpdispatcher') constant dispatcher // ( -- obj ) HTTP dispatcher\\n\\n\\n//Lets use our dispatcher\\nfunction handleRequest(request, response){\\n try {\\n //log the request on console\\n console.log(request.url);\\n //Disptach\\n dispatcher.dispatch(request, response);\\n } catch(err) {\\n console.log(err);\\n }\\n}\",\"mode\":true,\"readonly\":false}","pruning":"{\"doc\":\"\\n\\\\ Make the target page editable for pruning. 把 target page 搞成 editable 以便修剪。\\nactive-tab :> id tabid! document.getElementsByTagName(\\\"body\\\")[0].contentEditable=true \\n\",\"readonly\":true,\"mode\":true}","smde_MyUniqueID":"j e f o r t h . 3 w e\n==============\n**Forth** is the simplest programming language ever. The jeforth.**3we** project is an implementation based on a **3 Words Engine** from [project-k](http://github.com/hcchengithub/project-k) for many applications: *HTA (jeforth.3hta)*, *HTML (jeforth.3htm)*, *Chrome Extension (jeforth.3ca)*, *Node.js (jeforth.3nd)*, *Node-webkit or NW.js (jeforth.3nw)*, and probably more in the future. All of them have been tested on Windows 8 or Windows 10.\n\nPlay now\n===========\nAmong the many applications, jeforth for web page (jeforth.3htm) can run on your web browser right now thus is good for demonstration. \n\n#### [Solar system](http://rawgit.com/hcchengithub/jeforth.3we/master/index.html?cls_include_solar-system.f)\n[簡介](http://note.youdao.com/yws/public/redirect/share?id=94764cf57ba4365e2997f4a268ff7716&type=false) \n![enter image description here](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/solar-system.png)\n\n#### [H2O](http://rawgit.com/hcchengithub/jeforth.3we/master/index.html?cls_include_h2o.f)\n![enter image description here](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/h2o.png)\n\n#### [Alarm clock](http://rawgit.com/hcchengithub/jeforth.3we/master/index.html?cls_include_alarm.f_er)\n ![enter image description here](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/demo-alarm.png)\n \n#### [Box2Dweb Physics Engine demo - Arrows](http://rawgit.com/hcchengithub/jeforth.3we/master/index.html?cls_include_box2dweb-arrow.f)\n![enter image description here](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/demo-arrow.png)\n\n#### [Chipmunk Physics Engine demo - Pyramid Stack](http://rawgit.com/hcchengithub/jeforth.3we/master/index.html?cls_include_chipmunk-js-pyramidstack.f)\n![enter image description here](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/demo-pyramidstack.png)\n\n\nWhat else can you do with jeforth.3we?\n=============\n\n#### [Markdown editor](http://note.youdao.com/yws/public/redirect/share?id=1a8a342f3a9c1e0622a6050480af28b7&type=false)\n\nNW.js can access files in your local computer and also have all abilities like the Chrome browser, that allows jeforth.3nw to include JavaScript modules from the Internet. For example, [SimpleMDE](https://simplemde.com) is a Markdown Editor that works fine on jeofrth.3nw. \n\n![enter image description here](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/demo 3nw mde editor.JPG)\n\n\nGet source code, unzip, and start running\n=============\n\n| Item | Address |\n----------------|----------------------------------------------\n| jeforth.3we high level source code | *http://github.com/hcchengithub/jeforth.3we* |\n| Kernel, projectk.js 3-words-engine| *http://github.com/hcchengithub/project-k* |\n\n \nClick the [Download ZIP] button of both projects [jeforth.3we](https://github.com/hcchengithub/jeforth.3we) and [project-k](https://github.com/hcchengithub/project-k) on their GitHub web page to get them. Unzip jeforth.3we first and then unzip project-k to under the jeforth.3we directory, as shown in the below directory listing. Then you can run 3hta.bat without installing anything else if your computer is Windows 8 or Windows 10; or run 3nd.bat and 3nw.bat, if you have installed node.js and nw.js.\n\nMy jeforth.3we/ directory listing for example,\n\n![jeforth3we-dir.png](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/jeforth3we-dir.png)\n\n\n**Note:** Only for jeforth.3hta and only when you were **Download Zip** jeforth.3we from GitHub, It's necessary to use GNU tool [unix2dos](http://waterlan.home.xs4all.nl/dos2unix.html) to convert the new line characters of all text files [from Unix's LF to Windows' CRLF](https://en.wikipedia.org/wiki/Unix2dos). This is an example command line of the usage:\n\n d:\\jeforth.3we>for /R %G in (*.*) do d:\\bin\\unix2dos.exe \"%G\"\n\n \n\nIf you were **git clone https://github.com/hcchengithub/jeforth.3we** instead of **Download Zip** then forget this step, GitHub shell for Windows already converts new line characters to CRLF correctly. \n\nPresentation videos\n======\n\n| No. | Mandarin | English |\n--------|----------|---------\n| 1 | [Opening](http://www.camdemy.com/media/19253)| n/a |\n| 2 | [Run the HTML version online](http://www.camdemy.com/media/19254)| n/a |\n| 3 | [Run the HTML version on local computer](http://www.camdemy.com/media/19255)| n/a |\n| 4 | [Run the HTA version](http://www.camdemy.com/media/19256)| n/a |\n| 5 | [Run Node.js and Node-Webkit version](http://www.camdemy.com/media/19257)| n/a |\n| 6 | [F2 inputbox edit mode](http://www.camdemy.com/media/19258)| n/a |\n| 7 | [F4 Copy marked string to inputbox](http://www.camdemy.com/media/19259)| n/a |\n| 8 | [F5 Restart](http://www.camdemy.com/media/19260)| n/a |\n| 9 | [Bigger/Smaller input box](http://www.camdemy.com/media/19261)| n/a |\n| 10 | [Esc clear input box](http://www.camdemy.com/media/19262)| n/a |\n| 11 | [Tab auto-complete](http://www.camdemy.com/media/19263)| n/a |\n| 12 | [Enter jump into the input box](http://www.camdemy.com/media/19264)| n/a |\n| 13 | [Up/Down recall command history](http://www.camdemy.com/media/19265)| n/a |\n| 14 | [Alt-Up Reuse used commands](http://www.camdemy.com/media/19266)| n/a |\n| 15 | [Crtl- / Ctrl+ Zoom in/ Zoom out](http://www.camdemy.com/media/19267)| n/a |\n| 16 | [Ctrl-Break stop all tasks](http://www.camdemy.com/media/19268)| n/a |\n| 17 | [BackSpace trims the output box](http://www.camdemy.com/media/19269)| n/a |\n| 18 | [Help is helpful](http://www.camdemy.com/media/19270)| n/a |\n| 19 | [jsc JavaScript Console](http://www.camdemy.com/media/19271)| n/a |\n\nWhat to play in further depth\n========================\nDownload and setup the jeforth.3we directory and project-k directory as mentioned above.\n\n#### **HTA** / jeforth.3hta\nDouble click the **jeforth.3we/jeforth.hta** or execute the below DOS command line in a DOS box,\n```\njeforth.hta cls .' Hello world' cr 3000 sleep bye\n```\n![3htahello-world.png](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/3htahello-world.png)\n\nThe prior method runs self-test because there's no given task to do. The 2'nd method is expected to print 'Hello world' (as shown above) and return to DOS box after 3 seconds.\n\n\nNote! If you see the Windows error message : [\"Safety Settings on this computer prohibit accessing a data source on another domain\"](https://social.msdn.microsoft.com/Forums/en-US/becc982a-b693-49bb-8fb0-95847a3e96c7/hta-safety-settings-on-this-computer-prohibit-accessing-a-data-source-on-another-domain?forum=scripting) that I heard may happen on some Windows 7 computers. Sorry, [I have no solution yet](http://stackoverflow.com/questions/32177060/hta-safety-settings-on-this-computer-prohibit-accessing-a-data-source-on-anot), It didn't happen on those Windows 7 computers that I could reach. Please upgrade to Windows 8 or 10 to avoid from the problem.\n\n#### **Node.js** / jeforth.3nd\nMake sure you can run node.exe in a DOS box so you have setup the path. Make the jeforth.3we/ folder be your working directory. Execute one of the below demo command lines:\n```\nnode jeforth.3nd.js\nnode jeforth.3nd.js cls .' Hello world' cr bye\n```\nAgain, like the above HTA case, the prior command line does the self-test, and the 2'nd is expected to print 'Hello world'.\n\nWe have a local Web server written by jeforth.3nd itself. See jeforth.3we/Webserver.bat. Having a local Web server is necessary to run jeforth.3htm. \n\n#### **HTML** / jeforth.3htm\nSetup your local Web server by running jeforth.3we/Webserver.bat, \n\n![webserver.png](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/webserver.png)\n\nthen try to visit below URLs:\n```\nhttp://localhost:8888\nhttp://localhost:8888/index.html\nhttp://localhost:8888/index.html? cr .\" hello world\" cr cr \nhttp://localhost:8888/index.html?_cr_.\"_hello_world\"_cr_cr \nhttp://localhost:8888/index.html? .\" 8-) \" 100 nap rewind\nhttp://localhost:8888/index.html?_.\"_8-)_\"_100_nap_rewind\n```\nI have tested IE10 , IE11 and Chrome. Firefox or other web browsers are not tested yet. As shown above, we can put any forth words in the URL. That will be the task jeforth.3htm will do after start up and the self-test will be skipped when having a task to do.\n\n#### **Node-webkit** / jeforth.3nw\nSetup your Node.js and Node-Webkit path in prior. Refer to 3nw.bat as an example. Make jeforth.3we/ be your working directory, run either one of below command lines:\n```\nnw ../jeforth.3we\nnw ../jeforth.3we cls .' Hello World' 3000 sleep bye\n```\nThe prior runs self-test because there's no given task to do. The 2'nd is expected to print 'Hello world' and return to DOS box after 3 seconds.\n\t\nCompile eforth.com\n--------------------------\n\nJeforth.3nd for Node.js can be a handy x86 CPU assembler (any other CPU too). We have an example to compile the legendary eforth.com executable for 16 bits PC under MS-DOS by Bill Muench and C. H. Ting, 1990.\n\n 1. Install node.js correctly so you can run node.exe in a DOX box. Working directory at jeforth.3we/. \n 2. Run: node.exe jeforth.3nd.js include 86ef202.f bye\n 3. You got jeforth.3we/eforth.com\n 4. I have a 32bits windows 8, so I can run eforth.com directly. If your Windows system is 64 bits, you'll need a DOS virtual machine like vmware, virtual box, or I recommend DOSBox, to run the created eforth.com.\n\nExcel automation\n---------------------\nUse jeforth.3hta to manipulate excel spread sheets. This example gets a column from a reference excel file to your target excel file.\n\n 1. Double click on jeforth.3we/jeforth.hta to start it. After the self-test type the command line \"include merge2.f\" into the input box.\n 2. Or run the below command line directory for the same thing:\n```\njeforth.hta include merge2.f\n```\n\n#### The End\n\n - FigTaiwan [http://figtaiwan.org](http://figtaiwan.org) \n - H.C. Chen [hcchen5600@gmail.com](hcchen5600@gmail.com) \n - Written with [StackEdit](https://stackedit.io/)\n\n\n "}
\ No newline at end of file
+{"3nw working on simpleMDE":"{\"doc\":\"\\n[x] Now ^2016-05-06 14:29:46 developing SimpleMDE on 3nw \\n[x] pickFile can work on 3htm, 3nw, 3hta but only 3hta gets the pathname string, \\n others are \\\"\\\" due to security restrictions I believe. Is there a workaround?\\n [x] try answers on Stackoverflow.com \\n 1. http://jsfiddle.net/dwebexperts/4FGg8/1/\\n http://stackoverflow.com/questions/15201071/how-to-get-full-path-of-selected-file-on-change-of-input-type-file-using-jav\\n Introduces a temp_path , which is interesting but not good enough for my MDE because\\n [Save] button needs the real pathname.\\n\\n-----------------\\n\\n\\\\ Word does not work, mde-include not ok yet, but interpret mode works fine\\n\\n\\n.( Include SimpleMDE.js )\\n\\n\\tjs> typeof(SimpleMDE)!=\\\"function\\\" [if]\\n\\t\\t\\n\\t\\t \\n\\t\\t\\n\\t\\t drop \\n\\t[then]\\n\\tfalse ( assume include failed ) \\n\\t30 ( seconds ) [for] \\n\\t\\tjs> typeof(SimpleMDE)==\\\"function\\\" [if] \\n\\t\\t\\tr> drop 0 >r \\\\ break the loop\\n\\t\\t\\tdrop true ( include OK )\\n\\t\\t[else] \\n\\t\\t\\t20 nap .\\\" .\\\" \\\\ wait a while\\n\\t\\t[then] \\n\\t[next] \\n\\t[if] .\\\" Done. \\\" [else] .\\\" Error! Failed to include SimpleMDE! [then] cr\\n\\n.( Create the required textarea for SimpleMDE ) cr\\n\\n \\n js> $(\\\".console3we\\\")[0] insertBefore\\n\\n.( Launch SimpleMDE on the above textarea ) cr\\n\\n \\n var simplemde = new SimpleMDE({element: document.getElementById(\\\"simplemde\\\")}); \\n simplemde \\n \\n constant simplemde\\n\\n.( Load README.md ) cr\\n\\n char README.md readTextFile\\n simplemde :: value(pop())\\n\\t\\n\\\\ Above interpret procedure works fine.\\n\\n\\n\\\\ [x] mde ( -- ) \\\\ open Markdown editor \\n\\n: mde-include ( -- ok? ) \\\\ Inclde MDE editor \\n\\tjs> typeof(SimpleMDE)!=\\\"function\\\" if\\n\\t\\t\\n\\t\\t \\n\\t\\t\\n\\t\\t drop \\n\\tthen\\n\\tfalse ( assume include failed ) \\n\\t30 ( seconds ) for \\n\\t\\tjs> typeof(SimpleMDE)==\\\"function\\\" if \\n\\t\\t\\tr> drop 0 >r \\\\ break the loop\\n\\t\\t\\tdrop true ( include OK )\\n\\t\\telse \\n\\t\\t\\t1000 nap \\\\ wait a while\\n\\t\\tthen \\n\\tnext ;\\n\\n\\\\ execute the word does not work. But run on interpret mode always ok. Why?\\n\\\\ Even when it's not work, check the elements of link and script, they are existing:\\n\\tjs> $(\\\"head\\\")[0] ce! ce 09 ce@ :> outerHTML .\\n\\tjs> $(\\\"head\\\")[0] ce! ce 10 ce@ :> outerHTML .\\n\\nstop \\n---------------\\n[x] 所有在 .console3we 範圍內的 textarea 都會在 F2 edit mode focused 時變成粉紅色。 ed 的亦然。\\n 把 ed 移出 .console3we 之外 (而非光 outputbox 之外) 就會失去所有的 .console3we style. 如下,\\n > js> $(\\\".eb\\\")[0] js> $(\\\".console3we\\\")[0] insertBefore\\n ==> 所以, SimpleMDE init textarea 要移出 .console3we 之上才行. \\n[x] Go on use the knowledge to fine tune 3we's style settings.\\n --> study common.css first \\n --> but I already use .console3we to constraint the range!\\n ==> 所以, SimpleMDE init textarea 要移出 .console3we 之上才行. \\n\\n\\\\ ^^2016-05-04 11:57:32^^ \\n\\\\ (@ 3nw) 改照抄 official demo page 上的 resource 也行, 但是問題還是一樣。\\n\\\\ 可見是 jeforth 的 style 造成的問題。 \\n\\\\ [x] 下一步, 3nw 的 style 反璞歸真, 或限制範圍。 ==> Bingo!! See Ynote \\n\\\\ \\\"SimpleMDE works fine on jeforth.3nw now\\\" \\n\\n\\n\\\\ Include SimpleMDE\\n\\n \\n < link rel=\\\"stylesheet\\\" href=\\\"https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css\\\"> \\n < script src=\\\"https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js\\\">\\n drop\\n js> typeof(SimpleMDE) tib. \\\\ ==> function (string) so it has been installed\\n\\n\\\\ Create a textarea\\n\\n \\n js> $(\\\".console3we\\\")[0] insertBefore\\n\\n\\\\ Launch SimpleMDE on the above textarea\\n\\n \\n var simplemde = new SimpleMDE({element: document.getElementById(\\\"simplemde\\\")}); \\n simplemde \\n \\n constant simplemde\\n\\n\\\\ Test, set the content\\n\\n simplemde pop().value(\\\"This text will appear in the editor\\\"); \\n\\n\\\\ Test, get the content\\n\\n simplemde :> value() \\\\ ==> # This text will appear in the editor (string)\\n\\n-----------------------------\\nStudy https://simplemde.com/ so as to copy the usage\\n\\n\\\\ 瞧瞧 body\\n > js> $(\\\"body\\\")[0] ce! ce\\n [object HTMLBodyElement] innerHTML=
\\n\\n\\nThe problem with lists, is that you can't make the looks of the list be \\ndifferent than from the text. The number of the list always must have the \\nsame color and font as the text.\\n
\\nBut, by adding an extra element in the list-item, you can work around these \\nlimitations and create a very slick list. Here's how to do it:\\n\\n
\\n
The Netherlands is a country in ...sfssd sdflsdj sdfjs djs
dfsdf sdf
jsdfs
\\n
The United States of America is a federal constitutional ...
\\n
The Philippines officially known as the Republic ...
\\n
The United Kingdom of Great Britain and ...
\\n \\n
\\n\\n\\n\\n
\\n\\nYou can change the bullet style of an unorered list to some other build-in \\nvalues, but you can also change them into an image. This technique can make \\nyour list even prettier. Let's see how this is done.\\n
\\n
Java
\\n
.NET
\\n
C++
\\n
PHP
\\n
\\n
\\n\\n\\n\\nThis list is taken from the the iPhone Contacts App with CSS and jQuery. \\nIt shows the Contacts.app style list as you can see them on the iPhone. \\nJust a little bit more eye candy for your web site.\\n\\n
\\n\\nNested lists (lists inside lists) can be extremely useful and beautiful to style. \\nBy combining the third technique (Image bullets), we can create a \\\"expanded list\\\". \\nOf course, with the help of jQuery, you can make this expanding even work (but we'll \\nstick to CSS techniques only).\\n \\n
Google\\n \\n
Picasa
\\n
Feedburner
\\n
Youtube
\\n \\n
\\n
Microsoft\\n \\n
Corel Corporation
\\n
Zignals
\\n
ByteTaxi
\\n \\n
\\n
Yahoo!\\n \\n
Xoopit
\\n
BuzzTracker
\\n
MyBlogLog
\\n \\n
\\n \\n
\\n\\n\\n\\n
\\nBy default, an ordered list uses numbers (1, 2, 3, 4 etc.) as list style type. \\nBy changing this value in CSS, you can create other numbering systems, for \\nexample the roman numbering style.\\n
\\nAlso by default, a list displays it's bullets outside of the elements \\n(you can see this pretty good in example #2 - different font for numbering). \\nTo get around this, we'll need to change the list-style-position to make the \\nnumbering display inside.\\n\\n
\\n
Lorem ipsum dolor sit amet, ... Fusce sit amet ...
\\n
Aenean placerat lectus tristique... Vivamus interdum ...
\\n
Mauris eget sapien arcu, vitae... Phasellus neque risus...
\\n
Phasellus feugiat lacus ... Duis rhoncus ...
\\n \\n
\\n\\n\\n\\n
\\n\\n
Lists are mostly used to display a number of items under each other,\\nin a totally new element. But what if you wanted an inline list? You \\ncan achieve this, by setting the display property to inline. But when \\nyou're in text, you can prefer to make it a comma seperated list. How \\nto achieve this? With the :after pseudo code.\\n
\\n
First inline item
\\n
Second inline item
\\n
Third inline item
\\n
Fourth inline item
\\n
\\n
\\n\\n\\n\\n
\\n
Here's a last small technique that works with CSS3 \\n(Supported by the latest versions of Firefox, Safari, HTA and Chrome). \\nWhen hovering a block element, you'll get a rotated hover state. \\nMight not be that useful, but it can be beautiful to see.
\\n\\n\\n\",\"mode\":true,\"readonly\":false}","Log 2016/4/8":"{\"doc\":\"[x] 3nw's js: storage.save(pathname) and js: storage.restore(pathname) work fine now.\\n[/] How about 3hta? <--- 3hta works fine already, forget it.\\n[x] 3nw should auto save and restore local storage. restore when start up, save when\\n any field is saved. So I don't need corresponding words for them.\\n\\n[x] How to change SimpleMDE font family and font size?\\n > js> $(\\\".mdbox\\\").css(\\\"font-size\\\") . \\\\ ==> 20px OK \\n > js> $(\\\".mdbox\\\").css(\\\"font-family\\\") . \\\\ ==> 'Microsoft Yahei' OK \\n \\\\ 改 font-size\\n js> $(\\\".mdbox\\\").css(\\\"font-size\\\",\\\"18px\\\");$(\\\".mdbox\\\").css(\\\"font-size\\\") tib.\\n \\\\ 改 font-family\\n $(\\\".mdbox\\\").css(\\\"font-family\\\",\\\"courier\\\");$(\\\".mdbox\\\").css(\\\"font-family\\\") tib.\\n $(\\\".mdbox\\\").css(\\\"font-family\\\",\\\"Microsoft Yahei\\\");$(\\\".mdbox\\\").css(\\\"font-family\\\") tib.\\n\\n[x] 控制 SimpleMDE -- height\\n js> $(\\\".CodeMirror\\\").css(\\\"height\\\",\\\"550px\\\");$(\\\".CodeMirror\\\").css(\\\"height\\\") tib. \\\\ <---- it works!\\n > js> $(\\\".CodeMirror\\\").css(\\\"width\\\",\\\"90%\\\") . \\\\ <---- it works\\n [object Object] OK \\n > js> $(\\\".CodeMirror\\\").css(\\\"width\\\") . \\\\ ==> 1013px OK \\\"90%\\\" expected but it's in pixel.\\n > js> $(\\\".CodeMirror\\\").css(\\\"height\\\") . \\\\ ==> 300px OK 表示有機會\\n [object Object] OK \\n > js> $(\\\".CodeMirror\\\").css(\\\"height\\\",\\\"250px\\\") . <---- it works! \\n [object Object] OK \\n > js> $(\\\".CodeMirror\\\").css(\\\"height\\\",\\\"200px\\\") . <---- 自動 變成 300px, 有防呆機制。\\n [object Object] OK \\n > js> $(\\\".CodeMirror\\\").css(\\\"height\\\") . \\\\ ==> 300px OK \\n\\n[x] SimpleMDE 有個問題, 讀入新檔時, 若原先在 Preview mode 因為不會自動切成\\n edit mode 看起來好像無反應。 --> 自動先切成 edit mode 然後才讀進檔案。\\n Full screen & side-by-side 根本碰不到 [Load] button 因此不用考慮。\\n [x] Check SimpleMDE current mode\\n > js> $(\\\".md\\\").length . \\\\ ==> 1 OK \\n > js> $(\\\".md\\\")[0].mde . \\\\ ==> [object Object] OK \\n > js> $(\\\".md\\\")[0].mde.isPreviewActive() . \\\\ ==> false OK \\n > js> $(\\\".md\\\")[0].mde.isSideBySideActive() . \\\\ ==> false OK \\n > js> $(\\\".md\\\")[0].mde.isFullscreenActive() . \\\\ ==> false OK \\n [x] Alert() when in preview mode.\\n\\n[x] to play flot, need to read markdown document in flot project, so \\n [x] try \\\"simplemde\\\" first <--- which is done now ^2016-05-10 09:02:53 \\n\\n[ ] index.html 這段舊方法應該可以糾正了, 用 element.style. something 取代原來的寫法\\n \\n \\n\\n[ ] stopSleeping 要更有彈性點\\n JavaScript error on word \\\"stopSleeping\\\" : \\n Object doesn't support property or method 'resume'\\n\\n\\n[x] design pickFile for 3nw\\n --> see Ynote: \\\"jeforth.3we fix pickFile problem on 3nw. Get full path of local file\\\"\\n\\n[x] on 3NW,\\n var simplemde = new SimpleMDE();simplemde constant simplemde\\n --> JavaScript error : SimpleMDE is not defined <-- Use BootCDN.cn can be better\\n The including process takes time too. \\n --> Check SimpleMDE where went? <--- window.SimpleMDE() is a function which\\n is the constructor.\\n\\nstop\\n[/] to play flot, need to read markdown document in flot project, so try \\\"simplemde\\\" first\\n\\nchar ../simplemde-markdown-editor/src/css/simplemde.css readTextFile .\\nchar ../simplemde-markdown-editor/src/js/simplemde.js readTextFile .\\n \\n[x] NW.js is buggy. textarea wrap=off does not work !! --> Upgrade to new version then ok.\\n nwjs-sdk-v0.14.3-win-x64.zip is OK. pickFile oncancel() event is also requiring the new\\n NW.js. \\n\\n[ ] (on 3HTA) ls.f ed issue: \\n Very strange bug\\n These two lines will be executed when click [Read] button\\n \\n
\\n \\n
\\n --> and JavaScript error on word \\\"doElement\\\" : 發生錯誤,無法完成操作 80020101。\\n --> The most strange is that, may because of the same reason, simpleMDE.js alredy\\n included in 3NW !!\\n js> $(\\\"script\\\").length . \\\\ ==> 4\\n js> $(\\\"script\\\")[3].src . \\\\ ==> file:///C:/Users/hcche/Documents/GitHub/simplemde-markdown-editor/src/js/simplemde.js\\n\\n\\nstop\\njs> vm.appname==\\\"jeforth.3hta\\\" [if] char js/numeric-1.2.6.js\\n[else] char http://www.numericjs.com/lib/numeric-1.2.6.js [then]\\nreadTextFile \\\\ 先讀取 .js 檔, 但不能直接用\\n \\nwindow.numeric = numeric; // 先對 source 做一點必要的加工, 把 numeric 掛上 global \\n + \\\\ 然後才執行\\t\\n\\nstop\\n\\n[ ] 菴中自題 宋 釋顯萬 萬松嶺上一間屋 老僧半間雲半間 雲自三更去行雨 歸來方羨老僧閒\\n[ ] How to include numeric.js? It needs a workaround.\\n In example of jeforth.3we\\\\js\\\\numeric-1.2.6.js, it does not work to:\\n include.js http://rawgit.com/hcchengithub/jeforth.3we/develop/js/numeric-1.2.6.js \\n because the module assumes itself is included by HTML head while it's not in this case.\\n Note: It does not work due to that is volatile in 3nw, 3htm, 3ce and 3hta, \\n while it's under global in Node.js.\\n --> Workaround is:\\n char http://www.numericjs.com/lib/numeric-1.2.6.js\\n \\\\ char http://rawgit.com/hcchengithub/jeforth.3we/develop/js/numeric-1.2.6.js \\n\\treadTextFile \\\\ 先讀取 .js 檔, 但不能直接用\\n\\t \\n\\twindow.numeric = numeric; // 先對 source 做一點必要的加工, 把 numeric 掛上 global \\n\\t + \\\\ 然後才執行\\t\\n --> Youtube presentation\\n\\t\\n[ ]\\ttutor-cloth.f console3we strange. \\n\\t[ ] Improve the scrollto position. \\n\\t[ ] Font size not consistant either.\\n\\t\\n: snapshot ( -- ) \\\\ Save outputbox to a ed\\n (ed) ( eb ) now t.dateTime ( eb now ) js: $(\\\".ebname\\\",tos(1))[0].value=pop()\\n js: $(\\\".ebtextarea\\\",tos())[0].value=outputbox.innerHTML ( eb ) \\\\ load the content\\n dup eb.content.code dup eb.appearance.browse ( eb ) \\\\ correct appearance mode\\n js: $(\\\".ebsaveflag\\\",pop())[0].checked=false \\\\ Not saved yet, up to users decision\\n ;\\n\\nstop\\n dup eb.content.browse eb.appearance.browse ;\\n\\nstop\\n[ ] log.save goes to local storage. No more log.things will be added.\\n[x] check HTML li il or something else that support \\\"[ ]\\\" and indent.\\n --> play with this article http://www.marcofolio.net/css/8_different_ways_to_beautifully_style_your_lists.html\\n --> Use the old way, accept it.\\n[ ] let support comments but be careful, ... no no problem.\\n[ ] GitHub read me should feature the published 3ce Chrome extension.\\n[ ] what if local storage usage become huge? An archive method is needed.\\n\\n\\n[x] optimize [x]platform.f ls.f and editor.f\\n --> forget it. Let things come out as it be.\\n[x] Ctrl-s 竟然會自動補上 HTML closing tag !! \\n --> it seems like editor.f's Ctrl-S. --> Yeah, seems be.\\n[x] HTA can open only one window, don't know why. Use that one anyway.\\n[/] improve (export) , it's ok now but ugly.\\n Use local-storage-field-editable? to improve it.\\n --> Let it be, we have better things to do.\\n\\nstop\\neb.open check it out, if ok, go on, if not, JSON.stringify() can make it a string and show.\\nand by the way make it a readonly.\\n[x] how about an array? field is array and stringify is ok.\\n ==> stringify() can handle anything if only not a recursing object.\\n\\nstop\\n--- marker --- dropall cls \\n: local-storage-field-editable? ( name -- field boolean ) \\\\ Check if the object is a local storage editable document\\n js> storage.get(pop()) >r \\n js> typeof(rtos())==\\\"object\\\" if\\n js> typeof(rtos().doc)==\\\"string\\\"\\n js> typeof(rtos().mode)==\\\"boolean\\\"\\n js> typeof(rtos().readonly)==\\\"boolean\\\"\\n and and ( boolean )\\n else \\n false ( boolean )\\n then r> swap ;\\nchar autoexec local-storage-field-editable? .s\\nstop\\n\\n--- marker --- dropall cls \\n: local-storage-field-editable? ( name -- field boolean ) \\\\ Check if the object is a local storage editable document\\n js> storage.get(pop()) ( field ) \\n js> typeof(tos())==\\\"object\\\" if\\n js> typeof(tos().doc)==\\\"string\\\" ( field boolean ) \\n js> typeof(tos(1).mode)==\\\"boolean\\\" ( field boolean boolean ) \\n js> typeof(tos(2).readonly)==\\\"boolean\\\" ( field boolean boolean boolean ) \\n and and ( field boolean )\\n else \\n false ( field boolean )\\n then ;\\nchar x local-storage-field-editable? .s\\nstop\\njs> storage.get(\\\"autoexec\\\") js> typeof(pop()==\\\"object\\\") . \\nstop \\n\\njs: storage.set(\\\"x\\\",{aa:11})\\njs: storage.set(\\\"y\\\",\\\"我的大好是天\\\")\\njs: storage.set(\\\"z\\\",[\\\"aa\\\",123,\\\"bb\\\"])\\n\\nstop\\njs> storage.get(\\\"autoexec\\\") js> typeof(tos().doc)==\\\"string\\\"&&typeof(tos().mode)==\\\"boolean\\\"&&typeof(tos().readonly)==\\\"boolean\\\" .\\n\\n\\nstop\\n\\n[x] I twisted the ls.f to bring in the older code into new eb format of \\n doc,readonly,mode and it works for autoexec but can't edit unless \\n after saved!!?? --> fixed, haha bug.\\n\\n[x] The problem of local storage edit box lose the focus to inputbox has fixed.\\n I already have a treatment in forthConsoleHandler() for Ctrl-Enter to NOT focus on \\n to inputbox after running a TIB. So, simply do inputbox.blur() has solved the \\n problem. -- 2016/4/29 13:51\\n\\n
\\n[x] Local storage fields may not edit box document. How to avoid them from being opened by\\n edit box? \\n An edit box document is a local storage field that has \\n {doc,readonly,mode} fields.\\n So this is enough to tell.\\n\\n
\\n[x] Move older log to local storage.\\n\\n[x] let ed command take the field name, makes list easier too. --> done.\\n\\n[x] Now I hope that I can use some script in tr.table. So I can click and run scripts.\\n That requires a Security Policy:\\n Refused to execute inline event handler because it violates the following Content \\n Security Policy directive: \\\"script-src 'self' 'unsafe-eval'\\\". Either the 'unsafe-inline' \\n keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline \\n execution.\\n But after added 'unsafe-inline' into \\\"content_security_policy\\\", reload manifest.json gets\\n this error :\\n\\t\\t嘗試安裝這項擴充功能時顯示警告訊息:\\n\\t\\tIgnored insecure CSP value \\\"'unsafe-inline'\\\" in directive 'script-src'.\\n\\tSo, the only way is to use a function directly.\\n\\t--> 奇怪了, 那 jeforth.3ce 已經在用的 script 是怎麼能跑的?\\n\\t\\t--> inputbox 是收 element.onkeydown , defined in jeforth.3htm.js and platform.f\\n\\t\\t\\t只要不是 inline 形式的 onclick=\\\"blabla\\\" 就可以了。(嗎)\\n\\t\\t--> 那對 jeforth 很簡單哪! 先取得 element 再幫他掛上 element.onxxxx=function 即可。\\n\\t\\t\\telement.onxxxx=debugger; <--- Failed, 'degugger' unknown.\\n\\t\\t\\telement.onxxxx=\\\"dictate('blabla')\\\" <--- no error, but element.onxxxx will be null.\\n\\t\\t\\telement.onxxxx=function(){debugger} <--- OK!! 'this' is the element.\\n\\t\\t\\th1 :: onclick=function(e){dictate('.s')} <--- OK!!! it works fine.\\n\\t==> 結論就是不要寫成 inline script 就行了, 那沒問題呀!\\n\\t--> See Ynote: jeforth.3ce let tr.table to have script, do-able!\\n\\n[x] is#text? paste-string erase-#text-anchorNode\\n ==> See Ynote: jeforth.3ce window.getSelection() 得到的 Selection object \\n 是揮發性的!不能留下來以後用。\\n\\n[x] project-k baby.html, sample.html 突然 run 起來之後 Ctrl-enter 沒有作用, F12 debugger 才看得見\\n 問題, 原來是 jQuery 掛不起來:\\n Failed to load resource: net::ERR_NAME_NOT_RESOLVED http://ajax.microsoft.com/ajax/jQuery/jquery-1.11.2.js\\n baby.html:48 Uncaught ReferenceError: jQuery is not defined\\n 這常有, 應該要有警告。\\n 這是 GFW 的問題, 透過 VPN 就好了。中國境內有沒有 jQuery 的 mirror?\\n --> Yes! Baidu, Sina, and UpYun. Search \\\"CDN Library\\\" or \\\"Hosted JavaScript Libraries in China\\\"\\n in my YNote. Project-K samples already modified to use Baidu CDN library. Better now.\\n\\n[x] 14:21 2016-04-12 jeforth.3ce startup page to advertise itself. Use YNote directly.\\n cls er\\t\\n\\t\\n[x] Include .f or .js from GitHub is ok! Wonderful! \\n This line works fine on the published jeforth.3ce which was installed from Chrome Web Store,\\n include http://rawgit.com/hcchengithub/jeforth.3we/develop/3htm/f/ls.f \",\"mode\":true,\"readonly\":false}","Play Flot":"{\"doc\":\"\\n \\\\ Flot.js demo GitHub\\\\flot\\\\examples\\\\basic-usage\\\\index.html\\n\\n \\\\ Prepare the Flot ploting zone\\n\\n ' flotzone [if] [else] \\n constant flotzone // ( -- DIV ) Place for Flot plotings avoid CSS conflict.\\n \\\\ flotzone :: style.background=\\\"transparent\\\"\\n js: $(\\\"div\\\",\\\".console3we\\\").css(\\\"backgroundColor\\\",\\\"transparent\\\")\\n flotzone js> $(\\\".console3we\\\")[0] insertBefore\\n [then]\\n\\n \\\\ Include CSS and Flot.js\\n \\n js> typeof($.plot)!=\\\"function\\\" [if] \\n \\n <--!link id=flotcss href=\\\"../flot/examples/examples.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\"-->\\n \\n drop\\n\\n \\\\ Wait a while, make sure Flot.js is ready\\n .( $.plot readiness check .)\\n ( seconds * 1000 / nap ) js> 60*1000/200 [for] \\n js> typeof($.plot)==\\\"function\\\" [if] \\n r> drop 0 >r \\\\ break the loop\\n [else] \\n 200 nap .\\\" .\\\" \\\\ wait a while\\n [then] \\n [next] cr\\n [then]\\n \\n \\\\ Demo #1\\n \\\\ Create the placeholder\\n\\n flotzone\\n ( placeholer1 )\\n appendChild\\n\\n \\\\ Plot a line \\n \\n js: $.plot($(\\\"#placeholder1\\\"),[[[0,0],[1,1]]],{yaxis:{max:1}})\\n\\n \\\\ Demo #2\\n \\\\ Create the placeholder\\n\\n flotzone\\n ( placeholer2 )\\n appendChild\\n\\n \\\\ Plot some lines\\n \\n \\n $(function() {\\n\\n var d1 = [];\\n for (var i = 0; i < 14; i += 0.5) {\\n d1.push([i, Math.sin(i)]);\\n }\\n\\n var d2 = [[0, 3], [4, 8], [8, 5], [9, 13]];\\n\\n // A null signifies separate line segments\\n\\n var d3 = [[0, 12], [7, 12], null, [7, 2.5], [12, 2.5]];\\n\\n $.plot(\\\"#placeholder2\\\", [ d1, d2, d3 ]);\\n\\n // Add the Flot version string to the footer\\n\\n $(\\\"#footer\\\").prepend(\\\"Flot \\\" + $.plot.version + \\\" – \\\");\\n });\\n \\n\\n[ ] flotzone 目前必須放在 .console3we 之外才行, 希望能放在 outputbox 裡面, 做實驗方便。\\n[/] How to clear inherited CSS style for the flotzone element?\\n See 3hta local storage field \\\"Study remove CSS style for an element\\\"\\n --> 不成功, 用 Yahoo CSS reset 也不行。 甚至把 jeforth.3we 本身的 common.css 取消了也不行。\\n[x] 在 outputbox 裡一片白的 flotzone 經 insertBefore 到 .console3we 之上, 還是一片白。\\n[x] 那反過來呢? **在外成功之後** 搬進來如何? --> still failed. But then move out will be ok!\\n flotzone js> inputbox insertBefore \\\\ failed\\n flotzone js> header insertBefore \\\\ ok\\n js> body flotzone appendChild \\\\ ok 只要搬出 .console3we 都 ok\\n\\n[ ] 研究如何 dump 整個 style of an element 來查看\\n js> header.style obj>keys .\\n js> $(\\\".console3we\\\")[0].style obj>keys .\\n\\n[ ] 用 xjeforth.hta <--- 改過, 試試看到底為何 進 console3we 就不行\\n --> 上面說本來不行的搬出去也不行, 現在用 xjeforth.hta, 可能是因為經過簡化, 本來在 outputbox 裡不行的\\n 變成搬出去就可以了。\\n --> 繼續簡化...把 inputbox, outputbox 搬出 .console3we 之外, 終於可以成功地把 flot charts 放進\\n outputbox 了!\\n[ ] Flot.js 於 style.background 有細微的問題。我報了 bug on Flot.js GitHub Issue : \\n https://github.com/flot/flot/issues/1497\\n Or refer to YNote: \\\"Flot bug of graph disappear reproduced. How to fix it\\\"\\n 試圖研究在用到 flot.js 時把 .console3we 的 style 重新定義, 例如把 background 去掉, 就\\n 可以在 outputbox 裡正常運作了。\\n flotzone js> outputbox insertBefore \\\\ 搬到 outputbox 之前仍在 .console3we 裡複製出問題.\\n 查看 style tags 找到 console3we 的 background\\n 把它改成 transparent 試試看.\\n[x] > js> $(\\\"style\\\").length . \\\\ ==> 4 OK \\n 這 4 個裡面不含 common.css 的定義! 所以我以前就說 inputbox 要變粉紅色得分開弄一個 style 原因\\n 可能就是這個。 \\n\\n > js> $(\\\"style\\\")[0].outerHTML .\\n OK \\n\\n > js> $(\\\"style\\\")[1].outerHTML .\\n OK \\n\\n > js> $(\\\"style\\\")[2].outerHTML .\\n OK \\n\\n > js> $(\\\"style\\\")[3].outerHTML .\\n OK \\n\\n[ ] 蓋過去行不行? --> 3hta 不行。似乎 common.css 用了 link tag 就不能改了,讀進來執行的方式才可以修改。\\n js> $(\\\".console3we\\\").length . \\\\ ==> 1 OK \\n js> $(\\\".console3we\\\")[0].style . \\\\ ==> [object MSStyleCSSProperties] OK \\n js> $(\\\".console3we\\\")[0].style.background . \\\\ ==> null string\\n js> $(\\\".console3we\\\")[0].style.backgroundddd . \\\\ ==> undefined OK \\n js: $(\\\".console3we\\\")[0].style.background=\\\"transparent\\\"\\n js> $(\\\".console3we\\\")[0].style.background . \\\\ ==> none OK \\n\\n\\n\",\"mode\":true,\"readonly\":false}","Play flot on 3nw":"{\"doc\":\"\\n \\\\ Flot.js demo GitHub\\\\flot\\\\examples\\\\basic-usage\\\\index.html\\n\\n \\\\ Prepare the Flot ploting zone\\n\\n ' flotzone [if] [else] \\n constant flotzone // ( -- DIV ) Place for Flot plotings avoid CSS conflict.\\n flotzone js> $(\\\".console3we\\\")[0] insertBefore\\n [then]\\n\\n \\\\ Include CSS and Flot.js\\n \\n js> typeof($.plot)!=\\\"function\\\" [if] \\n \\n <--!link id=flotcss href=\\\"../flot/examples/examples.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\"-->\\n \\n drop\\n\\n \\\\ Wait a while, make sure Flot.js is ready\\n .( $.plot readiness check .)\\n ( seconds * 1000 / nap ) js> 60*1000/200 [for] \\n js> typeof($.plot)==\\\"function\\\" [if] \\n r> drop 0 >r \\\\ break the loop\\n [else] \\n 200 nap .\\\" .\\\" \\\\ wait a while\\n [then] \\n [next] cr\\n [then]\\n \\n \\\\ Demo #1\\n \\\\ Create the placeholder\\n\\n flotzone\\n ( placeholer1 )\\n appendChild\\n\\n \\\\ Plot a line \\n \\n js: $.plot($(\\\"#placeholder1\\\"),[[[0,0],[1,1]]],{yaxis:{max:1}})\\n\\n \\\\ Demo #2\\n \\\\ Create the placeholder\\n\\n flotzone\\n ( placeholer2 )\\n appendChild\\n\\n \\\\ Plot some lines\\n \\n \\n $(function() {\\n\\n var d1 = [];\\n for (var i = 0; i < 14; i += 0.5) {\\n d1.push([i, Math.sin(i)]);\\n }\\n\\n var d2 = [[0, 3], [4, 8], [8, 5], [9, 13]];\\n\\n // A null signifies separate line segments\\n\\n var d3 = [[0, 12], [7, 12], null, [7, 2.5], [12, 2.5]];\\n\\n $.plot(\\\"#placeholder2\\\", [ d1, d2, d3 ]);\\n\\n // Add the Flot version string to the footer\\n\\n $(\\\"#footer\\\").prepend(\\\"Flot \\\" + $.plot.version + \\\" – \\\");\\n });\\n \\n\\n[ ] flotzone 目前必須放在 .console3we 之外才行, 希望能放在 outputbox 裡面, 做實驗方便。\\n[/] How to clear inherited CSS style for the flotzone element?\\n See 3hta local storage field \\\"Study remove CSS style for an element\\\"\\n --> 不成功, 用 Yahoo CSS reset 也不行。 甚至把 jeforth.3we 本身的 common.css 取消了也不行。\\n[x] 在 outputbox 裡一片白的 flotzone 經 insertBefore 到 .console3we 之上, 還是一片白。\\n[x] 那反過來呢? **在外成功之後** 搬進來如何? --> still failed. But then move out will be ok!\\n flotzone js> inputbox insertBefore \\\\ failed\\n flotzone js> header insertBefore \\\\ ok\\n js> body flotzone appendChild \\\\ ok 只要搬出 .console3we 都 ok\\n\\n[ ] 研究如何 dump 整個 style of an element 來查看\\n js> header.style obj>keys .\\n js> $(\\\".console3we\\\")[0].style obj>keys .\\n\\n[ ] 用 xjeforth.hta <--- 改過, 試試看到底為何 進 console3we 就不行\\n --> 上面說本來不行的搬出去也不行, 現在用 xjeforth.hta, 可能是因為經過簡化, 本來在 outputbox 裡不行的\\n 變成搬出去就可以了。\\n --> 繼續簡化...把 inputbox, outputbox 搬出 .console3we 之外, 終於可以成功地把 flot charts 放進\\n outputbox 了!\\n[ ] Flot.js 於 style.background 有細微的問題。我報了 bug on Flot.js GitHub Issue : \\n https://github.com/flot/flot/issues/1497\\n Or refer to YNote: \\\"Flot bug of graph disappear reproduced. How to fix it\\\"\\n 試圖研究在用到 flot.js 時把 .console3we 的 style 重新定義, 例如把 background 去掉, 就\\n 可以在 outputbox 裡正常運作了。\\n flotzone js> outputbox insertBefore \\\\ 搬到 outputbox 之前仍在 .console3we 裡複製出問題.\\n 查看 style tags 找到 console3we 的 background\\n 把它改成 transparent 試試看.\\n[x] > js> $(\\\"style\\\").length . \\\\ ==> 4 OK \\n 這 4 個裡面不含 common.css 的定義! 所以我以前就說 inputbox 要變粉紅色得分開弄一個 style 原因\\n 可能就是這個。 \\n\\n > js> $(\\\"style\\\")[0].outerHTML .\\n OK \\n\\n > js> $(\\\"style\\\")[1].outerHTML .\\n OK \\n\\n > js> $(\\\"style\\\")[2].outerHTML .\\n OK \\n\\n > js> $(\\\"style\\\")[3].outerHTML .\\n OK \\n\\n[ ] 蓋過去行不行?\\n js> $(\\\".console3we\\\").length .\\n\\n\\n\",\"mode\":true,\"readonly\":false}","Play with numeric.js":"{\"doc\":\"\\n\\n\\ncls \\n\\\\ Linear algebra example. We start with a matrix.\\n\\nvar A = [[1,2,3],\\n [4,5,6],\\n [7,3,9]]; A value A\\n\\n\\\\ Let's also make a vector.\\n var x = [3,1,2]; x value x\\n\\n\\\\ Matrix-vector product. b = A (.) x\\n var b = numeric.dot(vm.g.A,vm.g.x); b value b b (see)\\n\\n\\\\ Matrix inverse. ~A \\n var Ainv = numeric.inv(vm.g.A); Ainv value Ainv \\nAinv (see)\\n\\n\\\\ Let's check it: ~A (.) b = x Bingo!!!!\\n numeric.dot(vm.g.Ainv,vm.g.b); (see)\\n\\n\\\\ Determinant\\n numeric.det(vm.g.A); cr tib. \\n\\n\\\\ Sin wave\\n var x = numeric.linspace(0,6.3,25); x to x x (see)\\n\\n var y = numeric.sin(vm.g.x); y value y y (see)\\n\\n\\n\\n\\nstop\\njs> numeric tib.\\n\\nstop\\njs> vm.appname==\\\"jeforth.3hta\\\" [if] char js/numeric-1.2.6.js\\n[else] char http://www.numericjs.com/lib/numeric-1.2.6.js [then]\\nreadTextFile \\\\ 先讀取 .js 檔, 但不能直接用\\n \\nwindow.numeric = numeric; // 先對 source 做一點必要的加工, 把 numeric 掛上 global \\n + \\\\ 然後才執行\\t\\n\\nstop\\n\\\\ Also hosted on BootCDN.cn\\n\\\\ http://cdn.bootcss.com/numeric/1.2.6/numeric.js\\n\\n\\\\ These lines works fine! Test ok on 3ce, 3hta ADO reads only local files\\n\\\\ so the path should be only \\\"js/numeric-1.2.6.js\\\",\\n\\nchar http://localhost:8888/js/numeric-1.2.6.js readTextFile tib.\\nchar http://www.numericjs.com/lib/numeric-1.2.6.js readTextFile tib.\\nchar http://www.numericjs.com/lib/numeric-1.2.6.min.js readTextFile tib.\\n\\n\\n\",\"mode\":true,\"readonly\":false}","Study XMLHttpRequest object 2016-07-06":"{\"doc\":\"[ ] Study how to *write* files to local disk on super-chrome jeforth.3htm\\n --> 先前有找到過一個例子, 可以把網頁上的 pictures drag-drop 一下就 save 成 local file\\n Ynote: \\\"jeforth 研究 Chrome extension 存檔到本地 disk 的方法\\\" the thing is \\\"XMLHttpRequest\\\" \\n --> Study XMLHttpRequest @ http://www.w3school.com.cn/xml/xml_http.asp\\n var x =new XMLHttpRequest(); x constant xmlhttp // ( -- obj ) XMLHttpRequest object\\nxmlhttp :: open(\\\"GET\\\",\\\"a.html\\\",true)\\nxmlhttp :: send(null)\\ntry on 3hta ... error : access denied\\ntry on jeforth.3nw --> it works! \\n\\n\\nStudy XMLHttpRequest object \\nhttp://www.w3school.com.cn/xml/xml_http.asp\\n\\n> var x =new XMLHttpRequest(); x constant xmlhttp // ( -- obj ) XMLHttpRequest object\\n> xmlhttp . ==> [object XMLHttpRequest] \\\\ this is how it looks like\\n> xmlhttp :: open(\\\"GET\\\",\\\"a.html\\\",true) \\\\ try to read something from the server, a.html is not existing.\\n> xmlhttp :: send(null) \\\\ arm the instruction.\\n> xmlhttp :> readyState . ==> 4 \\\\ 4 is \\\"loaded\\\" or \\\"complete\\\"\\n> xmlhttp :> status \\\\ ==> 0 (number) \\\\ 0 is \\\"uninitialized\\\", a.html is not existing remember?\\n\\n\\\\ Try again\\n> xmlhttp :: open(\\\"GET\\\",\\\"index.html\\\",true) \\\\ now index.html is jeforth.3htm's main page\\n \\\\ the 3'rd argument Async = True 表示脚本会在 send() 方法之后继续执行,而不等待来自服务器的响应。\\n> xmlhttp :: send(null)\\n\\n\\\\ 照理說這時候要等 event xmlhttp.onreadystatechange=state_Change_event_handler; \\\\ or false if event not used\\n\\n> xmlhttp :> readyState \\\\ ==> 4 OK \\n> xmlhttp :> status \\\\ ==> 200 (number) \\\\ Bingo!! 200 is OK\\n> xmlhttp :> statusText \\\\ ==> OK (string)\\n> xmlhttp :> responseText \\\\ ==> 真的把檔案讀進來了!! Bingo !! 3nw, 3htm (super_chrome and webserver).\\n \\n \\n \\n appname \\n \\n \\n \\n\\n\\\\ 3htm/f/readtextfile.f 裡面用的是 $.get 裡面可能就是用 XMLHttpRequest.\\n\\n> xmlhttp :: open(\\\"POST\\\",\\\"222\\\",false) \\\\ 沒有 error \\n> xmlhttp :: send(\\\"1234bsdfsd\\\") \\\\ 沒有 error 但也沒效果\\n\\n\\\\ 以上 post 無效是 3nw, 3htm(super_chrome) \\n\\\\ --> 改用 3htm + webserver.f 試試看 -- same result :-(\\n\\\\ 我不瞭解 POST command 的真正意義。Server 端應該要有人把收到的 data 存成檔案。\\n\\n[ ] Server 端應該要有人把收到的 data 存成檔案。這就有點麻煩了, 還不如直接用 3nw。\\n 我以前研究過 Web server 端的程式 on 3nd, it's time to review.\\n\",\"mode\":true,\"readonly\":false}","Style for 3nw":"{\"doc\":\"
Style for 3nw
drop\\n js: outputbox.style.fontSize=\\\"1.5em\\\"\\n js: inputbox.style.fontSize=\\\"1.5em\\\"\\n editbox-style \\n .eb .box { width:90%; font-size:1.1em; /* filename */ } \\n .eb .box, .eb .ebhtmlarea { border:1px solid black; }\\n .eb .ebtextarea { font-size:1.2em }\\n .eb input { font-size:0.7em /* buttons */ }\\n .eb p { display:inline; }\\n .eb .ebname { font-size: 1em; } /* field name */\\n js: $(\\\"#ebstyle\\\")[0].innerHTML=pop() \\\\ 直接修改 ebstyle \\ncr\\n\",\"mode\":true,\"readonly\":false}","[Closed] Study remove CSS style for an element":"{\"doc\":\"*** CSS is like 塗在牆上的油漆, 是一層層抹蓋上去的。新加的 style 蓋在原有的之上。 jeforth.3we 的確有能力\\n 可以把原有的 style tag 翻出來修改 style.innerHTML 即可。\\n\\n[x] common.css 不要用 link 引進, 改在 3htm/f/platform.f 裡用 定義。如此有希望。\\n Done, See 3hta \\\"Log 2016/05/17\\\".\\n\\n[x] No work, even Yahoo CSS reset. Try to remove 3hta's CSS styles. Try ultimate nothing first.\\n\\n\\\\ [x] Try Yahoo CSS reset. partially works on 3hta. Same partial result on 3htm on Chrome.\\n\\n〈link id=flotcss href=\\\"http://yui.yahooapis.com/3.18.1/build/cssreset-context/cssreset-context-min.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\"〉\\n\\n\\n〈div class=\\\"yui3-cssreset\\\">\\n Anything here would be reset, 好像有效。\\n 雖然 background color 沒有如預期變成白色, 字體倒是變小了, \\n 不過 font-family 還是 courier new. 沒有恢復。 \\n 這可能是因為字體、大小、背景顏色等並不會造成 style 的問題。\\n〈/div>\\n drop\\n\\nstop\\nhttp://stackoverflow.com/questions/15901030/reset-remove-css-styles-for-element-only\\n\\n[x] js: $(vm.g.flotzone).removeAttr('style') <-- does not work in 3hta\\n js: $(\\\".console3we\\\").removeAttr('style') <-- not Chrome Version 50.0.2661.94 m either\\n\\n[x] No work in 3hta, nor 3htm\\n\\n\\n constant sstt\\n\\n\\nYahoo CSS reset \\n/*\\nYUI 3.18.1 (build f7e7bcb)\\nCopyright 2014 Yahoo! Inc. All rights reserved.\\nLicensed under the BSD License.\\nhttp://yuilibrary.com/license/\\n*/\\n.yui3-cssreset html{color:#000;background:#FFF}.yui3-cssreset body,.yui3-cssreset div,.yui3-cssreset dl,.yui3-cssreset dt,.yui3-cssreset dd,.yui3-cssreset ul,.yui3-cssreset ol,.yui3-cssreset li,.yui3-cssreset h1,.yui3-cssreset h2,.yui3-cssreset h3,.yui3-cssreset h4,.yui3-cssreset h5,.yui3-cssreset h6,.yui3-cssreset pre,.yui3-cssreset code,.yui3-cssreset form,.yui3-cssreset fieldset,.yui3-cssreset legend,.yui3-cssreset input,.yui3-cssreset textarea,.yui3-cssreset p,.yui3-cssreset blockquote,.yui3-cssreset th,.yui3-cssreset td{margin:0;padding:0}.yui3-cssreset table{border-collapse:collapse;border-spacing:0}.yui3-cssreset fieldset,.yui3-cssreset img{border:0}.yui3-cssreset address,.yui3-cssreset caption,.yui3-cssreset cite,.yui3-cssreset code,.yui3-cssreset dfn,.yui3-cssreset em,.yui3-cssreset strong,.yui3-cssreset th,.yui3-cssreset var{font-style:normal;font-weight:normal}.yui3-cssreset ol,.yui3-cssreset ul{list-style:none}.yui3-cssreset caption,.yui3-cssreset th{text-align:left}.yui3-cssreset h1,.yui3-cssreset h2,.yui3-cssreset h3,.yui3-cssreset h4,.yui3-cssreset h5,.yui3-cssreset h6{font-size:100%;font-weight:normal}.yui3-cssreset q:before,.yui3-cssreset q:after{content:''}.yui3-cssreset abbr,.yui3-cssreset acronym{border:0;font-variant:normal}.yui3-cssreset sup{vertical-align:text-top}.yui3-cssreset sub{vertical-align:text-bottom}.yui3-cssreset input,.yui3-cssreset textarea,.yui3-cssreset select{font-family:inherit;font-size:inherit;font-weight:inherit}.yui3-cssreset input,.yui3-cssreset textarea,.yui3-cssreset select{*font-size:100%}.yui3-cssreset legend{color:#000}#yui3-css-stamp.cssreset-context{display:none}\\n\\n\\n\\n[ ] \",\"mode\":true,\"readonly\":false}","[closed] Bug error click [open] of a ls.f ed log but OK on snapshot":"{\"doc\":\"
\\n Snapshot 2016-05-19 16:59:10 <======== Click Open ok Log 2016/05/17 <========= Click Open causes the below error [closed] stamp command Study remove CSS style for an element Play Flot log of 3nw 3nw working on simpleMDE Play with numeric.js 8 different ways to beautifully style your lists autoexec
OK JavaScript error on word \\\"eb.settings\\\" : Unable to get property 'checked' of undefined or null reference Panic jsc> > reset
> .s 0: [object HTMLDivElement] (object) <-------- this is the eb editbox 1: [object Object] (object) <--------- this is suspected the problem, what is it? OK > snapshot
[x] Check eb.settings, what 'checked' ?? RI: (eb.read) stack unbalance in a if case1 else case2 then
\",\"mode\":false,\"readonly\":false}","[closed] stamp command":"{\"doc\":\"[x] I need time stamp, a Stamp command that pastes t.dateTime at the cursor position.\\n: stamp ( -- ) \\\\ Paste date-time at cursor position\\n js> clipboardData.getData(\\\"text\\\") ( saved ) \\\\ SAVE-restore\\n now t.dateTime ( saved \\\"date time\\\" )\\n js: clipboardData.setData(\\\"text\\\",pop()) ( saved )\\n WshShell.SendKeys \\\"^v\\\" \\n 500 sleep js: clipboardData.setData(\\\"text\\\",pop()) ( empty ) \\\\ save-RESTORE\\n ;\\n /// It works now 2016-05-16 18:11:03. Leave 'stamp' in inputbox then put cursor\\n /// at target position, press Ctrl-Enter, then that's it! Date-time pasted to\\n /// the target position.\\n\",\"mode\":true,\"readonly\":false}","ad":"{\"doc\":\"\\n\\\\ Remove all annoying floating ad boxes. 刪除所有惱人的廣告框。\\nactive-tab :> id tabid! \\nvar divs = document.getElementsByTagName(\\\"div\\\");\\nfor (var i=divs.length-1; i>=0; i--){\\n if(divs[i].style.position){\\n divs[i].parentNode.removeChild(divs[i]);\\n }\\n}\\nfor (var i=divs.length-1; i>=0; i--){\\n if(parseInt(divs[i].style.width)<600){ // <---- 任意修改\\n divs[i].parentNode.removeChild(divs[i]);\\n }\\n}\\n\\n\",\"readonly\":true,\"mode\":true}","autoexec":"{\"doc\":\"\\njs: outputbox.style.fontSize=\\\"1.5em\\\"\\njs: inputbox.style.fontSize=\\\"1.5em\\\"\\n\",\"mode\":true,\"readonly\":false}","dividend for 3nw":"{\"doc\":\"[ ] Error! tabs.query unknown.\\n[ ] 3nw in trouble, extra errors after the first real error.\\n\\n\\\\ \\n\\\\ jeforth.3ce 讀取「臺灣銀行」的「除權除息表」並比對歷史,如果有新的就發出 alert。\\n\\\\ 應用 localStorage 貯存公司列表,所以關機重跑還是記得讀到過的公司。\\n\\\\\\n\\\\ 要手動先準備的部分\\n\\\\ 1. open the data page \\n\\\\ > js: window.open(\\\"http://fund.bot.com.tw/z/ze/zeb/zeba.djhtm\\\")\\n\\\\ 2. open 3ce page\\n\\\\ 3. Assign tabid\\n\\\\ > list-tabs \\\\ get tabid\\n\\\\ 228 除權除息表-依股號\\n\\\\ > 228 tabid! \\\\ setup tabid \\n\\ns\\\" http://fund.bot.com.tw/z/ze/zeb/zeba.djhtm\\\" constant 除權除息表網址 // ( -- \\\"url\\\" )\\n除權除息表網址 js: push({url:pop()}) tabs.query ( [tabs] )\\njs> tos().length>=1 [if] [else] \\n 除權除息表網址 js: window.open(pop()) \\\\ 想取得該 tab 的 window object? No way! 別想了。\\n cr .( 上網讀取【台灣銀行--除權除息表】網頁 ) cr \\n [begin] \\n 除權除息表網址 js: push({url:pop()}) tabs.query ( [tabs] ) \\n char . . 500 nap \\n js> tos().length>=1 [if] true [else] false [then]\\n [until] cr\\n[then]\\njs> pop()[0].id tabid! \\ncr .( 已成功讀取【台灣銀行--除權除息表】網頁 ) cr \\n\\n' Refresh_the_target_page ' check_updated and [if] \\n Refresh_the_target_page check_updated\\n[else]\\n : dump-all-
( -- ) \\\\ Dump all
table cells of tabid target page\\n js> $(\\\"td\\\").length ( length )\\n ?dup if dup for dup r@ - ( COUNT i ) \\n >r\\n js> $(\\\"td\\\")[rtos()].innerText \\\\ cell value\\n js> $(\\\"td\\\")[rtos()].getAttribute(\\\"class\\\") dup if char _note_ + then\\n js> $(\\\"td\\\")[rtos()].id dup if char _note_ + then\\n r>\\n .\\\" index:\\\" . .\\\" ID: \\\" . .\\\" Class: \\\" . space . cr \\\\ the cr provides an important nap time \\n ( COUNT ) next drop then ; \\n /// Run on jeforth.3ce target page\\n\\n : dump-all-
( -- ) \\\\ Dump all
table rows of tabid target page\\n js> $(\\\"tr\\\").length ( length )\\n ?dup if dup for dup r@ - ( COUNT i ) \\n >r\\n js> $(\\\"tr\\\")[rtos()].outerHTML remove-script-from-HTML remove-select-from-HTML \\\\ row HTML\\n js> $(\\\"tr\\\")[rtos()].getAttribute(\\\"class\\\") dup if char _note_ + then\\n js> $(\\\"tr\\\")[rtos()].id dup if char _note_ + then\\n r>\\n .\\\" index:\\\" . .\\\" ID: \\\" . .\\\" Class: \\\" . space drop cr \\\\ the cr provides an important nap time \\n ( COUNT ) next drop then ; \\n /// Run on jeforth.3ce target page\\n \\n : Refresh_the_target_page ( -- ) \\\\ Refresh the tabid target page.\\n tabid js: chrome.tabs.reload(pop())\\n 500 nap tabid tabs.get :> status!=\\\"complete\\\" if\\n 1500 nap \\\\ Do my best to allow the title to become available\\n .\\\" Still loading \\\" tabid tabs.get :> title . space\\n 0 begin\\n tabid tabs.get :> status==\\\"complete\\\" if 1+ then\\n dup 5 > if ( TOS 餵給 until ) else \\\\ 5 complete to make sure it's very ready.\\n char . . 300 nap false\\n then\\n until .\\\" done! \\\" cr\\n then ;\\n /// Improve this if the target page is unstable then we need to timeout and retry.\\n\\n : find-next-company ( i -- i' ) \\\\ Find next 已公布除權息日的公司 in 台銀除權除息表 return index or zero.\\n s\\\" var last_index = \\\" swap + [compile] \\\\ setup variable for the target page\\n \\n var next_index = 0;\\n var array_td = document.getElementsByTagName(\\\"td\\\");\\n for (var i=last_index+1; i :> [0] ;\\n\\n : company-name ( i -- name ) \\\\ Convert index of
to company name\\n var array_td = document.getElementsByTagName(\\\"td\\\"); \\n char array_td[ swap + char ].innerText + \\n [compile] :> [0] ;\\n\\n : get-company-hash ( -- hash count ) \\\\ Get the company names of 台銀除權除息表。\\n var array_td = document.getElementsByTagName(\\\"td\\\");\\n {} ( hash ) 0 ( count ) 0 ( index ) begin \\n find-next-company dup ( hash count idx' idx' ) \\n while \\n ( hash count idx' ) swap 1+ swap ( hash count++ idx' )\\n dup company-name ( hash count++ idx' name )\\n js: tos(3)[pop()]=true ( hash count++ idx' )\\n repeat ( hash count++ 0 ) drop ;\\n\\n : save-company-hash ( hash -- ) \\\\ Save company hash to local storage key 'company-hash'.\\n js> JSON.stringify(pop()) ( json )\\n js: localStorage[\\\"company-hash\\\"]=pop() ;\\n /// localStorage[\\\"company-hash\\\"] is JSON\\n\\n : restore-company-hash ( -- hash ) \\\\ Read company hash from local storage key 'company-hash'.\\n js> localStorage[\\\"company-hash\\\"] \\n js> tos()==undefined if null else js> JSON.parse(pop()) then ;\\n /// localStorage[\\\"company-hash\\\"] is JSON\\n\\n : isSameHash ( h1 h2 -- boolean ) \\\\ Compare two hash table\\n \\n var flag = true;\\n for (var i in tos(1)){ // 兩頭各比一次\\n if (tos()[i]!==true) flag = false;\\n break;\\n }; \\n for (var i in tos()){ // 兩頭各比一次\\n if (tos(1)[i]!==true) flag = false;\\n break;\\n }; execute(\\\"2drop\\\"); flag ;\\n\\n : check_updated ( -- ) \\\\ Check if 台銀除權除息表 is updated\\n restore-company-hash ( hash0 ) obj>keys :> length if \\\\ Init check\\n now t.dateTime . .\\\" localStorage company hash = \\\" restore-company-hash dup (see)\\n get-company-hash drop dup -rot isSameHash if ( company-hash )\\n drop .\\\" , no update since the last check.\\\" cr\\n else ( company-hash )\\n s\\\" , something new updated. Check it out!\\\" \\n dup . cr js: alert(pop())\\n dup (see) save-company-hash\\n then\\n else \\n \\\\ initialize\\n get-company-hash drop save-company-hash\\n then ;\\n\\n \\\\ Check every hour\\n \\\\ run: begin Refresh_the_target_page check_updated 1000 60 * 60 * nap again\\n\\n Refresh_the_target_page check_updated \\n[then]\\n\\n\\n\\n \\\\ Obloleted words\\n \\n : count_oAddCheckbox ( -- n ) \\\\ Get the company count of 台銀除權除息表。\\n 0 ( count ) 0 ( index ) begin \\n find-next-company dup ( count idx' idx' ) \\n while \\n ( count idx' ) swap 1+ swap \\n repeat ( count 0 ) drop ;\\n /// Item count does not mean much, because the table cuts items \\n /// before yesterday.\\n\\n : check_oAddCheckbox_count ( -- ) \\\\ Check if 台銀除權除息表 is updated <== obsoleted\\n js> localStorage.oAddCheckbox_count ( init check ) if\\n now t.dateTime . .\\\" localStorage.oAddCheckbox_count = \\\" js> localStorage.oAddCheckbox_count .\\n count_oAddCheckbox js> localStorage.oAddCheckbox_count int = if\\n .\\\" , no update since the last check.\\\" cr\\n else\\n s\\\" , something new updated. Check it out!\\\" \\n dup . cr js: alert(pop())\\n count_oAddCheckbox js: localStorage.oAddCheckbox_count=pop()\\n then\\n else \\n \\\\ initialize\\n count_oAddCheckbox\\n js: localStorage.oAddCheckbox_count=tos()\\n js> localStorage.oAddCheckbox_count!=pop() if\\n s\\\" Error! Your browser does not support HTML5 localStorage.\\\" \\n dup . cr \\\"msg\\\"abort\\n then\\n then ;\\n\\n\",\"mode\":true,\"readonly\":false}","log of 3nw":"{\"doc\":\"[x] file input 若被 user cancel 則 sleep 得不到 stopsleeping 在那裏苦等 <--- problem!\\n> constant ff\\n> ff :> value . \\\\ ==> OK it's null string by default\\n> ff :> value . \\\\ after picking a file, it becomes a pathname\\nC:\\\\Users\\\\hcche\\\\Documents\\\\GitHub\\\\chrome-app-samples\\\\tryitnowbutton_small.png OK \\n> ff :> value . \\\\ try again but click cancel, it becomes a null string as anticipated, good!\\n> \\\\ click [cancel] clears ff.value <--- good!!\\n> ff :: onchange=function(){alert(\\\"onchange\\\")} \\\\ Add event handler, it works!\\n> \\\\ click [cancel] does not fire onchange() event unless due to the above reason that has actually been changed.\\n> ff :: oncancel=function(){alert(\\\"onCancel\\\")} <--- click [cancel] does not fire this event at all. But onchange() event got fired sometimes.\\n> ff :: onchange=function(){alert(\\\"onBigChange\\\")} \\\\ Handler can be changed and it works fine.\\n> ff :> oncancel . \\\\ ==> function (){alert(\\\"onCancel\\\")} OK check, it's there\\n> ff :> onchange . \\\\ ==> function (){alert(\\\"onBigChange\\\")} check, it's there\\n> \\\\ ff :: onabort=function(){alert(\\\"onAbort\\\")} \\\\ ==> Click cancel does not fire this either.\\n> \\\\ ff :> onabort . \\\\ ==> ff :: onabort=function(){alert(\\\"onAbort\\\")}\\n> \\\\ No, click [cancel] does not fire onabort() \\n\\n\\\\ 企圖故意製造 onchange 100% 發生的努力, 失敗了:\\n> ff :> value=\\\"dummy\\\" <--- Not allowed, see err message:\\nJavaScript error : Failed to set the 'value' property on 'HTMLInputElement': \\nThis input element accepts a filename, which may only be programmatically set \\nto the empty string.\\n\\n\\\\ 機會 : 每個 file input 都是新的, 用完馬上 remove 掉, 有機會讓所有的 cancel 都 fire \\n\\\\ onchange() event? --> 一上來馬上 cancel 因為 file.value 都是 null string 沒有變故\\n\\\\ 不會 fire onchange() event. --> 試試為 file.value 給訂初值 --> No way, see:\\n\\\\ 为安全起见,file-upload 元素不允许 HTML 作者或 JavaScript 程序员指定一个默认的文件名。\\n\\nff :> defaultValue \\\\ ==> null string.\\n constant fff\\nff :: onbeforedeactivate=function(){alert(\\\"beforeDeActivate\\\")} \\\\ <== fire when blur, 不適合.\\n\\nff :: onblur=function(){alert(\\\"onblur\\\")} <-- fired when both clicking [瀏覽] and \\nclick desk top but not clicking [cancel], shit!!!\\n\\n[x] 解決了! 3nw 會 fire oncancel() when [cancel] clicked!! Bingo!!\\nff :: onemptied=function(){type(\\\"onemptied\\\")}\\nff :: onended=function(){type(\\\"onended\\\")}\\nff :: onerror=function(){type(\\\"onerror\\\")}\\nff :: onerrorupdate=function(){type(\\\"onerrorupdate\\\")}\\nff :: onfilterchange=function(){type(\\\"onfilterchange\\\")}\\nff :: onfocus=function(){type(\\\"onfocus\\\")}\\nff :: onfocusin=function(){type(\\\"onfocusin\\\")}\\nff :: onfocusout=function(){type(\\\"onfocusout\\\")}\\nff :: onhelp=function(){type(\\\"onhelp\\\")}\\nff :: oninput=function(){type(\\\"oninput\\\")}\\nff :: onchange=function(){type(\\\"onChange\\\")}\\nff :: oncancel=function(){type(\\\"oncancel\\\")}\\n\\n3hta\\nonfocusin onfocus onfocusout \\nonfocusin onfocus onfocusout\\n\\n3nw\\nonfocus \\nonfocus oncancel\\nonfocus \\nonfocus oncancel\\n\\n[x] Answer to stackoverflow with my finding of oncancel() works!\\n http://stackoverflow.com/questions/10127492/capturing-cancel-event-on-input-type-file\\n\\n I have the same question, the solution is surprisingly very \\n easy ... at least in my case NW.js (Node-Webkit) fires oncancel \\n event if user click the [cancel] button in the file chooser \\n dialogue. You use this simple and native way if you're also on \\n NW.js (process.version is v5.11.0).\\n\\n I also tried Microsoft HTA on Windows 10, it does not fire the \\n oncancel event.\\n\\n' --- [if] --- [then] marker --- \\n\\n \\n \\n\\n\\n\\nThe above sample code, modified for jeforth, from \\nhttp://stackoverflow.com/questions/29705135/node-webkit-read-full-path-of-files-from-directory\\nworks fine, very well. No problem at all getting the full pathname on 3nw, but not on 3ce. So, \\nNW.js is really provides super power.\\n\\n\\\\ Works fine on 3nw,\\n> js> $(\\\"#fileDialog\\\").length \\\\ ==> 1 OK \\n> js> $(\\\"#fileDialog\\\")[0].value . \\\\ ==> C:\\\\Users\\\\hcche\\\\Downloads\\\\download OK \\n> js> document.getElementById(\\\"fileDialog\\\") . \\\\ ==> [object HTMLInputElement] OK \\n> js> document.getElementById(\\\"fileDialog\\\").value . \\\\ ==> C:\\\\Users\\\\hcche\\\\Downloads\\\\download OK \\n> pickFile \\n> .s\\n 0: (string) \\\\ <--- My original pickFile does not work on 3nw. Needs debug.\\n\\n\\\\ On jeforth.3ce, failed as anticipated\\n\\n > js> document.getElementById(\\\"fileDialog\\\").value .\\n C:\\\\fakepath\\\\__865.jpg OK <---- \\\"fakepath\\\" as anticipated.\\n\\n\\\\ Works fine on 3HTA.\\n\\n > js> document.getElementById(\\\"fileDialog\\\").value .\\n C:\\\\Users\\\\hcche\\\\Downloads\\\\魏月梅 全民健保核退申請書.PDF OK \\n\\n\\\\ So, pickFile can be improved by this solution from Stackoverflow.\\n\\n: pickFile ( -- \\\"pathname\\\" ) \\\\ Pick a file through web browser's GUI\\nchar input createElement ( element )\\ndup char type char file setAttribute ( element )\\ndup char id char pickfile setAttribute ( element )\\neleBody over appendChild \\\\ 要 append 才有作用。\\n( element ) js> tos().click();tos().value ( element pathname ) ;\\n\\n\\\\ 照上面這個 pickFile 實驗, 還是不行。確定傳回的 pathname 是個 \\\"\\\". 然而手動觀察 element.value 卻是\\n\\\\ 正確的 pathname. [x] 猜想, 最後一行手動看應該會是 expected pathname 無誤。\\n\\n> .s \\n 0: [object HTMLInputElement] (object) \\\\ backup\\n 1: C:\\\\Users\\\\hcche\\\\Downloads\\\\jeforth.3ce.p4.jpg (string)\\n 2: [object HTMLInputElement] (object) \\\\ to be removed\\n> removeElement\\n> js> tos(1).value . \\\\ 查看 element 的 value \\nC:\\\\Users\\\\hcche\\\\Downloads\\\\jeforth.3ce.p4.jpg OK \\\\ 竟然是對的。此時 element id 確定已經不存在了。\\n\\n\\n[x] 嘗試手動作最後一行\\n: pickFile ( -- \\\"pathname\\\" ) \\\\ Pick a file through web browser's GUI\\nchar input createElement ( element )\\ndup char type char file setAttribute ( element )\\ndup char id char pickfile setAttribute ( element )\\neleBody over appendChild \\\\ 要 append 才有作用。\\n; \\n\\n\\\\ 果然, 這行一起做, 傳回 \\\"\\\"\\n( element ) js> tos().click();tos().value ( element pathname ) ;\\n\\n\\\\ 手動分開做, 就 OK 了!!\\n( element ) js: tos().click()\\njs> tos().value ( element pathname ) ;\\n\\n[x] click() 之後, 加上一點 nap 看看, --> \\n\\n: pickFile ( -- \\\"pathname\\\" ) \\\\ Pick a file through web browser's GUI\\nchar input createElement ( element )\\ndup char type char file setAttribute ( element )\\ndup char class char pick_file setAttribute ( element )\\njs> body over appendChild \\\\ 要 append 才有作用。\\njs: tos().click() ( element ) \\\\ 回來就表示 user 已經完成操作\\n( seconds * 1000 / nap ) js> 60*1000/200 for ( element ) \\n\\tjs> tos().value if \\n\\t\\tr> drop 0 >r \\\\ break the loop\\n\\telse \\n\\t\\t200 nap .\\\" .\\\" \\\\ wait a while\\n\\tthen \\nnext ( element ) \\njs> tos().value \\\\ 即使 timeout 也不管了 ( element path ) \\nswap removeElement ; ( path ) \\n\\n\\\\ Ultimate version\\n\\n: pickFile ( -- \\\"pathname\\\" ) \\\\ Pick a file through web browser's GUI\\n\\tchar input createElement ( element )\\n\\tdup char type char file setAttribute ( element )\\n\\tdup char class char pick_file setAttribute ( element ) \\\\ for debug, clue of the element\\n\\tjs: tos().onchange=function(){execute('stopSleeping')} ( element )\\n\\tjs> body over appendChild \\\\ 要 append 才有作用。 ( element )\\n js: tos().click() ( element ) \\\\ @ HTA 回來就表示 user 已經完成操作, @ NW.js 則馬上回來。\\n\\t( minutes*60*1000 ) js> 5*60*1000 sleep ( element )\\n\\tjs> tos().value \\\\ 即使 timeout 也不管了 ( element path ) \\n\\tswap removeElement ; ( path ) \\n\\n: pickFile \\t\\t( -- \\\"pathname\\\" ) \\\\ Pick a file through web browser's GUI\\nchar input createElement ( element )\\ndup char type char file setAttribute ( element )\\ndup char class char pick_file setAttribute ( element ) \\\\ for debug, clue of the element\\n\\\\ For none 3hta only, setup the event handler\\njs> vm.appname!=\\\"jeforth.3hta\\\" if\\n\\tjs: tos().onchange=function(){execute('stopSleeping')} ( element ) then\\njs> body over appendChild \\\\ 要 append 才有作用。 ( element )\\njs: tos().click() ( element ) \\\\ @ HTA 回來就表示 user 已經完成操作, @ NW.js 則馬上回來。\\n\\\\ For none 3hta only, wait for the onchange event\\njs> vm.appname!=\\\"jeforth.3hta\\\" if\\n\\t( minutes*60*1000 ) js> 5*60*1000 sleep ( element ) then\\njs> tos().value \\\\ 即使 timeout 也不管了 ( element path ) \\nswap removeElement ; ( path ) \\n/// Works fine on 3hta and 3nw. The dialog works but returns Null string on 3htm \\n/// or C:\\\\fakepath\\\\__865.jpg on 3ce.\\n/// Through excel app's GetOpenFilename method can do the same thing:\\n/// excel.app js> pop().GETopenFILENAME <== with or w/o () both fine\\n/// Excel's GetSaveAsFilename method too.\\n\\n\\n\\n\\n[x] 3nw's js: storage.save(pathname) and js: storage.restore(pathname) work fine now.\\n[/] How about 3hta? <--- 3hta works fine already, forget it.\\n[x] 3nw should auto save and restore local storage. restore when start up, save when\\n any field is saved. So I don't need corresponding words for them.\\n\",\"mode\":true,\"readonly\":false}","node.js HTTP server":"{\"doc\":\"\\n\\\\ ~@~@~@~@~@~@~@~@~ Build Your First HTTP Server in Node.js ~@~@~@~@~@~@~@~@~\\n\\\\\\n\\\\ https://www.diigo.com/user/hcchen/b/373115646\\n\\\\ jeforth.3nw localsotrage field \\\"node.js HTTP server\\\"\\n\\\\ ~\\\\jeforth.3we\\\\3nd\\\\build_your_http_server.f \\n\\\\\\n\\n\\\\ Lets require/import the HTTP module and choose a port to listen\\n js> require('http') constant http // ( -- HTTP-object ) Get node.js http module\\n\\n\\\\ Lets define a port we want to listen to\\n 8080 constant PORT // ( -- port# ) Port number HTTP server listen to\\n\\n\\\\ We need a function which handles requests and send response\\n \\n \\n var f = function handleRequest(request, response){\\n response.end('It Works!! Path Hit: ' + request.url);\\n };f\\n constant handleRequest // ( -- func ) Request handler\\n \\n\\n\\\\ Callback triggered when server is successfully listening. Hurray!\\n \\n var f = function callback(){\\n type(\\\"Server listening on: http://localhost:\\\"+vm[context].PORT);\\n }; f\\n constant server-callback // ( -- func ) Call back function of the HTTP server\\n\\n\\\\ Create a server\\n http :> createServer(vm[context].handleRequest)\\n constant server // ( -- obj ) HTTP server object\\n\\n\\\\ Lets start our server\\n server :> listen(vm[context].PORT,vm[context][\\\"server-callback\\\"])\\n\\n\\\\ Your server should respond differently to different URL \\n\\\\ paths. This means we need a dispatcher. Dispatcher is kind \\n\\\\ of router which helps in calling the desired request handler \\n\\\\ code for each particular URL path. Now lets add a dispatcher \\n\\\\ to our program. First we will install a dispatcher module, \\n\\\\ in our case httpdispatcher. There are many modules available \\n\\\\ but lets install a basic one for demo purposes\\n\\n js> require('httpdispatcher') constant dispatcher // ( -- obj ) HTTP dispatcher\\n\\n\\n//Lets use our dispatcher\\nfunction handleRequest(request, response){\\n try {\\n //log the request on console\\n console.log(request.url);\\n //Disptach\\n dispatcher.dispatch(request, response);\\n } catch(err) {\\n console.log(err);\\n }\\n}\",\"mode\":true,\"readonly\":false}","pruning":"{\"doc\":\"\\n\\\\ Make the target page editable for pruning. 把 target page 搞成 editable 以便修剪。\\nactive-tab :> id tabid! document.getElementsByTagName(\\\"body\\\")[0].contentEditable=true \\n\",\"readonly\":true,\"mode\":true}","smde_MyUniqueID":"j e f o r t h . 3 w e\n==============\n**Forth** is the simplest programming language ever. The jeforth.**3we** project is an implementation based on a **3 Words Engine** from [project-k](http://github.com/hcchengithub/project-k) for many applications: *HTA (jeforth.3hta)*, *HTML (jeforth.3htm)*, *Chrome Extension (jeforth.3ca)*, *Node.js (jeforth.3nd)*, *Node-webkit or NW.js (jeforth.3nw)*, and probably more in the future. All of them have been tested on Windows 8 or Windows 10.\n\nPlay now\n===========\nAmong the many applications, jeforth for web page (jeforth.3htm) can run on your web browser right now thus is good for demonstration. \n\n#### [Solar system](http://rawgit.com/hcchengithub/jeforth.3we/master/index.html?cls_include_solar-system.f)\n[簡介](http://note.youdao.com/yws/public/redirect/share?id=94764cf57ba4365e2997f4a268ff7716&type=false) \n![enter image description here](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/solar-system.png)\n\n#### [H2O](http://rawgit.com/hcchengithub/jeforth.3we/master/index.html?cls_include_h2o.f)\n![enter image description here](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/h2o.png)\n\n#### [Alarm clock](http://rawgit.com/hcchengithub/jeforth.3we/master/index.html?cls_include_alarm.f_er)\n ![enter image description here](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/demo-alarm.png)\n \n#### [Box2Dweb Physics Engine demo - Arrows](http://rawgit.com/hcchengithub/jeforth.3we/master/index.html?cls_include_box2dweb-arrow.f)\n![enter image description here](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/demo-arrow.png)\n\n#### [Chipmunk Physics Engine demo - Pyramid Stack](http://rawgit.com/hcchengithub/jeforth.3we/master/index.html?cls_include_chipmunk-js-pyramidstack.f)\n![enter image description here](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/demo-pyramidstack.png)\n\n\nWhat else can you do with jeforth.3we?\n=============\n\n#### [Markdown editor](http://note.youdao.com/yws/public/redirect/share?id=1a8a342f3a9c1e0622a6050480af28b7&type=false)\n\nNW.js can access files in your local computer and also have all abilities like the Chrome browser, that allows jeforth.3nw to include JavaScript modules from the Internet. For example, [SimpleMDE](https://simplemde.com) is a Markdown Editor that works fine on jeofrth.3nw. \n\n![enter image description here](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/demo 3nw mde editor.JPG)\n\n\nGet source code, unzip, and start running\n=============\n\n| Item | Address |\n----------------|----------------------------------------------\n| jeforth.3we high level source code | *http://github.com/hcchengithub/jeforth.3we* |\n| Kernel, projectk.js 3-words-engine| *http://github.com/hcchengithub/project-k* |\n\n \nClick the [Download ZIP] button of both projects [jeforth.3we](https://github.com/hcchengithub/jeforth.3we) and [project-k](https://github.com/hcchengithub/project-k) on their GitHub web page to get them. Unzip jeforth.3we first and then unzip project-k to under the jeforth.3we directory, as shown in the below directory listing. Then you can run 3hta.bat without installing anything else if your computer is Windows 8 or Windows 10; or run 3nd.bat and 3nw.bat, if you have installed node.js and nw.js.\n\nMy jeforth.3we/ directory listing for example,\n\n![jeforth3we-dir.png](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/jeforth3we-dir.png)\n\n\n**Note:** Only for jeforth.3hta and only when you were **Download Zip** jeforth.3we from GitHub, It's necessary to use GNU tool [unix2dos](http://waterlan.home.xs4all.nl/dos2unix.html) to convert the new line characters of all text files [from Unix's LF to Windows' CRLF](https://en.wikipedia.org/wiki/Unix2dos). This is an example command line of the usage:\n\n d:\\jeforth.3we>for /R %G in (*.*) do d:\\bin\\unix2dos.exe \"%G\"\n\n \n\nIf you were **git clone https://github.com/hcchengithub/jeforth.3we** instead of **Download Zip** then forget this step, GitHub shell for Windows already converts new line characters to CRLF correctly. \n\nPresentation videos\n======\n\n| No. | Mandarin | English |\n--------|----------|---------\n| 1 | [Opening](http://www.camdemy.com/media/19253)| n/a |\n| 2 | [Run the HTML version online](http://www.camdemy.com/media/19254)| n/a |\n| 3 | [Run the HTML version on local computer](http://www.camdemy.com/media/19255)| n/a |\n| 4 | [Run the HTA version](http://www.camdemy.com/media/19256)| n/a |\n| 5 | [Run Node.js and Node-Webkit version](http://www.camdemy.com/media/19257)| n/a |\n| 6 | [F2 inputbox edit mode](http://www.camdemy.com/media/19258)| n/a |\n| 7 | [F4 Copy marked string to inputbox](http://www.camdemy.com/media/19259)| n/a |\n| 8 | [F5 Restart](http://www.camdemy.com/media/19260)| n/a |\n| 9 | [Bigger/Smaller input box](http://www.camdemy.com/media/19261)| n/a |\n| 10 | [Esc clear input box](http://www.camdemy.com/media/19262)| n/a |\n| 11 | [Tab auto-complete](http://www.camdemy.com/media/19263)| n/a |\n| 12 | [Enter jump into the input box](http://www.camdemy.com/media/19264)| n/a |\n| 13 | [Up/Down recall command history](http://www.camdemy.com/media/19265)| n/a |\n| 14 | [Alt-Up Reuse used commands](http://www.camdemy.com/media/19266)| n/a |\n| 15 | [Crtl- / Ctrl+ Zoom in/ Zoom out](http://www.camdemy.com/media/19267)| n/a |\n| 16 | [Ctrl-Break stop all tasks](http://www.camdemy.com/media/19268)| n/a |\n| 17 | [BackSpace trims the output box](http://www.camdemy.com/media/19269)| n/a |\n| 18 | [Help is helpful](http://www.camdemy.com/media/19270)| n/a |\n| 19 | [jsc JavaScript Console](http://www.camdemy.com/media/19271)| n/a |\n\nWhat to play in further depth\n========================\nDownload and setup the jeforth.3we directory and project-k directory as mentioned above.\n\n#### **HTA** / jeforth.3hta\nDouble click the **jeforth.3we/jeforth.hta** or execute the below DOS command line in a DOS box,\n```\njeforth.hta cls .' Hello world' cr 3000 sleep bye\n```\n![3htahello-world.png](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/3htahello-world.png)\n\nThe prior method runs self-test because there's no given task to do. The 2'nd method is expected to print 'Hello world' (as shown above) and return to DOS box after 3 seconds.\n\n\nNote! If you see the Windows error message : [\"Safety Settings on this computer prohibit accessing a data source on another domain\"](https://social.msdn.microsoft.com/Forums/en-US/becc982a-b693-49bb-8fb0-95847a3e96c7/hta-safety-settings-on-this-computer-prohibit-accessing-a-data-source-on-another-domain?forum=scripting) that I heard may happen on some Windows 7 computers. Sorry, [I have no solution yet](http://stackoverflow.com/questions/32177060/hta-safety-settings-on-this-computer-prohibit-accessing-a-data-source-on-anot), It didn't happen on those Windows 7 computers that I could reach. Please upgrade to Windows 8 or 10 to avoid from the problem.\n\n#### **Node.js** / jeforth.3nd\nMake sure you can run node.exe in a DOS box so you have setup the path. Make the jeforth.3we/ folder be your working directory. Execute one of the below demo command lines:\n```\nnode jeforth.3nd.js\nnode jeforth.3nd.js cls .' Hello world' cr bye\n```\nAgain, like the above HTA case, the prior command line does the self-test, and the 2'nd is expected to print 'Hello world'.\n\nWe have a local Web server written by jeforth.3nd itself. See jeforth.3we/Webserver.bat. Having a local Web server is necessary to run jeforth.3htm. \n\n#### **HTML** / jeforth.3htm\nSetup your local Web server by running jeforth.3we/Webserver.bat, \n\n![webserver.png](https://github.com/hcchengithub/jeforth.3we/wiki/pictures/webserver.png)\n\nthen try to visit below URLs:\n```\nhttp://localhost:8888\nhttp://localhost:8888/index.html\nhttp://localhost:8888/index.html? cr .\" hello world\" cr cr \nhttp://localhost:8888/index.html?_cr_.\"_hello_world\"_cr_cr \nhttp://localhost:8888/index.html? .\" 8-) \" 100 nap rewind\nhttp://localhost:8888/index.html?_.\"_8-)_\"_100_nap_rewind\n```\nI have tested IE10 , IE11 and Chrome. Firefox or other web browsers are not tested yet. As shown above, we can put any forth words in the URL. That will be the task jeforth.3htm will do after start up and the self-test will be skipped when having a task to do.\n\n#### **Node-webkit** / jeforth.3nw\nSetup your Node.js and Node-Webkit path in prior. Refer to 3nw.bat as an example. Make jeforth.3we/ be your working directory, run either one of below command lines:\n```\nnw ../jeforth.3we\nnw ../jeforth.3we cls .' Hello World' 3000 sleep bye\n```\nThe prior runs self-test because there's no given task to do. The 2'nd is expected to print 'Hello world' and return to DOS box after 3 seconds.\n\t\nCompile eforth.com\n--------------------------\n\nJeforth.3nd for Node.js can be a handy x86 CPU assembler (any other CPU too). We have an example to compile the legendary eforth.com executable for 16 bits PC under MS-DOS by Bill Muench and C. H. Ting, 1990.\n\n 1. Install node.js correctly so you can run node.exe in a DOX box. Working directory at jeforth.3we/. \n 2. Run: node.exe jeforth.3nd.js include 86ef202.f bye\n 3. You got jeforth.3we/eforth.com\n 4. I have a 32bits windows 8, so I can run eforth.com directly. If your Windows system is 64 bits, you'll need a DOS virtual machine like vmware, virtual box, or I recommend DOSBox, to run the created eforth.com.\n\nExcel automation\n---------------------\nUse jeforth.3hta to manipulate excel spread sheets. This example gets a column from a reference excel file to your target excel file.\n\n 1. Double click on jeforth.3we/jeforth.hta to start it. After the self-test type the command line \"include merge2.f\" into the input box.\n 2. Or run the below command line directory for the same thing:\n```\njeforth.hta include merge2.f\n```\n\n#### The End\n\n - FigTaiwan [http://figtaiwan.org](http://figtaiwan.org) \n - H.C. Chen [hcchen5600@gmail.com](hcchen5600@gmail.com) \n - Written with [StackEdit](https://stackedit.io/)\n\n\n "}
\ No newline at end of file
From ff4e7e0c36b154660ed7dfaf01495a0d4f75869f Mon Sep 17 00:00:00 2001
From: "H.C. Chen"
Date: Sun, 25 Mar 2018 11:37:31 +0800
Subject: [PATCH 10/20] little bug
---
3hta/excel/excel.f | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/3hta/excel/excel.f b/3hta/excel/excel.f
index b260ed0..d4b7432 100644
--- a/3hta/excel/excel.f
+++ b/3hta/excel/excel.f
@@ -32,7 +32,7 @@
null value excel.app // ( -- obj ) The Excel.Application object or undefined if no excel exists.
/// "Application Object (Excel)" http://msdn.microsoft.com/en-us/library/office/ff194565(v=office.15).aspx
- s" where name = 'ExCeL.ExE'" count-process ( count )
+
excel.app.count 1 > [if]
cr cr ." W A R N I N G ! (from excel.f)" cr cr
." Multiple Excel.Application are running, I can only handle one of them." cr
@@ -40,6 +40,7 @@
." that one or you'll have to use the 'kill-excel' command to close all of them and" cr
." then '--excel.f-- include excel.f' to restart me, the excel.f module, again." cr cr
[then]
+
excel.app.count [if]
\ 用這行就錯了! On Error Resume Next:Set xl=GetObject("","excel.application"):vm.push(xl) 會開出新 Excel.Application。
On Error Resume Next:Set xl=GetObject(,"excel.application"):vm.push(xl) \ 這行才是沿用既有的 Excel.Application。
@@ -501,7 +502,7 @@ function lookup(index){ // return hash[index] or undefined
[then] \ excel.app exists
\ -- end of source code --
-
+
\ \ ================ How to open an Excel file ============================================
\ \
From d99c548c4acf1aa3d68cf3283197a7c7b2bb3417 Mon Sep 17 00:00:00 2001
From: "H.C. Chen"
Date: Thu, 29 Mar 2018 18:37:01 +0800
Subject: [PATCH 11/20] better excel.f
---
3hta/excel/excel.f | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/3hta/excel/excel.f b/3hta/excel/excel.f
index d4b7432..3cb0ccb 100644
--- a/3hta/excel/excel.f
+++ b/3hta/excel/excel.f
@@ -238,12 +238,20 @@
else selection :: item(tos()).activate() then ;
/// 這組工具:上,下,左,右,當格,的【判斷】都依賴這些 cell 有
/// 值,若不然時就要用本命令 i?stop 透過 selection 來完成。
- /// \ Example, 選中的格子都去掉頭尾空白。
+ /// \ Example-1, 選中的格子都去掉頭尾空白,做完 i 自動消失
/// manual 0 cut ( 前置準備 )
- /// i?stop ( 【判斷】兼【移位】,留下 i )
- /// cell@ trim cell! ( do 把當格前後空白都刪掉 )
+ /// i?stop ( 【判斷】兼【移位】,留下 i,此 i 不能破壞 )
+ /// cell@ trim cell! ( do 把當格前後空白都刪掉,i 沒用到就放著 )
/// 1 nap rewind ( 重複 )
- /// auto ( 收尾 )
+ /// auto ( 收尾 )
+ ///
+ /// \ Example-2: 檢查選中的格子是否都是數字,若非就印出 i 繼續,做完 i 自動消失
+ /// cr manual 0 [begin] ( 前置準備 )
+ /// i?stop ( 【判斷】兼【移位】,留下 i,此 i 不能破壞 )
+ /// cell@ js> typeof(pop())=='number' ( i number? )
+ /// [if] ( i 不能破壞 ) [else] dup ( i 不能破壞 ) . cr [then] ( 若非 number 印出 i )
+ /// 1 nap [again] ( 重複 )
+ /// auto ( 收尾 )
: @?stop ?cell@ if drop else stop then ; // ( -- ) Stop if the activeCell is not value
/// Example, 一路往下只要【當格】有值就把它抄到右邊去:
From cf39f12888e894b2c2870197f96f7dbbe6902d77 Mon Sep 17 00:00:00 2001
From: "H.C. Chen"
Date: Thu, 12 Apr 2018 14:33:20 +0800
Subject: [PATCH 12/20] fix a bug in ls.f
3htm localStorage members are not editbox fields, fixed
---
3htm/f/ls.f | 26 +++++++++++++----------
LOG/log.txt | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 72 insertions(+), 13 deletions(-)
diff --git a/3htm/f/ls.f b/3htm/f/ls.f
index 7bc0bfb..61d761a 100644
--- a/3htm/f/ls.f
+++ b/3htm/f/ls.f
@@ -670,17 +670,21 @@ function Handler(w) {
swap ( DIV array ) \ 放整個 list 的 DIV, 非必要但可避免被 er 刪除。
begin js> tos().length while ( DIV array )
js> tos().pop() ( DIV array fieldname )
- ( DIV array fieldname INPUT )
- dup ( DIV array fieldname INPUT INPUT )
- char fieldname ( DIV array fieldname INPUT INPUT "fieldname" )
- js> tos(3) ( DIV array fieldname INPUT INPUT "fieldname" fieldname )
- setAttribute ( DIV array fieldname INPUT )
- js> tos(3) swap appendChild ( DIV array fieldname )
- ( DIV array fieldname INPUT )
- dup char fieldname js> tos(3) setAttribute ( DIV array fieldname INPUT )
- js> tos(3) swap appendChild ( DIV array fieldname )
- s" " swap + char + ( DIV array SPAN )
- js> tos(2) swap appendChild ( DIV array )
+ js> typeof(storage.all()[tos()])=='string' if \ 過濾非 editbox fields 的東西
+ ( DIV array fieldname INPUT )
+ dup ( DIV array fieldname INPUT INPUT )
+ char fieldname ( DIV array fieldname INPUT INPUT "fieldname" )
+ js> tos(3) ( DIV array fieldname INPUT INPUT "fieldname" fieldname )
+ setAttribute ( DIV array fieldname INPUT )
+ js> tos(3) swap appendChild ( DIV array fieldname )
+ ( DIV array fieldname INPUT )
+ dup char fieldname js> tos(3) setAttribute ( DIV array fieldname INPUT )
+ js> tos(3) swap appendChild ( DIV array fieldname )
+ s" " swap + char + ( DIV array SPAN )
+ js> tos(2) swap appendChild ( DIV array )
+ else
+ drop ( DIV array )
+ then
repeat 2drop
\ 給以上變出來的 buttons 畫龍點睛
['] (export-one-field) ['] (ed)
diff --git a/LOG/log.txt b/LOG/log.txt
index 3aea007..5bb3c11 100644
--- a/LOG/log.txt
+++ b/LOG/log.txt
@@ -6052,5 +6052,60 @@
js> vm[context].x 要簡化成 vm.v('x') , vm.forth.y 簡化成 vm.r('y')
13:11 2018-03-20 完成
-
-
\ No newline at end of file
+[ ] 請問 FORTH 的 select - case 結構怎麼實現?
+ H.C.Chen
+ 週三 2018/4/4, 下午 09:45
+ 有網友問, 因為 if else then 多幾層之後,收尾就會有一大堆 then then then
+ then . . . . 不好看。我試著「畫」個樣子出來(如下),添加 start-case, case,
+ end-case 命令好像可以?有現成的設計嗎?
+
+ start-case boolean1 if
+ do case1 \ 然後跳到 end-case 之後
+ case boolean2 if
+ do case2 \ 然後跳到 end-case 之後
+ case boolean3 if
+ do case3 \ 然後跳到 end-case 之後
+ case boolean4 if
+ do case4 \ 然後跳到 end-case 之後
+ end-case
+
+ - start-case 於 compile state 初始一個暫時獨立的 array 記錄每個 case 的位置;run time 不做事。
+ - if 若成立,往下執行到 else 或 case 或 then 為止,跳到 then 或 end-case 之後。
+ - if 若不成立,往下跳到 else 或 then 或 case。
+ - case , compile 跳往 end-case 的 jump 命令,向 start-case 登記自己的位置供 end-case 來回填它的位置; 。然後回填 here 給前一個 if ,
+ - end-case , compile time 要回填 here 給之前所有的 case。
+
+ \ A1
+ 吳政昌(亞斯)
+ 週三 2018/4/11, 上午 08:45
+ 參考 https://github.com/phf/forth/blob/master/x86/jonesforth.f
+
+ \ A2
+ 吳政昌(亞斯)
+ 週三 2018/4/11, 上午 08:36
+ 參考 https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Selection.html
+ Selection - Gforth Manual
+ 5.8.1 Selection. flag IF code ENDIF . If flag is non-zero (as far as IF etc. are concerned, a cell with any bit set represents truth) code is executed. flag IF code1 ELSE code2 ENDIF
+ www.complang.tuwien.ac.at
+
+[x] EditBox edit box 壞了,有些 fields 殺不掉,改不了。
+ [x] 先複習 ls.f 有啥東西 --> eb.delete 裡最後是這樣:
+ ( eb name ) js: storage.del(pop()) ( eb ) removeElement ;
+ [x] storage <-- where from? ... from jeforth.3we\3htm\f\platform.f
+ js> storage.all() (see)
+ 看到只有三個 fields 'ad' 'autoexec' 'pruning' 所以其他東西不該出現的難怪
+ 不能 delete!
+ [x] 查 list command 怎麼回事?
+ js> storage.all() obj>keys .
+ ad,autoexec,pruning,length,key,getItem,setItem,removeItem,clear OK
+ 除了前三個 field,其他都是 object members. <--------- RI!
+ 這些 members 可能是新的吧? 為何以前沒有發現?
+ --> 3hta 沒有 js> storage.all().length
+ [ ] 既然 chrome 有了新的 localStorage object members 咱就該考慮用上去,例
+ 如用 storage.all().length storage.all().key(i) 等等,而非目前的解法
+ 用 typeof(field)=='string' 來加一層分辨,有點簍。
+ [x] js> storage.all() obj>keys . <--- 其中只有 editbox 的 fields 的 type 是 string
+ 可行的解法。 ----> 好了! 改了 ls.f 的 list 之定義,利用分辨是否 string
+ 過濾掉非 editbox fields.
+ FP @ 14:01 2018-04-12
+
\ No newline at end of file
From 6ad8762183acc42ab885bcc51c976d209fa477d5 Mon Sep 17 00:00:00 2001
From: "H.C. Chen"
Date: Thu, 12 Apr 2018 16:21:49 +0800
Subject: [PATCH 13/20] case...endcase copied from joneforth works fine
---
LOG/log.txt | 14 +++++++++++++-
f/jeforth.f | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+), 1 deletion(-)
diff --git a/LOG/log.txt b/LOG/log.txt
index 5bb3c11..48c4c3a 100644
--- a/LOG/log.txt
+++ b/LOG/log.txt
@@ -6108,4 +6108,16 @@
可行的解法。 ----> 好了! 改了 ls.f 的 list 之定義,利用分辨是否 string
過濾掉非 editbox fields.
FP @ 14:01 2018-04-12
-
\ No newline at end of file
+
+[x] select-case 參考 T550 Downloads\jonesforth.f
+ [x] 先查看 if else then 的寫法一不一樣 ... 差不多,所以照抄有機會
+ : if ( -- a ) \ if..else..then, if..then
+ compile 0branch here 0 , ; immediate compile-only
+ : IF IMMEDIATE
+ ' 0BRANCH , \ compile 0BRANCH
+ HERE @ \ save location of the offset on the stack
+ 0 , \ compile a dummy offset
+ ;
+ [x] 直接抄 joneforth 立刻成功.
+ [x] 3htm, 3hta 直接就通過了 selftest
+
\ No newline at end of file
diff --git a/f/jeforth.f b/f/jeforth.f
index a1a26c4..eae8974 100644
--- a/f/jeforth.f
+++ b/f/jeforth.f
@@ -1173,6 +1173,54 @@ function test(x){ return x }; test() null = \ true true
[d 1,0,2,2 d] [p "?dup" p]
+ \ case ... endcase definition is copied from
+ \ https://github.com/phf/forth/blob/master/x86/jonesforth.f
+ \ Also thanks to FigTaiwan 吳政昌(亞斯) for the hints.
+
+: case ( -- 0 ) \ ( key ) case of endof endcase
+ 0 ; immediate
+ /// Usage:
+ /// ( key ) case
+ /// char a of char AAAA endof
+ /// char b of char BBBB endof
+ /// char c of char CCCC endof
+ /// \ In default case, the key must be at TOS for being eaten by endcase
+ /// char ???? swap
+ /// endcase
+
+: of ( -- ) \ ( key ) case of endof endcase
+ ['] over , ['] = , [compile] if ['] drop , ; immediate
+ /// see help case
+
+: endof ( -- ) \ ( key ) case of endof endcase
+ [compile] else ; immediate
+ /// see help case
+
+: endcase ( -- ) \ ( key ) case of endof endcase
+ ['] drop , begin ?dup while [compile] then repeat ; immediate
+ /// see help case
+
+
+ *** case ... endcase
+ marker ---
+ : test
+ case
+ char a of char AAAA endof
+ char b of char BBBB endof
+ char c of char CCCC endof
+ \ In default case, the key must be at TOS for being eaten by endcase
+ char ???? swap
+ endcase ;
+ char a test \ ==> AAAA (string)
+ char b test \ ==> BBBB (string)
+ char c test \ ==> CCCC (string)
+ char d test \ ==> ???? (string)
+
+ [d 'AAAA','BBBB','CCCC','????' d]
+ [p 'case', 'of', 'endof', 'endcase' p]
+ ---
+
+
: variable ( -- ) \ Create a variable.
create 0 , [ char push(function(){last().type='colon-variable'}) jsEvalNo , ] ;
From 7d8e2a8241b3dbf1f1c7c56433a13e4297a9cf18 Mon Sep 17 00:00:00 2001
From: "H.C. Chen"
Date: Mon, 16 Apr 2018 10:57:50 +0800
Subject: [PATCH 14/20] new command find-office-nic
---
3hta/f/misc.hta.f | 35 ++++++++++++++++++++++++++++-------
3hta/f/wmi.f | 14 +++++++++++---
2 files changed, 39 insertions(+), 10 deletions(-)
diff --git a/3hta/f/misc.hta.f b/3hta/f/misc.hta.f
index 859f0db..1926c6d 100644
--- a/3hta/f/misc.hta.f
+++ b/3hta/f/misc.hta.f
@@ -57,13 +57,34 @@ Math.sign = function sign(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };
\ ----- NIC on/off utility -----
- 19 value officeLAN // ( -- n ) DeviceID of the OA LAN NIC. Change this for your case.
- /// "where deviceid = 19" is for my LRV2 OA only
- /// Need administrator privilege, run 'dos' check title.
- /// Run 3HTA.bat through right click to 'Run as administrator'.
- /// Set NIC deviceID : "19 to officeLAN" misc.f
- /// Get NIC deviceID : "activeNIC :> deviceid ." wmi.f
- /// See all NIC devices : "list-all-nic" wmi.f
+ 0 value officeLAN // ( -- n ) DeviceID of the OA LAN NIC. Change this for your case.
+ /// Loaded by find-office-nic command automatically
+ /// Need administrator privilege, Run 3HTA.bat through right click to 'Run as administrator'.
+ /// Set NIC deviceID : 19 to officeLAN
+ /// Get NIC deviceID : activeNIC :> deviceid
+ /// See all NIC devices : list-all-nic
+ /// "where deviceid = 8" is for my LRV2 OA
+
+ : is-office-nic? ( "caption" -- boolean ) \ 用 Caption 來辨認 OA 的 office LAN 是那個 nic
+ tos().indexOf("ThinkPad USB-C Dock Ethernet")!=-1
+ pop(1).indexOf("Intel(R) Ethernet Connection (4) I219-LM")!=-1
+ or ;
+
+ : find-office-nic ( -- ) \ Load officeLAN with office NIC automatically
+ "" getNIC ( nic nic ... ) \ No where clause, get all of them
+ #nic ?dup if for
+ >r r@ :> caption is-office-nic? \ 找到了
+ if
+ r@ :> NetConnectionStatus==2 \ must be connected
+ if
+ r@ :> DeviceID to officeLAN
+ then
+ then
+ r> drop
+ next then ;
+
+ 0 to officeLAN find-office-nic officeLAN [if] [else]
+ alert("officeLAN not found! nicon nicoff will not work") [then]
: (nicoff) ( -- ) \ Turn off the NIC (the certain where clause is for my LRV2 only)
\ s" where deviceid = 19" getNIC :> disable()
diff --git a/3hta/f/wmi.f b/3hta/f/wmi.f
index afaacab..58ba4fc 100644
--- a/3hta/f/wmi.f
+++ b/3hta/f/wmi.f
@@ -117,9 +117,7 @@
/// activeNIC :> enable() \ return 5 is failed when not an administrator
/// check #nic for the active NIC count if there are many.
-: list-all-nic ( -- ) \ List all NIC devices
- cr ." ---- List all NIC ----" cr
- "" getNIC ( nic nic ... ) \ No where clause, get all of them
+: nics-on-stack ( nic1 nic2 ... -- ) \ Print NIC objects on data stack, #nic is their count
#nic ?dup if for
>r r@ :> caption . cr
." / NetConnectionStatus: " r@ :> NetConnectionStatus . cr
@@ -131,6 +129,16 @@
r> drop
next then ;
+: list-all-nic ( -- ) \ List all NIC devices
+ cr ." ---- List all NICs ----" cr
+ "" getNIC ( nic nic ... ) \ No where clause, get all of them
+ nics-on-stack ;
+
+: list-active-nic ( -- )
+ cr ." ---- List Acive NICs ----" cr
+ "" activeNIC ( nic nic ... ) \ No where clause, get all of them
+ nics-on-stack ;
+
." List all NIC" cr
"" getNIC ( nic nic ... ) \ No where clause, get all of them
From fb1283838826a792b7673992e45ba414bfd19c7d Mon Sep 17 00:00:00 2001
From: "H.C. Chen"
Date: Mon, 16 Apr 2018 11:01:43 +0800
Subject: [PATCH 15/20] improve message
---
3hta/f/misc.hta.f | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/3hta/f/misc.hta.f b/3hta/f/misc.hta.f
index 1926c6d..53e2989 100644
--- a/3hta/f/misc.hta.f
+++ b/3hta/f/misc.hta.f
@@ -84,7 +84,7 @@ Math.sign = function sign(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };
next then ;
0 to officeLAN find-office-nic officeLAN [if] [else]
- alert("officeLAN not found! nicon nicoff will not work") [then]
+ alert("officeLAN not found! Manually '8 to officeLAN' for nicon,nicoff") [then]
: (nicoff) ( -- ) \ Turn off the NIC (the certain where clause is for my LRV2 only)
\ s" where deviceid = 19" getNIC :> disable()
From b33f6ecf7a3513a929824531aa284edffb787bc0 Mon Sep 17 00:00:00 2001
From: "H.C. Chen"
Date: Fri, 27 Apr 2018 18:24:59 +0800
Subject: [PATCH 16/20] todo open
---
LOG/log.txt | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/LOG/log.txt b/LOG/log.txt
index 48c4c3a..28984ce 100644
--- a/LOG/log.txt
+++ b/LOG/log.txt
@@ -6120,4 +6120,10 @@
;
[x] 直接抄 joneforth 立刻成功.
[x] 3htm, 3hta 直接就通過了 selftest
-
\ No newline at end of file
+
+[ ] Yuan: 參考一下 Excel 增益集 JavaScript 程式設計概觀
+ https://msdn.microsoft.com/zh-tw/library/office/mt616487.aspx
+ Office Resources
+ https://developer.microsoft.com/en-us/office/gallery/?filterBy=Samples
+
+
From 88383cb7b6f5eca8c624276313da7bf3f0922e05 Mon Sep 17 00:00:00 2001
From: "H.C. Chen"
Date: Wed, 30 May 2018 18:58:44 +0800
Subject: [PATCH 17/20] add discover command to 12choc.f
---
demo/12choc.f | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/demo/12choc.f b/demo/12choc.f
index eb4988a..482063e 100644
--- a/demo/12choc.f
+++ b/demo/12choc.f
@@ -325,11 +325,11 @@
sponge.setAngle(0);
sponge.setVel(cp.v(0,0));
1000 nap ;
- : 6:6 ( 8 numbers -- ) \ Put 6 chocs on each side
+ : 6:6 ( 12 numbers -- ) \ Put 6 chocs on each side
6 left:right home
hold< 6 for drop-choc-right drop-choc-left wait nap next >hold ;
- : 5:5 ( 8 numbers -- ) \ Put 5 chocs on each side
+ : 5:5 ( 10 numbers -- ) \ Put 5 chocs on each side
5 left:right home
hold< 5 for drop-choc-right drop-choc-left wait nap next >hold ;
@@ -348,6 +348,11 @@
: 1:1 ( 2 numbers -- ) \ Put 1 choc on each side
home hold< drop-choc-right drop-choc-left wait nap >hold ;
+ : discover ( -- ) \ Put all chocs into the liquid to see which one is defect
+ 12 [for] 12 t@ - drop-choc-left wait nap [next] ;
+ /// Move the sponge right side out of the tank but
+ /// left side in the liquid.
+
\ Auxiliary tools
: view ( -- ) \ See all chocolates' weight
From f18fb04a6eeccbcbfad0dcf515285b6ee0787356 Mon Sep 17 00:00:00 2001
From: "H.C. Chen"
Date: Thu, 14 Jun 2018 16:26:47 +0800
Subject: [PATCH 18/20] =?UTF-8?q?=E7=A9=BA=E8=B0=B7=E5=85=88=E7=94=9F?=
=?UTF-8?q?=E7=99=BC=E7=8F=BE=E7=9A=84=20bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
|| 定義有誤, 存在了那麼久!
---
LOG/log.txt | 13 +++++++++++++
f/jeforth.f | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/LOG/log.txt b/LOG/log.txt
index 28984ce..14f62e6 100644
--- a/LOG/log.txt
+++ b/LOG/log.txt
@@ -6126,4 +6126,17 @@
Office Resources
https://developer.microsoft.com/en-us/office/gallery/?filterBy=Samples
+[ ] 13:00 2018/06/14 用 jupyter notebook 有兩種選擇:
+ 1. 用 ijavascript kernel, 缺點就是沒有 magic 無法與其他 jupyter notebook 功能
+ 協作.
+ 2. 用 %%js 問題是跨 Cell 好像就斷了!
+
+[x] 空谷居士:在我这边,因为,比源系统多增加include了一个汉化的文件,会有这么个小状况。
+ 以前也没有,不知道为什么,这两天发现冒出来了。
+ yeap , include 1.f , 裡面只有一行 comment , 果真 stack 出現空 string
+ 有空看看
+ RI: 本來的 || 定義有誤!!我當時知道,但是在 jeforth.3ca\3htm\f\quit.f 用上時忘了!
+ was: code || push(pop(1)||pop()) end-code // ( a b == a || b ) if a then swap else b endif
+ tobe: code || tos(1) ? pop() : pop(1) end-code // ( a b == a || b ) if a then a else b endif
+ 解決了!
diff --git a/f/jeforth.f b/f/jeforth.f
index eae8974..8cfaa58 100644
--- a/f/jeforth.f
+++ b/f/jeforth.f
@@ -671,7 +671,7 @@ function nextQuote(source) {
code or var b=pop(),a=pop();push(Boolean(a)||Boolean(b)) end-code // ( a b == a or b ) Logical or. See also '||' and 'OR'.
code not push(!Boolean(pop())) end-code // ( x == !x ) Logical not. Capital NOT is for bitwise.
code && push(pop(1)&&pop()) end-code // ( a b == a && b ) if a then b else swap endif
-code || push(pop(1)||pop()) end-code // ( a b == a || b ) if a then swap else b endif
+code || tos(1) ? pop() : pop(1) end-code // ( a b == a || b ) if a then a else b endif
code AND push(pop() & pop()) end-code // ( a b -- a & b ) Bitwise AND. See also 'and' and '&&'.
code OR push(pop() | pop()) end-code // ( a b -- a | b ) Bitwise OR. See also 'or' and '||'.
code NOT push(~pop()) end-code // ( a -- ~a ) Bitwise NOT. Small 'not' is for logical.
From d7c38f9bfd871e5f602bb67105cf96e9a9b89890 Mon Sep 17 00:00:00 2001
From: "H.C. Chen"
Date: Fri, 15 Jun 2018 10:06:35 +0800
Subject: [PATCH 19/20] sideeffects fixed
---
LOG/log.txt | 4 ++++
f/jeforth.f | 6 +++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/LOG/log.txt b/LOG/log.txt
index 14f62e6..49921be 100644
--- a/LOG/log.txt
+++ b/LOG/log.txt
@@ -6139,4 +6139,8 @@
was: code || push(pop(1)||pop()) end-code // ( a b == a || b ) if a then swap else b endif
tobe: code || tos(1) ? pop() : pop(1) end-code // ( a b == a || b ) if a then a else b endif
解決了!
+ 本來的寫法是直接套用 javascript 的 || 運算,當初想鐵定不會錯。
+ 現在看,因為 pop(a) || pop(b) 的特性,如果 pop(a) 成立了,pop(b) 根本不會被執行,
+ 那就會把 b 留在 FORTH data stack 裡, 這個結果太奇怪,沒有用。所以要改寫。
+ || 很少用,我用上了時不記得這種詭異的行為,結果出錯了,幸好被您發現!!
diff --git a/f/jeforth.f b/f/jeforth.f
index 8cfaa58..76e2cf9 100644
--- a/f/jeforth.f
+++ b/f/jeforth.f
@@ -696,9 +696,9 @@ function nextQuote(source) {
true and \ true
true or \ true
false or \ true
- {} [] || \ true [] {}
- && \ true []
- || \ [] true
+ {} [] || \ true {}
+ [] && \ true []
+ swap \ [] true
&& \ true
"" && \ true ""
not \ false
From 93794a58d45162f07f588d15dc9000f5fc88ce09 Mon Sep 17 00:00:00 2001
From: "H.C. Chen"
Date: Sun, 17 Jun 2018 12:27:49 +0800
Subject: [PATCH 20/20] about to make a release
---
3hta/f/misc.hta.f | 7 +
3htm/f/ls.f | 12 +-
LOG/log.txt | 10045 ++++++++++++++++++++++----------------------
f/jeforth.f | 8 +-
js/version.js | 2 +-
5 files changed, 5067 insertions(+), 5007 deletions(-)
diff --git a/3hta/f/misc.hta.f b/3hta/f/misc.hta.f
index 53e2989..7039b46 100644
--- a/3hta/f/misc.hta.f
+++ b/3hta/f/misc.hta.f
@@ -55,6 +55,8 @@ Math.sign = function sign(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };
( Word array ) (aliases) ;
/// Used in DOS box batch program for jeforth to ignore DOS words.
+proc-env COMPUTERNAME char 31ENB667 = [if]
+
\ ----- NIC on/off utility -----
0 value officeLAN // ( -- n ) DeviceID of the OA LAN NIC. Change this for your case.
@@ -123,4 +125,9 @@ Math.sign = function sign(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };
\ nicoff 60 * 1000 * nap nicon ;
\ last :: comment=tick('officeLAN').comment
+[then]
+
+
+\ --- The End ---
+
\ No newline at end of file
diff --git a/3htm/f/ls.f b/3htm/f/ls.f
index 61d761a..2a1f3ea 100644
--- a/3htm/f/ls.f
+++ b/3htm/f/ls.f
@@ -737,12 +737,12 @@ function Handler(w) {
js> storage.get("autoexec") [if] [else]
\ js: outputbox.style.fontSize="1.5em"
- cr .( Launch the briefing ) cr
- drop
- cr cr
- .( execute the 'list' command ) cr
+ \ cr .( Launch the briefing ) cr
+ \ drop
+ \ cr cr
+ \ .( execute the 'list' command ) cr
list
unindent
{} js: tos().doc=pop(1) js: tos().readonly=true js: tos().mode=true
diff --git a/LOG/log.txt b/LOG/log.txt
index 49921be..780d6d1 100644
--- a/LOG/log.txt
+++ b/LOG/log.txt
@@ -1,544 +1,544 @@
- ~%~%~%~%~%~%~%~ j e f o r t h . 3 w e ~%~%~%~%~%~%~%~
- The jeforth with a three words engine
- Same kernel - jeforth.js, jeforth.f, voc.f - for
- all applications - HTA, HTM, Node.js - and more?
- http://github.com/hcchengithub/jeforth.3we
+ ~%~%~%~%~%~%~%~ j e f o r t h . 3 w e ~%~%~%~%~%~%~%~
+ The jeforth with a three words engine
+ Same kernel - jeforth.js, jeforth.f, voc.f - for
+ all applications - HTA, HTM, Node.js - and more?
+ http://github.com/hcchengithub/jeforth.3we
---------- developping log --------------------------------------------------------------
-[x] first line of jeforth.f is strange. I skip it now. Need to find out the reason someday. hcchen5600 2014/01/28 11:39:49
- ==> fso does not support utf-8, ado does.
+[x] first line of jeforth.f is strange. I skip it now. Need to find out the reason someday. hcchen5600 2014/01/28 11:39:49
+ ==> fso does not support utf-8, ado does.
[x] why UTF-8 chinese characters are not shown correctly? ==> big5 is ok!
- ==> fso does not support utf-8, ado does.
+ ==> fso does not support utf-8, ado does.
[X] jquery.terminal-0.7.7.js ==> I give up jQuery-terminal when it comes to HTA.
- > 552 var data = $.Storage.get(name + 'commands');
- > alert(name+"==>"+data);
- > 553 data = data ? new Function('return ' + data + ';')() : [];
- > 554 var pos = data.length-1;
+ > 552 var data = $.Storage.get(name + 'commands');
+ > alert(name+"==>"+data);
+ > 553 data = data ? new Function('return ' + data + ';')() : [];
+ > 554 var pos = data.length-1;
- How to make a Terminal (comamnd line, shell like) U/I on Web page?
- See this answer ==> evernote:///view/2472143/s22/bf00c410-9727-401f-98a7-221c8fc00558/bf00c410-9727-401f-98a7-221c8fc00558/
+ How to make a Terminal (comamnd line, shell like) U/I on Web page?
+ See this answer ==> evernote:///view/2472143/s22/bf00c410-9727-401f-98a7-221c8fc00558/bf00c410-9727-401f-98a7-221c8fc00558/
[x] the screen output is a little strange, messy. Find a SRP.
- ==> print() probably is the root cause, it wrap around long lines. Looks like the jQuery-terminal
- thinks of the right-edge with a wrong number.
- ==> When use 'body' instead of a DIV component, the jQuery-terminal can not scroll up and the
- bottom line can not see!
- ==> So, give up using jQuery-terminal? Sure, ok this is it!
- ==> [/] simplify the SRP and report to the jQuery-terminal author.
- ==> [/] also consider to use termlib.js @ evernote:///view/2472143/s22/6df50a24-f3b8-4ae4-afc5-45d7e180b3dc/6df50a24-f3b8-4ae4-afc5-45d7e180b3dc/
- ==> [x] Try normal HTML terminal first
- ------ http://jsfiddle.net/hcchen/9Kr5E/ hcchen/jsfiddle ------------------
- << HTML section >>
-
-
恭喜發財!
-
- root@host
-
-
-
- << JavaScript section >>
-
- $("#command").keyup(function (e) {
- if (e.keyCode == 13) {
- submit();
- }
- });
-
- var submit = function () {
- var command = document.getElementById("command").value;
- var outputel = document.getElementById("screenoutput");
- var div = document.createElement("div");
- div.innerHTML = "root@host " + command;
- outputel.appendChild(div);
- document.getElementById("command").value = "";
- };
- ==> I give up jQuery-terminal when it comes to HTA.
+ ==> print() probably is the root cause, it wrap around long lines. Looks like the jQuery-terminal
+ thinks of the right-edge with a wrong number.
+ ==> When use 'body' instead of a DIV component, the jQuery-terminal can not scroll up and the
+ bottom line can not see!
+ ==> So, give up using jQuery-terminal? Sure, ok this is it!
+ ==> [/] simplify the SRP and report to the jQuery-terminal author.
+ ==> [/] also consider to use termlib.js @ evernote:///view/2472143/s22/6df50a24-f3b8-4ae4-afc5-45d7e180b3dc/6df50a24-f3b8-4ae4-afc5-45d7e180b3dc/
+ ==> [x] Try normal HTML terminal first
+ ------ http://jsfiddle.net/hcchen/9Kr5E/ hcchen/jsfiddle ------------------
+ << HTML section >>
+
+
恭喜發財!
+
+ root@host
+
+
+
+ << JavaScript section >>
+
+ $("#command").keyup(function (e) {
+ if (e.keyCode == 13) {
+ submit();
+ }
+ });
+
+ var submit = function () {
+ var command = document.getElementById("command").value;
+ var outputel = document.getElementById("screenoutput");
+ var div = document.createElement("div");
+ div.innerHTML = "root@host " + command;
+ outputel.appendChild(div);
+ document.getElementById("command").value = "";
+ };
+ ==> I give up jQuery-terminal when it comes to HTA.
[x] In .3nw jsEvalRaw's return value spec was quirky, it was ( data errormsg ), make it simpler
- ( data, errormsg, flag) ?
- jsEvalRaw is a very useful word. By using jsEvalRaw, we don't need to try{}catch{} every
- system call. E.g. readTextFile() and writeTextFile() become much easier.
+ ( data, errormsg, flag) ?
+ jsEvalRaw is a very useful word. By using jsEvalRaw, we don't need to try{}catch{} every
+ system call. E.g. readTextFile() and writeTextFile() become much easier.
[x] Now start to port wsh.f (wmi.f excel.f ... )
[x] Make .... <=== 研究 WSC 就是為了要 support 這組有趣的命令
- Study how to combine VBscipt and JScript
- HTC http://msdn.microsoft.com/en-us/library/ms532146(v=vs.85).aspx
- WSC or WSH gui interface with IE or HTA http://computer-programming-forum.com/61-wsh/9dad42d8c1e3a878.htm
+ Study how to combine VBscipt and JScript
+ HTC http://msdn.microsoft.com/en-us/library/ms532146(v=vs.85).aspx
+ WSC or WSH gui interface with IE or HTA http://computer-programming-forum.com/61-wsh/9dad42d8c1e3a878.htm
- hcchen5600 2014/07/01 08:44:41 It's very easy. See below hcchen5600 2014/06/30 17:22:40
+ hcchen5600 2014/07/01 08:44:41 It's very easy. See below hcchen5600 2014/06/30 17:22:40
[/] WSC can be used in VBScript even wthout registered.
- Ask Michael Harris, if same thing can be done in JScript? ==> Now I realized, even if it
- would turn out that only VBscript can GetObject(..wsc..) is good enough. jeforth.hta uses
- that VBScript to launch jeforth.js would be fine.
- [x] Put the jeforth.js into jeforth.wsc, Open jeforth.WSC in jeforth.hta
- ==> use to include jeforth.js in WSC is ok.
- [/] we can publicate properties and methods but how to publicate objects?
-
-
-
-
-
- ==> If you are thinking of a