Should I use single colons (:) or double colons (::) for before, after, first-letter and first-line pseudo-elements?

For what it’s worth, Selectors 4 now explicitly instructs1 authors to use double colons for all pseudo-elements, including CSS1 and CSS2 pseudo-elements, going forward (emphasis mine): Because CSS Level 1 and CSS Level 2 conflated pseudo-elements and pseudo-classes by sharing a single-colon syntax for both, user agents must also accept the previous one-colon notation for … Read more

What’s the difference between Git ignoring directory and directory/*?

There’re differences among www, www/ and www/*. Basically from the documentation and my own tests, www find a match with a file or a directory, www/ only matches a directory, while www/* matches directories and files inside www. I’ll only discuss on the differences between www/ and www/* here, since the differences between www and … Read more

What are the distinctions between the various symbols (*,&, etc) combined with parameters? [duplicate]

To understand this you’ll first need to understand pointers and references. I’ll simply explain the type declaration syntax you’re asking about assuming you already know what pointers and references are. In C, it is said that ‘declaration follows use.’ That means the syntax for declaring a variable mimics using the variable: generally in a declaration … Read more

Convert Scientific Notation to Float

You are looking at the default str() formatting of floating point numbers, where scientific notation is used for sufficiently small or large numbers. You don’t need to convert this, the value itself is a proper float. If you need to display this in a different format, format it explicitly: >>> print(0.00001357) 1.357e-05 >>> print(format(0.00001357, ‘f’)) … Read more

What does %w(array) mean?

%w(foo bar) is a shortcut for [“foo”, “bar”]. Meaning it’s a notation to write an array of strings separated by spaces instead of commas and without quotes around them. You can find a list of ways of writing literals in zenspider’s quickref.

tech