Top "Syntax-error" questions

A syntax error occurs when a program does not follow the syntactical rules of the programming language.

Why is the "else" line giving an invalid syntax error?

I'm having this error: File "zzz.py", line 70 else: ^ SyntaxError: invalid syntax The line which causes the problem is marked …

python syntax-error indentation if-statement
In Ruby, how do I check if method "foo=()" is defined?

In Ruby, I can define a method foo=(bar): irb(main):001:0> def foo=(bar) irb(main):002:1> p "foo=#{…

ruby syntax-error
syntax error near unexpected token `$'in\r''

I'm trying to compile the NIST Biometric Image Software, and I have been having trouble all day. I finally got …

cygwin syntax-error token biometrics
error C2061: syntax error : identifier

Here is my C++ code // XuatChuoiBTHang.h #pragma once #include "BieuThuc.h" #include "BieuThucHang.h" class XuatChuoiBTHang { public: virtual string …

c++ syntax-error
Cannot assign a value of type ViewController to a value of type UITextFieldDelegate?

Here's the error when I wrote the line self.MessageTextField.delegate = self: /ChatApp/ViewController.swift:27:42: Cannot assign a value of …

ios swift delegates syntax-error uitextfielddelegate
How to fix the YAML syntax error: did not find expected '-' indicator while parsing a block?

I have some code written in my .travis.yml written for a Python library. Using lint.travis-ci.org, I came …

syntax-error yaml indentation travis-ci
How to select top five or 'N' rows in Oracle 11g

select distinct ani_digit, ani_business_line from cta_tq_matrix_exp limit 5 I want to select top five rows …

sql oracle oracle11g syntax-error
SYNTAX_ERR: DOM Exception 12 - Hmmm

I have been working on a small slideshow / public display for a client that uses HTML5 Rock's Slideshow code. I …

javascript html dom syntax-error domexception
JSON syntax error: 'unexpected number' or 'JSON.parse: expected ',' or '}' after property value in object'

I receive this response from a POST request using $.ajax(): {"command": 6,"log_size":50,"log":[ {"type": 30,"tag": "*NETEVENT*","sensors": "0D","ti": 1047161877,"…

javascript jquery json syntax-error
How to make SELECT NEXT VALUE work in SQL Server?

I'm having some difficulties trying to get the following to work in SQL Server: CREATE TABLE table_X AS SELECT …

sql sql-server syntax syntax-error porting