2022 Fall CP 課程

2022 Fall 計算機程式的課程進度將放在 Weblog, 並且使用 mdecycu At cycu 登記 disqus. 所有與課程相關的問題, 都希望在各週 Weblog 下方的 disqus 詢答.

課程評分

cp2022 課程評分項目請參考: syllabus

命令提示字元

cmd (Command Line) 指令, 是 Windows 命令 中的一種. 常用的命令提示字元視窗中的指令包括:

echo, dir, cd, ping, set, rem, start, path, reg, exit, taskkill, powershell

網路環境設定

由於希望能夠讓電腦輔助設計室中使用純 IPv6 網路設定上網, 開機啟動後, 可採管理員模式執行下列 batch file 進行網路環境設定:

因為在執行過程中, 需要利用 Powershell 命令 關閉 IPv4 網路協定, 並開啟 IPv6 網路協定, 需要以管理員模式執行才能順利完成.

1_ipv6_network_setup.bat 通常放在隨身碟最外部, 且三個檔案放在同一目錄.

REM Get-ExecutionPolicy -List
REM Set-ExecutionPolicy RemoteSigned
echo "disable ipv4 and setup proxy for ipv6"
SET CurrentDir=%~dp0
%windir%\system32\reg.exe import %CurrentDir%1_2022_cadlab_network_setup.reg
REM powershell -noexit -executionpolicy bypass -File %CurrentDir%1_disable_ipv4.ps1
powershell -executionpolicy bypass -File %CurrentDir%1_disable_ipv4.ps1
exit

執行時, 需要 1_2022_cadlab_network_setup.reg 與 1_disable_ipv4.ps1 兩個檔案:

1_2022_cadlab_network_setup.reg 主要是關閉自動偵測 proxy server, 且手動設定代理主機.

Windows Registry Editor Version 5.00

 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
 ; disable AutoDetect
"AutoDetect"=dword:00000000
"MigrateProxy"=dword:00000001
; enable Proxy
"ProxyEnable"=dword:00000001 
"ProxyHttp1.1"=dword:00000000 
"ProxyServer"="http://[2001:288:6004:17::42]:3128"
"ProxyOverride"="localhost;"

執行 1_2022_cadlab_network_setup.reg, 只需要點擊滑鼠左鍵兩次就可以執行.

1_disable_ipv4.ps1 為 Powershell 命令, 主要將所有網路卡上的 IPv4 網路設定取消 (因為現階段所安裝的某套件會啟動網路攻擊, 透過 IPv4 網路協定嘗試與外部網站連結取得後門權限).

以下 Powershell 命令 會自動關閉 IPv4 網路協定, 然後開啟 IPv6 網路協定:

Disable-NetAdapterBinding -Name "*" -ComponentID ms_tcpip
Enable-NetAdapterBinding -Name "*" -ComponentID ms_tcpip6

上述相關設定檔案: cadlab_network_setup.zip

W1 教學影片

建立 Github 帳號

請尚未建立 Github 帳號的學員, 至 https://github.com/join 申請帳號. 課程評分項目將包含利用 Github Classroom 建立的倉儲與網站內容 (透過 invite link). 2022fall Github 帳號與學號對照的倉儲位於 https://github.com/mdecycu/studlist/tree/main/2022fall, w2 起將利用 https://ethercalc.net/ 在線由各學員自行輸入, 之後若 Github 更動, 則可以透過 Pull Requests 提出修改請求.

建立 Onedrive 帳號

請尚未建立 Onedrive 帳號的學員登入 @nfu 帳號後, 至 https://www.microsoft.com/zh-tw/education/products/office, 以 @nfu 帳號申請 Onedrive 5TB 儲存權限. 課程中所提供的檔案, 需要登入以 @nfu 註冊的 Onedrive 帳號後, 才能下載.

利用 Github 建立網頁

只要在 Github 倉儲中放入 HTML, cssJavascript, 並且設定 Github Pages 對應的分支, Github 就會給定 Github_帳號.github.io/倉儲名稱 作為網址 (各學員課程網址將為: https://mdecp2022.github.io/site-學員_Github_帳號), 以 WWW 伺服器 serve 使用者所提供的網頁內容.

除了配置在 Github Classroom 的課程倉儲與網頁外, 學員也可以在登入 Github 後, 利用 https://github.com/mdecycu/cmsite 作為 template, 使用 https://pages.github.com/ 建立個人網頁, 並利用網頁 (https://Github_帳號.github.io) 建立個人簡歷 (Curriculum Vitae) 網站.

維護 Github 上的網頁

在近端將動態網頁轉為靜態網頁後, acpGithub 倉儲.

Computer 簡介

以下資料取自: https://mde.tw/content/Computer.html

A computer is a digital electronic machine that can be programmed to carry out sequences of arithmetic or logical operations (computation) automatically. Modern computers can perform generic sets of operations known as programs. These programs enable computers to perform a wide range of tasks. A computer system is a "complete" computer that includes the hardware, operating system (main software), and peripheral equipment needed and used for "full" operation. This term may also refer to a group of computers that are linked and function together, such as a computer network or computer cluster.

A broad range of industrial and consumer products use computers as control systems. Simple special-purpose devices like microwave ovens and remote controls are included, as are factory devices like industrial robots and computer-aided design, as well as general-purpose devices like personal computers and mobile devices like smartphones. Computers power the Internet, which links billions of other computers and users.

Early computers were meant to be used only for calculations. Simple manual instruments like the abacus have aided people in doing calculations since ancient times. Early in the Industrial Revolution, some mechanical devices were built to automate long tedious tasks, such as guiding patterns for looms. More sophisticated electrical machines did specialized analog calculations in the early 20th century. The first digital electronic calculating machines were developed during World War II. The first semiconductor transistors in the late 1940s were followed by the silicon-based MOSFET (MOS transistor) and monolithic integrated circuit (IC) chip technologies in the late 1950s, leading to the microprocessor and the microcomputer revolution in the 1970s. The speed, power and versatility of computers have been increasing dramatically ever since then, with transistor counts increasing at a rapid pace (as predicted by Moore's law), leading to the Digital Revolution during the late 20th to early 21st centuries.

Conventionally, a modern computer consists of at least one processing element, typically a central processing unit (CPU) in the form of a microprocessor, along with some type of computer memory, typically semiconductor memory chips. The processing element carries out arithmetic and logical operations, and a sequencing and control unit can change the order of operations in response to stored information. Peripheral devices include input devices (keyboards, mice, joystick, etc.), output devices (monitor screens, printers, etc.), and input/output devices that perform both functions (e.g., the 2000s-era touchscreen). Peripheral devices allow information to be retrieved from an external source and they enable the result of operations to be saved and retrieved.

Program 簡介

以下資料取自: https://mde.tw/content/Program.html

A computer program is a sequence or set of instructions in a programming language for a computer to execute. Computer programs are one component of software, which also includes documentation and other intangible components.

A computer program in its human-readable form is called source code. Source code needs another computer program to execute because computers can only execute their native machine instructions. Therefore, source code may be translated to machine instructions using the language's compiler. (Machine language programs are translated using an assembler.) The resulting file is called an executable. Alternatively, source code may execute within the language's interpreter.

If the executable is requested for execution, then the operating system loads it into memory and starts a process. The central processing unit will soon switch to this process so it can fetch, decode, and then execute each machine instruction.

If the source code is requested for execution, then the operating system loads the corresponding interpreter into memory and starts a process. The interpreter then loads the source code into memory to translate and execute each statement. Running the source code is slower than running an executable. Moreover, the interpreter must be installed on the computer.

Python 簡介

以下資料取自: https://en.wikipedia.org/wiki/Python_(programming_language), 充分了解上述內容後, 可進入 https://mde.tw/content/Python.html 開始練習如何根據需求編寫 Python 程式.

Python is a high-level, interpreted, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.

Python is dynamically-typed and garbage-collected. It supports multiple programming paradigms, including structured (particularly procedural), object-oriented and functional programming. It is often described as a "batteries included" language due to its comprehensive standard library.

Guido van Rossum began working on Python in the late 1980s as a successor to the ABC programming language and first released it in 1991 as Python 0.9.0. Python 2.0 was released in 2000 and introduced new features such as list comprehensions, cycle-detecting garbage collection, reference counting, and Unicode support. Python 3.0, released in 2008, was a major revision that is not completely backward-compatible with earlier versions. Python 2 was discontinued with version 2.7.18 in 2020.

Python consistently ranks as one of the most popular programming languages.