Java Memory Management

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...

Java Stream

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...

Lambda Expression in Java/Kotlin

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,...

Python Notes: Global Interpreter Lock

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...

Python Notes: Decorator

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?...