Search Results

Search found 6696 results on 268 pages for 'syntax highlighting'.

Page 26/268 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Error in SQL Syntax ERROR1064

    - by 01010011
    Hi, Everytime I try to create the following table in MySQL command line: CREATE TABLE book(book_id int NOT NULL AUTO_INCREMENT PRIMARY KEY, isbn char(20), title char(20), author_f_name char(20), author_l_name char(20), condition ENUM("as new","very good","good","fair","poor"), price decimal(8,2), genre char(20)); I keep getting this error message: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL version for the right syntax to use near 'condition ENUM("as new","very good","good","fair","poor"), price decimal(8,2), g' at line 6 I've tried using single quotes and double quotes for the ENUM options. Where did I go wrong?

    Read the article

  • syntax error in python:

    - by pecker
    Hello, I'm learning python. It gives syntax error in this script. I'm unable to figure out. import exceptions class FOUND(Exception): pass x = [1,2,3,4,56,73,29,35,12,32,63,12,76,75,89] while True: test = int(raw_input('Enter integer to be checked in list:')) try: count = -1 for y in x: count += 1 if y == test: raise FOUND except ValueError,e: print "Not a valid integer (%d)"%(e) except FOUND: print "Found (%d) at (%d)"%(test,count) else: print "Not found ,Appending (%d) to list at location (%d)"%(test,count+1) x.append(test) finally: print "The List:" print x print " " Invalid syntax & it highlights comma in this line: 'except ValueError,e:'

    Read the article

  • HAML-like syntax for non-HTML documents?

    - by Peter
    I love using HAML for HTML documents. It has clean syntax that's much more attractive than ERB. It works perfectly for HTML documents. What about for non-HTML? Such as, for example, an email or text document with certain automatically-substituted components? I've been falling back to ERB, but don't like the heavy syntax compared to HAML. Is there any way to use HAML for ordinary documents without having divs and html elements appear when % and . start a line? Or is there some alternative to both HAML and ERB that I should investigate?

    Read the article

  • SQLAlchemy declarative syntax with autoload in Pylons

    - by Juliusz Gonera
    I would like to use autoload to use an existings database. I know how to do it without declarative syntax (model/_init_.py): def init_model(engine): """Call me before using any of the tables or classes in the model""" t_events = Table('events', Base.metadata, schema='events', autoload=True, autoload_with=engine) orm.mapper(Event, t_events) Session.configure(bind=engine) class Event(object): pass This works fine, but I would like to use declarative syntax: class Event(Base): __tablename__ = 'events' __table_args__ = {'schema': 'events', 'autoload': True} Unfortunately, this way I get: sqlalchemy.exc.UnboundExecutionError: No engine is bound to this Table's MetaData. Pass an engine to the Table via autoload_with=<someengine>, or associate the MetaData with an engine via metadata.bind=<someengine> The problem here is that I don't know where to get the engine from (to use it in autoload_with) at the stage of importing the model (it's available in init_model()). I tried adding meta.Base.metadata.bind(engine) to environment.py but it doesn't work. Anyone has found some elegant solution?

    Read the article

  • C++: Templates for static functions?

    - by Rosarch
    I have a static Utils class. I want certain methods to be templated, but not the entire class. How do I do this? This fails: #pragma once #include <string> using std::string; class Utils { private: template<class InputIterator, class Predicate> static set<char> findAll_if_rec(InputIterator begin, InputIterator end, Predicate pred, set<char> result); public: static void PrintLine(const string& line, int tabLevel = 0); static string getTabs(int tabLevel); template<class InputIterator, class Predicate> static set<char> Utils::findAll_if(InputIterator begin, InputIterator end, Predicate pred); }; Error: utils.h(10): error C2143: syntax error : missing ';' before '<' utils.h(10): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int utils.h(10): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int utils.h(10): error C2238: unexpected token(s) preceding ';' utils.h(10): error C2988: unrecognizable template declaration/definition utils.h(10): error C2059: syntax error : '<' What am I doing wrong? What is the correct syntax for this? Incidentally, I'd like to templatize the return value, too. So instead of: template<class InputIterator, class Predicate> static set<char> findAll_if_rec(InputIterator begin, InputIterator end, Predicate pred, set<char> result); I'd have: template<class return_t, class InputIterator, class Predicate> static return_t findAll_if_rec(InputIterator begin, InputIterator end, Predicate pred, set<char> result); How would I specify that: 1) return_t must be a set of some sort 2) InputIterator must be an iterator 3) InputIterator's type must work with return_t's type. Thanks.

    Read the article

  • Flash error 1084: "Syntax error"

    - by Elliot Broomhall
    Hi I'm getting two error messages in Flash when using actionscropt 3.0 "Topbar,Layer 'Action Layer',Frame 1,line 12 1084: syntax error: expection semicolon before add. "Topbar,Layer 'Action Layer',Frame 1,line 12 1084: syntax error: expection rightbrace before semicolon Here is my code could anyone give some insight to what is actually happening thanks and help on rectifying the issue thanks. clip = Number(random(7)) + 1; while (Number(clip) <= 7) { clip = Number(clip) + 1; Scale = Number(random(80)) + 1; setProperty("/star", _x, Number(random(800)) + 10); setProperty("/star", _rotation, Number(random(330)) + 50); setProperty("/star", _xscale, Scale); setProperty("/star", _yscale, Scale); setProperty("/star", _y, Number(random(800)) + 50); n = Number(n) + 1; bn = "star" add n; duplicateMovieClip("star", bn, n); set(bn add ":n", n); } // end while clip = "0";

    Read the article

  • Where to put conditionals in ANSI-syntax SQL queries

    - by RenderIn
    What's the difference between these two queries? I've been resistant to jumping on the ANSI-syntax bandwagon because I have not been able to unravel various syntactical ambiguities. Is 1) returning the product of the join and only then filtering out those joined records which have weight = 500? And is 2) filtering out those prior to the join? Is 2 bad syntax? Why might I use that? 1: SELECT SOMETHING FROM FOO INNER JOIN BAR ON FOO.NAME = BAR.NAME WHERE BAR.WEIGHT < 500 2: SELECT SOMETHING FROM FOO INNER JOIN BAR ON FOO.NAME = BAR.NAME AND BAR.WEIGHT < 500

    Read the article

  • Syntax Error with MySQL 5.1 Server

    - by Mr.Z
    I am trying to connect to a server remotely using the command line client window. I am using MySQL 5.1 and I do not know why I am getting syntax error. If you can help me, that would be much appreciated. username as user password as pass hostname as example.com I have tried: mysql> -u user -h example.com -p ; mysql> -h example.com -u user -p ; I have looked at the reference manual and other verisons of remote connection with Server 5.1 but I can't see the syntax error.

    Read the article

  • SQLite subquery syntax/error/difference from MySQL

    - by Rudie
    I was under the impression this is valid SQLite syntax: SELECT *, (SELECT amount AS target FROM target_money WHERE start_year <= p.bill_year AND start_month <= p.bill_month ORDER BY start_year ASC, start_month ASC LIMIT 1) AS target FROM payments AS p; But I guess it's not, because SQLite returns this error: no such column: p.bill_year What's wrong with how I refer to p.bill_year? Yes, I am positive table payments hosts a column bill_year. Am I crazy or is this just valid SQL syntax? It would work in MySQL wouldn't it?? I don't have any other SQL present so I can't test others, but I thought SQLite was quite standardlike.

    Read the article

  • Oracle (Old?) Joins - A tool for conversion?

    - by Grasper
    I have been porting oracle selects, and I have been running across a lot of queries like so: SELECT e.last_name, d.department_name FROM employees e, departments d WHERE e.department_id(+) = d.department_id; ...and: SELECT last_name, d.department_id FROM employees e, departments d WHERE e.department_id = d.department_id(+); Are there any guides/tutorials for converting all of the variants of the (+) syntax? What is that syntax even called (so I can scour google)? Even better.. Is there a tool that will do this conversion for me? When was this standard phased out? Any info is appreciated.

    Read the article

  • Eclipse: Double semi-colon on an import

    - by smp7d
    Using Eclipse, if I have an extra semicolon on an import line (not the last import line), I see a syntax error in the IDE. However, this compiles fine outside of the IDE (Maven in this case). Example: import java.util.ArrayList;; //notice extra semicolon import java.util.List; Does anyone else see this behavior? Why is this showing as a syntax error? I am working with someone who keeps pushing these this to source control and it is irritating me (they clearly aren't using Eclipse). Full disclosure... I am using SpringSource Tool Suite 2.8.0.

    Read the article

  • #ifndef syntax for include guards in C++

    - by PhADDinTraining
    I'm currently studying for a CS course's final exam and I've run into a minor (maybe major?) issue regarding the syntax of C++ #ifndef. I've looked at the syntax for #infndef when using it as an #include guard, and most on the web seem to say: #ifndef HEADER_H #include "header.h" ... #endif But my class's tutorial slides show examples as: #ifndef __HEADER_H__ #include "header.h" ... #endif I was wondering what (if any) the difference was between the two. The exam will most likely ask me to write an #include guard, and I know conventional wisdom is to just go with what the prof / tutor says, but if there's a difference during compilation I'd like to know. Thanks all!

    Read the article

  • Correct syntax for matching a string inside a variable against an array

    - by Jamex
    Hi, I have a variable, $var, that contains a string of characters, this is a dynamic variable that contains the values from inputs. $var could be 'abc', or $var could be 'blu', I want to match the string inside variable against an array, and return all the matches. $array = array("blue", "red", "green"); What is the correct syntax for writing the code in php, my rough code is below $match = preg_grep($var, $array); (incorrect syntax of course) I tried to put quotes and escape slashes, but so far no luck. Any suggestion? TIA

    Read the article

  • Shell Scripting For loop Syntax Error

    - by NewShellScripter
    Hello, I am trying to make a simple shell script to ping a source but I am getting bash-2.03$ ./test.sh google.com 10 .5 /home/users/me 16 256 ./test.sh: line 35: syntax error near unexpected token `((' ./test.sh: line 35: `for (( i = 1 ; i <= $totalArguments ; i++ ))' This is the code: #!/bin/bash ip=$1 count=$2 interval=$3 outputDirectory=$4 shift; shift; shift; shift; totalArguments=$# for (( i = 1 ; i <= $totalArguments ; i++ )) do ping -c $count -i $interval -s ${!i} $ip >> $outputDirectory/${!i}results.txt done Can someone tell me what I am doing wrong with the for loop syntax? Thanks!

    Read the article

  • 42000 Syntax error in query when executing prepared statement

    - by Griff McGriff
    I have been pulling my hair out trying to swap my current script over to PDO. I have simplified the MySQL query for this example, but the error remains even with this version. $sql = 'SELECT * FROM :table WHERE lastUpdate > :appDate'; try{ $db = connect(); $stmt = $db->prepare($sql); $stmt->bindParam(':table', $table); $stmt->bindParam(':appDate', $appDate); foreach($tablesToCheck as $table){ $stmt->execute(); $resultset[] = $stmt->fetchAll(); } } catch(PDOException $e){ print 'Error!: '.$e->getMessage().'<br/>'; }//End try catch $stmt-errorInfo() returns: ( [0] => 42000 [1] => 1064 [2] => 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 ''GroupName' WHERE lastUpdate > NULL' at line 1 )

    Read the article

  • Shell script syntax error: unexpected end of line

    - by user1557674
    I wrote a simple shell script to check for the existence of a xml file and if it exists, then rename an old xml file to be backup and then move the new xml file to where the old xml file was stored. #!/bin/sh oldFile="/Documents/sampleFolder/sampleFile.xml" newFile="/Documents/sampleFile.xml" backupFileName="/Documents/sampleFolder/sampleFile2.backup" oldFileLocation="/Documents/sampleFolder" if [ -f "$newFile" ] ; then echo "File found" #Rename old file mv $oldFile $backupFileName #move new file to old file's location mv $newFile $oldFileLocation else echo "File not found, do nothing" fi However, every time I try to run the script, I get 4 command not found messages and a syntax error: unexpected end of file. Any suggestions on why I get these command not found errors or the unexpected end of file? I double checked that I closed all my double quotes, I have code highlight :) EDIT: output from running script: : command not found: : command not found: : command not found1: : command not found6: replaceXML.sh: line 26: syntax error: unexpected end of file

    Read the article

  • Can the template parameters of a constructor be explicitly specified?

    - by sth
    A constructor of a class can be a template function. At the point where such a constructor is called, the compiler usually looks at the arguments given to the constructor and determines the used template parameters from them. Is there also some syntax to specify the template parameters explicitly? A contrived example: struct A { template<typename T> A() {} }; Is there a way to instantiate this class? What is the syntax to explicitly specify the constructor's template parameters? My use case would be a problem were the compiler doesn't seem to find the correct templated constructor. Explicitly specifying the template parameters would probably generate more useful error messages or even resolve the problem.

    Read the article

  • SQL code editor with syntax highlighing, auto-formatting and code folding

    - by Victor Stanciu
    Hello, Is there any SQL editor that supports syntax highlighting, automatic code formatting and code folding? I found this, but it's an Eclipse plugin (I'm a NetBeans user), and cannot automatically format code, which is the most important feature I'm after. Autocompletion is not important, nor is the possibility of running the code (like the SQL editor in NetBeans). Edit: I'm sorry for not specifying, I'm looking for Linux or even web-based software.

    Read the article

  • iPhone text editor syntax highlight

    - by Jack
    Hi, As the title suggests, I am trying to add a text editor with syntax highlighting to a project. I have asked a similar question before and got pointed in the direction of either: a) a UITextView and NSAttributedStrings Or b) a web view Can anyone shed some light on using either of These methods or suggest an alternative? I have searched around for a few hours now and have found nothing. Jack

    Read the article

  • Unknown syntax error.

    - by matt1024
    Why do I get a syntax error running this code? If I remove the highlighted section (return cards[i]) I get the error highlighting the function call instead. Please help :) def dealcards(): for i in range(len(cards)): cards[i] = '' for j in range(8): cards[i] = cards[i].append(random.randint(0,9) return cards[i] print (dealcards())

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >