What does auto do in margin: 0 auto?

When you have specified a width on the object that you have applied margin: 0 auto to, the object will sit centrally within it’s parent container. Specifying auto as the second parameter basically tells the browser to automatically determine the left and right margins itself, which it does by setting them equally. It guarantees that the left and right margins will … Read more

gcc: error: unrecognized command line option

A more deterministic way of pointing to the exact toolchain you want to use is to provide its full prefix when setting CROSS_COMPILE. This will avoid possible path-related errors, and the information on which exact toolchain was used for building will be embedded in your build script. Full example – installing official Arm gcc toolchain and … Read more

How to restart Postgresql

Try this as root (maybe you can use sudo or su): Without any argument the script also gives you a hint on how to restart a specific version Similarly, in case you have it, you can also use the service tool: Please, pay attention to the optional [version …] trailing argument. That’s meant to allow you, the user, to act on a specific … Read more

Check string “None” or “not” in Python 2.7

For empty strings both are different: will not print anything because it is empty and therefore considered False but: will print because foo is not None! I Changed it according to PEP8. if foo is not None is equivalent to your if not foo is None but more readable and therefore recommended by PEP8. A bit more about the general principles in Python: The if will only be True if a … Read more

What is key=lambda

A lambda is an anonymous function: It is often used in functions such as sorted() that take a callable as a parameter (often the key keyword parameter). You could provide an existing function instead of a lambda there too, as long as it is a callable object. Take the sorted() function as an example. It’ll return the given iterable in sorted order: but that sorts uppercased … Read more