Multi-armed bandits

I always forgot which problem multi-armed bandits actually refer to. I vagulely recalled the one-armed bandit as the slot machine. But I often was confused about that. As a non-native speaker, I first learned the word bandit from playing RPG games as a kid. When I learned that a slot machine can also be referred…

Motivating MCMC

Maybe it is my communications background, it took me long time to really “understand” why we need MCMC. Consider a really simple inference problem of trying to recover state from data , in Bayesian inference, we try to compute the posterior distribution In all textbooks, it will just explain that the denominator is hard to…

Markov chain terminology

I like to view Markov chain as simply state transition model. Let’s consider finite number of states to make thing simple. Time homogeneous: simply mean that the state transition matrix does not change over time Irreducible: I hate this term as I tend to forget what it really means. Model is irreducible if one can…

Frobenius norm, trace norm and other matrix norms

I usually remember what Frobenius norm is. That is, the sum of square of all elements in a matrix. And I sometimes remember what nuclear norm is. That is, the sum of singular values of a matrix. But I forgot what trace norm is when I came across it again today. Actually all of them…

Fixing Yamaha P80 keyboard

I have sticky keys on my P80. I check the most serious one and it appears to be broken as some others suggested. I initially just tried to glue the broken piece together but it doesn’t solve the sticky issue completely. I eventually tried the needle method described in this blog post and webpage. I…

Mixin

Mixin is an incomplete class that can be mixed into multiple classes. For example, mixin Fluttering { void flutter() { print(‘fluttering’); } } abstract class Bird with Fluttering { void chirp() { print(‘chirp chirp’); } } Note that the Fluttering mixin can be used in multiple classes. If we want to restrict the mixin to…

Cannot locate adb starting Android emulator in Android Studio

I got this obscure problem and couldn’t resolve it no matter what I tried. It turns out it simply was because I was running virtualbox on another desktop and I wasn’t aware of that. The error is totally misleading. I was using Ubuntu 16.04. After I shut down the other virtual machine, Android emulator started…

Dart Cheatsheet

I found this cheatsheet very useful in understanding some unique features of Dart such as (?? and ..).

Game programming with Flutter and Flame

A very nice video tutorial to build 2D game with Flame/Flutter. I’m new to Flutter and Dart. I usually write in Python and wrote some Java decade ago. Dart is reasonable intuitive if one is familiar with Java or C/C++/C#. I came across some issues going through the tutorial though. I use Ubuntu 16.04 and…

Asynchronous programming in Dart

There are three keywords future, await, async to achieve asynchronous programming in Dart. I found the below example from the official documentation is most insightfull. Future printOrderMessage() async { print(‘Awaiting user order…’); var order = await fetchUserOrder(); print(‘Your order is: $order’); } Future fetchUserOrder() { // Imagine that this function is more complex and slow….