Top "Syntax" questions

Syntax refers to the actual language elements and symbols themselves.

How to convert Set to Array?

Set seems like a nice way to create Arrays with guaranteed unique elements, but it does not expose any good …

javascript arrays collections syntax ecmascript-harmony
-bash: syntax error near unexpected token `newline'

To reset the admin password of SolusVM I am executing the following command: php /usr/local/solusvm/scripts/pass.php …

bash syntax newline token
When do we need curly braces around shell variables?

In shell scripts, when do we use {} when expanding variables? For example, I have seen the following: var=10 # Declare variable …

bash shell syntax curly-braces
Ternary operator (?:) in Bash

Is there a way to do something like this int a = (b == 5) ? c : d; using Bash?

bash syntax conditional-operator
Is double square brackets [[ ]] preferable over single square brackets [ ] in Bash?

A co-worker claimed recently in a code review that the [[ ]] construct is to be preferred over [ ] in constructs like if [ "`…

bash if-statement syntax
How do you express binary literals in Python?

How do you express an integer as a binary number with Python literals? I was easily able to find the …

python syntax binary integer literals
Difference between single and double quotes in Bash

In Bash, what are the differences between single quotes ('') and double quotes ("")?

bash shell syntax quotes
Bash syntax error: unexpected end of file

Forgive me for this is a very simple script in Bash. Here's the code: #!/bin/bash # june 2011 if [ $# -lt 3 -o $# …

bash syntax
Ruby - test for array

What is the right way to: is_array("something") # => false (or 1) is_array(["something", "else"]) # => true (or > 1) …

ruby syntax