Nice reminder of the reason you should prefer do/while(0) macros: it’s all about the single-statement if/else construct with a semicolon!
I’m not sure how many years of man-frustration have been spent agonizing over this problem, but it seems like a lot of resources could be pooled (i.e. QA screw-ups could be avoided) if there were some industry standard power adapters for laptops.
What do the laptop manufacturers stand to gain by creating their own, custom power adapters?
I just clicked on a suggested fix in NetBeans (stock configuration) where I had to catch a checked exception. It surrounded my statement with a try/catch block, imported logging, and logged the exception with the class name / a log level of severe in the catch block. I hadn’t used logging anywhere else in the application. I feel like some bounds have been overstepped.
Am I controlling the IDE, or is the IDE controlling me?
from urllib2 import urlopen
from lxml import etree
parser = etree.HTMLParser()
file = urlopen('http://xkcd.com')
tree = etree.parse(file, parser)
comic = tree.findall('//img[@title]')[1]
print comic.attrib['title']