SyntaxError: not a chance — What is this error?

You have found an easter egg in Python. It is a joke. It means that delimiting blocks by braces instead of indentation will never be implemented. Normally, imports from the special __future__ module enable features that are backwards-incompatible, such as the print() function, or true division. So the line from __future__ import braces is taken … Read more

Why is `continue` not allowed in a `finally` clause in Python?

The use of continue in a finally-clause is forbidden because its interpretation would have been problematic. What would you do if the finally-clause were being executed because of an exception? for i in range(10): print i try: raise RuntimeError finally: continue # if the loop continues, what would happen to the exception? print i It … Read more

Calling a Sub in VBA

Try – Call CatSubProduktAreakum(Stattyp, Daty + UBound(SubCategories) + 2) As for the reason, this from MSDN via this question – What does the Call keyword do in VB6? You are not required to use the Call keyword when calling a procedure. However, if you use the Call keyword to call a procedure that requires arguments, … Read more

Dict merge in a dict comprehension

It’s not exactly an answer to your question but I’d consider using ChainMap to be an idiomatic and elegant way to do what you propose (merging dictionaries in-line): >>> from collections import ChainMap >>> d1 = {1: ‘one’, 2: ‘two’} >>> d2 = {3: ‘three’} >>> ds = [d1, d2] >>> dict(ChainMap(*ds)) {1: ‘one’, 2: … Read more

JavaScript: SyntaxError: missing ) after argument list

You have an extra closing } in your function. var nav = document.getElementsByClassName(‘nav-coll’); for (var i = 0; i < button.length; i++) { nav[i].addEventListener(‘click’,function(){ console.log(‘haha’); } // <== remove this brace }, false); }; You really should be using something like JSHint or JSLint to help find these things. These tools integrate with many editors … Read more

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