Search Results

Search found 11178 results on 448 pages for 'syntax checking'.

Page 29/448 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • 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

  • Syntax Highlighting in a ListBox

    - by ph0enix
    Hi all, I've searched the web and I can't seem to find anything that will work for me. I've seen plenty of discussion, and even some fairly extensible open-source tools, for code editors that provide line numbers and syntax highlighting. Here's my dilemma... I'm working on a "digital code review" project in C#.NET that allows users to specify source files, add them to a particular session, and other users can make comments and line references to the files being reviewed. Basic requirements: Must be written in C#.NET I don't need to be able to edit the text in the text box Users need to be able to select a line (or multiple lines), to make line references. It seems to me that I need some fancy implementation of a ListBox control (not a drop-down list) that has some OwnerDraw capabilities to add line numbers and syntax highlighting. Unfortunately, I haven't had any luck putting it together myself, and I can't seem to find a control that's already been written or a reference on how I might be able to accomplish this. Any suggestions??

    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

  • What is your favorite colorscheme FOR PROGRAMMING in Vim?

    - by ThomasGHenry
    I think this is a relevant question for programmers and I'd like to hear other people's answers because some syntax highlighting color schemes are better on the eyes than others. This can affect productivity as much as ergonomic keyboards or anything else on here. It's about comfort and productivity. So, I'm curious. Do you find some color schemes better adapted for some languages over others? At the other end of the spectrum, I think coding without syntax highlight is awful and slow going. Does anyone work better like this? Thanks! EDIT: so we'll try it as a community wiki. Similar Question

    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

  • Fast string suffix checking in C# (.NET 4.0)?

    - by ilitirit
    What is the fastest method of checking string suffixes in C#? I need to check each string in a large list (anywhere from 5000 to 100000 items) for a particular term. The term is guaranteed never to be embedded within the string. In other words, if the string contains the term, it will be at the end of the string. The string is also guaranteed to be longer than the suffix. Cultural information is not important. These are how different methods performed against 100000 strings (half of them have the suffix): 1. Substring Comparison - 13.60ms 2. String.Contains - 22.33ms 3. CompareInfo.IsSuffix - 24.60ms 4. String.EndsWith - 29.08ms 5. String.LastIndexOf - 30.68ms These are average times. [Edit] Forgot to mention that the strings also get put into separate lists, but this is not important. It does add to the running time though. On my system substring comparison (extracting the end of the string using the String.Substring method and comparing it to the suffix term) is consistently the fastest when tested against 100000 strings. The problem with using substring comparison though is that Garbage Collection can slow it down considerably (more than the other methods) because String.Substring creates new strings. The effect is not as bad in .NET 4.0 as it was in 3.5 and below, but it is still noticeable. In my tests, String.Substring performed consistently slower on sets of 12000-13000 strings. This will obviously differ between systems and implementations. [EDIT] Benchmark code: http://pastebin.com/smEtYNYN

    Read the article

  • use of assertions for type checking in php?

    - by user151841
    I do some checking of arguments in my classes in php using exception-throwing functions. I have functions that do a basic check ( ===, in_array etc ) and throw an exception on false. So I can do assertNumeric($argument, "\$argument is not numeric."); instead of if ( ! is_numeric($argument) ) { throw new Exception("\$argument is not numeric."); } Saves some typing I was reading in the comments of the php manual page on assert() that As noted on Wikipedia - "assertions are primarily a development tool, they are often disabled when a program is released to the public." and "Assertions should be used to document logically impossible situations and discover programming errors— if the 'impossible' occurs, then something fundamental is clearly wrong. This is distinct from error handling: most error conditions are possible, although some may be extremely unlikely to occur in practice. Using assertions as a general-purpose error handling mechanism is usually unwise: assertions do not allow for graceful recovery from errors, and an assertion failure will often halt the program's execution abruptly. Assertions also do not display a user-friendly error message." This means that the advice given by "gk at proliberty dot com" to force assertions to be enabled, even when they have been disabled manually, goes against best practices of only using them as a development tool So, am I 'doing it wrong'? What other/better ways of doing this are there?

    Read the article

  • Launch ClickOnce via URL but not checking for updates

    - by Jeff Kotula
    I have a ClickOnce app that is frequently launched from another application via a URL. The URL includes some command-line arguments that load data, etc. Since the frequency of launching the app is so high, I want to cut out the check for version updates. So I implemented my own checking through the ApplicationDeployment class to avoid it. It works fine if you launch from the Start Menu once the app is installed. However, we also want to preserve the launch via URL behavior because it is advantageous in so many ways. But when launching via URL, the update check is always performed -- it seems IE isn't smart enough to look for the app in the local download area to see if it is already installed or not... Does anyone know of a way to get the "don't check for updates automatically" behavior while still using the URL launch mechanism? Actually, it looks like the issue is a Catch-22 in the ClickOnce model. If you launch with a URL, IE will always touch base with the host and check the version, updating if necessary, regardless of whether or not the app is flagged as "Don't check version". However, if you launch from the Start Menu, ClickOnce disables command-line arguments. Has anyone found any way around this, or know of a MS plan to fix it?

    Read the article

  • Checking for valid email addresses

    - by Roland
    I'm running a website with more than 60 000 registered users. Every week notifications are send to these users via email, now I've noticed some of the mail addresses do not exists anymore eg. the domain address is valid but the email name en asdas@ is not valid anymore since person does not work at a company anymore etc. Now I'm looping through the database and doing some regular expression checks and checking if the MX records exist with the following two functions function verify_email($email){ if(!preg_match('/^[_A-z0-9-]+((\.|\+)[_A-z0-9-]+)*@[A-z0-9-]+(\.[A-z0-9-]+)*(\.[A-z]{2,4})$/',$email)){ return false; } else { return true; } } // Our function to verify the MX records function verify_email_dns($email){ list($name, $domain) = split('@',$email); if(!checkdnsrr($domain,'MX')){ return false; } else { return true; } } If the email address is in an invalid format or the domain does not exists I delete the users account. Are there any methods I could use to check if the email address still exists or not if the domain name is valid and the email address is in the correct format? For example [email protected] does not exist anymore but test.com is a valid domain name.

    Read the article

  • help with mysql triggers (checking values before insert)

    - by user332817
    hi I'm quite new to mysql and I'm trying to figure out how to use triggers. what I'm trying to do: I have 2 tables, max and sub_max, when I insert a new row to sub_max I want to check if the SUM of the values with the same foreign_key as the new row are less than the value in the max table. I think this sounds confusing so here are my tables: CREATE TABLE max( number INT , MaxAmount integer NOT NULL) CREATE TABLE sub_max( sub_number INT , sub_MaxAmount integer NOT NULL, number INT, FOREIGN KEY ( number ) REFERENCES max( number )) and here is my code for the trigger, I know the syntax is off but this is the best I could do from looking up tutorials. CREATE TRIGGER maxallowed after insert on submax FOR EACH ROW BEGIN DECLARE submax integer; DECLARE maxmax integer; submax = select sum(sub_MaxAmount) from sub_max where sub_number = new.sub_number; submax = submax + new. sub_MaxAmount; maxmax = select MaxAmount from max where number = new.number ; if max>maxmax rollback? END I wanted to know if I'm doing this remotely correctly. Thanks in advance.

    Read the article

  • Checking multiple conditions in Ruby (within Rails, which may not matter)

    - by Ev
    Hello rubyists and railers, I have a method which checks over a params hash to make sure that it contains certain keys, and to make sure that certain values are set within a certain range. This is for an action that responds to a POST query by an iPhone app. Anyway, this method is checking for about 10 different conditions - any of which will result in an HTTP error being returned (I'm still considering this, but possibly a 400: bad request error). My current syntax is basically this (paraphrased): def invalid_submission_params?(params) [check one] or [check two] or [check three] or [check four] etc etc end Where each of the check statements returns true if that particular parameter check results in an invalid parameter set. I call it as a before filter with params[:submission] as the argument. This seems a little ugly (all the strung together or statements). Is there a better way? I have tried using case but can't see a way to make it more elegant. Or, perhaps, is there a rails method that lets me check the incoming params hash for certain conditions before handing control off to my action method?

    Read the article

  • Checking if Date is within Range

    - by Brett Powell
    So I am using a scripting language with c++ syntax, and trying to think of the best way to check if a date is within range. The problem I am running into is that if the current day is in a new month, the check is failing. Here is what my code looks like... if(iMonth >= iStartMonth && iMonth <= iEndMonth) { if(iDay >= iStartDay && iDay <= iEndDay) { if(iYear >= iStartYear && iYear <= iEndYear) { bEnabled = true; return; When I have something like this... (Pulled in from cfg file specified by client) Start date: 3 27 2010 End Date: 4 15 2010 Current Date: 3 31 2010 The day check fails because if(iDay <= iEndDay) does not pass. The scripting language doesn't have a lot of time related functions, and I cant compare timestamps because im allowing users to put like "03:27:2010" and "04:15:2010" as start/end dates in a config file. Im assuming I am just not thinking straight and missing an easy fix.

    Read the article

< Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >