Tech

  • Posted on

    An example of Survey with privacy

    A while ago, I read the book Probabilistic Programming and Bayesian Methods for Hackers written by Cam Davidson-Pilon and was really impressed by an example of carrying out surveys. Although it is not a standard method with wide scope of use, from the perspective of a software engineer who is not from statistics background, I think its idea is pretty beautiful and worth knowing

  • Posted on

    How to stub network in iOS

    There are times we wish to fake a network event, for example, a network error. However, integrating a 3rd party stub library just for this purpose is not really worthy. This post aims at demonstrating how to stub network.

  • Posted on

    Quick thoughts on Tail recursion in Swift

    I always thought that Tail call optimization (TCO), sometimes called tail recursion optimization, is supported in most languages by default. It turns out to be opposite.

  • Posted on

    Method Swizzling: What, Why and How

    Method swizzling is a very powerful technique that takes advantage of dynamism. The core idea of this technique is to replace the real implementation of a method at runtime. With this power, we could be able to do a lot of cool stuffs. Actually, this special feature is offered by the Objective-C runtime, via message dispatch.

  • Posted on

    Method dispatch in Swift

    Method dispatch is a term referring to mechanisms by which the program determines which operation should be executed (by operation, I mean a set of instructions). There are times we expect a method behavior to be determined only at runtime. This motivation give rise to different mechanisms of dispatching a method, each of which has its own pros and cons.

  • Posted on

    How a Swift file is compiled

    First of all, this is not “how an iOS/MacOS app is built”. An app consists of a bunch of source code files, structured in modules/frameworks, each of which could be purely in swift/objective-c, or mixed and match…

  • Posted on

    What is Simpson's paradox?

    If you’re from the world of statistics, you may have heard of it. Two doctors, Dr. Hibbert and Dr. Nick, both perform 2 types of surgeries: heart surgery and band-aid removal…

  • Posted on

    A misuse of Expectation

    This post is to demonstrate a common use of expectation that is not correct. The example is excerpted from lecture 23 of MIT6_042J

  • Posted on

    Weight initialization - impact on layer distribution

    This post covers some experiments to demonstrate the impact of weight initialization on the distribution of activations on each layer in neural network, especially the very last layers.

  • Posted on

    A dive into Histogram of Oriented Gradients (HOG)

    In this post, we will dive into Histogram of Oriented Gradients (HOG), a common technique used to extract features of images… And then implement it in python (in order to comprehend it).