CS50x Week 12: Final Project!

Finally, I have reached the end of CS50x, this week we did our final project. There are many projects on display here. The projects are divided into several categories. You can use any skills your learnt in CS50x to aid in making your final project. Students are also encouraged to buy a domain for their final project. … Continue reading CS50x Week 12: Final Project!

CS50x Week 10

Javascript – Allows interaction with user. E.g. onclick, add html via .html(“string”), change CSS, etc. JQuery – library based on Javascript. Use Google chrome’s console log to debug when programming, can check for variable value or play with Javascript. To recap, HTML gives structure, CSS gives style, PHP gives logic, Javascript + JQuery gives dynamic/ … Continue reading CS50x Week 10

6.00.1x Week 5 (Incomplete)

Efficiency How much time it takes for our program to run.

The function iterates elements in list L, if the element is equals to x, it returns true. This function continues to iterate until x is found, or if not found, returns false. There are two extreme cases here, if x happens to be … Continue reading 6.00.1x Week 5 (Incomplete)

CS50x Week 9: C$50 Finance(Problem Set)

We are done with C programming language, now we are stepping into web programming. This week, we will learn about HTML, CSS, PHP, and SQL. HTML is HyperText Markup Language, it is the standard markup language used to display websites. To see the html of a website, right click anywhere with blank space on a … Continue reading CS50x Week 9: C$50 Finance(Problem Set)

CS50x Week 8: Mispellings (Problem Set)

This week’s problem set requires us to implement a spell-checker. The usage is speller [dictionary] text, where speller is our program, dictionary is optional, text is a file that contains the paragraphs that need to be spell-checked. If user does not specify a dictionary, a default dictionary will be used. The main body of the … Continue reading CS50x Week 8: Mispellings (Problem Set)

CS50x Week 8

Trees We learned trie last week, trie is a type of data structure called tree. Tree has a node at the top, called root, then it has 0 or more nodes, called children. If a node does not have any child, it is called leaf. Binary tree When each node of a tree has at … Continue reading CS50x Week 8

CS50x Week 7: Forensics (Problem Set)

There are many image file formats such as BMP, JPG, PNG, and GIF. They can be grouped into lossy format and lossless format. Lossy format uses lossy compression that cuts away some data of the image to make an image that appears to be perfect copy, but not a perfect copy. lossless format uses lossless … Continue reading CS50x Week 7: Forensics (Problem Set)

CS50x Week 7

scanf()

The first argument of scanf is %i, a specifier for integer, scanf expects an integer from the terminal, when an integer is encountered, it will be stored in x. The second argument is the address of x.

This above shows how scanf can be used to input data into array. In each … Continue reading CS50x Week 7

6.00.1x Week 4

Our code does not always work as we intended, so we need to have some ways to debug it. Testing and debugging Testing methods Ways to test the program with examples to see if it work as intended. Debugging methods Ways to fix the program after you know it does not work as intended. Testing … Continue reading 6.00.1x Week 4

CS50x Week 5

Memory in a program Diagram below represents the memory segments of a running program: Text This segment has 1s and 0s. Initialized data This segment has global variable. Unintiailized data This segment has global variable. Heap This segment is for dynamically allocated variable allocated by malloc function. When malloc is called, the function grabs some … Continue reading CS50x Week 5