syntax-error

What to do with "Unexpected indent" in python?

How do I rectify the error "unexpected indent" in python? ...

update sql syntax - reset a field to itself with a concatenation - sql server 2005

I'm getting and error using this syntax: update table set field1 = (field1+' - '+field2) where field1 = 'somevalue' It's not too happy with doing this for me. I know that the '+' for concatenation works in my select statements, so that is the right syntax. There is something else at play here... and I tried removing the parenthesis ...

C#: property/field namespace ambiguities

I get compile error because the compiler thinks Path.Combine refers to my field, but I want it to refer to class System.IO.Path. Is there a good way to handle this other than always having to write the FQN like System.IO.Path.Combine()? using System.IO; class Foo { public string Path; void Bar(){ Path.Combine("",""); } // compil...

Reporting syntax errors in a JSON object with jQuery and/or Javascript

What the best way to report a syntax error when I'm loading a JSON feed with jQuery? I can establish the error reporting settings like this: error: function(xhr){ alert('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText); } however this function doesn't fire when the URL I've called loads ...

bash shell script syntax error

I wrote a function in bash script. However, it's complaining about syntax. I really can't see what is it..... the error message is [: missing `]' addem() { if [ $# -eq 0] || [ $# -gt 2 ] then echo -1 elif [ $# -eq 1 ] then echo $[ $1 + $1 ] ...

What does this syntax error mean?

i got 3 syntax errors: "syntax error before "}" token" my code was IBOutlet UITextView *fruitDescription } "syntax error before "{" token" my code was - (void)viewDidUnload { "syntax error before "{" token" my code was - (void)dealloc { Any ideas? ...

why wont it recognize the @properties from header file from main file?

UIView.h #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> @interface UIView : UIResponder { IBOutlet UILabel *endLabel; IBOutlet UIButton *goButton; IBOutlet UITextField *textBox1; IBOutlet UITextField *textBox2; @property(nonatomic, retain) UILabel *endLabel; @property(nonatomic, retain) UIButton *goB...

Syntax Error with MySQL Query

Hey everyone, I am getting the following error and I have spent hours looking at it and cannot figure out why! ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary='doej2', secondary='1' WHERE id='2'' at line 1 Here is my code: <?php if (...

python docstrings

ok so I decided to learn python (perl, c, c++, java, objective-c, ruby and a bit of erlang and scala under my belt). and I keep on getting the following error when I try executing this: Tue Jul 21{stevenhirsch@steven-hirschs-macbook-pro-2}/projects/python:-->./apache_logs.py File "./apache_logs.py", line 17 print __doc__ ...

Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION

I've created the a class and tested, and getting the error Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in /usr/local/apache/htdocs/MiniBlog/user/user_class.php on line 96 The line 96 is in the function of class User: class User{ var $reg_time; functioin set_regtime($regtime){ $this...

How do I fix this syntax error?

The code is: function roundAmount(theDecimal) { var s = "" + Math.round(theDecimal * 100) / 100 var i = s.indexOf('.') if (i < 0) { return s + ".00" } var t = s.substring(0, i + 1) + s.substring(i + 1, i + 3) if (i + 2 == s.length) t += "0" return t } The line with the erro...

Groovy map syntax error

If I have this code : import javax.swing.* import java.awt.image.* def xMap = [ BufferedImage.TYPE_3BYTE_BGR : "3 byte BGR", BufferedImage.TYPE_4BYTE_ABGR : "4 byte ABGR", ] the IDE will generate this error : illegal colon after argument expression; solution: a complex label expression before a colon must be paren...

syntax error: _stdcall -- Help? Please?

Hello, I am trying to use this code to define the APIs that are needed to communicate with a card reader. Below is the header file (complete). [AtUsbHid.h] It is throwing several errors, but I figure if the syntax issue is solved, the rest will fall into place. Please help me out. I made sure that __export was replaced with __declsp...

Weird glitch with PHP

I need help debugging sample site : http://www.testground.idghosting.com/mma/contact-mma.php in english it's shows the "sent message" even if the form is not filled.. but in french (top right corner link) it doesn' show the fomr at all.... Here is my whole code : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "ht...

What is wrong with my syntax here?

The goal is to count the number of paragraphs in a group of users text... (I will assume its always bigger than 5 paragraphs for this exercise) Then I want to 1/2 the number of paragraphs, round it down and enter some content(echo "yehhoo") in between. I do understand the way I have gotten my $newvalue is not very good, would also lik...

Python - If statement

Hi I keep getting invalid syntax with the below: if (row[0] == year) and (row[1] == month) and (row[2] == day and (row[3] == hour) and (row[4] == minute): print "hello" else: print "hello2" Any ideas? ...

Haskell: Parsing error with 'where' and a guard

So, I'm just starting to teach myself Haskell out of the book Real World Haskell, and in the course of doing one of the exercises, I wrote the following code: step acc ch | isDigit ch = if res < acc then error "asInt_fold: \ \result overflowed" ...

Why is this J function not running?

I am attempting to learn J and the book I am using says this is the proper way to define a monadic function function =: 3:0 function statements so I followed this format and wrote the folding code. Can you tell me why this is throwing a syntax error when I try to call it with input but if I just call p it returns 3 h=:>:@i.@<....

js syntax error when invoking mouseover callback

I have some javascript code that creates an img tag with a mouseover callback, and adds the img tag to the page. The problem is that a javascript syntax error happens (in the Firefox Console) whenever the callback is invoked. This code demonstrates the problem... var imgUrl = 'http://sstatic.net/so/img/logo.png'; var ...

PHP syntax errors

My ISPs PHP server is now returning 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed. On what I thought was valid php, i.e. if ( $_REQUEST[ 'some_data' ] == null ) { echo "<p>No data</p>"; } else { echo "<p>Some data</p>"; } I have tried turning on error reporting ...