Catechism and the Pope
I am neither theologian nor bible scholar. But just a Catholic layperson and would like to share my opinions.
The most recent hot issue is the changing of the Catechism about death penalty by Pope Francis. Then throughout the Twitter, I can see there are a lot of debates on this issue, including some people criticising the Pope.
Therefore, in this post, I will share some of my understandings.
Regarding the Catechism of the Catholic Church (CCC), according to USCCB Question 17,
Firefox batch download extension: DownloadSelected
In my previous post, I mentioned about DownThemAll on Firefox 56. Now the latest release of Firefox is version 61, but there is no update of DownThemAll for Firefox Quantum support. Using older unsupported version like Firefox 56 is not a good idea, because there will have no security update. Firefox ESR 52 is slower than Firefox 56 as I have mentioned.
Since I have spare time recently, I spent some days to write a Firefox extension, DownloadSelected, to solve my problem.
Inheritance and composition
The modern JavaScript with the ES6 syntax and the rise of the popularity like ReactJS, functional programming becomes more and more common. When using React, one of the common practice is to use composition instead of inheritance.
Because I started learning programming when the OOP was the most prevailing paradigm, I was trained to solve the problem by using OOP concepts like polymorphoism, inheritance, encapsulation, etc.
I think JS is the most interesting programming language in the modern technology. It supports server-side and client-side development. With the ES6, it supports OOP keywords like class and also using FP (functional programming) syntax like fat arrow (=>).
After reading The Lean Startup
Because I was planning to start a small project, I have developed a prototype. And I asked a friend for some advice and showed the project to him. Then he gave me his opinions, and asked me to read The Lean Startup (Eric Ries, 2011). So, I stopped my project, and start reading the book. This post is about what I get from the book.
(I will write another post for what I have learnt so far.)
Scientific Learning
In my previous post, I wrote about Lean Startup. And I found that it is very interesting that I have come through these things.
- S.M.A.R.T (specific, measurable, actionable, realistic, time-bound) (post)
- Machine Learning - Deep Learning - Convolutional Neural Network (CNN)
- Statistics
- Kaizen (改善法) (post)
- Agile development. Test development development (TDD)
- Research study
When I read The Lean Startup (Ries, 2011), I learn about lean manufacturing. Then only I discovered that kaizen is also part of the lean manufacturing. Wow! I realise that, all of these things are related. And the core of the concept is, “scientific learning”.
Med (Linux Memory Editor) 3.0
Med (Linux Memory Editor) 3.0 released.
Recently I did a great revamp. Remove most of the old code which was not rightly designed. And previously I wrote a ByteManager, which I guess it causes a lot of trouble and crash, together with the memory value locking using multi-threading.
As a result, I spent some times to do a revamp. Remove the ByteManager and use the shared_ptr instead. Because C++ doesn’t have garbage collection. It is hardly for this application to manage the dynamically allocated memory, because the scanned address needs to be hold awhile, or stored for saving, or hold for editing. By using shared_ptr, the memory will be freed automatically when it has no reference.
Coin Flip Conundrum
I watched this video,
[youtube https://www.youtube.com/watch?v=IAiNqQi30-Y]
Very interesting.
So, I managed to prove it through some scripting.
https://gist.github.com/allencch/36544a84fdb8159756618290209f1750
And I get some result like this,
[code lang=text] Result: Target: [0, 1] average steps = 3.987 Target: [0, 0] average steps = 5.9505 [/code]
P/S: Wrote a robust flip coin script, which can accept the coin tossing sequence with any length. [here]
C++ Unit Test and Dependency Injection
TDD (test driven development) is widely adopted in modern development such as web development. Because it allows the developers to test the solution robustly in order to produce a more stable product.
Higher level programming languages like JavaScript and Ruby allows the developers to easily mock the functions and data to test the target specification. However, programming language like C++ is not designed for TDD. It will be more complex if you want to mock functions.
How to solve C/C++ memory leaking (in Linux)?
My hobby project Med is written in C++. A lot of implementations need to use dynamic memory allocation and instantiation. Because complex data is impractical to be passed by value, like the case of JavaScript object and array. Since C++ doesn’t have garbage collection, it is possible that the developer doesn’t free/delete the dynamically created memory properly.
As in my project Med, the program will retrieve the memory from other process. That means, it needs to make a copy of the scanned memory. And this will involve creating dynamic memory (using new operator). When using the program to filter the memory to get the target result, it needs to get a new copy of memory with the updated values, then compare with the previous copy. The unmatched will need to be discarded (free/delete); the matched will need to replace the old one (also free/delete the old one, because the new one is dynamically allocated).
Firefox Legacy version 56.0.2
The latest Firefox version 57 and above, a.k.a Firefox Quantum, it is fast, but… that is not what I need.
As a developer, I favoured Chromium more than Firefox. And I use Firefox mainly for downloading. The addon DownThemAll is the must. The greatest feature I love is the ability to highlight and download the selected hyperlinks as batch. And I can name the downloaded files by original filename or based on the text in HTML.