by Xiaokang Zhang | Aug 10, 2020 | Computer Science
Compiler is the translator between human readable high level language and the computer readable low level languages, it translate the a program from a source language into a target language. Why do we need compiler? Because for human beings, programming in a machine...
by Xiaokang Zhang | May 20, 2019 | Computer Science
Java Memory Model What’s in the memory of a running Java application? Before we look into the details, we can guess that the following component is needed for an application to run: The code: Java code is not complied or executed in native code format, the code...
by Xiaokang Zhang | Apr 25, 2019 | Computer Science
What is stream? Stream is an abstraction of data operations. It takes input from the collections, Arrays of I/O channels. From imperative to declarative For example, given a list of people, find out the first 10 people with age less or equals to 18. The following...
by Xiaokang Zhang | Apr 10, 2019 | Computer Science
Higher-order function In computer science, a higher-order function is a function that does at least one of the following: Takes one or more functions as argumentsReturns a function as its result. All other functions are first-order functions. Anonymous class In Java,...
by Xiaokang Zhang | Jun 21, 2018 | Computer Science
Why Python use GIL Python uses reference count for memory management. Each objects in python has a reference count variables that keep track of the number of reference to the object. When the reference count goes back to 0, Python would release this object from...
by Xiaokang Zhang | Jun 19, 2018 | Computer Science
By definition, a decorator is a function that takes another function and extends the behavior of the latter function without explicitly modifying it. Built-in decorators such as @staticmethod, @classmethod, and @property work in the same way. How decorator works?...