syntax-error

Creating a list with >255 elements

Ok, so I'm writing some python code (I don't write python much, I'm more used to java and C). Anyway, so I have collection of integer literals I need to store. (Ideally >10,000 of them, currently I've only got 1000 of them) I would have liked to be accessing the literals by file IO, or by accessing there source API, but that is disallow...

Why does this code produce "syntax error, unexpected '='" ?

$text . = '1 paragraph'; $text . = '2 paragraph'; $text . = '3 paragraph'; echo $text; This code gives error syntax error, unexpected '='. What is the problem? ...

OpenLDAP configuration error ldap_bind: Invalid credentials (49)

I'm using Ubuntu 10.4 server and I'm trying to configure OpenLDAP as a protocol for authentication for SVN and other services. However I quite don't understand how ldap works and after setting a example config I tried to populate it without success. This is the error: ldap_bind: Invalid credentials (49) It seems to be example config p...

PHP IF Statement executing both conditions

Hi, I'm currently integrating a payment system into my website. I have a response script which basically takes in the data from the secure server and displays to the customer if the payment has gone through or not. My problem is that the if statement is actually displaying both messages to the customer, even if the payment has been suc...

Error while creating new object in rails

hello, I am getting this error in rails whenever i am trying to create an object for the model. I am working on Windows 7 C:\Ruby\joker\chapter3>ruby script/console Loading development environment (Rails 2.3.8) >> mycb = ComicBook.new SyntaxError: C:/Ruby/joker/chapter3/app/models/comic_book.rb:19: syntax error, u nexpected $end, expec...

What's wrong with my try: except: syntax?

Choking code: while port < 0 or port > 65535: try: port = int(raw_input("Enter port: ") except ValueError: print "Invalid port number." Result: File "/Users/.../Documents/.../CS 176A/TCPServer.py", line 10 except ValueError: ^ SyntaxError: invalid syntax ...

sqlite subquery syntax error

I have a syntax error in this subquery that I cannot seem to figure out why it won't work. All the parens are matched select min(max_s) from (select max(salary) from instructor group by dept_name) as s(max_s); Error: near "(": syntax error ...

bash syntax error when using case statement

I have bash script that I use regularly in my job to automate a large job. I was making some changes today, but everything seemed fine. The script itself is about 1700 lines long. The first part of the script is all good and runs through all the user input and logic just fine. It then proceeds into the core of the script and stops wo...

ROR + How to make Textarea with few conditions of validation and property .

Here, In my code I have to put one of the text_area and i have to put some certain condition over them. Code which was used by me. Ruby Code:: <%= text_area "rate_unit","rate_unit_notes", "rows" => 3, "cols" => 50, :tabindex=>3, :maxlength=>100 %> HTML Code after executing the page <textarea tabindex="3" rows="3" name="rate_...

INVALID SYNTAX ERROR for 'else' statement in python

I am trying to write a quicksort program in python, however I'm getting an invalid syntax error at else statement in the second last line below: import random n=int(raw_input("Enter the size of the list: ")) # size of the list intlist = [0]*n for num in range(n): intlist[num]=random.randint(0,10*n) pivot=random.choice(intlist) lis...

How to identify which line in the batch file has a syntax error ?

I'm running a batch file on Windows and got this error: The syntax of the command is incorrect. Is that possible to identify which line in the batch file is incorrect ? ...

Why isn't this compiling?

I'v created this class here: //Integer rectangle class class AguiRectangle { int x; int y; int width; int height; public: bool isEmpty { return x == 0 && y == 0 && width == 0 && height == 0; } int getTop() { return x; } int getLeft() { return y; } int ge...

Require help in Django 'local variable 'form' referenced before assignment'

Hello, I am having problem in django. I have created a form in my app where I can take details of a client. Now I want to create a form which can allow me to edit a form. However I am having some problems when I go to /index/edit_client/1, I get this error. local variable 'form' referenced before assignment I do not know what the reas...

Really simple MySQL JOIN not working?

What am I doing wrong? Seriously confused. SELECT * FROM photos WHERE user_id = 1 JOIN photos_albums ON photos_albums.photo_id = photos.id The context is, I have a table to store photos, and another table to store photo albums (not shown). I also have a cross-referencing table photos_albums to store which photos are in which albums. ...

PHP Error T_STRING

Parse error: syntax error, unexpected T_STRING in /opt/lampp/htdocs/Community/register.php on line 84 I get that error, here is line 84 of my code. if ($firstname && $lastname && $username && $email && $password && $repassword){ if ($password == $repassword){ if (strstr($email, "@") && strstr($email, ".") &...

C++ program instruction

I have written out the program, however once I tried compileing it a get syntax errors and cannot fine where the syntax errors are. Would you know why my program won't compile? It should calculate number of second sound travels in difference gases, information given by user. include <iostream> #include <fstream> using namespace std; ...

Where Is the Syntax Error in this SQL?

I've got a query that is pretty much the same as many others which are used in the same library... but I did a lot of copy&paste on the SQL to add features to each one which are all similar but slightly different. Just below is the section which gives me the SQL Parser error. It fires at the Set rs = line. dim sql, rs sql = "DECLARE @st...

Why isn't "0f" treated as a floating point literal in C++?

Why isn't 0f treated as a floating point literal in C++? #include <iostream> using namespace std; int main(){ cout << 0f << endl; return 0; } Compiling the above gives me C2509 (syntax error: 'bad suffix on number') using VS2008. ...

T_CONSTANT_ENCAPSED_STRING blocking ip.

Here is line 37; $write = mysql_query("INSERT INTO `trial' VALUES (" '', '".$ip."', '1' ") or die(mysql_error()); The error may be coming from further up.. But I'm not quite sure :S I am trying to block the ip of a ...

Identifying syntax errors in Java

Given this code in Java: int i,j; String[] names; names[0] = new String("mary"); names[1] = "John"; i = names.length; j = names[0].length(); I need to find the error. As far as I can tell, lines 1, 2, 4, and 5 are correct because they involve simple instance variables, adding elements to arrays, and finding the length of an array. How...