Welcome to
Thuyen's corner

-
2017 in review
P/s: Vietnamese below. Unemployed. After leaving Fossil, I lost my balance. There was a time I had not seen any of my friends. I missed them as much as I missed my work :). Acquired some new knowledge. While being out of work, I took part in a few courses in Coursera, MIT Opencourseware and so on. Some courses did bring me plenty of interests, headaches, and mind-blowing moments as well.
-
Tản mạn: Khi chúng ta có nhiều lựa chọn
Khi nói đến giải quyết vấn đề, người ta đôi khi dùng một cụm dài hơn là giải quyết vấn đề và ra quyết định (problem solving and decision making). Ta có thể hiểu việc giải bài toán thông qua hai hình thái: (1) Từ không có lời giải -> có lời giải (2) Từ có nhiều lời giải -> chọn ra lời giải tối ưu…
-
MVVM best practice: Inputs - Outputs
When it comes to iOS architecture, MVVM is one of the most favorable candidates. Not only does it provide higher testability than MVC but also this architecture is lightweight as compared to its counterparts such as VIPER. Despite that, proper approaches should be adopted to take advantage of MVVM. Otherwise, we could end up with an alike version of MVC with an additional component (ViewModel).
-
Định lý cuối cùng của Fermat
Khoảng 5-6 tháng trước mình xem một bộ phim tài liệu có tựa đề “BBC - Horizon - 1996 - Fermat’s Last Theorem”. Đây là một câu chuyện về lịch sử toán học mà mình thấy rất hay nên muốn chia sẻ lại. Fermat là một nhà toán học người Pháp. Ông có nhiều đóng góp quan trọng trong lý thuyết số (number theory). Một trong số đó là định lý Fermat lớn, hay định lý cuối cùng của Fermat (Fermat’s Last Theorem).
-
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
-
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.
-
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.
-
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.
-
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.
-
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…