├── .github
└── ISSUE_TEMPLATE
│ └── sharing-course-notes.md
├── .gitignore
├── README.md
├── docs
├── 01.112
│ └── index.html
├── 02.126
│ └── index.html
├── 02.137DH
│ └── index.html
├── 02.212TS
│ └── index.html
├── 02.229
│ └── index.html
├── 30.003
│ └── index.html
├── 30.101
│ └── index.html
├── 30.102
│ └── index.html
├── 30.110
│ └── index.html
├── 40.002
│ └── index.html
├── 40.011
│ └── index.html
├── 40.016
│ └── index.html
├── 40.302
│ └── index.html
├── 40.305
│ └── index.html
├── 404.html
├── 50.003
│ └── index.html
├── 50.005
│ └── index.html
├── 50.012
│ └── index.html
├── 50.034
│ └── index.html
├── 50.038
│ └── index.html
├── assets
│ ├── fonts
│ │ ├── font-awesome.css
│ │ ├── material-icons.css
│ │ └── specimen
│ │ │ ├── FontAwesome.ttf
│ │ │ ├── FontAwesome.woff
│ │ │ ├── FontAwesome.woff2
│ │ │ ├── MaterialIcons-Regular.ttf
│ │ │ ├── MaterialIcons-Regular.woff
│ │ │ └── MaterialIcons-Regular.woff2
│ ├── images
│ │ ├── GitHub-Mark-32px.png
│ │ ├── book.png
│ │ ├── download.png
│ │ ├── favicon.png
│ │ ├── icons
│ │ │ ├── bitbucket.1b09e088.svg
│ │ │ ├── github.f0b8504a.svg
│ │ │ └── gitlab.6dd19c00.svg
│ │ ├── logo.png
│ │ └── profile.png
│ ├── javascripts
│ │ ├── application.c648116f.js
│ │ ├── lunr
│ │ │ ├── lunr.da.js
│ │ │ ├── lunr.de.js
│ │ │ ├── lunr.du.js
│ │ │ ├── lunr.es.js
│ │ │ ├── lunr.fi.js
│ │ │ ├── lunr.fr.js
│ │ │ ├── lunr.hu.js
│ │ │ ├── lunr.it.js
│ │ │ ├── lunr.ja.js
│ │ │ ├── lunr.jp.js
│ │ │ ├── lunr.multi.js
│ │ │ ├── lunr.nl.js
│ │ │ ├── lunr.no.js
│ │ │ ├── lunr.pt.js
│ │ │ ├── lunr.ro.js
│ │ │ ├── lunr.ru.js
│ │ │ ├── lunr.stemmer.support.js
│ │ │ ├── lunr.sv.js
│ │ │ ├── lunr.th.js
│ │ │ ├── lunr.tr.js
│ │ │ ├── tinyseg.js
│ │ │ └── wordcut.js
│ │ └── modernizr.74668098.js
│ └── stylesheets
│ │ ├── application-palette.a8b3c06d.css
│ │ └── application.30686662.css
├── index.html
├── search
│ └── search_index.json
├── sitemap.xml
└── sitemap.xml.gz
└── notes
├── 01.112 Machine Learning
└── 2019-Siew Wen
│ ├── 01.112_notes.pdf
│ ├── 01.112_notes.tex
│ ├── BayesianNetworks.md
│ ├── Clustering.md
│ ├── FowardBackwardAlgorithm.md
│ ├── HiddenMarkovModel.md
│ ├── IntroToML.md
│ ├── LinearClassification.md
│ ├── LogisticRegression.md
│ ├── MixtureModels.md
│ ├── README.md
│ ├── ReinforcementLearning.md
│ ├── SVM.md
│ ├── final_cheatsheet.pdf
│ └── pictures
│ ├── 1d_mixture_models.png
│ ├── bayesian_network_example.png
│ ├── effects_of_regularization.PNG
│ ├── em.png
│ ├── gaussian_em_iterations.PNG
│ ├── kink.PNG
│ ├── not_linear_separable_through_origin.PNG
│ ├── penalty.png
│ ├── pres_accident.png
│ ├── sgd_loss_functions.png
│ └── slack_variable.jpg
├── 01.113 Statistical and Machine Learning
└── 2020-huikang
│ └── first-half.html
├── 02.126 SEA under Japan
└── 2019
│ ├── SEA under Japan Week 01 - Before 1941.md
│ ├── SEA under Japan Week 02.md
│ ├── SEA under Japan Week 03.md
│ ├── SEA under Japan Week 04.md
│ ├── SEA under Japan Week 05.md
│ ├── SEA under Japan Week 08.md
│ ├── SEA under Japan Week 09.md
│ ├── SEA under Japan Week 10.md
│ ├── SEA under Japan Week 11.md
│ ├── SEA-under-Japan-2019-notes.pdf
│ └── SEA-under-Japan-2019-notes.tex
├── 02.137DH Introduction to Digital Humanities
└── 2019-WM
│ ├── 02.137DH_notes.pdf
│ └── 02.137DH_notes.tex
├── 02.212TS The Visual Culture of Science and Technology
└── 2019
│ ├── 02.212TS_notes.pdf
│ └── 02.212TS_notes.tex
├── 02.229 Decision Theory & Practice
└── 2019-Yustynn
│ ├── decision-theory-2019-notes.pdf
│ ├── w01-summary.pdf
│ ├── w02-summary.pdf
│ ├── w03-summary.pdf
│ ├── w04-summary.pdf
│ ├── w05-summary.pdf
│ ├── w06-summary.pdf
│ ├── w09-summary.pdf
│ ├── w10-summary.pdf
│ ├── w10-summary.png
│ ├── w11-summary.pdf
│ ├── w12-summary.pdf
│ ├── w13-summary.pdf
│ └── w13-summary.png
├── 30.003 Introduction to Probability and Statistics
└── 2019-WM
│ ├── 30.003_PnS_notes.pdf
│ ├── 30.003_PnS_notes.tex
│ ├── 30.003_finals_revision_guide.pdf
│ ├── 30.003_finals_revision_guide.tex
│ ├── 30.003_midterms_revision_guide.pdf
│ └── 30.003_midterms_revision_guide.tex
├── 30.101 Systems & Control
└── 2020-WM
│ ├── 30.101_SnC_notes.pdf
│ ├── 30.101_SnC_notes.tex
│ ├── 30.101_midterms_revision_guide.pdf
│ ├── 30.101_midterms_revision_guide.tex
│ └── blockdiagrams.png
├── 30.102 Electromagnetics & Applications
└── 2020-WM
│ ├── 30.102_finals_revision_guide.pdf
│ ├── 30.102_finals_revision_guide.tex
│ ├── 30.102_midterms_revision_guide.pdf
│ ├── 30.102_midterms_revision_guide.tex
│ ├── TL_ant_Tx.png
│ └── planecurrent.png
├── 30.110 Digital Systems Lab
└── 2020-WM
│ ├── 16expressions.png
│ ├── 30.110_revision_guide.pdf
│ ├── 30.110_revision_guide.tex
│ ├── 4bitreg.png
│ ├── bin-sync-counter.png
│ ├── binary-ripple-counter.png
│ ├── logicgates.jpg
│ ├── logicgates.png
│ ├── mealy-machine.png
│ ├── moore-machine.png
│ ├── seq-fsm.png
│ ├── seq-logic-2.png
│ ├── serial-trf.png
│ ├── state-diagram.png
│ ├── state-minimization.png
│ ├── static-discipline.png
│ ├── uni_shift_reg.png
│ ├── wx.jpg
│ └── yz.jpg
├── 40.002 Optimisation
└── 2019-huikang
│ ├── README.md
│ ├── final-summary.md
│ ├── final-summary.pdf
│ ├── midterm-summary.md
│ └── midterm-summary.pdf
├── 40.011 Data and Business Analytics
└── 2019-huikang
│ ├── README.md
│ ├── midterm-cheatsheet.md
│ └── midterm-cheatsheet.pdf
├── 40.012 Manufacturing and Service Operations
└── 2020-huikang
│ ├── assets
│ ├── EOQ-cost.png
│ ├── EOQ-inventory.png
│ ├── EPQ-inventory.png
│ ├── NV-formulas.png
│ └── QR-inventory.png
│ └── inventory-management.md
├── 40.014 Engineering Systems Architecture
└── 2020-huikang
│ ├── assets
│ ├── influence-diagram.png
│ ├── modularity.png
│ └── stakeholder-diagram.png
│ ├── first-half.md
│ └── second-half.md
├── 40.016 The Analytics Edge
└── 2019-huikang
│ ├── R-cheatsheet.md
│ ├── R-cheatsheet.pdf
│ └── README.md
├── 40.302 Advanced Topics in Optimization
├── 2019-Yustynn
│ └── opti-notes.pdf
└── 2021-huikang
│ ├── README.md
│ ├── README.pdf
│ └── assets
│ ├── cheatsheet-page-1.png
│ ├── cheatsheet-page-2.png
│ ├── jm-cmax-1.png
│ ├── jm-cmax-2.png
│ ├── permutation-flow-shop-alt.png
│ ├── taxonomy-machine-environment.png
│ └── taxonomy-objective-functions.png
├── 40.305 Advanced Topics in Stochastic Modeling
└── 2019-Yustynn
│ └── atsm-notes.pdf
├── 40.316 Game Theory
└── 2021-huikang
│ ├── README.md
│ └── assets
│ ├── cheatsheet-page-1.png
│ ├── cheatsheet-page-2.png
│ └── splitting-the-pie.png
├── 50.003 Elements of Software Construction
├── 2018-Joel
│ ├── esc_notes_joel.pdf
│ └── esc_notes_joel_src
│ │ ├── img
│ │ ├── blocking-queue.png
│ │ ├── cyclic-barrier.png
│ │ ├── nonblockingll.png
│ │ ├── parallel-bfs.jpg
│ │ ├── parallelization.png
│ │ ├── phaser.jpg
│ │ └── volatile.png
│ │ ├── main.tex
│ │ └── src
│ │ ├── CDLDemo.java
│ │ ├── DecoratorDemo.java
│ │ ├── DiningPhil1.java
│ │ ├── FutureRenderer2.java
│ │ ├── ISTDWebsiteClickRandomLink.java
│ │ ├── ObserverPattern.java
│ │ ├── ParameterizedTest.java
│ │ ├── PizzaStore.java
│ │ ├── StrategyPattern.java
│ │ ├── TestWithMock.java
│ │ ├── VisitorPatternOriginal.java
│ │ ├── generalized_fuzzer.py
│ │ └── simple-fuzzer.c
└── 2019-Siew Wen
│ ├── 50.003_Finals_Revision_Compiled.md
│ ├── 50.003_Finals_Revision_Concurrency.md
│ ├── 50.003_Finals_Revision_Refactoring.md
│ ├── 50.003_Finals_Revision_Test_Design.md
│ ├── 50.003_Finals_Revision_UML.md
│ ├── 50.003_Finals_notes.pdf
│ ├── 50.003_Finals_notes.tex
│ └── basic-control-flow-graphs.jpg
├── 50.005 Computer System Engineering
├── 2018-Shaun,Joel
│ └── cse_notes_shaun.pdf
└── 2019-Siew Wen
│ ├── 50.005_notes.pdf
│ ├── 50.005_notes.tex
│ ├── Networking.md
│ └── OS.md
├── 50.012 Networks
└── 2019-Siew Wen
│ ├── 50.012_finals_summary.pdf
│ ├── 50.012_finals_summary.tex
│ ├── 50.012_midterms_summary.pdf
│ ├── 50.012_midterms_summary.tex
│ ├── 50.012_notes.pdf
│ ├── 50.012_notes.tex
│ ├── Extras.md
│ ├── Finals-Summary.md
│ ├── Lecture1-TransportLayer.md
│ ├── Lecture10-CongestionControl.md
│ ├── Lecture11-TCPWrapup.md
│ ├── Lecture13-NetworkLayerOverview.md
│ ├── Lecture14-IPAddressing.md
│ ├── Lecture15-RoutingAlgorithms.md
│ ├── Lecture16-Routing.md
│ ├── Lecture17-SDN.md
│ ├── Lecture19-Link_Layer.md
│ ├── Lecture2-HTTP.md
│ ├── Lecture21-WirelessNetworks.md
│ ├── Lecture3-WebAPI.md
│ ├── Lecture5-NetworkApplications.md
│ ├── Lecture6-CDN-and-PNP.md
│ ├── Lecture7-RDT.md
│ ├── Lecture8-RDTPipelines.md
│ ├── Lecture9-TCP_RDT_CC_Principles.md
│ ├── Midterm-Summary.md
│ ├── README.md
│ ├── pictures
│ ├── GNB.PNG
│ ├── GNB_receiver.PNG
│ ├── GNB_sender.PNG
│ ├── IPv4_vs_IPv6.PNG
│ ├── SR.PNG
│ ├── SR_dillema.PNG
│ ├── TCPCongestionControl.PNG
│ ├── TCP_sender_simple.PNG
│ ├── code-division-multiple-access-cdma.jpg
│ ├── control_plane.PNG
│ ├── demo_rest_api.png
│ ├── djikstra_oscillations.png
│ ├── forwarding_diagram.png
│ ├── hol_blocking.png
│ ├── input_port2.png
│ ├── output_port.png
│ ├── rdt2.1_receiver.PNG
│ ├── rdt2.1_sender.PNG
│ ├── rdt2.2_receiver.PNG
│ ├── rdt2.2_sender.PNG
│ ├── rdt3.0_pipeling.PNG
│ ├── rdt3.0_receiver.jpg
│ ├── rdt3.0_sender.PNG
│ ├── rdt3.0_stopandwait.PNG
│ ├── rdt_noack.png
│ ├── rdt_noack2.png
│ ├── rdt_noack3.png
│ ├── routing_architecture.png
│ ├── stopandwait_vs_pipeline.PNG
│ ├── subnet_example.png
│ ├── switching_bus.png
│ ├── switching_crossbar.png
│ ├── switching_memory.png
│ ├── tcp_fairness.PNG
│ └── tcp_throughput.PNG
│ ├── tcp_sample.py
│ └── udp_sample.py
├── 50.021 Artificial Intelligence
└── 2021-huikang
│ ├── README.md
│ ├── README.pdf
│ └── assets
│ ├── alpha-beta-pruning.png
│ ├── backtracking.png
│ ├── cheatsheet-page-1.png
│ ├── cheatsheet-page-2.png
│ ├── cheatsheet-page-3.png
│ └── cheatsheet-page-4.png
├── 50.034 Introduction to Probability and Statistics
└── 2018-Jing Yu
│ └── pns_notes_kjy.pdf
├── 50.038 Computational Data Science
└── 2019-Siew Wen
│ ├── 50.038 exam-checklist.md
│ └── 50.038-exam-checklist.pdf
├── 50.039 Theory and Practice of Deep Learning
└── 2021-huikang
│ ├── README.md
│ ├── README.pdf
│ └── assets
│ ├── finals-cheatsheet-page-1.png
│ ├── finals-cheatsheet-page-2.png
│ ├── midterms-cheatsheet-page-1.png
│ ├── midterms-cheatsheet-page-2.png
│ ├── q-table.png
│ └── transformer.png
└── 50.045 Information Retrieval
└── 2021-huikang
├── README.md
├── README.pdf
└── assets
├── NDCG.png
└── query-likelihood-model.png
/.github/ISSUE_TEMPLATE/sharing-course-notes.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Sharing course notes
3 | about: Use this issue template if you would like to share your course notes.
4 | title: "[Notes] xx.xxx Course Name Here"
5 | labels: needs-review
6 | assignees: flamanta
7 |
8 | ---
9 |
10 | **Course Name**
11 |
12 | xx.xxx Course Name Here
13 |
14 | **Link to your course notes on cloud storage**
15 |
16 | [GDrive](https://drive.google.com)
17 |
18 | **Do you need help converting your notes into LaTeX?**
19 |
20 | Yes/No
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | **/.DS_Store
2 |
--------------------------------------------------------------------------------
/docs/assets/fonts/material-icons.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
3 | * use this file except in compliance with the License. You may obtain a copy
4 | * of the License at:
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE
9 | * DISTRIBUTED UNDER THE LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 | * SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING PERMISSIONS AND
12 | * LIMITATIONS UNDER THE LICENSE.
13 | */@font-face{font-family:"Material Icons";font-style:normal;font-weight:400;src:local("Material Icons"),local("MaterialIcons-Regular"),url("specimen/MaterialIcons-Regular.woff2") format("woff2"),url("specimen/MaterialIcons-Regular.woff") format("woff"),url("specimen/MaterialIcons-Regular.ttf") format("truetype")}
--------------------------------------------------------------------------------
/docs/assets/fonts/specimen/FontAwesome.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/docs/assets/fonts/specimen/FontAwesome.ttf
--------------------------------------------------------------------------------
/docs/assets/fonts/specimen/FontAwesome.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/docs/assets/fonts/specimen/FontAwesome.woff
--------------------------------------------------------------------------------
/docs/assets/fonts/specimen/FontAwesome.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/docs/assets/fonts/specimen/FontAwesome.woff2
--------------------------------------------------------------------------------
/docs/assets/fonts/specimen/MaterialIcons-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/docs/assets/fonts/specimen/MaterialIcons-Regular.ttf
--------------------------------------------------------------------------------
/docs/assets/fonts/specimen/MaterialIcons-Regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/docs/assets/fonts/specimen/MaterialIcons-Regular.woff
--------------------------------------------------------------------------------
/docs/assets/fonts/specimen/MaterialIcons-Regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/docs/assets/fonts/specimen/MaterialIcons-Regular.woff2
--------------------------------------------------------------------------------
/docs/assets/images/GitHub-Mark-32px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/docs/assets/images/GitHub-Mark-32px.png
--------------------------------------------------------------------------------
/docs/assets/images/book.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/docs/assets/images/book.png
--------------------------------------------------------------------------------
/docs/assets/images/download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/docs/assets/images/download.png
--------------------------------------------------------------------------------
/docs/assets/images/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/docs/assets/images/favicon.png
--------------------------------------------------------------------------------
/docs/assets/images/icons/bitbucket.1b09e088.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/assets/images/icons/github.f0b8504a.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/assets/images/icons/gitlab.6dd19c00.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/assets/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/docs/assets/images/logo.png
--------------------------------------------------------------------------------
/docs/assets/images/profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/docs/assets/images/profile.png
--------------------------------------------------------------------------------
/docs/assets/javascripts/lunr/lunr.da.js:
--------------------------------------------------------------------------------
1 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r,m,i;e.da=function(){this.pipeline.reset(),this.pipeline.add(e.da.trimmer,e.da.stopWordFilter,e.da.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.da.stemmer))},e.da.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.da.trimmer=e.trimmerSupport.generateTrimmer(e.da.wordCharacters),e.Pipeline.registerFunction(e.da.trimmer,"trimmer-da"),e.da.stemmer=(r=e.stemmerSupport.Among,m=e.stemmerSupport.SnowballProgram,i=new function(){var i,t,n,s=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],o=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],a=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("løst",-1,2)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],u=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],c=new m;function l(){var e,r=c.limit-c.cursor;c.cursor>=t&&(e=c.limit_backward,c.limit_backward=t,c.ket=c.cursor,c.find_among_b(o,4)?(c.bra=c.cursor,c.limit_backward=e,c.cursor=c.limit-r,c.cursor>c.limit_backward&&(c.cursor--,c.bra=c.cursor,c.slice_del())):c.limit_backward=e)}this.setCurrent=function(e){c.setCurrent(e)},this.getCurrent=function(){return c.getCurrent()},this.stem=function(){var e,r=c.cursor;return function(){var e,r=c.cursor+3;if(t=c.limit,0<=r&&r<=c.limit){for(i=r;;){if(e=c.cursor,c.in_grouping(d,97,248)){c.cursor=e;break}if((c.cursor=e)>=c.limit)return;c.cursor++}for(;!c.out_grouping(d,97,248);){if(c.cursor>=c.limit)return;c.cursor++}(t=c.cursor)=t&&(r=c.limit_backward,c.limit_backward=t,c.ket=c.cursor,e=c.find_among_b(s,32),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del();break;case 2:c.in_grouping_b(u,97,229)&&c.slice_del()}}(),c.cursor=c.limit,l(),c.cursor=c.limit,function(){var e,r,i,n=c.limit-c.cursor;if(c.ket=c.cursor,c.eq_s_b(2,"st")&&(c.bra=c.cursor,c.eq_s_b(2,"ig")&&c.slice_del()),c.cursor=c.limit-n,c.cursor>=t&&(r=c.limit_backward,c.limit_backward=t,c.ket=c.cursor,e=c.find_among_b(a,5),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del(),i=c.limit-c.cursor,l(),c.cursor=c.limit-i;break;case 2:c.slice_from("løs")}}(),c.cursor=c.limit,c.cursor>=t&&(e=c.limit_backward,c.limit_backward=t,c.ket=c.cursor,c.out_grouping_b(d,97,248)?(c.bra=c.cursor,n=c.slice_to(n),c.limit_backward=e,c.eq_v_b(n)&&c.slice_del()):c.limit_backward=e),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}});
--------------------------------------------------------------------------------
/docs/assets/javascripts/lunr/lunr.ja.js:
--------------------------------------------------------------------------------
1 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(m){if(void 0===m)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===m.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var l="2"==m.version[0];m.ja=function(){this.pipeline.reset(),this.pipeline.add(m.ja.trimmer,m.ja.stopWordFilter,m.ja.stemmer),l?this.tokenizer=m.ja.tokenizer:(m.tokenizer&&(m.tokenizer=m.ja.tokenizer),this.tokenizerFn&&(this.tokenizerFn=m.ja.tokenizer))};var j=new m.TinySegmenter;m.ja.tokenizer=function(e){var r,t,i,n,o,s,p,a,u;if(!arguments.length||null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return l?new m.Token(e.toLowerCase()):e.toLowerCase()});for(r=(t=e.toString().toLowerCase().replace(/^\s+/,"")).length-1;0<=r;r--)if(/\S/.test(t.charAt(r))){t=t.substring(0,r+1);break}for(o=[],i=t.length,p=a=0;a<=i;a++)if(s=a-p,t.charAt(a).match(/\s/)||a==i){if(0=c.limit)return;c.cursor=e+1}for(;!c.out_grouping(u,97,248);){if(c.cursor>=c.limit)return;c.cursor++}(s=c.cursor)=s&&(r=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,e=c.find_among_b(a,29),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del();break;case 2:n=c.limit-c.cursor,c.in_grouping_b(d,98,122)?c.slice_del():(c.cursor=c.limit-n,c.eq_s_b(1,"k")&&c.out_grouping_b(u,97,248)&&c.slice_del());break;case 3:c.slice_from("er")}}(),c.cursor=c.limit,r=c.limit-c.cursor,c.cursor>=s&&(e=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,c.find_among_b(m,2)?(c.bra=c.cursor,c.limit_backward=e,c.cursor=c.limit-r,c.cursor>c.limit_backward&&(c.cursor--,c.bra=c.cursor,c.slice_del())):c.limit_backward=e),c.cursor=c.limit,c.cursor>=s&&(i=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,(n=c.find_among_b(l,11))?(c.bra=c.cursor,c.limit_backward=i,1==n&&c.slice_del()):c.limit_backward=i),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}});
--------------------------------------------------------------------------------
/docs/assets/javascripts/lunr/lunr.stemmer.support.js:
--------------------------------------------------------------------------------
1 | !function(r,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(r.lunr)}(this,function(){return function(r){r.stemmerSupport={Among:function(r,t,i,s){if(this.toCharArray=function(r){for(var t=r.length,i=new Array(t),s=0;s>3]&1<<(7&s))return this.cursor++,!0}return!1},in_grouping_b:function(r,t,i){if(this.cursor>this.limit_backward){var s=b.charCodeAt(this.cursor-1);if(s<=i&&t<=s&&r[(s-=t)>>3]&1<<(7&s))return this.cursor--,!0}return!1},out_grouping:function(r,t,i){if(this.cursor>3]&1<<(7&s)))return this.cursor++,!0}return!1},out_grouping_b:function(r,t,i){if(this.cursor>this.limit_backward){var s=b.charCodeAt(this.cursor-1);if(i>3]&1<<(7&s)))return this.cursor--,!0}return!1},eq_s:function(r,t){if(this.limit-this.cursor>1),a=0,f=u=(l=r[i]).s_size){if(this.cursor=e+l.s_size,!l.method)return l.result;var m=l.method();if(this.cursor=e+l.s_size,m)return l.result}if((i=l.substring_i)<0)return 0}},find_among_b:function(r,t){for(var i=0,s=t,e=this.cursor,n=this.limit_backward,u=0,o=0,h=!1;;){for(var c=i+(s-i>>1),a=0,f=u=(_=r[i]).s_size){if(this.cursor=e-_.s_size,!_.method)return _.result;var m=_.method();if(this.cursor=e-_.s_size,m)return _.result}if((i=_.substring_i)<0)return 0}},replace_s:function(r,t,i){var s=i.length-(t-r);return b=b.substring(0,r)+i+b.substring(t),this.limit+=s,this.cursor>=t?this.cursor+=s:this.cursor>r&&(this.cursor=r),s},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>b.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),b.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}});
--------------------------------------------------------------------------------
/docs/assets/javascripts/lunr/lunr.sv.js:
--------------------------------------------------------------------------------
1 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r,l,n;e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=(r=e.stemmerSupport.Among,l=e.stemmerSupport.SnowballProgram,n=new function(){var n,t,i=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],s=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],a=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],o=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],u=[119,127,149],m=new l;this.setCurrent=function(e){m.setCurrent(e)},this.getCurrent=function(){return m.getCurrent()},this.stem=function(){var e,r=m.cursor;return function(){var e,r=m.cursor+3;if(t=m.limit,0<=r||r<=m.limit){for(n=r;;){if(e=m.cursor,m.in_grouping(o,97,246)){m.cursor=e;break}if(m.cursor=e,m.cursor>=m.limit)return;m.cursor++}for(;!m.out_grouping(o,97,246);){if(m.cursor>=m.limit)return;m.cursor++}(t=m.cursor)=t&&(m.limit_backward=t,m.cursor=m.limit,m.ket=m.cursor,e=m.find_among_b(i,37),m.limit_backward=r,e))switch(m.bra=m.cursor,e){case 1:m.slice_del();break;case 2:m.in_grouping_b(u,98,121)&&m.slice_del()}}(),m.cursor=m.limit,e=m.limit_backward,m.cursor>=t&&(m.limit_backward=t,m.cursor=m.limit,m.find_among_b(s,7)&&(m.cursor=m.limit,m.ket=m.cursor,m.cursor>m.limit_backward&&(m.bra=--m.cursor,m.slice_del())),m.limit_backward=e),m.cursor=m.limit,function(){var e,r;if(m.cursor>=t){if(r=m.limit_backward,m.limit_backward=t,m.cursor=m.limit,m.ket=m.cursor,e=m.find_among_b(a,5))switch(m.bra=m.cursor,e){case 1:m.slice_del();break;case 2:m.slice_from("lös");break;case 3:m.slice_from("full")}m.limit_backward=r}}(),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}});
--------------------------------------------------------------------------------
/docs/assets/javascripts/lunr/lunr.th.js:
--------------------------------------------------------------------------------
1 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(t){if(void 0===t)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===t.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var i="2"==t.version[0];t.th=function(){this.pipeline.reset(),this.pipeline.add(t.th.trimmer),i?this.tokenizer=t.th.tokenizer:(t.tokenizer&&(t.tokenizer=t.th.tokenizer),this.tokenizerFn&&(this.tokenizerFn=t.th.tokenizer))},t.th.wordCharacters="[-]",t.th.trimmer=t.trimmerSupport.generateTrimmer(t.th.wordCharacters),t.Pipeline.registerFunction(t.th.trimmer,"trimmer-th");var n=t.wordcut;n.init(),t.th.tokenizer=function(e){if(!arguments.length||null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return i?new t.Token(e):e});var r=e.toString().replace(/^\s+/,"");return n.cut(r).split("|")}}});
--------------------------------------------------------------------------------
/docs/sitemap.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | https://opensutd.org/course-notes/
5 | 2021-01-17
6 | daily
7 |
8 |
9 | https://opensutd.org/course-notes/30.003/
10 | 2021-01-17
11 | daily
12 |
13 |
14 | https://opensutd.org/course-notes/30.101/
15 | 2021-01-17
16 | daily
17 |
18 |
19 | https://opensutd.org/course-notes/30.102/
20 | 2021-01-17
21 | daily
22 |
23 |
24 | https://opensutd.org/course-notes/30.110/
25 | 2021-01-17
26 | daily
27 |
28 |
29 | https://opensutd.org/course-notes/40.002/
30 | 2021-01-17
31 | daily
32 |
33 |
34 | https://opensutd.org/course-notes/40.011/
35 | 2021-01-17
36 | daily
37 |
38 |
39 | https://opensutd.org/course-notes/40.016/
40 | 2021-01-17
41 | daily
42 |
43 |
44 | https://opensutd.org/course-notes/40.302/
45 | 2021-01-17
46 | daily
47 |
48 |
49 | https://opensutd.org/course-notes/40.305/
50 | 2021-01-17
51 | daily
52 |
53 |
54 | https://opensutd.org/course-notes/02.126/
55 | 2021-01-17
56 | daily
57 |
58 |
59 | https://opensutd.org/course-notes/02.137DH/
60 | 2021-01-17
61 | daily
62 |
63 |
64 | https://opensutd.org/course-notes/02.212TS/
65 | 2021-01-17
66 | daily
67 |
68 |
69 | https://opensutd.org/course-notes/02.229/
70 | 2021-01-17
71 | daily
72 |
73 |
74 | https://opensutd.org/course-notes/01.112/
75 | 2021-01-17
76 | daily
77 |
78 |
79 | https://opensutd.org/course-notes/50.003/
80 | 2021-01-17
81 | daily
82 |
83 |
84 | https://opensutd.org/course-notes/50.005/
85 | 2021-01-17
86 | daily
87 |
88 |
89 | https://opensutd.org/course-notes/50.012/
90 | 2021-01-17
91 | daily
92 |
93 |
94 | https://opensutd.org/course-notes/50.034/
95 | 2021-01-17
96 | daily
97 |
98 |
99 | https://opensutd.org/course-notes/50.038/
100 | 2021-01-17
101 | daily
102 |
103 |
--------------------------------------------------------------------------------
/docs/sitemap.xml.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/docs/sitemap.xml.gz
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/01.112_notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/01.112 Machine Learning/2019-Siew Wen/01.112_notes.pdf
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/Clustering.md:
--------------------------------------------------------------------------------
1 | # Clustering
2 |
3 | - Unsupervised learning
4 | - Cluster: collection of similar data points, and is sufficiently different from other groups.
5 | - Criterion for selecting clusters & representatives
6 | - Cosine Similarity: $\frac{x^{(i)}\cdot x^{(j)}}{||x^{(i)}||\cdot ||x^{(j)}||}$
7 | - Euclidean Distance: $||x^{(i)}|| - ||x^{(j)}||$
8 |
9 | ## K-means
10 |
11 | ### Cost of Clustering
12 |
13 | $$ cost(C_1...C_k, z^{(1)}...z^{(k)}) = \sum_{j=1...k}\sum_{i\Subset C_j} ||x^{(i)} - z^{(j)} ||^2 $$
14 |
15 | $$ cost(z^{(1)}...z^{(k)}) = \sum_{i=1...n} \min_{j=1...k} ||x^{(i)} - z^{(j)} ||^2 $$
16 | ### How it works
17 | 1. Choose the number of clusters $k$
18 | 2. Place the centroids $c_1, c_2, ..... c_k$ randomly
19 | 3. for each data point $x_i$:
20 | - find the nearest centroid $(c_1, c_2 .. c_k)$
21 | - assign the point to that cluster
22 | 4. for each cluster j = $1..k$
23 | - new centroid = mean of all points assigned to that cluster
24 | $$z^{(j)} = \frac{1}{|C_j|} \sum_{i \Subset C_j} x^{(i)}$$
25 | 5. Repeat steps 4 and 5 until
26 | - convergence ( when we find a clustering that minimizes the cost of clustering)
27 | - or until the end of a fixed number of iterations.
28 |
29 | Each iteration requires $O(kn)$ operations, and necessarily lowers the cost of clustering,, the sum of costs of individual clusters.
30 |
31 |
32 | ## K-medoids
33 |
34 | ### Choosing k
35 | We should choose the value of k that results in the highest relative drop in the cost (which corresponds to an “elbow” in the graph capturing as a function of $k$).
36 |
37 | ### How it works
38 | 1. Choose the number of clusters $k$
39 | 2. Choose the exemplars $z_1, z_2, ..... z_k$ randomly out of the data points (or given otherwise)
40 | 3. For each data point $x_i$, other than the centroids:
41 | - calculate the distance to each exemplar $z_1, z_2, ..... z_k$
42 | - add the data point to the cluster that contains $z^{(j)}$ which is nearest to the point $x_i$.
43 | 4. Set new exemplar $z^{(j)}$ to be the point in $C^j$ that minimizes $\sum_{i\Subset C^j} d(x^{(i)},z^{(j)})$
44 | 5. Repeat steps 3-4 until no further change in cost.
45 |
46 | ## Difference between K-means and K-medoids
47 |
48 | | K-medoids | K-means |
49 | | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
50 | | K-mediods is applicable to arbitrary objects and distance functions (e.g. categorical data) | Not possible to be applied for arbitrary objects and distance functions |
51 | | It is less sensitive to noisy data when compared to k-means since a mediod is less influenced by outlier than a mean. | More sensitive to noisy data |
52 | | Can be applied even when true data points are not available and only their pair-wise distances are provided | Cannot be applied if true data points are not available |
53 | | Can be applied to both continuous and discrete domains | Can only be applied to the continuous domain since the mean is not necessarily a data point. |
54 | | Longer run time, especially for large and random datasets. Computing the medoid is harder than computing the average | Shorter run time |
55 | | Medoid has no statistical meaning; it is neither a median nor geometric median | The mean value has a true geometrical and statistical meaning |
56 |
57 | ### Similarities between K-means and K-medoids
58 | - each iteration decreases the cost
59 | - the algorithm always converges
60 | - different starts gives different final answers
61 | - it does not achieve the global minimum
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/FowardBackwardAlgorithm.md:
--------------------------------------------------------------------------------
1 | ## Forward-Backward Algorthm
2 |
3 | ### Going Forward
4 |
5 | - $\alpha_u(j) =$ the sum of the scores of all paths from START to node $u$ at $j$
6 |
7 | - For the first node, there is no emission probability.
8 | $$
9 | \begin{aligned}
10 | \alpha_u(1) &= \alpha_{START,u} \\
11 | &= p(x_0 , y_1 = u)
12 | \end{aligned}
13 | $$
14 |
15 | - For the other nodes,
16 |
17 | $$\text{Given that }\sum_B P(A,B) = P(A)$$
18 |
19 | $$
20 | \begin{aligned}
21 | \alpha_u(j+1) &= p(x_1 ... x_j, y_{j+1} = u) \\
22 | &= \sum_v p(x_1...x_j, y_{j+1} = u, y_j = v) \\
23 | &= \sum_v p(x_1...x_{j-1}, y_j = v, x_j, y_{j+1}= u) \\
24 | &= \sum_v p(x_1...x_{j-1}, y_j = v) \cdot b_v(x_j) \cdot a_{v,u} \\
25 | &= \sum_v \alpha_v(j) \cdot b_v(x_j)\cdot \alpha_{v,u}
26 | \end{aligned}
27 | $$
28 |
29 | ### Going Backward
30 |
31 | - $\beta_u(j) =$ the sum of the scores of all paths from node $u$ at $j$ to STOP.
32 |
33 | > $x_{j+1}$ cannot be generated before $x_j$
34 |
35 | $$
36 | \begin{aligned}
37 | \beta_u(j) &= p(x_j...x_n | y_j = u) \\
38 | &= \sum_v p(x_j...x_n, y_{j+1} = v | y_j = u) \\
39 | &= \sum_v p(x_j, y_{j+1} = v, x_{j+1}... x_n | y_j =u) \\
40 | &= \sum_v b_u(x_j) \cdot a_{u,v} \cdot p(x_{j+1}...x_n | y_{j+1} = v) \\
41 | &= \sum_v b_u(x_j) \cdot a_{u,v} \cdot \beta_v(j+1)
42 | \end{aligned}
43 | $$
44 |
45 | Time Complexity: $O(nT^2)$
46 | - $O(T)$ operations for $T$ nodes at $n$ positions
47 |
48 |
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/LogisticRegression.md:
--------------------------------------------------------------------------------
1 | # Logistic Regression
2 |
3 | $$ \sigma (\theta\cdot x + \theta_0) = \frac{\exp(\theta\cdot x + \theta_0)}{1+\exp(\theta\cdot x + \theta_0)} $$
4 |
5 | Let $h(x) = \sigma (\theta\cdot x + \theta_0)$
6 |
7 | - $p(y|x) = h(x) \text{ for } y = + 1$
8 | - $p(y|x) = 1-h(x) \text{ for } y = - 1$
9 |
10 | We can combine the piece-wise function into one expression.
11 |
12 | $$p(y|x) = \sigma (y(\theta\cdot x + \theta_0)) $$
13 |
14 | ### Determining the label of prediction
15 |
16 | If new input $x$ is positive,
17 | $$p(y=+1|x) > p(y=-1|x)$$
18 | $$\frac{p(y=+1|x)}{p(y=-1|x)} > 0$$
19 | $$\log \frac{p(y=+1|x)}{p(y=-1|x)} > 0$$
20 | $$\log \exp (\theta\cdot x + \theta_0) = \theta\cdot x + \theta_0 > 0$$
21 |
22 | ## Objective Function
23 |
24 | $$
25 | \begin{aligned}
26 | &\max_{\theta,\theta_0} \prod_{i=1}^n p(y^{(i)}|x^{(i)}) \\
27 | = &\max_{\theta,\theta_0} \log\prod_{i=1}^n p(y^{(i)}|x^{(i)} \\
28 | = &\max_{\theta,\theta_0} \sum_{i=1}^n \log p(y^{(i)}|x^{(i)}) \\
29 | = &\min_{\theta,\theta_0} \sum_{i=1}^n -\log p(y^{(i)}|x^{(i)}) \\
30 | = &\min_{\theta,\theta_0} \sum_{i=1}^n \log \frac{1}{p(y^{(i)}|x^{(i)})} \\
31 | \end{aligned}
32 | $$
33 |
34 | We reduce the expression into a summation term from a product term **to avoid the underflow problem** where the constant multiplication of probabilities leads to a number that is too small to be represented in the computer.
35 |
36 | ## Loss Function
37 |
38 | Since the objective function refers to the minimization of the loss function, we have
39 | $$
40 | \begin{aligned}
41 | &\sum_{i=1}^n \log p(\frac{1}{y^{(i)}|x^{(i)}}) \\
42 | = &\sum_{i=1}^n \log(1+\exp(-y^{(i)}(\theta\cdot x^{(i)}+ \theta_0))
43 | \end{aligned}
44 | $$
45 |
46 | To determine the cost/error at each iteration, let's drop $\theta_0$ to make life easier for now since it can be added back easily.
47 |
48 | $$ e^{(t)}(\theta) = \log(1+\exp(-y^{(i)}(\theta\cdot x^{(i)})) $$
49 | $$ \triangledown e^{(t)}(\theta) = \frac{-y^{(t)}x^{(t)}}{1+\exp(-y^{(i)}(\theta\cdot x^{(i)}))} $$
50 |
51 | Then we update the weights as such
52 |
53 | $$ \theta \leftarrow \theta - \alpha\triangledown e^{(t)}(\theta) $$
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/README.md:
--------------------------------------------------------------------------------
1 | # Machine Learning Revision
2 |
3 | Table of Contents
4 |
5 | - [Intro to Machine Learning](IntroToML.md)
6 | - [Linear Classification](LinearClassification.md)
7 | - [Logistic Regression](LogisticRegression.md)
8 | - [Clustering](Clustering.md)
9 | - [SVM](SVM.md)
10 | - [Mixture Models](MixtureModels.md)
11 | - [Hidden Markov Models](HiddenMarkovModel.md)
12 | - [Forward Backward Algorithm](FowardBackwardAlgorithm.md)
13 | - [Bayesian Networks](BayesianNetworks.md)
14 | - [Reinforcement Learning](ReinforcementLearning.md)
15 | - :bulb: [Finals Cheatsheet](final_cheatsheet.pdf)
16 |
17 | > :warning: Beware notes for these concepts were **not written**, as I felt that they were pretty self-explanative when you learn them.
18 | >- Neural Networks
19 | >- Generative Models
20 |
21 | Below are some basic background info for Machine Learning.
22 | - [What is Machine Learning](#what-is-machine-learning)
23 | - [Recap on Convex Functions](#recap-on-convex-functions)
24 | - [Empirical Risk](#empirical-risk)
25 | - [Loss Functions](#loss-functions)
26 | - [Types of Machine Learning](#types-of-machine-learning)
27 |
28 | ## What is Machine Learning
29 |
30 | Machine learning revolves around **models**, which are trained via certain **techniques** and **learning algorithms** that are based on specific **loss functions**. They produce outputs based on **predictor functions**.
31 |
32 | ## Recap on Convex Functions
33 |
34 | A convex function typically has a U-shape (there are boundary cases where the surface can be flat, though. In that case the function is both convex and concave).
35 |
36 | Properties:
37 | - $\frac{f(x_1)+f(x_2)}{2} ≥ f(\frac{x_1+x_2}{2})$
38 | - Its local optimum is also a global optimum.
39 | - Sum of convex functions is also convex.
40 |
41 | Some examples:
42 | - $f(x) = (x-1)^2 $
43 | - $f(x) = max(x^2, 2^x)$
44 | - $f(x) = |x| - x$
45 |
46 | The convexity of empirical risk allows us to find the minimum even in non-realizable case.
47 |
48 | ## Empirical Risk
49 |
50 | Defined as the average loss on the training examples.
51 | $$ R_n(\theta) = \frac{1}{n} \sum_{t=1}^n Loss_h(y^{(t)}\theta\cdot x^{(t)}) $$
52 |
53 | ## Loss Functions
54 |
55 | | Loss function | $Loss_h(z)$ |
56 | | -------------------------------- | ----------------- |
57 | | Squared Euclidean/ Least Squares | $\frac{1}{2}z^2$ |
58 | | Zero-one loss | |
59 | | Hinge Loss | $max\{ 1-z , 0\}$ |
60 |
61 |
62 |
63 |
64 |
65 | ## Types of Machine Learning
66 |
67 | > Notice the resemblance in the problems from each category of tasks
68 |
69 | Supervised Tasks
70 | - Classification $f: R^n \rightarrow \{ 1...k \}$
71 | - LR,SVM, Perceptron NB
72 | - Regression: $f: R^n \rightarrow R^m$
73 | - Ridge Regression, Logistic Regression
74 | - Structured Prediction: $f: S_1 \rightarrow S_2$ where $\text{size}(S_1) >\text{size}(S_2)$
75 | - HMM, CRF, Structured Perceptron, Structural SVM
76 |
77 | Unsupervised Tasks
78 | - Clustering: $f: R^n \rightarrow \{ 1...k \}$
79 | - K-means, EM
80 | - Dimensionality Reduction: $f: R^n \rightarrow R^m$
81 | - PCA, LDA, Autoencoder
82 | - Structured Prediction: $f: S_1 \rightarrow S_2$
83 | - Unsupervised HMM
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/ReinforcementLearning.md:
--------------------------------------------------------------------------------
1 | # Reinforcement Learning
2 |
3 | **Problem:** $f: S \rightarrow A$
4 | - $S$: Set of States
5 | - $A$: Set of Actions
6 |
7 | **Transition Probability**
8 | - Moving from one state to another state is not definite
9 | - $ T(s,a,s') = p(s'|s,a) $
10 |
11 | **Reward**
12 | - Incentivize a target state to be reached / not reached.
13 | - Can be positive (reward) / negative (penalty)
14 | - $R(s,a,s')$: Generally
15 | - $R(s')$ : if the system only requires the target state to be reached.
16 |
17 | ## Markov Decision Process
18 |
19 | Given
20 | - a set of states $S$
21 | - a set of actions $A$
22 | - a transition probability function $T(s,a,s') = p(s'|s,a) $
23 | - a reward function $R(s,a,s')$ or $R(s')$
24 |
25 | ### Utility (Long Term Reward)
26 | - Maximizing the rewards alone is not sufficient to incentivise the program to reach the final state that you want. The program may infinitely loop around a few states
27 | - Hence we apply a **discount** $\gamma$ to long-term rewards.
28 |
29 | $$
30 | \begin{aligned}
31 | U([s_1,s_2,...s_n]) &= R(s_1) + \gamma R(s_2) + \gamma_2 R(s_3) + ... \\
32 | &= \sum_{t=0}^\infty R(s_t)
33 | \end{aligned}
34 | $$
35 |
36 | ### Value Iteration Policy
37 |
38 | We first define the following
39 | - $\pi(s)$: a particular policy that specifies the action we should take in state $s$
40 | - $V^\pi(s)$: The value of state $s$ under policy $\pi$
41 | - $Q^\pi(s,a)$: The $Q$-value of state $s$ and action $a$ under policy $\pi$
42 |
43 | and the optimal version of them
44 | - $\pi^*(s)$: a particular policy that specifies the action we should take in state $s$
45 | - $V^*(s)$: The value of state $s$ under the optimal policy $\pi^*$
46 | - $Q^*(s,a)$: The $Q$-value of state $s$ and action $a$ under policy $\pi^*$
47 |
48 | $$
49 | \begin{aligned}
50 | Q^*(s,a) &= \sum_{s'} T(s,a,s') [R(s,a,s') + \gamma V^*(s')] \\\\
51 | V^*(s) &= Q^*(s,\pi^*(s)) \\
52 | &= \max_a Q^*(s,a) \\
53 | &= \max_a \sum_{s'} T(s,a,s') [R(s,a,s') + \gamma V^*(s')] \\\\
54 | \pi^*(s) = \argmax_a Q^*(s,a)
55 | \end{aligned}
56 | $$
57 |
58 | ### Value Iteration Algorithm
59 | 1. Start with $V_0^*(s) = 0$ $\forall s \in S$
60 | 2. Given $V_i^*$,
61 | 1. calculate the values for all states $s \in S$ and
62 | 2. keep track of the best actions to formulate the best policy
63 |
64 | $$
65 | V^*(s) \leftarrow \max_a \sum_{s'} T(s,a,s') [R(s,a,s') + \gamma V^*(s')]
66 | $$
67 |
68 | 3. Repeat until convergence.
69 |
70 | ### Q-value Iteration Algorithm
71 |
72 | Similar to Value Iteration Algorithm.
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/SVM.md:
--------------------------------------------------------------------------------
1 | # SVMs
2 |
3 | ## Adding Slack Variables
4 |
5 | Sometimes we get data which has two classes that are mostly separated except some small training data where the two categories overlap. In such cases, we would like to allow some points to intentionally be misclassified so as classify the rest correctly.
6 |
7 | To do so, for each training data point we can define a variable that measures the distance of the point to its marginal hyperplane, $\xi_t$, in terms ofthe hinge loss function.
8 |
9 | $$
10 | \begin{aligned}
11 | \xi_t &= Loss_h(y^{(t)}(\theta\cdot x^{(t)} + \theta_0))\\
12 | &= max\{1-y^{(t)}(\theta\cdot x^{(t)}),0 \}
13 | \end{aligned}
14 | $$
15 |
16 |
17 |
18 |
19 |
20 |
21 | We can define a separating hyperplane by minimizing such errors $\xi_i$
22 |
23 | $$ \min_{\theta,\theta_0,\xi} \{ \sum_{i=1}^N \xi_i \} $$
24 |
25 | Each individual training point has a different but parallel marginal hyperplane.
26 |
27 | $$
28 | \begin{aligned}
29 | \theta\cdot x + \theta_0 \geq 1 - \xi_i & \text{if } y_i = +1 \\
30 | \theta\cdot x + \theta_0 \leq -1 + \xi_i & \text{if } y_i = -1
31 | \end{aligned}
32 | $$
33 |
34 | Combining these 2 equations we yield a single equation for the constraint of primal problem.
35 | $$ y^{(i)}(\theta\cdot x^{(i)} + \theta_0) \geq 1 -\xi_i $$
36 |
37 | ### Updated Primal Problem
38 | $$ \min \frac{\lambda}{2}||\theta||^2 + \sum_{t=1}^n \xi_t$$
39 |
40 | $$
41 | \begin{aligned}
42 | \text{such that } y^{(i)}(\theta\cdot x^{(i)} + \theta_0) \geq 1 -\xi_i,& \\
43 | \xi\geq 0, &\\
44 | t=1...n &
45 | \end{aligned}
46 | $$
47 |
48 | Here, the slack variables are simply encoding the **hinge loss in the primal formulation.**
49 |
50 | ### Updated Dual Formulation
51 |
52 | The Dual Problem remains the same, except that we limit how large the Langrange multipliers $\alpha_t$ can become.
53 |
54 | - Also the larger the value of $\lambda$ (the more we want to expand the margin at the expense of the constraints), the smaller the resulting $\alpha_t$ must be.
55 |
56 | $$ \max \sum_{i=1}^n \alpha_t - \frac{1}{2} \sum_{i=1}^n\sum_{j=1}^n \alpha_i \alpha_j y^{(i)}y^{(j)}(x^{(i)}) $$
57 |
58 | $$ \text{subject to } 0 \leq \alpha_t \leq 1/\lambda, \sum_{i=1}^n \alpha_i y^{(i)} = 0 $$
59 |
60 | ### Complementary slackness constraints
61 |
62 | $$
63 | \begin{aligned}
64 | &\hat{\alpha}_i = 0 \rightarrow \text{non-support vectors: } &y^{(i)} (\sum_{j=1}^n \hat{\alpha}_j y^{(j)}(x^{(j)} \cdot x^{(i)}) + \hat{\theta}_0) \geq 1 \\
65 | &\hat{\alpha}_i \Subset (0,1/\lambda) \rightarrow \text{support vectors: } &y^{(i)} (\sum_{j=1}^n \hat{\alpha}_j y^{(j)}(x^{(j)} \cdot x^{(i)}) + \hat{\theta}_0) = 1 \\
66 | &\hat{\alpha}_i = 1/\lambda \rightarrow \text{margin violations: } &y^{(i)} (\sum_{j=1}^n \hat{\alpha}_j y^{(j)}(x^{(j)} \cdot x^{(i)}) + \hat{\theta}_0) \leq 1
67 | \end{aligned}
68 | $$
69 |
70 | We can use $\alpha_i$ that lies in the interior of possible values to reconstruct $\hat{\theta}_0$
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/final_cheatsheet.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/01.112 Machine Learning/2019-Siew Wen/final_cheatsheet.pdf
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/pictures/1d_mixture_models.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/01.112 Machine Learning/2019-Siew Wen/pictures/1d_mixture_models.png
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/pictures/bayesian_network_example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/01.112 Machine Learning/2019-Siew Wen/pictures/bayesian_network_example.png
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/pictures/effects_of_regularization.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/01.112 Machine Learning/2019-Siew Wen/pictures/effects_of_regularization.PNG
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/pictures/em.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/01.112 Machine Learning/2019-Siew Wen/pictures/em.png
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/pictures/gaussian_em_iterations.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/01.112 Machine Learning/2019-Siew Wen/pictures/gaussian_em_iterations.PNG
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/pictures/kink.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/01.112 Machine Learning/2019-Siew Wen/pictures/kink.PNG
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/pictures/not_linear_separable_through_origin.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/01.112 Machine Learning/2019-Siew Wen/pictures/not_linear_separable_through_origin.PNG
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/pictures/penalty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/01.112 Machine Learning/2019-Siew Wen/pictures/penalty.png
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/pictures/pres_accident.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/01.112 Machine Learning/2019-Siew Wen/pictures/pres_accident.png
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/pictures/sgd_loss_functions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/01.112 Machine Learning/2019-Siew Wen/pictures/sgd_loss_functions.png
--------------------------------------------------------------------------------
/notes/01.112 Machine Learning/2019-Siew Wen/pictures/slack_variable.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/01.112 Machine Learning/2019-Siew Wen/pictures/slack_variable.jpg
--------------------------------------------------------------------------------
/notes/02.126 SEA under Japan/2019/SEA under Japan Week 01 - Before 1941.md:
--------------------------------------------------------------------------------
1 | # Circumstances that led to Japan's going to War
2 |
3 | ## SEA under Japan
4 |
5 | ### Lesson 2
6 |
7 | You could broadly split these reasons into *a. Historical* and *b. Immediate (30s - 41)*.
8 |
9 | ## Historical
10 |
11 | **Meiji Restoration - 1868**
12 |
13 | Japan was under a lot of pressure by Western powers. Westernization, industrialization, abolition of the Shogun and Samurai, restoration of power under the Emperor - adoption of many Western ideas.
14 |
15 | > First Sino -Japanese War 1894
16 | >
17 | > Invasion of Taiwan
18 | >
19 | > Korea - a dagger pointed in the heart of Jpan
20 |
21 | Many more militarily trained young men and demands of civilians (heavy taxation to fuel the restoration led to demands for foreign colonies) further fueled these expansionist tendencies.
22 |
23 | Interestingly, it led to painters going out onto the battlefront to make paintings for...stuff?
24 |
25 | ### Russo-Japanese War 1905
26 |
27 | Rooted in Manchurian and Korean territorial issues. It was significant to the Japanese because WOOHOO Asians never die. Made the Germans semi-nervous.
28 |
29 | Most Japanese still preferred a pacifist stance at this time however - see the poem by Akiko Yosano - but this changes by the time Manchuria happens.
30 |
31 | White supremacist prodding by Wilhem of Germany - interestingly, the Japanese looked to the Germans for guidance in the Meiji Restoration.
32 |
33 | ### Japan in WW1
34 |
35 | Beat the Germans, assisted the European allies (Britain, US, Italy and France) and profited (and took over German assets in Asia). This also earned them a permanent place on the Council of League of Nations.
36 |
37 | At the **Paris Peace Conference, 1919** , there was a proposal for racial equality - the Racial Equality Proposal - where there was a push for all races to be deemed officially equal. This was rejected by Britain and Australia. Japan is understandably upset.
38 |
39 | ### Washington Naval Conference 1921
40 |
41 | Naval Limitation Agreement - limiting ships in a 5:5:3 (UK:US:Japan). This snubs Japan.
42 |
43 | America passes the Japanese Exclusion Act in 1924, which singles out Japanese and bars them from immigrating to US.
44 |
45 | Then markets falter in 1926, which sparks nationalist sentiment in Japan. Well shit.
46 |
47 | Now the Japanese go full upsetti spaghetti.
48 |
49 | ## 1930s
50 |
51 | ### Manchurian 1931 - the Mukden Incident
52 |
53 | The "bombing" of a Japanese railway in Manchuria and the subsequent exit of the Japan from the League of Nations set the stage for shenanigans.
54 |
55 | And by shenanigans, I mean creating Manchukuo, using ex-Emperor Pu Yi as a figurehead head of state. The Japanese issued an ultimatum - be the head of state and have a chance of re-acquiring the title of Emperor, or be an enemy to the Japanese. Power rested with the Commander of General Affairs, and the associated assembly which was staffed by Japanese soldiers.
56 |
57 | After the formation of Manchukuo, Japan proceeds to migrate 1 million households to Manchukuo, which displaced hundreds of thousands of Manchurians.
58 |
59 | It's not a sudden annexation - the railway and all the designs for Manchuria have been there for years.
60 |
61 | ### The rekt of Nanking
62 |
63 | War against China **1937**, and it was brutal. They 'accidentally' bombed the American Panay, a gunship in the Yangtze River. Plenty of killing of civilians.
64 |
65 | Prime Minister of Japan (also Prince), Fumimaro Konoe escalated the war in China, and pushed for the Tripartite Act (signed Sept 1940) which created the Axis.
66 |
67 | ### Pearl Harbor 1941
68 |
69 | 2 hours after the start of the invasion of Malaya, they dropped by the American naval base Pearl Harbour and by that I mean they dropped bombs on Pearl Harbor. Chiang Kai-Shek and Winston Churchill were pretty hyped.
70 |
71 |
72 |
73 | ## How Social Awkwardness drove Japan to War
74 |
75 | Emperor - scared of upsetting the military and govt because of previous attempted coup
76 |
77 | Konoe - PM of Civilian Govt - fuffed about with working out a treaty/agreement with the Americans.
78 |
79 | Mitsumoe - Foreign Minister of Japan - Sees allies in Germany, Italy, Russia (because of German-Russian non-aggression pact),
80 |
81 | Military Arm - two factions: Army and Navy. Army and Navy commanders also trying to impress their jingoistic subordinates - all trying to impress each other. They're all secretly hoping that the Civilian Govt is able to work out a diplomatic solution with the Americans so they don't have to fight.
82 |
83 | #### Homework
84 |
85 | Similarities between the readings/comparisons and what not.
86 |
--------------------------------------------------------------------------------
/notes/02.126 SEA under Japan/2019/SEA under Japan Week 03.md:
--------------------------------------------------------------------------------
1 | # SEA under Japan Week 3
2 |
3 | We're doing some of last week's material because we didn't cover it.
4 |
5 | ## Pan-Asianism
6 |
7 | The idea that there's some unifying identity for Asian nations that would allow Asia to resist the West.
8 |
9 | The Western imperialist powers declined to give Asian people the same things that they gave their own citizens - self-determination, clear borders, votes and what not. They viewed Asia as the "waiting room of history" - where the people were not ready to create their own civilization, and needed Western guidance to achieve their potential - and hence justified Western presence.
10 |
11 | **Pan-Asianism** isn't just a Western concept - there exists commonalities between the Asian countries. Culturally, Confucianism, Buddhism and Hinduism are common threads that bound the Asian countries together.
12 |
13 | Japan identified itself as Asian, but also as a cut above the rest - some mental gymnastics took place when they tried to justify their shenanigans in Korea and China, and that they aren't a colonial power themselves.
14 |
15 | ### Teaist Pan-Asianism
16 |
17 | By Okakura: A pacifist idea of Pan-Asianism, rooted in cultural and spirituality and tea. Asian 'moral' soft power rooted in art, culture and philosophy, in contrast with the Western focus in science and politics.
18 |
19 | #### Sinic Pan-Asianism
20 |
21 | China needs help - too many problems and too varied a people. A weak China made for a poor Russian counterweight, and having Japan come along and fix China up would do Asia good. Japanese, Korean and even Chinese investors poured funds into this - until Japan started screwing around with the Chinese.
22 |
23 | ### Meishuron Pan-Asianism
24 |
25 | The Empire of the Rising Sun needed to be protected - a throwback to the samurai era of honor and what not. Somehow a lot of Japanese threw their lot with this. Japan needed to be militarily strong to protect the Emperor, and by extension, Asia. Under the Japanese umbrella would be the Greater Eastern Co-Prosperity Sphere.
26 |
27 | Yes, the Japanese believed in these idea, but we can't ignore the practical aspects of this war. They did need the resources.
28 |
29 | ## Japan in Malaya
30 |
31 | > Thomas Shenton - Governor of Singapore
32 | >
33 | > Percival - British Commander of Malaya and Singapore
34 | >
35 | > Yamashita - The Tiger of Malaya, Commander of the Japanese forces, and also a political enemy of Tojo. Still, a capable man nonetheless.
36 |
37 | The Singapore strategy - start with a naval base, some cannons, and get reinforcements from India and Australia. If shit goes down, get the Americans (didn't work because of *Pearl Harbor*) or reinforcement from the Middle East (Churchill's shifting theatres of war).
38 |
39 | The English had this incredible notion that the Japanese were grossly incapable of fighting - even when clearly outmatched. With the Japanese rolling in with 600 planes, mostly modern planes like the legendary Mitsubishi Zeros, the British were still fuffing about with 90 old planes like Buffalo Brewsters. You can see how this wouldn't work.
40 |
41 | The Thai were uncomfortable because to the north was Burma (under Brits) and to the south was Malaya (under Brits too) and thought the Brits had designs on the isthmus of Kra.
42 |
43 | The British planned Operation Matador as a countermove to Japanese landings in Malaya, but that would piss of the Thai.
44 |
45 | The advance of the Japanese was incredibly rapid - not just because they were properly equipped for the jungle, but also because the Brits very easily retreated. Contingents of Indian troops would surrender and defect because the Brits just gave in and ran.
46 |
47 | Disappointing.
48 |
49 | So repeatedly, they'd cede more land and say 'let's protect the further south'. You can see how this doesn't work.
50 |
51 |
--------------------------------------------------------------------------------
/notes/02.126 SEA under Japan/2019/SEA under Japan Week 05.md:
--------------------------------------------------------------------------------
1 | # SEA under Japan Week 5
2 |
3 | ### Japan and Malaya
4 |
5 | The Japanese had seeded and fanned independence movements within the Malays, given their funding and support from the KMM. They also leveraged on Malay Friday prayers to spread paraphenelia and pro-Japanese messages - which imbued a sort of strength into the clergy class.
6 |
7 | However, there was some low-level resistance against the Japanese (clearly). Breakoffs from the MPAJA would raid Japanese supply trucks, and the supplies stolen bled into the black market.
8 |
9 | The Japanese arrival catalysed the formation of the idea of a Malay nation. Apart from providing support to the KMM, which already wanted an independent Malay nation, their rule also indirectly gave rise to several Malay newspapers - this also caused a shift in linguistics, as Roman letters were adopted as the standard script for Melayu, and gave rise to some new phrases (in fact, when the British finally return, there was a whole new vernacular they'd have to pick up).
10 |
11 | The KMM eventually got miffed that the Japanese weren't actually keen on a Malay nation, and kept pushing for it. They eventually met and worked together with the Communists, which is weird because the Communists are allied to the British, and the KMM was allied with the Japanese. Eventually, the Japanese found the KMM more trouble than they were worth, and banned the KMM, with adviser roles being given out to the leaders of KMM.
12 |
13 | Then, in 1943, Burma gets a sort of independence with their own government (which is a puppet government, of course). This excites the Malays and gives them hope.
14 |
15 | Then **SYKE** the northernmost 4 states are given to Thailand, which to the Malays was an incredible betrayal. Mustafa Hussein said "**NOPE** screw dis I'm going back to perak bye you little shits".
16 |
17 | Japan then offers military training and the militarisation of the Malays, creating their own army - with 2000 strong, Japanese uniforms, training and equipment, led by Ibrahim Yaacob. This army was set against the MPAJA, but that really didn't work out because 1) these people aren't really warriors, and 2) many of these people thought that the MPAJA weren't that shitty and it was wrong to fight their own people.
18 |
19 | Food supplies were shitacular because the 4 northern states were the rice-producing states of Malaysia. (Meanwhile in the 4 states, while they were nominally Thai, but there's weak policing by the Thai and they're generally run by the Malays). Without good food (since most of the food was channeled to the Japanese war effort), there was a shift toward use of tapioca. It's calorie rich, but not nutritious, which led to a lot of growth stunting.
20 |
21 | THEN YAMASHITA MY BOI SEZ
22 |
23 | > Yo chinese people fuk u too gimme 50 million dollars
24 |
25 | And the Chinese somehow scraped together 50 million dollars (by borrowing from a Japanese bank).
26 |
27 | There's a slow breakdown of the notion of the plural society because of the common denominator of *desperately trying to survive* lubricated social exchange when people met in the markets (and black markets). Old British systems and ideas like a segregated plural society, and business/logistical systems were thrown out of the window. People improvised, and those improvised systems stayed.
28 |
29 | KRIS - kesatuan rakyat indonesia semenanjung. A greater Malay nation including Indonesia. A notion that bubbled up at the end of the War.
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/notes/02.126 SEA under Japan/2019/SEA under Japan Week 10.md:
--------------------------------------------------------------------------------
1 | # SEA under Japan Week 10
2 |
3 | The PETA Revolt in Indonesia
4 |
5 | Few written sources - largely survivor testimonies.
6 |
7 | Formed October 1943 as *Tentara Sukarela Pembela Tanah Air* - Voluntary Army for the Defence of Land and Seas. Strikingly, it was **volunteer** basis, and was largely from **upper class families**. Many signed up - at the time, the Japanese were still viewed **positively**.
8 |
9 | Creation of independent, non-hierarchical *daidans* (battalions) - not hiearchical but independent, and intra-*daidan* contact was forbidden. This was to prevent the possibility of revolt.
10 |
11 | Meant to serve as a standing force against possible reprisal from the Australians, or attacks on Indonesia.
12 |
13 | Indonesia had long been 'demilitarized' under Dutch rule, and the Japanese militarization of Indonesia empowered the Indonesian people by equipping them with the necessary skills and equipment.
14 |
15 | Each *kabupaten* raised a *daidan*. They were pulled out from their civilian lives and put through rigorous military training. When they returned after training, they found that civilian life had changed for the worse - farmers were forced to sell rice, eggs were bought by the Japanese at cute-rate prices ostensibly for PETA, but it ended up for the Japanese.
16 |
17 | Scrap iron was being taken, with ornamnets and young women forced to go to 'Tokyo' for 'study'.
18 |
19 | PETA officers would be slapped by the Japanese, and that really ticked off the Indonesians because the Japanese claimed that they were equals.
20 |
21 | Many taken away to be *romusha*, forced labour for mines and the Death Railway. Blitar *daidan* got to see some of this, but these *romusha* were slightly better off.
22 |
23 | Indonesia was host to a lot of Dutch, and let's not forget that they, the colonizers, ended up as victims as well.
24 |
25 | Japanese used other PETA troops from Blitar *daidan* and *Heiho* to **suppress** the **revolt**, which made it difficult for the Indonesians to fight each other (they're all nationalists after all). The rebels withdrew into the mountains, which helped them endure a bit longer. Eventually the revolting troops surrendered with conditions. The Japanese granted relatively *lenient* sentences because they had to handle the Indonesians carefully - if they executed all the troops, that would inspire rebellion in the rest.
26 |
27 | **Supriyadi **- leader of the PETA rebellion. Disappeared after the forces withdrew into the mountain. He was slated to be the minister of defence, apparently, but he just...disappeared.
28 |
29 | Blitar's pretty popular, because it's a story that advances the cause of nationalism or valor (it's rather romanticized). An old man eventually claimed to be Supriyadi, and there was a lot of interest because of the tale - and he made many plausible claims. The one *startling* one is that he was present at the declaration of Independence, and was simply not noticed because he wasn't dressed formally, and kept a low profile.
30 |
31 | Whether it's true or not is irrelevant - it's the fervor that it inspired that we should note.
32 |
33 | There were also **Japanese** who devoted themselves to the independence of Indonesia against the allies. They gave up their weapons to the Indonesians to arm them against the Allies - cheeky strat, really.
34 |
35 | ## Friday Recital
36 |
37 | Complete your summaries - 7 top summaries will be used for score. Final paper needs a bibliography of at least 5 sources, with a draft by week 12. [go prepare this ahead of time] Hard deadline is 6th.
38 |
39 | > **Examples of Papers**
40 | >
41 | > *Comfort women*
42 | >
43 | > *The reasons for japanese atrocities from diaries and confessions of soldiers*
44 | >
45 | > *Failure of colonial rule post-war*
46 | >
47 | > *experiences of children in malaya in WW2*
48 | >
49 | > *bushido and the Japanese actions in SEA*
50 | >
51 | > *The most persecuted race in SEA in WW2*
52 | >
53 | > *The reason for bridge building in SEA*
54 | >
55 | > *Local japanese resistance to the war during ww2*
56 | >
57 | > *Reasons for the aggressive insurgency against the dutch after the Japanese surrender*
58 | >
59 | > *Food in malaya*
60 | >
61 | > *Sukarno and the blood on his hands*
62 | >
63 | > *Life under colonial rule and the Japanese occupation*
64 | >
65 | > *The notion of Japanese superiority and the aversion to surrender*
66 | >
67 | >
68 | >
69 | >
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/notes/02.126 SEA under Japan/2019/SEA under Japan Week 11.md:
--------------------------------------------------------------------------------
1 | # SEA under Japan Week 11
2 |
3 | ## The Phillipines
4 |
5 | 1898 Battle of Manila Bay - the Spanish surrendered to the Americans, and gave up the Philippines. The reason for the fight was *Cuba* rather than the Philippines itself (Spanish American War 1898) resulting in the Treaty of Paris.
6 |
7 | America pays Spain $20 million for infrastructure (and ownership) of the Philippines.
8 |
9 | Nationalists say *we want our country*, not a *change of colonial power*. The Americans were never quite the colonial power compared to the Spaniards, Brits or the Dutch, but for the Filipinos, the Americans were just another white power coming over.
10 |
11 | The nationalists fought against the Americans for 3 years, and unsuccessfully so - they surrender in 1901. America was brutal in their clamping down against the revolutionaries (waterboarding, and widespread killing). In 1935, the Commonwealth of the Philippines was set up, because the Americans insist they aren't a colonial power.
12 |
13 | Then the Japanese attack.
14 |
15 | Most of the fighting is centered on Luzon, with two other strikes on the East and South. The Americans floundered, the same way the British did - the Japanese attack was fast, precise and brutal. To the Americans' credit, they held on longer because
16 |
17 | The Americans sought to preserve Manila (because they put a lot of resources into Manila) and decide not to fight in it - they make it an 'Open City', where they accept that the Japanese can take over it, contingent on not-destroying-the-whole-place.
18 |
19 | > It didn't work, because the Japanese still opened their assault with aerial bombing to soften the (non-existent) defence.
20 |
21 | The American and Philippine armies move to Corregidor, a small island, to hold their ground. Fighting is brutal - 5 months from December 30th till surrender.
22 |
23 | MacArthur is recalled to Australia by America. Surrender on 6th May, under Wainwright.
24 |
25 | The *Bataan March* - 80,000 POWs marched to camp *O'Donnell*, and only 50,000 reached the camp. Horrific conditions, with the Japanese just pulling random POWs into the bushes to be bayoneted so the Japanese troops could steal their watches. 6 days without food to walk 60 miles - those who fell behind where killed.
26 |
27 | *Hell Ships* - Japanese ships that transported the POWs to labour camps. One. carrying POWs, was sunk with their cargo on board - out of 662, only 82 survived.
28 |
29 | The Japanese set up a government in the Philippines - not very popular - and a government-in-exile headed by Quezon (President of the Philippines Commonwealth) in America.
30 |
31 | Despite Japanese efforts to win over the Filipino populace, Filipino sentiment was still strongly anti-Japanese.
32 |
33 | The Battle of Midway represent a sort of turning point in the war, because it revealed the apparent weakness of the Japanese - apart from the breaking of the Japanese code, the Americans could recover and reuse more ships than the Japanese, while most Japanese ships were wrecked.
34 |
35 | In 1944, the Americans fight to retake the Philippines. There's an iconic photo of MacArthur walking up the beach against the backdrop of amphibious assault boats, with a look of grim determination on his face - it blew up because something something American glory and what not. What *actually* happened was that MacArthur did not want to get wet, but because the boat he was on could not land, he had to walk. This grim determination was just him being pissed as hell.
36 |
37 | The Battle of Luzon - Japan reinstated Yamashita to defend Manila. Yamashita had the same idea as the Americans - a sort of open city, and planned to regroup. However, there was insubordination - Rear Admiral Iwabuchi had a vendetta against the Americans, and held Manila fiercely, while massacring the civilians (Manila Massacre - 100,000 to 250,000 dead). The Americans bombard Manila to hell, killing thousands upon thousands of civilians. Even libraries were destoyed - essentially, Filipino history ends in 1945 because everything was destroyed.
38 |
39 | There's also some serious *Force 136*/ MPAJA styled shenanigans - the **Hukbalahap**. A communist/socialist guerilla movement that fought the Japanese *and also the Americans*. At their peak, their had 50,000 to their name. They continue fighting the Philippines Government until 1946 before being put down by the president. In 1949, they go a bit crazy and assassinate Quezon's wife, which kind of pisses of the Americans.
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/notes/02.126 SEA under Japan/2019/SEA-under-Japan-2019-notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.126 SEA under Japan/2019/SEA-under-Japan-2019-notes.pdf
--------------------------------------------------------------------------------
/notes/02.137DH Introduction to Digital Humanities/2019-WM/02.137DH_notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.137DH Introduction to Digital Humanities/2019-WM/02.137DH_notes.pdf
--------------------------------------------------------------------------------
/notes/02.212TS The Visual Culture of Science and Technology/2019/02.212TS_notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.212TS The Visual Culture of Science and Technology/2019/02.212TS_notes.pdf
--------------------------------------------------------------------------------
/notes/02.229 Decision Theory & Practice/2019-Yustynn/decision-theory-2019-notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.229 Decision Theory & Practice/2019-Yustynn/decision-theory-2019-notes.pdf
--------------------------------------------------------------------------------
/notes/02.229 Decision Theory & Practice/2019-Yustynn/w01-summary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.229 Decision Theory & Practice/2019-Yustynn/w01-summary.pdf
--------------------------------------------------------------------------------
/notes/02.229 Decision Theory & Practice/2019-Yustynn/w02-summary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.229 Decision Theory & Practice/2019-Yustynn/w02-summary.pdf
--------------------------------------------------------------------------------
/notes/02.229 Decision Theory & Practice/2019-Yustynn/w03-summary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.229 Decision Theory & Practice/2019-Yustynn/w03-summary.pdf
--------------------------------------------------------------------------------
/notes/02.229 Decision Theory & Practice/2019-Yustynn/w04-summary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.229 Decision Theory & Practice/2019-Yustynn/w04-summary.pdf
--------------------------------------------------------------------------------
/notes/02.229 Decision Theory & Practice/2019-Yustynn/w05-summary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.229 Decision Theory & Practice/2019-Yustynn/w05-summary.pdf
--------------------------------------------------------------------------------
/notes/02.229 Decision Theory & Practice/2019-Yustynn/w06-summary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.229 Decision Theory & Practice/2019-Yustynn/w06-summary.pdf
--------------------------------------------------------------------------------
/notes/02.229 Decision Theory & Practice/2019-Yustynn/w09-summary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.229 Decision Theory & Practice/2019-Yustynn/w09-summary.pdf
--------------------------------------------------------------------------------
/notes/02.229 Decision Theory & Practice/2019-Yustynn/w10-summary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.229 Decision Theory & Practice/2019-Yustynn/w10-summary.pdf
--------------------------------------------------------------------------------
/notes/02.229 Decision Theory & Practice/2019-Yustynn/w10-summary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.229 Decision Theory & Practice/2019-Yustynn/w10-summary.png
--------------------------------------------------------------------------------
/notes/02.229 Decision Theory & Practice/2019-Yustynn/w11-summary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.229 Decision Theory & Practice/2019-Yustynn/w11-summary.pdf
--------------------------------------------------------------------------------
/notes/02.229 Decision Theory & Practice/2019-Yustynn/w12-summary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.229 Decision Theory & Practice/2019-Yustynn/w12-summary.pdf
--------------------------------------------------------------------------------
/notes/02.229 Decision Theory & Practice/2019-Yustynn/w13-summary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.229 Decision Theory & Practice/2019-Yustynn/w13-summary.pdf
--------------------------------------------------------------------------------
/notes/02.229 Decision Theory & Practice/2019-Yustynn/w13-summary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/02.229 Decision Theory & Practice/2019-Yustynn/w13-summary.png
--------------------------------------------------------------------------------
/notes/30.003 Introduction to Probability and Statistics/2019-WM/30.003_PnS_notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.003 Introduction to Probability and Statistics/2019-WM/30.003_PnS_notes.pdf
--------------------------------------------------------------------------------
/notes/30.003 Introduction to Probability and Statistics/2019-WM/30.003_finals_revision_guide.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.003 Introduction to Probability and Statistics/2019-WM/30.003_finals_revision_guide.pdf
--------------------------------------------------------------------------------
/notes/30.003 Introduction to Probability and Statistics/2019-WM/30.003_midterms_revision_guide.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.003 Introduction to Probability and Statistics/2019-WM/30.003_midterms_revision_guide.pdf
--------------------------------------------------------------------------------
/notes/30.101 Systems & Control/2020-WM/30.101_SnC_notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.101 Systems & Control/2020-WM/30.101_SnC_notes.pdf
--------------------------------------------------------------------------------
/notes/30.101 Systems & Control/2020-WM/30.101_midterms_revision_guide.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.101 Systems & Control/2020-WM/30.101_midterms_revision_guide.pdf
--------------------------------------------------------------------------------
/notes/30.101 Systems & Control/2020-WM/blockdiagrams.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.101 Systems & Control/2020-WM/blockdiagrams.png
--------------------------------------------------------------------------------
/notes/30.102 Electromagnetics & Applications/2020-WM/30.102_finals_revision_guide.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.102 Electromagnetics & Applications/2020-WM/30.102_finals_revision_guide.pdf
--------------------------------------------------------------------------------
/notes/30.102 Electromagnetics & Applications/2020-WM/30.102_midterms_revision_guide.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.102 Electromagnetics & Applications/2020-WM/30.102_midterms_revision_guide.pdf
--------------------------------------------------------------------------------
/notes/30.102 Electromagnetics & Applications/2020-WM/TL_ant_Tx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.102 Electromagnetics & Applications/2020-WM/TL_ant_Tx.png
--------------------------------------------------------------------------------
/notes/30.102 Electromagnetics & Applications/2020-WM/planecurrent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.102 Electromagnetics & Applications/2020-WM/planecurrent.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/16expressions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/16expressions.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/30.110_revision_guide.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/30.110_revision_guide.pdf
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/4bitreg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/4bitreg.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/bin-sync-counter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/bin-sync-counter.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/binary-ripple-counter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/binary-ripple-counter.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/logicgates.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/logicgates.jpg
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/logicgates.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/logicgates.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/mealy-machine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/mealy-machine.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/moore-machine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/moore-machine.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/seq-fsm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/seq-fsm.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/seq-logic-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/seq-logic-2.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/serial-trf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/serial-trf.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/state-diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/state-diagram.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/state-minimization.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/state-minimization.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/static-discipline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/static-discipline.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/uni_shift_reg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/uni_shift_reg.png
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/wx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/wx.jpg
--------------------------------------------------------------------------------
/notes/30.110 Digital Systems Lab/2020-WM/yz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/30.110 Digital Systems Lab/2020-WM/yz.jpg
--------------------------------------------------------------------------------
/notes/40.002 Optimisation/2019-huikang/README.md:
--------------------------------------------------------------------------------
1 | This contains my revision notes midterms and finals. I have obtained 90% for the first three of the four exams/quiz.
2 |
3 | The images are not my work, and most of them are taken from the slides.
4 |
5 | The source code is available in [my repository](https://github.com/tonghuikang/notes_ESD_term10/tree/master/OPTI).
6 |
7 |
--------------------------------------------------------------------------------
/notes/40.002 Optimisation/2019-huikang/final-summary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.002 Optimisation/2019-huikang/final-summary.pdf
--------------------------------------------------------------------------------
/notes/40.002 Optimisation/2019-huikang/midterm-summary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.002 Optimisation/2019-huikang/midterm-summary.pdf
--------------------------------------------------------------------------------
/notes/40.011 Data and Business Analytics/2019-huikang/README.md:
--------------------------------------------------------------------------------
1 | This contains the cheatsheet for the first half of the course.
2 |
3 | For the finals, I had used a cheatsheet from my senior. Moreover, I am already familiar with the accounting and finance concepts (I am in the SUTD-SMU Dual Degree Programme).
4 |
5 |
--------------------------------------------------------------------------------
/notes/40.011 Data and Business Analytics/2019-huikang/midterm-cheatsheet.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.011 Data and Business Analytics/2019-huikang/midterm-cheatsheet.pdf
--------------------------------------------------------------------------------
/notes/40.012 Manufacturing and Service Operations/2020-huikang/assets/EOQ-cost.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.012 Manufacturing and Service Operations/2020-huikang/assets/EOQ-cost.png
--------------------------------------------------------------------------------
/notes/40.012 Manufacturing and Service Operations/2020-huikang/assets/EOQ-inventory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.012 Manufacturing and Service Operations/2020-huikang/assets/EOQ-inventory.png
--------------------------------------------------------------------------------
/notes/40.012 Manufacturing and Service Operations/2020-huikang/assets/EPQ-inventory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.012 Manufacturing and Service Operations/2020-huikang/assets/EPQ-inventory.png
--------------------------------------------------------------------------------
/notes/40.012 Manufacturing and Service Operations/2020-huikang/assets/NV-formulas.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.012 Manufacturing and Service Operations/2020-huikang/assets/NV-formulas.png
--------------------------------------------------------------------------------
/notes/40.012 Manufacturing and Service Operations/2020-huikang/assets/QR-inventory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.012 Manufacturing and Service Operations/2020-huikang/assets/QR-inventory.png
--------------------------------------------------------------------------------
/notes/40.014 Engineering Systems Architecture/2020-huikang/assets/influence-diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.014 Engineering Systems Architecture/2020-huikang/assets/influence-diagram.png
--------------------------------------------------------------------------------
/notes/40.014 Engineering Systems Architecture/2020-huikang/assets/modularity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.014 Engineering Systems Architecture/2020-huikang/assets/modularity.png
--------------------------------------------------------------------------------
/notes/40.014 Engineering Systems Architecture/2020-huikang/assets/stakeholder-diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.014 Engineering Systems Architecture/2020-huikang/assets/stakeholder-diagram.png
--------------------------------------------------------------------------------
/notes/40.014 Engineering Systems Architecture/2020-huikang/first-half.md:
--------------------------------------------------------------------------------
1 | # Midterms revision
2 |
3 | I am here studying the exam paper. Some instructions may not be present in the midterms but are still expected to be followed.
4 |
5 | Bring a ruler to improve your quality of life.
6 |
7 | ### Architectural design concepts
8 |
9 | - Modularity, Operational Analysis, Scenario Analysis, Structural Design, Operational Analysis, Concept Generation, Problem and Mission Statements, Use Cases
10 | - Use common sense
11 |
12 |
13 |
14 | ### Identifying Stakeholders
15 |
16 | - Your power-interest diagram require annotated arrows.
17 |
18 | 
19 |
20 | - One table explains the position of the power and interest in the diagram.
21 | - One table explains the relationship between the different stakeholders. You only need to fill up cells with a relationship.
22 |
23 |
24 |
25 | ### Influence Diagrams
26 |
27 | - Sketch this argument using the Design Research Methodology notation. In particular, each arc should have two signs (either “+” or “-“), one at the tail end of the arc and the other at the head of the arc. Label each arc as “E”, for “Experience” or “A” for “Assumption”.
28 | - Points will be deducted if you use the words "increase" or "decrease" within a bubble - this information belongs on the arcs.
29 | - Your proposal should be in the shape of a hexagon.
30 |
31 | 
32 |
33 | ### Architectural DSM
34 |
35 | - Rearrange rows and columns such that the "loss" is minimum. "Loss" is the distance of ones from the diagonal.
36 | - You can sketch the relationships as a graph.
37 |
38 |
39 |
40 | ### Modularity
41 |
42 | - Identify six functions
43 | - Identify three subsystems
44 | - Assign functions to the subsystems
45 | - List the exchanges on a table "Exchange", "From Entity", "To Entity"
46 | - Sketch a state change diagram for a typical cycle of events
47 |
48 | 
49 |
50 | ### Trade Studies
51 |
52 | - You need to draw a table.
53 | - Headings: Attribute List, Relative Weighting, A Rating, A Weighted Rating, B Rating, B Weighted Rating.
54 | - Summaries (after attribute list): Total, Rank, Recommend
55 |
56 |
--------------------------------------------------------------------------------
/notes/40.016 The Analytics Edge/2019-huikang/R-cheatsheet.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.016 The Analytics Edge/2019-huikang/R-cheatsheet.pdf
--------------------------------------------------------------------------------
/notes/40.016 The Analytics Edge/2019-huikang/README.md:
--------------------------------------------------------------------------------
1 | This contains my R cheatsheet, which is good for both midterms and finals.
2 |
3 |
--------------------------------------------------------------------------------
/notes/40.302 Advanced Topics in Optimization/2019-Yustynn/opti-notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.302 Advanced Topics in Optimization/2019-Yustynn/opti-notes.pdf
--------------------------------------------------------------------------------
/notes/40.302 Advanced Topics in Optimization/2021-huikang/README.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.302 Advanced Topics in Optimization/2021-huikang/README.pdf
--------------------------------------------------------------------------------
/notes/40.302 Advanced Topics in Optimization/2021-huikang/assets/cheatsheet-page-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.302 Advanced Topics in Optimization/2021-huikang/assets/cheatsheet-page-1.png
--------------------------------------------------------------------------------
/notes/40.302 Advanced Topics in Optimization/2021-huikang/assets/cheatsheet-page-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.302 Advanced Topics in Optimization/2021-huikang/assets/cheatsheet-page-2.png
--------------------------------------------------------------------------------
/notes/40.302 Advanced Topics in Optimization/2021-huikang/assets/jm-cmax-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.302 Advanced Topics in Optimization/2021-huikang/assets/jm-cmax-1.png
--------------------------------------------------------------------------------
/notes/40.302 Advanced Topics in Optimization/2021-huikang/assets/jm-cmax-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.302 Advanced Topics in Optimization/2021-huikang/assets/jm-cmax-2.png
--------------------------------------------------------------------------------
/notes/40.302 Advanced Topics in Optimization/2021-huikang/assets/permutation-flow-shop-alt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.302 Advanced Topics in Optimization/2021-huikang/assets/permutation-flow-shop-alt.png
--------------------------------------------------------------------------------
/notes/40.302 Advanced Topics in Optimization/2021-huikang/assets/taxonomy-machine-environment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.302 Advanced Topics in Optimization/2021-huikang/assets/taxonomy-machine-environment.png
--------------------------------------------------------------------------------
/notes/40.302 Advanced Topics in Optimization/2021-huikang/assets/taxonomy-objective-functions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.302 Advanced Topics in Optimization/2021-huikang/assets/taxonomy-objective-functions.png
--------------------------------------------------------------------------------
/notes/40.305 Advanced Topics in Stochastic Modeling/2019-Yustynn/atsm-notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.305 Advanced Topics in Stochastic Modeling/2019-Yustynn/atsm-notes.pdf
--------------------------------------------------------------------------------
/notes/40.316 Game Theory/2021-huikang/assets/cheatsheet-page-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.316 Game Theory/2021-huikang/assets/cheatsheet-page-1.png
--------------------------------------------------------------------------------
/notes/40.316 Game Theory/2021-huikang/assets/cheatsheet-page-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.316 Game Theory/2021-huikang/assets/cheatsheet-page-2.png
--------------------------------------------------------------------------------
/notes/40.316 Game Theory/2021-huikang/assets/splitting-the-pie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/40.316 Game Theory/2021-huikang/assets/splitting-the-pie.png
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel.pdf
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/img/blocking-queue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/img/blocking-queue.png
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/img/cyclic-barrier.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/img/cyclic-barrier.png
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/img/nonblockingll.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/img/nonblockingll.png
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/img/parallel-bfs.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/img/parallel-bfs.jpg
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/img/parallelization.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/img/parallelization.png
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/img/phaser.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/img/phaser.jpg
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/img/volatile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenSUTD/course-notes/edec7500de149483451bd2a3b2910c763988d8d2/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/img/volatile.png
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/src/CDLDemo.java:
--------------------------------------------------------------------------------
1 | import java.util.concurrent.CountDownLatch;
2 |
3 | public class CDLDemo {
4 |
5 | public static void main(String[] args) throws Exception {
6 | CountDownLatch latch = new CountDownLatch(3);
7 |
8 | Waiter waiter = new Waiter(latch);
9 | Decrementer decrementer = new Decrementer(latch);
10 |
11 | new Thread(waiter).start();
12 | new Thread(decrementer).start();
13 | }
14 | }
15 |
16 | class Waiter implements Runnable {
17 |
18 | CountDownLatch latch = null;
19 |
20 | public Waiter(CountDownLatch latch) {
21 | this.latch = latch;
22 | }
23 |
24 | public void run() {
25 | try {
26 | latch.await();
27 | } catch (InterruptedException e) {
28 | e.printStackTrace();
29 | }
30 |
31 | System.out.println("Waiter Released");
32 | }
33 | }
34 |
35 | class Decrementer implements Runnable {
36 |
37 | CountDownLatch latch = null;
38 |
39 | public Decrementer(CountDownLatch latch) {
40 | this.latch = latch;
41 | }
42 |
43 | public void run() {
44 | try {
45 | Thread.sleep(1000);
46 | this.latch.countDown();
47 | System.out.println(latch.getCount());
48 |
49 | Thread.sleep(1000);
50 | this.latch.countDown();
51 | System.out.println(latch.getCount());
52 | Thread.sleep(1000);
53 | this.latch.countDown();
54 | System.out.println(latch.getCount());
55 | } catch (InterruptedException e) {
56 | e.printStackTrace();
57 | }
58 | }
59 | }
60 |
61 | // output:
62 | // 2
63 | // 1
64 | // 0
65 | // Waiter Released
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/src/DecoratorDemo.java:
--------------------------------------------------------------------------------
1 | import java.util.Scanner;
2 |
3 | public class DecoratorDemo {
4 | public static void main(String[] args){
5 | MyPizza basicPizza = new Ham(new TomatoSauce(new Cheese(new PlainPizza())));
6 | System.out.println("Ingredients: " + basicPizza.ingredients());
7 | System.out.println("Price: " + basicPizza.getCost());
8 | }
9 | }
10 |
11 | interface MyPizza {
12 | public String ingredients();
13 | public double getCost();
14 | }
15 |
16 | class PlainPizza implements MyPizza {
17 | public String ingredients() {
18 | return "dough";
19 | }
20 |
21 | public double getCost() {
22 | return 4.00;
23 | }
24 | }
25 |
26 | abstract class ToppingDecorator implements MyPizza {
27 | protected MyPizza tempPizza;
28 |
29 | public ToppingDecorator(MyPizza newPizza){
30 | tempPizza = newPizza;
31 | }
32 |
33 | public String ingredients() {
34 | return tempPizza.ingredients();
35 | }
36 |
37 | public double getCost() {
38 | return tempPizza.getCost();
39 | }
40 | }
41 |
42 | class Cheese extends ToppingDecorator {
43 |
44 | public Cheese(MyPizza newPizza) {
45 | super(newPizza);
46 | }
47 |
48 | public String ingredients(){
49 | return tempPizza.ingredients() + ", cheese";
50 | }
51 |
52 | public double getCost(){
53 | return tempPizza.getCost() + 2.00;
54 | }
55 | }
56 |
57 | class TomatoSauce extends ToppingDecorator {
58 |
59 | public TomatoSauce(MyPizza newPizza) {
60 | super(newPizza);
61 | }
62 |
63 | public String ingredients(){
64 | return tempPizza.ingredients() + ", tomato sauce";
65 | }
66 |
67 | public double getCost(){
68 | return tempPizza.getCost() + .35;
69 | }
70 | }
71 |
72 | class Ham extends ToppingDecorator {
73 |
74 | public Ham(MyPizza newPizza) {
75 | super(newPizza);
76 | }
77 |
78 | public String ingredients(){
79 | return tempPizza.ingredients() + ", ham";
80 | }
81 |
82 | public double getCost(){
83 | return tempPizza.getCost() + 4.00;
84 | }
85 | }
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/src/DiningPhil1.java:
--------------------------------------------------------------------------------
1 | import java.util.Random;
2 | import java.util.concurrent.locks.ReentrantLock;
3 |
4 |
5 | // Locking policy: Each Fork1 object has a reentrant lock that
6 | // abstracts the availability of the lock. Since deadlock can only happen
7 | // if each Philosopher is holding on to one fork and waiting for a held Fork1,
8 | // if all 5 Philosophers hold on to forks on the same hand, e.g. left,
9 | // no forks would be left. If they try to get a Fork on the right,
10 | // then they would fail and release the left one. This solution prevents
11 | // deadlock and can be implemented either on the left or right hands.
12 |
13 | public class DiningPhil1 {
14 |
15 | private static int N = 5;
16 |
17 | public static void main (String[] args) throws Exception {
18 | Philosopher1[] phils = new Philosopher1[N];
19 | Fork1[] forks = new Fork1[N];
20 |
21 | for (int i = 0; i < N; i++) {
22 | forks[i] = new Fork1(i);
23 | }
24 |
25 | for (int i = 0; i < N; i++) {
26 | phils[i] = new Philosopher1 (i, forks[i], forks[(i+N-1)%N]);
27 | phils[i].start();
28 | }
29 | }
30 | }
31 |
32 | class Philosopher1 extends Thread {
33 | private final int index;
34 | private final Fork1 left;
35 | private final Fork1 right;
36 |
37 | public Philosopher1 (int index, Fork1 left, Fork1 right) {
38 | this.index = index;
39 | this.left = left;
40 | this.right = right;
41 | }
42 |
43 | public void run() {
44 | Random randomGenerator = new Random();
45 | try {
46 | while (true) {
47 | // Lock left, then tryLock right.
48 | Thread.sleep(randomGenerator.nextInt(100)); //not sleeping but thinking
49 | System.out.println("Phil " + index + " finishes thinking.");
50 | left.lock.lock();
51 | System.out.println("Phil " + index + " locks left.");
52 | left.pickup();
53 | System.out.println("Phil " + index + " picks up left Fork1.");
54 | System.out.println("Phil " + index + " tries to lock right.");
55 | boolean lockRight;
56 | if (lockRight = right.lock.tryLock()) {
57 | System.out.println("Phil " + index + " locks right.");
58 | right.pickup();
59 | System.out.println("Phil " + index + " picks up right Fork1.");
60 | }
61 | Thread.sleep(randomGenerator.nextInt(100)); //eating
62 | System.out.println("Phil " + index + " finishes eating.");
63 | left.putdown();
64 | System.out.println("Phil " + index + " puts down left Fork1.");
65 | left.lock.unlock();
66 | System.out.println("Phil " + index + " unlocks left.");
67 | if (lockRight) {
68 | right.putdown();
69 | System.out.println("Phil " + index + " puts down right Fork1.");
70 | right.lock.unlock();
71 | System.out.println("Phil " + index + " unlocks right.");
72 | }
73 | }
74 | } catch (InterruptedException e) {
75 | System.out.println("Don't disturb me while I am sleeping, well, thinking.");
76 | }
77 | }
78 | }
79 |
80 | class Fork1 {
81 | private final int index;
82 | private boolean isAvailable = true;
83 | public ReentrantLock lock = new ReentrantLock();
84 |
85 | public Fork1 (int index) {
86 | this.index = index;
87 | }
88 |
89 | public synchronized void pickup () throws InterruptedException {
90 | while (!isAvailable) {
91 | wait();
92 | }
93 |
94 | isAvailable = false;
95 | notifyAll();
96 | }
97 |
98 | public synchronized void putdown() throws InterruptedException {
99 | while (isAvailable) {
100 | wait();
101 | }
102 |
103 | isAvailable = true;
104 | notifyAll();
105 | }
106 |
107 | public String toString () {
108 | if (isAvailable) {
109 | return "Fork " + index + " is available.";
110 | }
111 | else {
112 | return "Fork " + index + " is NOT available.";
113 | }
114 | }
115 | }
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/src/FutureRenderer2.java:
--------------------------------------------------------------------------------
1 | public class FutureRenderer2 {
2 | private final ExecutorService executor = new ScheduledThreadPoolExecutor (100);
3 |
4 | void renderPage (CharSequence source) throws Exception {
5 | final List imageInfos = scanForImageInfo(source);
6 |
7 | Callable> task = new Callable>() {
8 | public List call () {
9 | List result = new ArrayList();
10 | for (ImageInfo imageInfo : imageInfos) {
11 | result.add(imageInfo.downloadImage());
12 | }
13 |
14 | return result;
15 | }
16 | };
17 |
18 | Future> future = executor.submit(task);
19 | renderText(source);
20 |
21 | try {
22 | List imageData = future.get(3, TimeUnit.SECONDS);
23 | for (ImageData data: imageData) {
24 | renderImage(data);
25 | }
26 | } catch (InterruptedException e) {
27 | Thread.currentThread().interrupt();
28 | future.cancel(true);
29 | } catch (TimeoutException e) {
30 | renderCross();
31 | }
32 | }
33 | private void renderCross() { /* TODO Auto-generated method stub */ }
34 | private void renderImage(ImageData data) { /* TODO Auto-generated method stub */ }
35 | private void renderText(CharSequence source) { /* TODO Auto-generated method stub */ }
36 | private List scanForImageInfo(CharSequence source) { return null; }
37 | }
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/src/ISTDWebsiteClickRandomLink.java:
--------------------------------------------------------------------------------
1 | import org.openqa.selenium.By;
2 | import org.openqa.selenium.StaleElementReferenceException;
3 | import org.openqa.selenium.WebDriver;
4 | import org.openqa.selenium.WebElement;
5 | import org.openqa.selenium.chrome.ChromeDriver;
6 |
7 | import java.util.Random;
8 |
9 | public class ISTDWebsiteClickRandomLink {
10 |
11 | public static void main(String[] args) throws InterruptedException {
12 | System.setProperty("webdriver.chrome.driver","/Users/Joel/Desktop/SUTD/Term 5/50.003 Elements of Software Construction/chromedriver.exe");
13 | WebDriver driver = new ChromeDriver();
14 |
15 | driver.get("https://istd.sutd.edu.sg");
16 | Random rand = new Random();
17 |
18 | while (true) {
19 | // get all the links
20 | java.util.List links = driver.findElements(By.tagName("a"));
21 | System.out.println(links.size());
22 |
23 | // click a random link
24 | int nextLink = rand.nextInt(links.size());
25 | System.out.println("*** Navigating to" + " " + links.get(nextLink).getAttribute("href"));
26 | if (links.get(nextLink).getAttribute("href") == null) continue;
27 |
28 | try {
29 | driver.navigate().to(links.get(nextLink).getAttribute("href"));
30 | Thread.sleep(3000);
31 | //driver.navigate().back();
32 | System.out.println("*** Navigated to" + " " + links.get(nextLink).getAttribute("href"));
33 | //staleElementLoaded = false;
34 | } catch (StaleElementReferenceException e) {
35 | //staleElementLoaded = true;
36 | }
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/src/ObserverPattern.java:
--------------------------------------------------------------------------------
1 | import java.util.ArrayList;
2 | import java.util.List;
3 |
4 | class Subject {
5 | private List observers = new ArrayList();
6 | private int state;
7 |
8 | public int getState() {
9 | return state;
10 | }
11 |
12 | public void setState(int state) {
13 | this.state = state;
14 | notifyAllObservers();
15 | }
16 |
17 | public void attach(Observer observer){
18 | observers.add(observer);
19 | }
20 |
21 | public void notifyAllObservers(){
22 | for (Observer observer : observers) {
23 | observer.update();
24 | }
25 | }
26 | }
27 |
28 | abstract class Observer {
29 | protected Subject subject;
30 | public abstract void update();
31 | }
32 |
33 |
34 | // two concrete implementations of the observer class
35 |
36 | class BinaryObserver extends Observer{
37 |
38 | public BinaryObserver(Subject subject){
39 | this.subject = subject;
40 | this.subject.attach(this);
41 | }
42 |
43 | @Override
44 | public void update() {
45 | System.out.println( "Binary String: " + Integer.toBinaryString( subject.getState() ) );
46 | }
47 | }
48 |
49 | class OctalObserver extends Observer{
50 |
51 | public OctalObserver(Subject subject){
52 | this.subject = subject;
53 | this.subject.attach(this);
54 | }
55 |
56 | @Override
57 | public void update() {
58 | System.out.println( "Octal String: " + Integer.toOctalString( subject.getState() ) );
59 | }
60 | }
61 |
62 | public class ObserverPattern {
63 | public static void main(String[] args) {
64 | Subject subject = new Subject();
65 |
66 | new OctalObserver(subject);
67 | new BinaryObserver(subject);
68 |
69 | System.out.println("First state change: 15");
70 | subject.setState(15);
71 | System.out.println("Second state change: 10");
72 | subject.setState(10);
73 | }
74 | }
75 |
76 | // output
77 | // First state change: 15
78 | // Octal String: 17
79 | // Binary String: 1111
80 | // Second state change: 10
81 | // Octal String: 12
82 | // Binary String: 1010
--------------------------------------------------------------------------------
/notes/50.003 Elements of Software Construction/2018-Joel/esc_notes_joel_src/src/ParameterizedTest.java:
--------------------------------------------------------------------------------
1 | import org.junit.*;
2 | import org.junit.runner.RunWith;
3 | import org.junit.runners.Parameterized;
4 | import org.junit.runners.Parameterized.Parameters;
5 | import static org.junit.Assert.*;
6 | import java.util.*;
7 |
8 | // include this for running parameterized tests
9 | @RunWith(Parameterized.class)
10 |
11 | public class ParameterizedTest {
12 | public int sum, a, b;
13 |
14 | // classic constructor
15 | public ParameterizedTest (int sum, int a, int b) {
16 | this.sum = sum;
17 | this.a = a;
18 | this.b = b;
19 | }
20 |
21 | // decide the list of parameters to be sent to the class
22 | @Parameters public static Collection