syntax-error

Syntax error with different gcc version?

I wrote a program in C with Ubuntu Linux and now I need to port it over to a UNIX machine (or what I believe to be a UNIX box). It compiles fine on my Ubuntu with GCC but when I try to compile it with GCC on the UNIX box, it gives this error: a.c: In function `goUpDir': a.c:44: parse error before `char' a.c:45: `newDir' undeclared (fir...

how to use foreign key into new table

I have one table CREATE TABLE GUEST(id int(15) not null auto_increment PRIMARY KEY, GuestName char(25) not null); CREATE TABLE PAYMENT(id int(15)not null auto_increment Foriegn Key(id) references GUEST(id), BillNr int(15) not null); what is problem in second command, why it is not working please correct me. it did not create new table...

F# syntax error.

I'm having a syntax error. I want to take the floor of a function that returns a floating point number. I thought this would give me the right answer let cyclesPerInterrupt bps bpw cpu factor = floor (fudge (float(factor) cyclesPerWord cpu wordsPerSec bps bpw)) But it doesn't. I've tried everything I can think of, and it's just not...

Seemingly completely random Python syntax errors

Here's a small sample section of some code I'm writing with python and pygame, for some reason it seems to be claiming that some seemingly very simple and apparently accurate things are syntax errors. Here's possibly the most annoying example. def Draw(): Surface.fill((255,255,255)) for square in squares: pygame.draw.rec...

Checking for valid credit card numbers.... lots of syntax errors.

At this point I'm fairly certain the code will run properly once I clear up all syntax errors. However I'm not really sure how to do this as I am not entirely familiar with Java. Any help is appreciated. Thanks for your help everyone I'm now using NetBeans. I'm seeing lots of errors but I'm not sure how to fix th...

Visual C++ error C2143: syntax error: missing ')' before 'constant'

I'm getting an error in Visual C++ that is giving me a really hard time. The error is error c2143 reading: syntax error: missing ')' before 'constant' My code line is: coefficient[i] = (1 - (2 * depth)) + ((t - floor( t + 0.5 ) + 1 ) 2 * depth); I have #include at the beginning of the file which should define the floor(double) func...

SQL Stored Procedure : Incorrect syntax within imbricated IFs

I get "Incorrect syntax" errors on every nested IF and ELSE statements in the following code... what's wrong ? ALTER PROCEDURE [WTFAULT].[usp_WTFault_GetPartFaultStatus] ( @linxPartId int = -1, @faultStatus varchar(10) output ) AS BEGIN DECLARE @NbFaultsInParts int, @NbPartsReturned int SET @NbPartsReturned = (SELECT COU...

What is the folding method corresponding to {{{ in Emacs?

I have used the following as comments in my .emacs // {{{ // }}} My .emacs ;; Basic Characteristics// {{{*/ (setq c-basic-offset 4) ; indents 4 chars (setq tab-width 4) ; and 4 char wide for TAB (setq indent-tabs-mode nil) ; And force use of spaces (turn-on-font-lock) ; same as syntax on in Vim (setq inhibit-splash-s...

What causes this Genshi's Template Syntax Error?

A Genshi template raises the following error: TemplateSyntaxError: invalid syntax in expression "${item.error}" of "choose" directive The part of the template code that the error specifies is the following ('feed' is a list of dictionary which is passed to the template): <item py:for="item in feed"> <py:choose error="${item.error}...

Interpreting SQL Server syntax errors

If there's one thing that I hate about SQL Server, it's the horribly unhelpful error messages. My favorite is "Incorrect syntax near..." because it provides almost no hint as to what's wrong. Are there any tools to get a better idea of what's wrong with the statement? Or does anybody have any other helpful hints for figuring these kin...

Syntax errror

Hello! I'm having a bad couple of weeks. Everything I touch seems to break. Ok, anyway... I have a web application in Visual Studio 2008 and it's been starting to act stange. I get a error message which says syntax error (nothing more). It "points" to the first row in my file Forms.aspx. The row says <%@ Page Language="C#" MasterPageF...

Why is Maya 2009 TreeView control giving a syntax error on drag?

I'm using the TreeView control in Maya 2009 but I'm getting a syntax error on drag and drop. My code is as follows (simplified for brevity): class View(event.Dispatcher): def __init__(self): self.window = cmds.window() tree_view = cmds.treeView( numberOfButtons=1, allowReparenting=True, dragAndDropComman...

Firefox 3 syntax error with external css

I get a strange syntax error in Firefox 3.0.10/Leopard when using the following html/css: foo.html: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html lang="en"> <head> <link rel="stylesheet" href="foo.css"/> </head> <body> Foo </body> </html> foo.css: div { color:...

Rails syntax error

Where is the error in this I can't see it: news = News.find(:all, :conditions => [":simulation_id => session[:sim_id] AND :created_at > session[:last_login]"]) ...

Where is the syntax error?

roles = Role.find_all_by_simulation_id(session[:sim_id]) forum_posts = Post.find(:all, :conditions => ["role_id = ? AND created_at > ?", roles.map(&:id), session[:last_login]]) Error: SQLite3::SQLException: near ",": syntax error: SELECT * FROM "posts" WHERE (role_id = 1,2,3,4 AND created_at > '2009-05-21 11:54:52') ...

C++ Programming Book Example on Stack

In this book, I am learning how the book writes a stack, but when I compile it, it reaches a compile error: #define DEFAULT_SIZE = 10 class Stack { private: int size; int top; int *value; public: Stack( int size = DEFAULT_SIZE ); virtual ~Stack(); bool isFull(); bool isEm...

Trying to create a Python Server

Hello, I am looking at trying to create a python server, which allows me to run root commands on a Centos Server remotely, I would also like the server to be able to respond with the result's of the command. I have found another question on here which has a basic python server, however it throws a error, the code is: #!/usr/bin/python...

Parse Error for a MySQL query in PHP

I got this error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/oznola38/public_html/code/classifieds.php on line 30 for this code: $qry = "INSERT INTO classified (name, address, city, state, zip, phone, fax, email, section, weeks, ad_text, link, display) VALUES ...

why does this code break out of loop ?

import math t=raw_input() k=[] a=0 for i in range(0,int(t)): s=raw_input() b=1 c=1 a=int(s) if a==0: continue else: d=math.atan(float(1)/b) + math.atan(float(1)/c) v=math.atan(float(1)/a) print v print d print float(v) print float(d) while(): ...

jdbc returns mySQL syntax error exception for a valid query

I user the java.sql.Statement.excecuteUpdate method to create a table and insert some values into the database through JDBC. However, it gives me MySQL syntax exceptions for no reason. I copied and pasted the same code into command prompt. it worked. I'm wondering why it's doing that?? ...