Multiple companies are selling RO (Reverse Osmosis) based water purifiers these days, and all of them will have some confusing diagram to accompany their product so that you are forced to call an electrician or a support guy to fix stuff which is actually very...
Author: Anupam Srivastava
So you got yourself access to a Debian server (or virtual private server) and have logged into it by one way or the other. In this tutorial, we will learn how to set up such a bare-bones server so you can access it remotely via...
A generic factory is a factory that can register any class type. It is very easy to write because we are allowed to use void pointers.
void Register(const std::string _key, const std::function<void *()> _creator)
m_creators[_key] = _creator;
ClassType* Get(const std::string _key) const
return static_cast<ClassType *>(m_creators.at(_key)());
std::map<std::string, std::function<void *()> > m_creators;
Derived1 *d1 = f.Get<Derived1>("Derived1");
Derived2 *d2 = f.Get<Derived2>("Derived2");
Derived1 *d2 = f.Get<Derived1>("Derived2"); // This also compiles!!!
As we are simply casting a void pointer, it is left to the developer to ensure...
Problem statement: Find the largest sum that is possible in an array. I.e., find the maximum sub-array. Solution: From the very first this problem looks complicated because of how it is framed. It sounds like we want to find the MAXIMUM from ALL THE POSSIBLE...
Ticking away the moments that make up a dull day Fritter and waste the hours in an offhand way. Kicking around on a piece of ground in your home town Waiting for someone or something to show you the way. Tired of lying in the...
This PDF was submitted to BITS PILANI Work Integrated Learning Program 2019 Object Oriented Analysis and Design (S2_18_SSZG514) for the final assignment.
I have not seen this discussed, yet. I had this idea that has given me a lot of perspective in life and has helped to understand why and how our system. Our system is a hierarchy of power. Why is not what is important here, but...
This is based on this Visual Studio 2013 for QtCreator along with my own changes. On Windows: Put the XML file in %APPDATA%/QtProject/qtcreator/styles On Linux/Unix: Put the XML file in $HOME/.config/QtProject/qtcreator/styles You are welcome!