{"id":29195901,"url":"https://github.com/pocper/ncu-course-programminganditsapplications","last_synced_at":"2025-07-02T05:06:48.165Z","repository":{"id":301358908,"uuid":"1007619170","full_name":"pocper/ncu-course-programmingAndItsApplications","owner":"pocper","description":"Projects for the NCU ME3099 Programming and Its Applications course, focusing on C# programming, Windows Forms design, multithreading, and resource management","archived":false,"fork":false,"pushed_at":"2025-06-26T12:20:00.000Z","size":1806,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-26T13:26:48.362Z","etag":null,"topics":["csharp","winforms-application"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pocper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-24T09:16:06.000Z","updated_at":"2025-06-26T12:27:58.000Z","dependencies_parsed_at":"2025-06-26T13:37:45.640Z","dependency_job_id":null,"html_url":"https://github.com/pocper/ncu-course-programmingAndItsApplications","commit_stats":null,"previous_names":["pocper/ncu-course-programminganditsapplications"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pocper/ncu-course-programmingAndItsApplications","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocper%2Fncu-course-programmingAndItsApplications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocper%2Fncu-course-programmingAndItsApplications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocper%2Fncu-course-programmingAndItsApplications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocper%2Fncu-course-programmingAndItsApplications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pocper","download_url":"https://codeload.github.com/pocper/ncu-course-programmingAndItsApplications/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocper%2Fncu-course-programmingAndItsApplications/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263077628,"owners_count":23410167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","winforms-application"],"created_at":"2025-07-02T05:06:47.530Z","updated_at":"2025-07-02T05:06:48.147Z","avatar_url":"https://github.com/pocper.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ncu-course-programmingAndItsAppications\n## 簡介\n- **學校** : 國立中央大學\n- **開課單位** : 機械工程學系\n- **課程名稱** : 程式設計與應用\n- **授課教授** : 林錦德 助理教授\n- **修課時間** : 2021年02月~2021年06月\n- **最終成績** : 99\n\n## 成績\n\n| 名稱 | 分數 | 名稱 | 分數 | 名稱 | 分數 |\n| ---- | ---- | ---- | ---- | ---- | ---- |\n| 作業02 | 100 | 小考02 | 100 | 期中模擬考   | 100 |\n| 作業03 | 100 | 小考03 | 100 | 期中考試     | 79 |\n| 作業04 | 100 | 小考04 | 100 | 期末考試     | 94 |\n| 作業05 | 100 | 小考05 | 100 | 期末觀念測試 | 79.9 |\n| 作業07 | 80  | 小考07 | 100 |  |  |\n| 作業10 | 100 | 小考10 | 100 |  |  |\n| 作業11 | 100 | 小考11 | 100 |  |  |\n| 作業12 | 100 | 小考12 | 100 |  |  |\n| 作業13 | 95  | 小考13 | 100 |  |  |\n| 作業14 | 95  | 小考14 | 100 |  |  |\n| 作業15 | 100 | 小考15 | 90  |  |  |\n| 作業16 | 100 | 小考16 | 100 |  |  |\n\n\n## 課程內容\n課程內容歸錦德老師所有，本人僅整理出大綱以供自己回顧\n\n1.  Week1  - Hello World! C#\n    \u003e 學習C#基礎語法(變數/判斷式/迴圈/陣列/指標/參考)\n2.  Week2  - 程式測試與除錯技巧\n    \u003e 學習如何使用Visual Studio的除錯功能\n3.  Week3  - WINDOWS FORM 設計(1) - 基本Windows Form 設計\n    \u003e 學習如何使用Winform中的Container/Tab/TextBox/Timer/Button\n4.  Week4  - WINDOWS FORM 設計(2) - 常用控制項介紹與實作\n    \u003e 學習如何使用Winform中的Label/CheckBox/ComboBox/ListBox/Event/DataTable\n5.  Week5  - 讀寫操作 - 字串操作\n    \u003e 學習字串建立/格式化/拆解/正則表示式/型別轉換\n6.  Week7  - 讀寫操作 - 檔案系統的操作與管理(2)\n    \u003e 學習檔案系統(檔案讀取/資料流)\n7.  Week8  - Midterm Mock Exam\n8.  Week9  - Midterm Exam\n9.  Week10 - 程式設計架構 - 命名空間、物件與DLL\n    \u003e 學習命名空間/類別/靜態方法/委派/事件/動態連結檔的製作與使用\n10. Week11 - 第三方函式庫(1) - 擷取與顯示麥克風訊號\n    \u003e 學習使用第三方函式庫/Chart Control\n11. Week12 - 多執行緒程式設計(1) - 使用與控制單一工作執行緒\n    \u003e 學習執行緒啟動/控制\n12. Week13 - 資源管理 - 物件生命週期與管理，GC 機制\n    \u003e 學習物件週期及Garbage Collection(GC)\n13. Week14 - 多執行緒程式設計(2) - 多執行緒互動、異常與設計樣本\n    \u003e 學習多執行緒的互動/鎖定/死結/非同步程序/異常處理\n14. Week15 - 第三方函式庫(2) - 使用第三方組件的注意事項\n15. Week16 - 使用SQLite的C語言DLL\n16. Week17 - 觀念測試\n17. Week18 - Final Exam\n\n## 作業介紹\n1. Week02_Debug  \n    EX03為二分逼近法，找出原始程式中的部分錯誤，並修正  \n    f(x) = x^2 - 2.8x + 5  \n    Theoretical Minimum:x=1.4, f(x) = 3.04  \n    Program Result: \n    ```\n    Find min value 3.04000002518296 at x = 1.39984130859375\n    ```\n\n2. Week03_WinFormDesign  \n    EX03為模擬機械手臂的狀態及位置，狀態分為靜止/移動/夾持/放置，位置分為原點/輸送帶/紅色倉儲區/綠色倉儲區\n    - 夾取紅色(狀態/位置):\n        移動/原點 (wait for 5 sec) -\u003e 夾持/紅色倉儲區 (wait for 2 sec) -\u003e 移動/紅色倉儲區 (wait for 8 sec) -\u003e 放置/輸送帶 (wait for 2 sec) -\u003e 移動/輸送帶 (wait for 7 sec) -\u003e 靜止/原點\n    - 夾取綠色(狀態/位置):\n        移動/原點 (wait for 8 sec) -\u003e綠色倉儲區 (wait for 2 sec) -\u003e綠色倉儲區 (wait for 5 sec) -\u003e 放置/輸送帶 (wait for 2 sec) -\u003e 移動/輸送帶 (wait for 7 sec) -\u003e 靜止/原點\n    \n    ![WinFormDesign](./Week03_WinFormDesign/result/EX03.png)\n\n3. Week04_WinFormDesign2  \n    EX04為一個dataGridView，並且具有四個欄位(Name/Height/Weight/Age)，當第一次開啟時會載入預設的10人資料，當使用者按下儲存會保留表格內的資料，載入會恢復上次儲存的資料，若沒有儲存過則是預設資料。\n    ![WinFormDesign2](./Week04_WinFormDesign2/result/EX04.png)\n\n4. Week06_StringManipulator  \n   HW為一個密碼強度檢察功能視窗，須滿足密碼條件(至少1個英文大寫、至少2個英文小寫、至少2個數字字元)\n\n   ![pwdChecker](./Week06_StringManipulator/HW/result/pwdChecker.png)\n\n5. Week07_FileSystem  \n   HW為一個可以讓使用者選擇資料夾，並且自動計算資料夾下所有檔案及資料夾數量  \n   ![calculateSizeFolder](./Week07_FileSystem/HW/result/calculateSizeFolder.png)\n\n6. Week10_ProgrammingStructure  \n   HW為將Box.dll加入參考，可透過文字框顯示長度寬度發生改變的時間及數值\n\n   ![Box](./Week10_ProgrammingStructure/HW/result/ex01.png)\n\n7. Week11_UseNAudio  \n   HW為即時錄製聲音樣本，並每100ms計算方均跟數值\n   ![Audio](./Week11_UseNAudio/result/ex01.png)\n\n8. Week12_BasicThread  \n   HW為使用者在文字框輸入文字內容並按下按鈕，執行緒會將文字內容呈現在第一個文字框裡面\n\n   ![Thread](./Week12_BasicThread/result/ex01.png)\n\n9. Week13_ResourceManagement  \n    HW為設計一個能夠寫入資料的類別(MyDataWriter)，當異常狀態發生(未正常關閉檔案)皆能釋放資源\n\n   ![Resource](./Week13_ResourceManagement/result/ex01.png)\n\n10. Week14_AdvancedThreadingProgramming  \n    避免兩個線程搶占資源，透過資源方式來避免\n    ![Thread2](./Week14_AdvancedThreadingProgramming/result/ex01.png)\n    ```\n    Thrd#3: 預備從帳戶_A_轉帳到帳戶_B_，轉帳金額100\n    Thrd#3: 預備lock 資源: _A_\n    Thrd#3: 已經lock 資源: _A_\n    Thrd#3: 預備lock 資源: _B_\n    Thrd#3: 已經lock 資源: _B_\n    Thrd#4: 預備從帳戶_B_轉帳到帳戶_A_，轉帳金額10\n    Thrd#4: 預備lock 資源: _B_\n    Thrd#3: 從帳戶_A_提出100, 餘額:900\n    Thrd#3: 從帳戶_B_存入100, 餘額:1100\n    Thrd#3: unlock 資源: _B_\n    Thrd#3: unlock 資源: _A_\n    Thrd#3: 完成從帳戶_A_轉帳到帳戶_B_，轉帳金額100\n    Thrd#3: 預備從帳戶_A_轉帳到帳戶_B_，轉帳金額100\n    Thrd#3: 預備lock 資源: _A_\n    Thrd#3: 已經lock 資源: _A_\n    Thrd#3: 預備lock 資源: _B_\n    Thrd#4: 已經lock 資源: _B_\n    Thrd#4: 預備lock 資源: _A_\n    ```\n\n11. Week15_UseFFT  \n    僅需繳交使用FFT函式時的注意事項\n\n    [Notice_FFT](./Week15_UseFFT/HW/108303013.txt)\n\n## 小考介紹\n1. Week02_Exam  \n    採用黃金比例法來求根號值，找出原始程式中的部分錯誤，並修正\n    ```\n    Input a value between 0 and 10 to find its root:2\n    The root of [2] is 1.41421615290795\n    ```\n\n2. Week03_Exam  \n   設計一個計算機，具有十三個按鍵(0~9, +, =, CE)，並可以讓使用者進行加法運算，按下CE時會清除結果  \n   ![calculator](./Week03_Exam/result/calculator.png)\n\n3. Week04_Exam  \n   設計一個資料篩選器，可以挑選資料表格中對應的欄位出來或是對應的系所\n   ![filter](./Week04_Exam/result/filter.png)\n\n4. Week06_Exam  \n   設計一個Numerical Control(NC) Program可以將G-Code中的座標透過regular expression提取出來  \n   [G-Code資料](./Week06_Exam/Test06.txt)  \n   ![NCProgram](./Week06_Exam/result/NCProgram.png)\n\n5. Week07_Exam  \n   設計一個座標轉換程式，可以將原本的直角座標(x, y, z)，轉換成球座標(r, theta, phi)並輸出成二進制檔案(LittleEndian or Big Endian)  \n   [直角坐標資料](./Week07_Exam/data/points.txt)  \n   ![coordinateConverter](./Week07_Exam/result/coordinateConverter.png)\n\n6. Week08_MidtermMockExam\n    1. 找出原始程式中矩陣乘積的錯誤，使專案可以正確執行\n    ![Test01](./Week08_MidtermMockExam/result/test01.png)\n    2. 根據輸入的數字轉換成進度條(0~128)，\n        - num\u003c70，進度條以綠色呈現\n        - 70\u003cnum\u003c100，進度條以黃色呈現\n        - 100\u003cnum，進度條以紅色呈現\n        \n        ![Test02](./Week08_MidtermMockExam/result/test02.png)\n    3. 找出以下條件\n        - 字尾具有\"ed\"的單字，並呈現在文字框\n        - 找出所有西元年份，並將加總結果呈現在文字框\n        \n        ![Test03](./Week08_MidtermMockExam/result/test03.png)\n    4. 解析WAV音訊格式的大小及建立時間\n\n        ![Test04](./Week08_MidtermMockExam/result/test04.png)\n\n7. Week09_MidtermExam  \n    題目卷被收回\n\n8. Week10_ProgrammingStructure  \n    共分為三個專案，輸出dll，輸出exe及完成1A2B的遊戲\n\n    ![Test10](./Week10_Exam/result/test10.png)\n\n9. Week11_UseNAudio  \n    將作業的單聲道改成雙聲道，並且可以設定聲音強度門檻，當超過門檻時，將紀錄的聲道/時間/強度寫入log.txt  \n    ![Test11](./Week11_Exam/result/test11.png)\n\n10. Week12_BasicThread  \n    將Week11_UseNAudio作業的內容改成按下開始錄音，再按一次則停止錄音。錄音過程中，執行緒會持續寫入使用者指定的檔案\n\n    ![Test12](./Week12_Exam/result/test12.png)\n\n11. Week13_ResourceManagement  \n    可以透過與CncSimulator.dll取得handle，模擬多個CNC機台返回速度/溫度/執行時間，並且最大同時連線數為3\n\n    ![Test13](./Week13_Exam/result/test13.png)\n\n12. Week14_AdvancedThreadingProgramming  \n    解決執行緒異常(檔案不存在/檔案被占用)\n\n    ![Test14](./Week14_Exam/result/test14.png)\n\n13. Week15_UseFFT  \n    可錄製聲音，並存檔成WAV格式(取樣率44100Hz, 樣本深度16-bits, 單聲道)，可選擇開一份WAV格式的檔案，並經過濾波器後，重新存成Filtered.WAV  \n    ![Test15](./Week15_Exam/result/test15.png)\n\n14. Week16_UsingSQLite  \n    使用dllImport建立sqlite3_open、sqlite3_close、sqlite3_exec與sqlite3_free，並且可以完成\"Insert into record Values ('Age','30') \"。執行完成後，使用SQLLiteStudio查看week16.db可以看已添增的數值\n\n    ![Test16](./Week16_Exam/result/test16.png)\n\n15. Week18_FinalExam\n    1. 分析資料夾中學生的檔案，檔案中具有一萬筆資料(學號/生日/手機號碼/學校Email)，學號須由9位數字組成，生日須由YYYY-MM-DD，手機號碼須由4位數字，6位數字中間以\"-\"分隔。若資料符合則移動至OK，否則記錄錯誤資訊到log.txt\n    \n        ![Test18_1](./Week18_FinalExam/result/test01.png)\n\n    2. 將data.csv檔案中的時間/訊號強度繪製出來，並且將原始訊號/FFT訊號/Filter後訊號繪圖到winForm\n        ![Test18_2](./Week18_FinalExam/result/test02.png)\n    \n    3. 設計StudentInfo，並輸出StudentInfo.dll\n        ```\n        BBBBBB AAA was born on 1979/10/17 上午 12:00:00, and his/her id is 111111111\n        2025-06-26\n        16689.4986898425 days from birthday.\n        DDDDD CCC was born on 2021/6/21 上午 12:00:00, and his/her id is 999999999\n        ```\n\n## 開發環境與需求\n- Visual Studio\n- .NETFramework,Version=v4.8\n- SQLiteStudio  \n  Week16_Exam中會使用到SQLiteStudio查看database  \n  [SQLiteStudio - Official Website](https://sqlitestudio.pl/)\n- DLL/DB位置  \n  為了簡化重複上傳部分不必要的文件，請自行複製dll/database\n  - Week09_MidtermExam\n    ``` sh\n    cp ncu-course-programmingAndItsApplications/Week09_MidtermExam/data/student_info.csv ncu-course-programmingAndItsApplications/Week09_MidtermExam/Program_4/bin/Debug\n    ```\n    \n  - Week10_ProgrammingStructure\n    ``` sh\n    cp ncu-course-programmingAndItsApplications/Week10_ProgrammingStructure/HW/data/* ncu-course-programmingAndItsApplications/Week10_ProgrammingStructure/HW/HW/bin/Debug\n    ```\n  \n  - Week13_Exam\n    ``` sh\n    cp ncu-course-programmingAndItsApplications/Week13_Exam/data/* ncu-course-programmingAndItsApplications/Week13_Exam/Test13/bin/Debug\n    ```\n\n  - Week16_Exam\n    ``` sh\n    cp ncu-course-programmingAndItsApplications/Week16_Exam/data/* ncu-course-programmingAndItsApplications/Week16_Exam/bin/Debug\n    ```\n  - Week18_FinalExam\n    ``` sh\n    cp ncu-course-programmingAndItsApplications/Week18_FinalExam/data/data.csv ncu-course-programmingAndItsApplications/Week18_FinalExam/Test02/bin/Debug\n    ```\n## 修課心得\n我是大推錦德老師的所有課程!這門的loading其實算蠻重，畢竟很多時候都需要自己看完課前影片並完成作業，上課時間會拿來小考，老師會更改作業中的部分內容並需要現場實做出來。老師的影片算是很用心在錄影片及教材讓人淺顯易懂的學會c#及winform的基礎。走完這學期算是很有感的學會一門程式語言，雖然現在(修完課的4年)回過頭來看，有些內容又還給老師，但至少需要用到的時候還可以回來翻講義。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocper%2Fncu-course-programminganditsapplications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpocper%2Fncu-course-programminganditsapplications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocper%2Fncu-course-programminganditsapplications/lists"}