A StoneWall Solution in C++
StoneWall is an interesting problem that requires some brain cycles yet not too complex. It is good software engineer interview question. Here is a C++ solution whose complexity is O(N). #include...
View ArticleHow to Convert Integers to Strings and Strings to Integers in PHP
Conversion from integer to string and from string to integer are common operations in most applications such as C++. PHP has its uniqueness in language and standard library design. In this post, we...
View ArticleHow to Install Wine 32-bit on CentOS 8
Since version 7, RHEL and CentOS only have 64 bit versions. For some reasons, it’s better to run many Windows applications under 32 bit wine. Like How to Install Wine 32-bit on CentOS 7, this post...
View ArticleBash Learning Materials
Bash (GNU Bourne-Again SHell) the default shell for many Linux distributions. It is very common for scripting languages in Linux. Bash is easy and straightforward for writing small tools. However, as...
View ArticleGCC May “Save” You Some Recursive Functions Calls: an Analysis of a Function...
We know compilers like gcc can do lots smart optimization to make the program run faster. Regarding functions call optimization, gcc can do tail-call elimination to save the cost of allocating a new...
View ArticleHow to Install Go 1.13.x on Ubuntu 18.04
In Ubuntu 18.04 LTS, the default Go lang version is 1.10. For compatibility reason, the Ubuntu LTS will usually keep the major release version numbers for packages. However, many applications, such as...
View ArticleHow to Query Transaction By ID in Hyperledger Fabric 2.0
Querying transaction content out from a blockchain network is a common practice used by common scenarios like exploring the blockchain history or verifying the blockchain transaction content from a...
View ArticleHow to Match Multiple Lines using Regex in Perl One-liners
Perl one-liners with perl’s regular expression statement can be a very powerful text processing tools used as commands in a terminal or a script. By default, the input to the perl one-liner with -p or...
View ArticleHow to Add Inline Comments for Multi-line Command in Bash Script
In Bash script, it is common that multiple small commands run together connected by pipes (|) and the whole command is quite long. For clarity, we may write the command in multiple lines. How to add...
View ArticleHow to Redirect Feed Links to follow.it using .htaccess
Feedburner used to a powerful tool for RSS feeds publishing and subscriber management. However, feedburner will unlikely leave its maintenance mode because there has been no new features yet less...
View ArticleHow to change another process’ environment variable in Linux?
Each process has its environment variables in Linux. But is it possible to change another process’ environment variable from another process in Linux? If it is possible to do so, how to do it? There is...
View Article4 Features of Python 3.9 That You Can’t Take Your Eyes Off
Python is one of the most popular programming languages in the world. It is widely popular for a plethora of tasks due to its flexible nature and ease of use. Python has also managed to beat other...
View ArticleLinux User Group Management and Operations
Linux allows more than one users to log into the system to run processes/programs at the same time. In order to make this multi-user system work properly, Linux provides ways to isolate and protect...
View ArticleHow to Count the Number of Words in a File in PHP?
Counting the number of words in a file is useful in many programs. In this post, we will discuss how to count the number of words in a file in a PHP script. In PHP standard library, we have function...
View ArticleLinux Kernel: fs: handle SEEK_HOLE/SEEK_DATA properly in all fs’s that define...
This change "fs: handle SEEK_HOLE/SEEK_DATA properly in all fs’s that define their own llseek" (commit 06222e4) in Linux kernel is authored by Josef Bacik <josef [at] redhat.com> on Mon Jul 18...
View ArticleLinux Kernel: ALSA: hda/realtek – Fix Headphone Mic doesn’t recording for ALC256
This change "ALSA: hda/realtek – Fix Headphone Mic doesn’t recording for ALC256" (commit d32b666) in Linux kernel is authored by Kailang Yang <kailang [at] realtek.com> on Thu Apr 23 15:10:53...
View ArticleLinux Kernel 4.19.70 Release
This post summarizes new features, bugfixes and changes in Linux 4.19.70 Release kernel release. Linux 4.19.70 Release release contains 95 changes, patches or new features. In total, there are 101,521...
View ArticleLinux Kernel: cifs: release auth_key.response for reconnect
This change "cifs: release auth_key.response for reconnect." (commit f5c4ba8) in Linux kernel is authored by Shu Wang <shuwang [at] redhat.com> on Fri Sep 8 18:48:33 2017 +0800. Description of...
View ArticleLinux Kernel: netpoll: fix netconsole IPv6 setup
This change "netpoll: fix netconsole IPv6 setup" (commit 00fe11b) in Linux kernel is authored by Sabrina Dubroca <sd [at] queasysnail.net> on Thu Feb 6 18:34:12 2014 +0100. Description of...
View ArticleLinux Kernel: PM / clk: Fix clock error check in __pm_clk_add()
This change "PM / clk: Fix clock error check in __pm_clk_add()" (commit 3fc3a0b) in Linux kernel is authored by Geert Uytterhoeven <geert+renesas [at] glider.be> on Fri May 8 10:47:43 2015 +0200....
View Article