-
The baby is having me
On one Friends episode, Ross zoned out when the prospect of becoming a father sank in. The burden of giving birth is momentary, and being parents are for the rest of life. What a moment of realization.
-
How not to create 2D arrays in Python
Python has many idioms that make writing the language a joy. One of them is, to quickly initialize an array of n elements you can do this
-
Warehouse assignment with Google OR Tool
Google OR Tool is a powerful library with built-in support for certain classes of optimization problems. For example, assignment problem is a well-known problem, in which N number of customers should be assigned to M number of warehouses such that the total serving distance is minimized. Replacing warehouses with fire stations, we may want to minimize the longest distance instead.
-
Travelling Saleman problem with local search
Another approach to combinatorial optimization problems is to use local search (LS). With constraint programming (CP), we slowly expand the search frontier by making one choice after another, and prune the search space along the way by removing choices that do not meet constraints. Once a full solution is reached, we are certain that is a valid solution.
-
Contraint programming with Google ORTool
Constraint programming (CP) is a technique employed in solving combinatorial problems. Combinatorial problems are set of problems that are quick to verify but take exponential time to try out all possible assignments. Brute force approaches often fail to terminate or take very long CPU time to be of any practical use.
-
Notes on Front-end development
Front-end development is quick to get started. As projects grow and code build up, there are nuances that may help us avoid the painful road of catching intermittent bugs. Below are a few things I would like to note. Key points are to keep the application state’s lean, make program flow obvious, and add checks at your build pipeline.
-
An unprecedented period
As of today, millions of Vietnamese have gone through their first week of self-confinement since our Prime Minister ordered businesses to shut down and people to stay in house. To some, the isolation period may have started earlier. Companies like mine have enforced remote working weeks prior to the official order. Self confining voluntarily for almost a month is unprecedented and unthinkable in normal time. But there is nothing normal about the recent course of events.
-
Covid-19
For the past 2 months, covid-19 has pushed lives of people all over the globe into disarray. Everywhere, events are cancelled, cargos held up at borders, trade suspended. Covid-19 has become the all dominating theme at dinner conversation. People talk about it in barber shops, in supermarkets, on taxi. And unlike the situation in Europe with thousands of confirmed cases, Vietnam has managed to keep the number below a hundred (though that is increasing daily). As a result, though covid-19 patients are referred to by number in the news, those numbers are still very personal. Pick a random person on the street, most likely he/she can recount with details where patient no. 34 went, what she did for a living, who were her F1 (people in direct contact with her)…
-
A decade in review
A decade time would feel short when the clock was ticking pass midnight on the last day of 2019. Where all the time has gone. Yet, a simple act of comparison between the self now and a decade ago, that whole decade would start to appear more real, heavier and thicker in one’s awareness. Old perceptions, preferences, fears, worries, desires were replaced by the new. Changes happened slow enough that one hardly noticed, yet, significant enough to surprise us when compressed in a moment of reminiscing. This is my first time to write them down.
-
Fast way to iterate through video frames with Python and OpenCV
Recently, I was working on a program to sample N frames from a source video, and then assign a score to each frame (from 0 to 1) in terms of thumbnail-worthiness. Before long, it became apparent that decoding video frames was one performance bottleneck. In this post, I would look into different ways of reading video frames with OpenCV and then speeding it up with multithreading.
Subscribe via RSS