前言:
主要是紀錄一下一些在命令列(console mode)下的快捷鍵,希望以後有需要用到可以給自己紀錄一下.
Console的快捷鍵列表
參考這裡來的.
以下兩個主要是一次移動一個字
alt ⌥+F to jump Forward by a word
alt ⌥+B to jump Backward by a word
這邊有其他的部分,移動字元,或是移動到一開始.
ctrl+A to jump to start of the line
ctrl+E to jump to end of the line
ctrl+K to kill the line starting from the cursor position
ctrl+Y to paste text from the kill buffer
ctrl+R to reverse search for commands you typed in the past from your history
ctrl+S to forward search (works in zsh for me but not bash)
ctrl+F to move forward by a char
ctrl+B to move backward by a char
在iTerm2 裡面編輯快捷鍵來使用一次跳一個字
參考這裡
按下 cmd + ,
選取 Profile -> Keys
加入以下: 使用 Alt+ <-來向左跳一個字
Keyboard Shortcut: ⌥←
Action: Send Escape Sequence
Esc+: b
加入以下: 使用 Alt+ ->來向右跳一個字
- Keyboard Shortcut: ⌥→
Action: Send Escape Sequence
Esc+: f
前言與心得整理 我把第六週的部分拆成上跟下,上半部主要解釋P與NP之間的定義與關係.下半部就是要介紹一些證明P=NP的一些理論與方法. 課堂到了最後,其實課堂裡面有許多有用的理論與推導想法,尤其是NP Complete推導的思路,真的能改變解決問題的思考脈絡與方法.相信也可以在以後解決問題的時候,更快可以判別問題的難度. 相關文章 [Coursera][Automata] 自動機理論-Automata筆記-第一週Finite Automata [Coursera][Automata] 自動機理論-Automata筆記-第二週: Regular Expression [Coursera][Automata] 自動機理論-Automata筆記-第三週: Context-Free Grammars and Pushdown Automata [Coursera][Automata] 自動機理論-Automata筆記-第四週: Pushdown Automata and Properties of Context-Free Languages [Coursera][Automata] 自動機理論-Automata筆記-第五週: Turing Machines and Undecidability [Coursera][Automata] 自動機理論-Automata筆記-第六週(上): Intractable Problems and NP-completeness [Coursera][Automata] 自動機理論-Automata筆記-第六週(下): Intractable Problems and NP-completeness 第六週後半部分的課程內容: 問題難度的排序 根據前一個章節的整理,我們可以把問題依照困難度排列(難->簡單)如下: (假設 P不等於NP) 無解的問題 需要Exponatial Time才能解決的問題 多項式時間,還不能決定的問題 (所謂的 NP類問題) 裡面可以再分成 NP Complete(較難) -> NP (較簡單) 多項式時間,可以決定的問題 (所謂的 P類問題) 先回過頭看 Polynomial Reduction 在繼續看Cook’s Theorem定義之前,根據NPTEL的影片,其實有很多詳細的介紹.不過針對許多名詞有不同的定義: 首先先回過頭來看polynomial time reducibility定義如下: 假設一個可判定圖靈機(DTM),從輸入為x處理並且輸出y的處理時間為Polynomial time-bond.如果x屬於L2,我們可以寫L2從L1polynomial time reducible過來的如果滿足以下條件: L2 屬於NP類問題,如果L原本是NP類問題 L2 屬於P類問題,如果原本L是屬於P類問題 這邊也就是解釋,我們可以透過reduction把不同的問題經過歸約(reduction)後到可以處理(或是判斷)為哪一類問題. 就可以回過頭來判斷轉換錢的問題是屬於那一類的問題. 再來,根據原有的plynomial time reducibility,我們會引入另外一個名詞定義polynomially transformable如下: A language L1 is polynomially transformable to L2, if there is a deterministic polynomial-time-bounded Turing machine M which will convert each string w1 in the alphabet of L1 into a string w2 in the alphabet of L2, such that w1 is in L1 if and only if w2 is in L2 L1 is NP-Complete and L1 polynomially transformable L2. To prove NP...