Intuition of isZero

Before reading, make sure you understand how positive integers are represented in lambda calculus. We want isZero to return true for zero (λ f x. x) and false for all other numbers. isZero = λ n. n (λ z. false) true Alternatively, you can write is as: isZero n = n (λ z. false) true So what is zero? Zero is λ f x. x, a function that takes two parameters f and x, and return x.

JNI Library Name on Mac

If you try a hello world example for JNI programming, it may tell you that you can just use System.loadLibrary(hello); to load a native library (may be C++, may be C, or some other language). Specifically, on Windows, this “hello” means “hello.dll”; on Linux or Unix, it means “hello.so”. I guess Mac is just one of the Unix members, so I have a shared library compiled and named “hello.so”. But I got “UnsatisfiedLinkError”.

Two Ways to Declare A Binary Tree in Haskell

I am about to take Professor Jhala’s class and now I am learning Haskell. One thing I find interesting is how you can define a recursive data structure in two different ways. Method 1 data Tree a = Leaf a | Branch (Tree a) (Tree a) Method 2 data Tree a = EmptyTree | Node a (Tree a) (Tree a) In short, method 2 is just method 1 with the “|” moved one left.

Static Variable Linking Error

I was working on a side project. It’s in C++. Given that I haven’t done much in C++, I treat it as an opportunity to learn C++ as the project progresses. I was stuck on a problem for several days. Here is the problem. I have a class variable (named cache) but it’s static. When compile, it keeps telling me: Undefined symbols for architecture x86_64: "H264_Decoder::cache", referenced from: H264_Decoder::H264_Decoder(void (*)(AVFrame*, AVPacket*, void*), void*) in H264_Decoder.

Solve Spring Boot Unknown Error

I was working on a short Spring Boot project. However, on my computer, no matter what I tried, it couldn’t start and gave me “unknown error”. The following is the error log: Wrong Spring Boot output: 4:01:54 PM: Executing external task 'bootRun'... :compileJava UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :findMainClass :bootRun . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .