python equivalent to perl’s qw()

Well, there’s definitely no way to do exactly what you can do in Perl, because Python will complain about undefined variable names and a syntax error (missing comma, perhaps). But I would write it like this (in Python 2.X): print ‘%8s %8s %8s’ % (‘date’, ‘price’, ‘ret’) If you’re really attached to Perl’s syntax, I … Read more

HTML5: which is better – using a character entity vs using a character directly?

If the encoding is UTF-8, the normal characters will work fine, and there is no reason not to use them. Browsers that don’t support UTF-8 will have lots of other issues while displaying a modern webpage, so don’t worry about that. So it is easier and more readable to use the characters and I would … Read more

Escape Quotes In HTML5 Data Attribute Using Javascript

There is no way around it, you have to escape the values properly, or the HTML can’t be parsed properly. You can’t use Javascript to correct the code after it is parsed, because then it has already failed. Your example with proper HTML encoding would be: <p class=”example” data-example=”She said &quot;&lt;abbr title=&quot;What The F***&quot;&gt;WTF&lt;/abbr&gt;&quot; on … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)