What does “all” stand for in a makefile?

A build, as Makefile understands it, consists of a lot of targets. For example, to build a project you might need Build file1.o out of file1.c Build file2.o out of file2.c Build file3.o out of file3.c Build executable1 out of file1.o and file3.o Build executable2 out of file2.o If you implemented this workflow with makefile, … Read more

Member function with static linkage

The keyword static has several different meanings in C++, and the code you’ve written above uses them in two different ways. In the context of member functions, static means “this member function does not have a receiver object. It’s basically a normal function that’s nested inside of the scope of the class.” In the context … Read more

What does the LEAL assembly instruction do?

LEA (load effective address) just computes the address of the operand, it does not actually dereference it. Most of the time, it’s just doing a calculation like a combined multiply-and-add for, say, array indexing. In this case, it’s doing a simple numeric subtraction: leal -4(%ebp), %eax just assigns to the %eax register the value of … Read more

Detecting a mobile browser

Using Regex (from detectmobilebrowsers.com): Here’s a function that uses an insanely long and comprehensive regex which returns a true or false value depending on whether or not the user is browsing with a mobile. For those wishing to include tablets in this test (though arguably, you shouldn’t), you can use the following function: Using navigator.userAgentData … Read more

Creating a List of Lists in C#

I seem to be having some trouble wrapping my head around the idea of a Generic List of Generic Lists in C#. I think the problem stems form the use of the <T> argument, which I have no prior experience playing with. Could someone provide a short example of declaring a class which is a … Read more