What is an example of the Liskov Substitution Principle?

A great example illustrating LSP (given by Uncle Bob in a podcast I heard recently) was how sometimes something that sounds right in natural language doesn’t quite work in code. In mathematics, a Square is a Rectangle. Indeed it is a specialization of a rectangle. The “is a” makes you want to model this with inheritance. However if … Read more

scp with port number specified

Unlike ssh, scp uses the uppercase P switch to set the port instead of the lowercase p: The lowercase p switch is used with scp for the preservation of times and modes. Here is an excerpt from scp’s man page with all of the details concerning the two switches, as well as an explanation of … Read more

What’s a .sh file?

If you open your second link in a browser you’ll see the source code: […] So it’s a bash script. Got Linux? In any case, the script is nothing but a series of HTTP retrievals. Both wget and curl are available for most operating systems and almost all language have HTTP libraries so it’s fairly … Read more

Difference between UTC and GMT

Astronomy versus Atomic clock By the original definitions the difference is that GMT (also officially known as Universal Time (UT), which may be confusing) is based on astronomical observations while UTC is based on atomic clocks. Later GMT has become to be used at least unofficially to refer to UTC, which blurs the distinction somewhat. GMT stands for Greenwich … Read more

g++ ld: symbol(s) not found for architecture x86_64

I had a similar warning/error/failure when I was simply trying to make an executable from two different object files (main.o and add.o). I was using the command: gcc -o exec main.o add.o But my program is a C++ program. Using the g++ compiler solved my issue: g++ -o exec main.o add.o I was always under the impression … Read more