Summary In this post, I will introduce function objects, also known as functors. Conclusion I provid the following snippets as a quick reference. See meeting-rooms-II for the problem details. /** * Definition for an interval. * struct Interval { * int start; * int end; * Interval() : start(0), end(0) {} * Interval(int s, int…
Month: February 2019
Allocate Memory in Constructors and Destructors
Summary In this post, I will introduce the way to define a class which contains memory allocation. I will focus on constructors and destructors in this post. Conclusion I present the conclusion first as usual: whenever the implementation of a class involves dynamically allocated memory, the class should explicitly define: a destructor which frees the…
Remote Desktop Application
Summary In this post, I will introduce a solution for remote desktop control. It is totally free and has great performance. Note: It seems Google Chrome Remote Desktop does not support gdm. But I am quite sure it works if you use lightdm which is also the default display manager in Ubuntu. Conclusion As usual,…
Namespace and Using
Summary In this post, I will introduce how to use "using" in C++, in other words, how to use an existing namespace. Conclusion As usual, I present the conclusion first. The followings are recommended ways which minimize name collision possibilities and maximize code clarity and writing convenience. See this post as well. For Headers Do…
How to Remove Safe Finder on Mac OS
Summary In this post, I will introduce how to remove Safe Finder, a notorious malware on multiple platforms. This post is not a technical post but really helps. Conclusion Use Malwarebytes. I’m not advertising. And the free version works. Details Safe Finder I come across Safe Finder when I surf a website which requires me…