Proper way to make HTML nested list?

Option 2 is correct. The nested list should be inside a <li> element of the list in which it is nested. Link to the W3C Wiki on Lists (taken from comment below): HTML Lists Wiki. Link to the HTML5 W3C ul spec: HTML5 ul. Note that a ul element may contain exactly zero or more li elements. The same applies to HTML5 ol. The description list (HTML5 dl) is similar, but allows … Read more

What is Python buffer type for?

An example usage: The buffer in this case is a sub-string, starting at position 6 with length 5, and it doesn’t take extra storage space – it references a slice of the string. This isn’t very useful for short strings like this, but it can be necessary when using large amounts of data. This example … Read more

How to leave/exit/deactivate a Python virtualenv

Usually, activating a virtualenv gives you a shell function named: which puts things back to normal. I have just looked specifically again at the code for virtualenvwrapper, and, yes, it too supports deactivate as the way to escape from all virtualenvs. If you are trying to leave an Anaconda environment, the command depends upon your version of conda. Recent versions (like … Read more

How does createOrReplaceTempView work in Spark?

createOrReplaceTempView creates (or replaces if that view name already exists) a lazily evaluated “view” that you can then use like a hive table in Spark SQL. It does not persist to memory unless you cache the dataset that underpins the view. The data is cached fully only after the .count call. Here’s proof it’s been cached: Related SO: spark createOrReplaceTempView vs … Read more

push_back vs emplace_back

In addition to what visitor said : The function void emplace_back(Type&& _Val) provided by MSCV10 is non conforming and redundant, because as you noted it is strictly equivalent to push_back(Type&& _Val). But the real C++0x form of emplace_back is really useful: void emplace_back(Args&&…); Instead of taking a value_type it takes a variadic list of arguments, so that means that you can now perfectly … Read more

Python TypeError: ‘type’ object is not iterable

If you query type(a), you get list. You probably want to do a mapping of the elements to the corresponding types, so use map: Furthermore you should not print the result of listType, since it does not return anything, and fix the indentation of the program. I hope it is correct now.

How to fix ‘ValueError: list.remove(x): x not in list’ error in Python

list.remove takes a single argument, which is the item you want to remove. From the docs: https://docs.python.org/3/tutorial/datastructures.html list.remove(x)Remove the first item from the list whose value is equal to x. It raises a ValueError if there is no such item. But “Maths, 76” is not an element in your list, hence you get the error ValueError: list.remove(x): x not in … Read more