Category "syntax"

Hive query to find conversion ratio

I am trying this query in Hive and it's not working. select ( ( select count(*) from click_streaming where page_

python - SyntaxError: unexpected character after line continuation character

I made this very simple one line code that is only supposed to start Hearthstone, I get the error "SyntaxError: unexpected character after line continuation ch

python - SyntaxError: unexpected character after line continuation character

I made this very simple one line code that is only supposed to start Hearthstone, I get the error "SyntaxError: unexpected character after line continuation ch

Sending Queries to a table in RMySQL, using R variables

I am trying to write data I have created in R and stored in arrays to MySQL table. Currently this is how I am doing it, for(z in 1:60){ dbSendQuery( mydb,

Why is the word file get highlighted in .py files in the Vim text editor?

The word "file" in python is not a keyword, but my Vim highlights it as if it were. Can someone suggest a fix and explain this strange behaviour? It keeps messi

Vue JS: reactive syntax

While I was trying to grasp reactivity fundamentals and its syntax I've encountered following problem. Consider this snippet: const app = Vue.createApp({ dat

var functionName = function() {} vs function functionName() {}

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consiste

Is there a powershell pattern for if($?) { }

I find myself chaining these a lot, eg: do-cmd-one if($?) { do-cmd-two } ... then at the end: if(!$?) { exit 1 } I assume there's a pattern for this in

Is there another way to write SUM(IIF([CONDITION], 1, 0))?

What SUM(IIF([CONDITION], 1, 0)) does is very simple. So simple, that what I really just want to write is COUNT([CONDITION]) (but that's invalid). Is there a sh

How to put mathematical equations in source code without making it unreadable?

When implementing complex calculations, I found that readability suffered a lot. For example, this formula is absolutely unreadable when translated to code (I c

Sytax error: Missing ), but I don't see it. My quotation marks don't seem to be the problem either

I've been working on this app script trying to automate data from a Google sheet to create events on Google Calendar. I've tried changing the Quotation marks fr

Python, what does an underscore before parenthesis do

Looking through some of the Django code at authentication forms I noticed the following syntax label=_("Username") Normally I would have just used a pair of

Trying to target specific links for styling in CSS

I'm trying to target just the links in my nav bar as I have inserted other dummy links further down in my home page that I want to style on their own. I have tr

Boolean assignment operators in PHP

I find myself doing this kind of thing somewhat often: $foo = true; $foo = $foo && false; // bool(false) With bitwise operators, you can use the &

Why can an Object member variable not be both final and volatile in Java?

If in a class I have a ConcurrentHashMap instance that will be modified and read by multiple threads I might define like this: public class My Class { pri

Best way to "negate" an instanceof

I was thinking if there exists a better/nicer way to negate an instanceof in Java. Actually, I'm doing something like: if(!(myObject instanceof SomeClass)) { /*

What does it mean += in Python?

What does it mean when it's like this: self.something += ('somethin',) What does "+=" mean and what does the comma mean?

Empty productions in RFC 5234 (Augmented BNF)

Does Augmented BNF (as specified by RFC 5234) allow matches to empty string? From reading grammar of the Augmented BNF itself (section 4, ABNF Definition of ABN

OCaml explicit type signatures

In Haskell, it is considered good practice to explicitly declare the type signature of your functions, even though it can (usually) be inferred. It seems like t

Python: Make class iterable

I have inherited a project with many large classes constituent of nothing but class objects (integers, strings, etc). I'd like to be able to check if an attribu