Parsing domain from a URL

Check out parse_url(): parse_url doesn’t handle really badly mangled urls very well, but is fine if you generally expect decent urls.

ImportError: No module named ‘MySQL’

I was facing the similar issue. My env details – Python 2.7.11 pip 9.0.1 CentOS release 5.11 (Final) Error on python interpreter – Use pip to search the available module – Install the mysql-connector-python-rf – Verify Thanks =) For python3 and later use the next command: $ pip3 install mysql-connector-python-rf

Dice Rolling java program

You should use a while loop: The dice are rolled again and again until the player has won or lost (then, break ends the while loop).

CSS selectors ul li a {…} vs ul > li > a {…}

“>” is the child selector “” is the descendant selector The difference is that a descendant can be a child of the element, or a child of a child of the element or a child of a child of a child ad inifinitum. A child element is simply one that is directly contained within the parent element: for … Read more

What is the difference between array and enum in C ?

Array is a variable that can contain multiple elements with index starting from 0 whereas enum is an user defined datatype that contains a list of members for which an integer constant is assigned starting from 0. in case of enum the numbers starting from 0 are not indexes whereas in case of an array they are indexes. … Read more