Learn Rust by Building a Full-stack Todo Application

What I want to write a blog about how I learned Rust. Please forgive me that I just started learning such a great programming language in 2022. To learn Rust by doing, I have built a full-stack todo application. You can try it here. The source code is available at GitHub. Here I am going to write about how to build it. How Firstly, as everyone beginning, I learn Rust from the book as well....

May 1, 2022 · 3 min · Lex Cao

Kotlin Weird Equality

Recently, I encountered a weird equality question about Kotlin which does not usually get much attention while coding. So here is the thought process. Background The following code snippet is using Kotlin 1.3.72. The business logic of it has been removed and only remained the code structure for reproducing the question. // a enum for state enum class MyState { OK, CANCELED } // it might return nullable MyState fun processing(): MyState?...

April 21, 2020 · 8 min · Lex Cao

Generate Converter for Kotlin Class by KAPT

Background In web backend development, the operation of an entity need to code a number of similar classes to handle request (avoiding the direct use of entities), which resulting in related terminology: PO (Persistent Object) DTO (Data Transfer Object) BO (Business Object) VO (View Object) Most of these classes trim a few fields directly from the entity. For example, by using OrderEntity in a request to create an order, it would process like following:...

April 13, 2020 · 4 min · Lex Cao

Reactive Overview

Reactive Streams Reactive Streams started as an initiative in late 2013 between engineers at Netflix, Pivotal and Lightbend. Reactive Streams is an initiative to provide a standard for asynchronous stream processing with non-blocking back pressure. This encompasses efforts aimed at runtime environments (JVM and JavaScript) as well as network protocols. You can read the origin specification on official website of Reactive Streams. Also, you can read the Chinese translation from here....

November 28, 2019 · 3 min · Lex Cao

Choose An English Name

Introduction I am Lixin Cao in Chinese Pinyin. I was finding a way to give myself an English name, then I found a post, How to choose an English name, which gives an useful method for choosing an English name, by which I made a program to help choose an English name. You can try it here. I will cover some detail of the post and the program in the below....

November 7, 2019 · 2 min · Lex Cao