Sheng-Hao Liao 廖聖郝 frakw
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    7
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    1. > * * * # 程式語言期中考博物館(一館) * ## [程式語言期末考博物館(二館)](https://hackmd.io/7u-L92BDQTWWxasSwWTS4Q?view) 館長:貓咪大佬 管理員:JunYao、7How 開館日期:2021/11/15 ## 名詞解釋館 * **Pascal**: * 一種imperative language * 一種命令式語言 * ~~商用語言~~ * **COBOL** : 一種用於商業的程式語言,屬於編譯語言 * **Overloaded operator**:給予operator多種意義、用途 * **Subtype**:是Subclass,但沒有修改從Superclass繼承下來的method,稱為Subtype * **Garbage collection**:將散落的記憶體回收再利用 * **Lifetime** : 變數從allocate到deallocate的時間 * **Strong typing** : * 執行前就需定義好變數型別的程式語言 * 在執行前可以檢查出所有type error * 不容許隱性的型別轉換,在執行前會檢查出所有type error * **Polymorphism**(多態性):override後仍使用相同名稱,但實作不同 * **Method overriding** : 繼承superclass的method使用相同的名稱,但是內容不同 * **Dynamic binding**:Runtime時,才會決定變數的型態 * **Coercion**:強制改變type,又分: * Widening: 轉換後值不改變(int -> float) | Narrowing: 轉換後值會改變(float -> int) * **Von Neumann bottleneck**:CPU 和 Memory 之間的資料傳輸速度比 CPU 執行速度慢,因此資料傳輸速度決定了電腦的速度 * **Von Neumann Architecture**:將程式指令記憶體和資料記憶體合併在一起的電腦設計概念架構 * Static typing:在Compile time時就決定變數的type,且run time時無法被改變 * Structure type compatibility: * 不同的type可以相互轉換/運算 * 變數的structure完全一樣 * Union type: * 將不同的datatype儲存在同一個記憶體空間的自訂型別 * Primitive data types:沒有被其他資料類型定義的資料型態 * Reference types : 可以間接存取記憶體的值的型別 * Dangling pointers : 指向不合法記憶體位址的指標 * Name type compatibility:兩個變數擁有相同的宣告或是使用相同的type宣告 * Array : 相同型態的資料儲存在連續的記憶體 * Fixed heap-dynamic array: * 固定的動態array,在需要使可以new出一個fixed的array * Storage binding is dynamic but fixed after allocation * Operator associativity rule | Operator precedence rule: * 定義同一優先級的operator之間關聯性的規則,如左關聯、右關聯 * 運算子優先度一樣時,要決定如何運算,如從左到右、從右到左 * Ex:A+B+C+D (((A+B)+C)+D) 左關聯 (A+(B+(C+D))) 右關聯 * Ambiguous grammar:相同的句子,可能造出兩種以上的parse tree * Smalltalk : A Pure OOP language * Everything is objects * l-value: * variable 的 address * 左值就是可以放在賦值操作符(等於=)兩邊的值 * r-value:暫存值,不會在使用它的運算式之外保存 * Functional side effect:調用函數時,還對主調用函數產生影響,例如修改全域變數 * Inheritance:子類別從父類別獲得定義好的屬性和方法 * Short-circuit evaluation :不用執行全部運算就能得出結果 * 例:or運算,一個條件成立整個式子就成立 * Ada : * 美國國防部開發 * 複雜難用 * 幾乎將所有語言的特色都融入 * Dynamic scope : * Based on calling sequences of program * 從calling sequences of program才可以知道scope * Static scope : * Base on program text * 從program text就可以知道scope * User-defined ordinal type : 使用者自己定義的有序資料類型,例如C++中的enume ### 非考古區 * BNF : 用來描述language的language,一種meta language * multi-dimensioned array * rectangular : 只有一個指標,指到一塊連續記憶體 * Jagged : 多個pointer指到1維陣列,形成多維 * Assosiative array : 透過key去access (Hash...) * operation 動手做 很複雜 * Axiomatic 根據邏輯做 也很複雜 * denotation 根據數學 以function實作 * Explicit Declaration : 使用前要宣告型別 * Implicit Declaration : 使用時會自動辨別型別 * type inferencing : 例 2 (int) 與 2.0f(float) * Declaration order : 使用前就要宣告 * int a; 這行之前都不能用a變數 * reference counter : 參照計數,記憶體管理技術,是指將記憶體的被參照次數儲存起來,當被參照次數變為零時就將其釋放 * stack dynamic : 從stack開始allocate,例 遞迴 * explicit heap dynamic : 從heap開始allocate,一般的動態配置記憶體 * implicit heap dynamic : cause by assignment ,assign過程中產生的暫時動態配置記憶體 * Referential transparency : 參照透明度,不更改程序行為的情況下將表達式替換為其相應的值 * result1 = (fun(a)+b)/(fun(a)-c); * temp = fun(a); * result2 = (temp+b)/(temp-c); * if fun has no side effects -> result1 == result2 => Referential transparency * CIR (class instance record) : 存dynamic binding的資訊,EX : vtable(存虛函數的指標) ## BNF館 (第2大題) * **2024** ![image](https://hackmd.io/_uploads/Byxu0mo0lg.png) * **2023** ![image](https://hackmd.io/_uploads/By4p6XiAge.png) * **2019** ![](https://i.imgur.com/rcGSfr6.png) * **2017** ![](https://i.imgur.com/yjfxn7N.jpg) * **2013** ![](https://i.imgur.com/93DEBGu.jpg) * **2011** ![](https://i.imgur.com/mobV6X9.jpg) * **2007(答案是錯的)** ![](https://i.imgur.com/E7qIizI.png) * **2006** ![](https://i.imgur.com/0qcLWZb.png) ## BNF 二館 (第3、4大題) * **2024** ![image](https://hackmd.io/_uploads/SJdtAXoAll.png) ![image](https://hackmd.io/_uploads/BkM9Rmi0xx.png) * **2023** ![image](https://hackmd.io/_uploads/rys1C7iCxx.png) ![image](https://hackmd.io/_uploads/S18l0mj0ex.png) * **2019** ![](https://i.imgur.com/T5fIxT0.png) ![](https://i.imgur.com/EOAotIB.png) * **2017** ![](https://i.imgur.com/ut9X8kP.png) ![](https://i.imgur.com/gIaGMRc.png) * **2013** ![](https://i.imgur.com/ZtoDpKE.jpg) ![](https://i.imgur.com/FsB1Lz4.png) * **2012** ![](https://i.imgur.com/WLKdnpx.png) ![](https://i.imgur.com/fulN2ON.png) * **2011** ![](https://i.imgur.com/yKwqnD8.jpg) ![](https://i.imgur.com/qaQnjtA.jpg) * **2007** ![](https://i.imgur.com/wwXIW0U.png) * **2006** ![](https://i.imgur.com/oJJZ4to.png) ## Weakest precondition館 (第5大題) * **2024** ![image](https://hackmd.io/_uploads/BkDiAXjRge.png) * **2023** ![image](https://hackmd.io/_uploads/HJCXAmjRex.png) * **2019** ![](https://i.imgur.com/rDjpN5B.png) * **2017** ![](https://i.imgur.com/6flNtNa.png) * **2013** ![](https://i.imgur.com/aiUYRR6.png) * **2012** ![](https://i.imgur.com/GpOugKZ.png) * **2011** ![](https://i.imgur.com/iIr1rdx.jpg) ## Scoping館 (第6大題) * **2024** ![image](https://hackmd.io/_uploads/HJdn07sRgg.png) * **2023** ![image](https://hackmd.io/_uploads/SJSr0msAxl.png) * **2019** ![](https://i.imgur.com/4eorbgh.png) * **2017** ![](https://i.imgur.com/XCNVg98.png) * **2013** ![](https://i.imgur.com/ypjh0PM.png) * **2012** ![](https://i.imgur.com/M2fTO9U.png) * **2011** ![](https://i.imgur.com/6nhMsmq.jpg) * **2007** ![](https://i.imgur.com/7m7baTO.png) * **2006** ![](https://i.imgur.com/ubJlAdZ.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully