Pinned Repositories
Cheejyg
Cheejyg/Cheejyg is a ✨special ✨ repository that you can use to add a README.md to your GitHub profile. Make sure it’s public and initialize it with a README to get started.
Conv
Conv is a collection of conversion libraries, for different languages, for handling type conversions.
CZ1007-Data-Structures-Assignment-1
Program templates for questions 1-4 are given in the Appendix. You must use them to implement your functions. The program contains a main() function, which includes a switch statement to execute different functions that you should implement. Each function can be called multiple times depending on the user’s choice.
CZ1007-Data-Structures-Programming-Lab-Test
Programming Lab Test (Toal time = 1 hr 15 minutes) Instructions 1. This is a closed book test. 2. Lab test will be held on week 8 (3-7 October) of Semester 1 in your lab tutorial session. 3. The question paper contains 5 sections, A, B, C, D and E. Each section contains 6 questions. 4. You are required to answer a total of 5 questions with one question from each section. The questions to be answered in the lab test will be randomly chosen during the lab test session. 5. Each question carries 20 marks. Total marks = 100. 6. The submitted question code will be marked according to its correctness. If the question code is unable to compile, you will get 0 mark for that question. 7. Program templates for the questions will be available during the test. You may use the program templates for your program development. 8. If you need a piece of rough paper to draft your code, please ask the lab technician for it. Notes 1. Section A – contains questions from lab and tutorial on Arrays. 2. Section B – contains questions from lab and tutorial on Character Strings. 3. Section C – contains questions from lab and tutorial on Structures. 4. Section D – contains questions from lab and tutorial on Recursive Functions. 5. Section E – contains questions from different topics. They are questions from past exam papers. You may refer to the past exam question papers to get hints on doing these questions.
CZ2005-Operating-Systems-Experiment-2-Process-Synchronization
We have two exercises in this experiment. 1. In this exercise, we will conduct the following steps to understand race condition problem in Nachos. 1) Change your working directory to lab2 by typing cd ~/nachos-3.4/lab2 2) Read the Nachos thread test program threadtest.cc carefully. There is a shared variable named value (initially zero). There are two functions, namely void Inc(_int which) and void Dec(_int which), where increases and decreases value by one, respectively. In this exercise, you need to consider different interleaving executions of Inc and Dec so that the shared variable value is equal to a predefined value after threads complete. 3) You need to implement the following three functions. When all the threads (two Inc_v1 threads and two Dec_v1 threads) complete in TestValueOne(), value=1. void Inc_v1(_int which) void Dec_v1(_int which) void TestValueOne() In Inc_v1 and Dec_v1, you need to use Yield primitive in Nachos to induce context switch. Inc_v1 and Dec_v1 should have the same logic as Inc and Dec, respectively. You are only allowed to add Yield into those two functions. You need to implement ThreadValueOne() by creating two threads with Inc_v1 and two threads with Dec_v1. The current thread should wait for all those threads to complete. At the end of TestValueOne(), a checking is performed on whether the value is 1. If the checking is passed, you should get the message "congratulations! passed.". Otherwise, an error message is printed. 4) After you finish implementing the above-mentioned functions, you can demonstrate the result of TestValueOne(), by commenting other test functions in ThreadTest() like below. //for exercise 1. TestValueOne(); //TestValueMinusOne(); //for exercise 2. //TestConsistency(); 5) Compile Nachos by typing make. If you see "ln -sf arch/intel-i386-linux/bin/nachos nachos” at the end of the compiling output, your compilation is successful. If you encounter any anomalies, type make clean to remove all object and executable files and then type make again for a clean compilation. 6) Test this program by typing ./nachos. If you see “congratulations! passed.” at the end of the debugging messages, your program is successful. Otherwise, “failed.” will be displayed. 7) Repeat Steps 3)—6), and implement the following three functions. When all the threads (two Inc_v2 threads and two Dec_v2 threads) complete in TestValueMinusOne(), value=-1. At Step 4), you need to test TestValueMinusOne(). void Inc_v2(_int which) void Dec_v2(_int which) void TestValueMinusOne() 2. In this exercise, we will conduct the following steps to understand process synchronization problem in Nachos. 1) Change your working directory to lab2 by typing cd ~/nachos-3.4/lab2 2) You need to implement the following three functions. When all the four threads (two Inc_Consistent threads and two Dec_Consistent threads) complete in TestConsistency(), value=0. You need to achieve consistent result (value=0), regardless of different interleaving execution orders in Inc_Consistent and Dec_Consistent as well as different thread fork orders in TestConsistency(). void Inc_Consistent (_int which) void Dec_Consistent (_int which) void TestConsistency () In Inc_Consistent and Dec_Consistent, you use Yield interface in Nachos to induce context switch. You need to implement TestConsistency() by creating two threads with Inc_Consistent and two threads with Dec_Consistent. The current thread should wait for all those threads to complete. At the end of TestConsistency(), a checking is performed on whether the value is 0. If the checking is passed, you should get the message "congratulations! passed.". Otherwise, an error message is printed.3) After you finish implementing the above-mentioned functions, you can demonstrate the result of TestConsistency(), by commenting other test functions in ThreadTest() like below. //for exercise 1. //TestValueOne(); //TestValueMinusOne(); //for exercise 2. TestConsistency(); 4) Compile Nachos by typing make. If you see "ln -sf arch/intel-i386-linux/bin/nachos nachos” at the end of the compiling output, your compilation is successful. If you encounter any anomalies, type make clean to remove all object and executable files and then type make again for a clean compilation. 5) Test this program by typing ./nachos. If you see “congratulations! passed.” at the end of the debugging messages, your program is successful. Otherwise, “failed.” will be displayed. In the oral exam, you need to demonstrate your testing with different interleaving execution orders in Inc_Consistent and Dec_Consistent as well as different thread fork orders in TestConsistency().
CZ2005-Operating-Systems-Experiment-3-Virtual-Memory
In this lab, you are required to complete a virtual memory implementation, including how to get a physical frame for a virtual page from the IPT if it exists there, how to put a physical frame/virtual page entry into TLB, and how to implement a least recently used page replacement algorithm. A software-managed TLB is implemented in Nachos. There is one TLB per machine. There is also an IPT which maps physical frames to virtual pages. Basically, the translation process first examines the TLB to see if there is a match. If so, the matching entry in the TLB will be used for address translation. If there is a miss, the IPT will be looked up. If a matching entry is found in the IPT, the entry will be used to update the TLB. A miss in the IPT means that the page will have to be loaded from disk, and a page in and page out will be performed. To decide which page to page out, a page replacement policy is used, for example, a least recently used algorithm which will be explained late on. During each lookup process, you need to perform some checking in order to make sure that you are looking up the correct entry and that the entry is valid. In order to check whether you are referencing the correct entries from the TLB, you have to check the valid bit. The TLB will get updated when an exception is raised and the required page entry isn't in it. In this case, a new entry needs to be inserted into the TLB. The new entry will be inserted into an invalid entry in the TLB or replace an existing entry if it is full. Since the TLB is small, the replacement policy for the TLB is simply FIFO. When there is a context switch between processes, e.g. the main process executing a child process, the entries in the TLB will be cleared by setting all entries to invalid. The IPT is simply implemented using an array, represented by the memoryTable (a mapping of what pages are in memory and their properties). There is one entry for each of the physical frame, and each entry contains the corresponding process id, virtual page number, and the last used field that records the tick value when the page was last accessed. The least recently used algorithms works by iterating through the memoryTable, from the beginning, to look for the entry that has been least recently used. If there is an entry that is not valid (i.e., its process is dead), the algorithm will return the index of this invalid entry. Otherwise, the algorithm will return the index of the least recently used entry (that is, the entry with the smallest last used field).
CZ3006-Net-Centric-Computing-Assignment-1-Implementation-of-a-Sliding-Window-Protocol
This assignment aims to enhance students' understanding of the network protocol hierarchy and flow control and error control techniques by implementing a sliding window protocol in a simulated communication network system. The programming language will be Java.
Genetic-Algorithms-for-Swarm-Parameter-Tuning
Swarming behaviour is based on aggregation of simple drones exhibiting basic instinctive reactions to stimuli. However, to achieve overall balanced/interesting behaviour the relative importance of these instincts, as well their internal parameters, must be tuned. In this project, you will learn how to apply Genetic Programming as means of such tuning, and attempt to achieve a series of non-trivial swarm-level behaviours.
Genetic-Algorithms-for-Swarm-Parameter-Tuning-Unity
Swarming behaviour is based on aggregation of simple drones exhibiting basic instinctive reactions to stimuli. However, to achieve overall balanced/interesting behaviour the relative importance of these instincts, as well their internal parameters, must be tuned. In this project, you will learn how to apply Genetic Programming as means of such tuning, and attempt to achieve a series of non-trivial swarm-level behaviours.
Integration-of-Mergesort-and-Insertion-Sort
As a divide-and-conquer algorithm, Mergesort breaks the input array into subarrays and recursively sort them. When the sizes of sub-arrays are small, the overhead of many recursive calls makes the algorithm inefficient. This problem can be remedied by choosing a small value of S as a threshold for the size of sub-arrays. When the size of a sub-array in a recursive call is less than or equal to the value of S, the algorithm will switch to Insertion sort, which is efficient for small input. A pseudocode of the modified Mergesort is given below:
Cheejyg's Repositories
Cheejyg/Genetic-Algorithms-for-Swarm-Parameter-Tuning
Swarming behaviour is based on aggregation of simple drones exhibiting basic instinctive reactions to stimuli. However, to achieve overall balanced/interesting behaviour the relative importance of these instincts, as well their internal parameters, must be tuned. In this project, you will learn how to apply Genetic Programming as means of such tuning, and attempt to achieve a series of non-trivial swarm-level behaviours.
Cheejyg/CZ2005-Operating-Systems-Experiment-3-Virtual-Memory
In this lab, you are required to complete a virtual memory implementation, including how to get a physical frame for a virtual page from the IPT if it exists there, how to put a physical frame/virtual page entry into TLB, and how to implement a least recently used page replacement algorithm. A software-managed TLB is implemented in Nachos. There is one TLB per machine. There is also an IPT which maps physical frames to virtual pages. Basically, the translation process first examines the TLB to see if there is a match. If so, the matching entry in the TLB will be used for address translation. If there is a miss, the IPT will be looked up. If a matching entry is found in the IPT, the entry will be used to update the TLB. A miss in the IPT means that the page will have to be loaded from disk, and a page in and page out will be performed. To decide which page to page out, a page replacement policy is used, for example, a least recently used algorithm which will be explained late on. During each lookup process, you need to perform some checking in order to make sure that you are looking up the correct entry and that the entry is valid. In order to check whether you are referencing the correct entries from the TLB, you have to check the valid bit. The TLB will get updated when an exception is raised and the required page entry isn't in it. In this case, a new entry needs to be inserted into the TLB. The new entry will be inserted into an invalid entry in the TLB or replace an existing entry if it is full. Since the TLB is small, the replacement policy for the TLB is simply FIFO. When there is a context switch between processes, e.g. the main process executing a child process, the entries in the TLB will be cleared by setting all entries to invalid. The IPT is simply implemented using an array, represented by the memoryTable (a mapping of what pages are in memory and their properties). There is one entry for each of the physical frame, and each entry contains the corresponding process id, virtual page number, and the last used field that records the tick value when the page was last accessed. The least recently used algorithms works by iterating through the memoryTable, from the beginning, to look for the entry that has been least recently used. If there is an entry that is not valid (i.e., its process is dead), the algorithm will return the index of this invalid entry. Otherwise, the algorithm will return the index of the least recently used entry (that is, the entry with the smallest last used field).
Cheejyg/Integration-of-Mergesort-and-Insertion-Sort
As a divide-and-conquer algorithm, Mergesort breaks the input array into subarrays and recursively sort them. When the sizes of sub-arrays are small, the overhead of many recursive calls makes the algorithm inefficient. This problem can be remedied by choosing a small value of S as a threshold for the size of sub-arrays. When the size of a sub-array in a recursive call is less than or equal to the value of S, the algorithm will switch to Insertion sort, which is efficient for small input. A pseudocode of the modified Mergesort is given below:
Cheejyg/CZ1007-Data-Structures-Programming-Lab-Test
Programming Lab Test (Toal time = 1 hr 15 minutes) Instructions 1. This is a closed book test. 2. Lab test will be held on week 8 (3-7 October) of Semester 1 in your lab tutorial session. 3. The question paper contains 5 sections, A, B, C, D and E. Each section contains 6 questions. 4. You are required to answer a total of 5 questions with one question from each section. The questions to be answered in the lab test will be randomly chosen during the lab test session. 5. Each question carries 20 marks. Total marks = 100. 6. The submitted question code will be marked according to its correctness. If the question code is unable to compile, you will get 0 mark for that question. 7. Program templates for the questions will be available during the test. You may use the program templates for your program development. 8. If you need a piece of rough paper to draft your code, please ask the lab technician for it. Notes 1. Section A – contains questions from lab and tutorial on Arrays. 2. Section B – contains questions from lab and tutorial on Character Strings. 3. Section C – contains questions from lab and tutorial on Structures. 4. Section D – contains questions from lab and tutorial on Recursive Functions. 5. Section E – contains questions from different topics. They are questions from past exam papers. You may refer to the past exam question papers to get hints on doing these questions.
Cheejyg/CZ2005-Operating-Systems-Experiment-2-Process-Synchronization
We have two exercises in this experiment. 1. In this exercise, we will conduct the following steps to understand race condition problem in Nachos. 1) Change your working directory to lab2 by typing cd ~/nachos-3.4/lab2 2) Read the Nachos thread test program threadtest.cc carefully. There is a shared variable named value (initially zero). There are two functions, namely void Inc(_int which) and void Dec(_int which), where increases and decreases value by one, respectively. In this exercise, you need to consider different interleaving executions of Inc and Dec so that the shared variable value is equal to a predefined value after threads complete. 3) You need to implement the following three functions. When all the threads (two Inc_v1 threads and two Dec_v1 threads) complete in TestValueOne(), value=1. void Inc_v1(_int which) void Dec_v1(_int which) void TestValueOne() In Inc_v1 and Dec_v1, you need to use Yield primitive in Nachos to induce context switch. Inc_v1 and Dec_v1 should have the same logic as Inc and Dec, respectively. You are only allowed to add Yield into those two functions. You need to implement ThreadValueOne() by creating two threads with Inc_v1 and two threads with Dec_v1. The current thread should wait for all those threads to complete. At the end of TestValueOne(), a checking is performed on whether the value is 1. If the checking is passed, you should get the message "congratulations! passed.". Otherwise, an error message is printed. 4) After you finish implementing the above-mentioned functions, you can demonstrate the result of TestValueOne(), by commenting other test functions in ThreadTest() like below. //for exercise 1. TestValueOne(); //TestValueMinusOne(); //for exercise 2. //TestConsistency(); 5) Compile Nachos by typing make. If you see "ln -sf arch/intel-i386-linux/bin/nachos nachos” at the end of the compiling output, your compilation is successful. If you encounter any anomalies, type make clean to remove all object and executable files and then type make again for a clean compilation. 6) Test this program by typing ./nachos. If you see “congratulations! passed.” at the end of the debugging messages, your program is successful. Otherwise, “failed.” will be displayed. 7) Repeat Steps 3)—6), and implement the following three functions. When all the threads (two Inc_v2 threads and two Dec_v2 threads) complete in TestValueMinusOne(), value=-1. At Step 4), you need to test TestValueMinusOne(). void Inc_v2(_int which) void Dec_v2(_int which) void TestValueMinusOne() 2. In this exercise, we will conduct the following steps to understand process synchronization problem in Nachos. 1) Change your working directory to lab2 by typing cd ~/nachos-3.4/lab2 2) You need to implement the following three functions. When all the four threads (two Inc_Consistent threads and two Dec_Consistent threads) complete in TestConsistency(), value=0. You need to achieve consistent result (value=0), regardless of different interleaving execution orders in Inc_Consistent and Dec_Consistent as well as different thread fork orders in TestConsistency(). void Inc_Consistent (_int which) void Dec_Consistent (_int which) void TestConsistency () In Inc_Consistent and Dec_Consistent, you use Yield interface in Nachos to induce context switch. You need to implement TestConsistency() by creating two threads with Inc_Consistent and two threads with Dec_Consistent. The current thread should wait for all those threads to complete. At the end of TestConsistency(), a checking is performed on whether the value is 0. If the checking is passed, you should get the message "congratulations! passed.". Otherwise, an error message is printed.3) After you finish implementing the above-mentioned functions, you can demonstrate the result of TestConsistency(), by commenting other test functions in ThreadTest() like below. //for exercise 1. //TestValueOne(); //TestValueMinusOne(); //for exercise 2. TestConsistency(); 4) Compile Nachos by typing make. If you see "ln -sf arch/intel-i386-linux/bin/nachos nachos” at the end of the compiling output, your compilation is successful. If you encounter any anomalies, type make clean to remove all object and executable files and then type make again for a clean compilation. 5) Test this program by typing ./nachos. If you see “congratulations! passed.” at the end of the debugging messages, your program is successful. Otherwise, “failed.” will be displayed. In the oral exam, you need to demonstrate your testing with different interleaving execution orders in Inc_Consistent and Dec_Consistent as well as different thread fork orders in TestConsistency().
Cheejyg/Conv
Conv is a collection of conversion libraries, for different languages, for handling type conversions.
Cheejyg/CZ1007-Data-Structures-Assignment-1
Program templates for questions 1-4 are given in the Appendix. You must use them to implement your functions. The program contains a main() function, which includes a switch statement to execute different functions that you should implement. Each function can be called multiple times depending on the user’s choice.
Cheejyg/Genetic-Algorithms-for-Swarm-Parameter-Tuning-Unity
Swarming behaviour is based on aggregation of simple drones exhibiting basic instinctive reactions to stimuli. However, to achieve overall balanced/interesting behaviour the relative importance of these instincts, as well their internal parameters, must be tuned. In this project, you will learn how to apply Genetic Programming as means of such tuning, and attempt to achieve a series of non-trivial swarm-level behaviours.
Cheejyg/Cheejyg
Cheejyg/Cheejyg is a ✨special ✨ repository that you can use to add a README.md to your GitHub profile. Make sure it’s public and initialize it with a README to get started.
Cheejyg/CZ3006-Net-Centric-Computing-Assignment-1-Implementation-of-a-Sliding-Window-Protocol
This assignment aims to enhance students' understanding of the network protocol hierarchy and flow control and error control techniques by implementing a sliding window protocol in a simulated communication network system. The programming language will be Java.
Cheejyg/CZ3006-Net-Centric-Computing-Assignment-2-Web-applications-using-JavaScript-and-PHP
This assignment aims to enhance students' understanding of Web client-side programming techniques using JavaScript and Web server-side programming techniques using PHP. Particularly, after this assignment, students should learn: 1) How are HTML elements and attributes represented in the JavaScript binding to DOM (Document Object Model)? 2) How can an event handler be associated with an event generated by a specific HTML element in the DOM event model? 3) How to access and manipulate HTML document elements from JavaScript? 4) How do HTML documents at the client side send information to web servers? How do server-side programs receive the information? 5) How do server-side programs access files? 6) How do server-side programs generate HTML documents and send them to the client side?
Cheejyg/CZ3007-Compiler-Techniques-First-Laboratory-Assignment
The goal of this lab is to implement a lexical analyser for a simple programming language called PL/3007. In later labs, we will more fully explore the syntax and semantics of this programming language, and by the last lab you will have a full, working compiler from PL/3007 to Java bytecode. In every lab, you will be provided with a code template (downloadable as a zip file from the course website) to get you started. You will then need to fill in the template to implement the relevant functionality of the compiler. The code template contains comments telling you which parts of the code you need to change, and which ones you should not touch. Every template also comes with a unit test suite containing one or a few tests (suggestion: google search for “unit test” if you are not very sure what it means). At first, the test suite will fail, since the functionalities tested are not yet implemented. You should add your own tests and run the test suite frequently to make sure that your implementation behaves correctly, and that your changes do not lead to regressions. Your assignment will be graded by the instructors using automated unit tests, so it is imperative that the code you hand in compiles and behaves correctly.
Cheejyg/CZ3007-Compiler-Techniques-Second-Laboratory-Assignment
The goal of this lab is to implement a parser for the programming language PL/3007. In the previous lab, you implemented a lexer, and in the next two labs you go through semantic analysis and code generation, so by the last lab you will have a full, working compiler from PL/3007 to Java bytecode. As in the previous lab, this lab provides you with a preconfigured Eclipse workspace (downloadable as a zip file from the course website) to get you started. The workspace contains several supporting files, which you do not need to touch, and a main file containing the beginnings of a parser specification using Beaver. The workspace also contains a rudimentary unit test suite, which you are encouraged to use and extend to test your implementation. Your assignment will be graded by the instructors using a unit test suite, so it is imperative that the code you hand in compiles and behaves correctly.
Cheejyg/Nanyang-Technological-University
Nanyang Technological University
Cheejyg/async-profiler
Sampling CPU and HEAP profiler for Java featuring AsyncGetCallTrace + perf_events
Cheejyg/Best-README-Template
An awesome README template to jumpstart your projects!
Cheejyg/fe-tier-list-maker.github.io
Tier list Maker.
Cheejyg/Lostark-helper
A set of helper tools for Lost Ark
Cheejyg/NTUnLearn
NTULearn helps you make learning more effective in and beyond the traditional walls. Breathing life into educational content. Bringing efficiency to day-to-day tasks.