Search Results

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

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

  • EXEC() syntax error using ODBC

    - by Mike Trader
    I have written a little ETL application that I wish to run a few lines of TSQL from. If i enter a simple query like "SELECT * FROM MyTable" everything is fine. All single line commands run as expected. A multiline query like this is also fine: DECLARE @TableName NVARCHAR(MAX) set @TableName = 'MyTable' EXECute ( 'DROP TABLE '+ @TableName ) Howevery when I try and run: DECLARE @TableName NVARCHAR(MAX) OPEN Tables FETCH NEXT FROM Tables INTO @TableName WHILE @@FETCH_STATUS = 0 BEGIN EXEC( 'DROP TABLE ' + @TableName ) FETCH NEXT FROM Tables INTO @TableName END I get a syntax error after TABLE in the EXEC() call. I have spent 6 hours trying to figure this out thinking perhaps I need to escape the single quote or something. I just cannot see the problem. A set of fresh eyes would be appreciated.

    Read the article

  • emacs does not open a file from argument and syntax highlight does not work

    - by Jus
    In my latest ubuntu box, When I type for example emacs ~/.bashrc, Emacs will start but not open .bashrc. This is true for any file I pass in. I've used Emacs for several years, and have never experienced this problem before. I added (global-font-lock-mode 1);; to my .emacs file, and Emacs does recognize it, for example. "(C++/; Abbrev)", but it won't do syntax highlighting. If you can solve any of these problems, it will be very appreciated. The following is my machine's configuration: uname -a Linux 2.6.35-28-generic-pae #49-Ubuntu SMP Tue Mar 1 14:58:06 UTC 2011 i686 GNU/Linux ~/.emacs (global-font-lock-mode 1);;

    Read the article

  • RewriteMap syntax Regex

    - by ienabellamy
    in my .htaccess i've tons of directives, with same syntax: RewriteRule ^(.*)/PRODUCT_1.aspx http://www.site.com/product.php?id_product=2891 RewriteRule ^(.*)/PRODUCT_2.aspx http://www.site.com/product.php?id_product=2896 and everything works. Now, i created a RewriteMap in my because i need to increase velocity (20.000 redirect 301 in htaccess no good), so: RewriteEngine On RewriteMap redirects dbm=db:/var/www/html/presta152/prestashop/redirects.db RewriteCond ${redirects:$1} !="" RewriteRule ^(.*)$ ${redirects:$1} [redirect=permanent,last] and my redirects.db is created by redirects.txt, that contains: /PRODUCT_1.aspx http://www.site.com/product.php?id_product=2891 /PRODUCT_2.aspx http://www.site.com/product.php?id_product=2896 this works if i try to call for example: www.site.com/PRODUCT_1.aspx i'm redirected... but if i try to call www.site.com/everythingpossibileinside/PRODUCT_1.aspx the redirect doesn't work. So, in my .htaccess this rule: RewriteRule ^(.*)/PRODUCT_1.aspx http://www.site.com/product.php?id_product=2891 works, but in my RewriteMap no. I think i must change this directive: RewriteRule ^(.*)$ ${redirects:$1} [redirect=permanent,last] i tried, but unsuccessful. Thanks to all.

    Read the article

  • Server 2008R2 Server Manager Roles and Features won't refresh or allow addition of new roles or features

    - by MattChorba
    I have a standalone DC in an isolated lab. I have installed the SUR tool and found no errors. I ran SFC and found no errors. I have attempted to install Windows Backup feature using Powershell, but received the same error about the computer needing to be restarted. Powershell cmdlets will list all of the installed roles and features. The rest of Server Manager works without problems. What can I do to get Server Manager Roles and Features working properly again? Picture of Error: CheckSUR.log: ================================= Checking System Update Readiness. Binary Version 6.1.7601.21645 Package Version 13.0 2011-11-28 13:20 Checking Windows Servicing Packages Checking Package Manifests and Catalogs Checking Package Watchlist Checking Component Watchlist Checking Packages Checking Component Store Summary: Seconds executed: 413 No errors detected (w) Unable to get system disk properties 0x0000045D IOCTL_STORAGE_QUERY_PROPERTY Disk Cache CheckSUR.persist.log: ================================= Checking System Update Readiness. Binary Version 6.1.7601.21645 Package Version 13.0 2011-11-28 13:20 Checking Windows Servicing Packages Checking Package Manifests and Catalogs Checking Package Watchlist Checking Component Watchlist Checking Packages Checking Component Store Summary: Seconds executed: 413 No errors detected (w) Unable to get system disk properties 0x0000045D IOCTL_STORAGE_QUERY_PROPERTY Disk Cache

    Read the article

  • Checking ActiveRecord Associations in RSpec.

    - by alokswain
    I am learning how to write test cases using Rspec. I have a simple Post Comments Scaffold where a Post can have many Comments. I am testing this using Rspec. How should i go about checking for Post :has_many :comments. Should I stub Post.comments method and then check this with by returning a mock object of array of comment objects? Is testing for AR associations really required ?

    Read the article

  • Checking OpenGL resource leaks

    - by kamziro
    So I have a rather large openGL program going, and checking for normal memory leaks (those by new and delete) is rather trivial -- just run it on valgrind. But what is the best way to check for potential opengl leaks? Is there an opengl utility that'll tell you how many resources (e.g framebuffers) are being used at the time, or such? Or is the only way to attach a counter to every glGenBlah and glDeleteBlah pairs?

    Read the article

  • Checking if app can run without admin rights?

    - by overtherainbow
    Hello To get Windows users to log on as regular users instead of admin, I need to check that all their applications run OK with limited rights. Is there an application specifically aimed at checking that an application can run with limited rights, or is SysInternals' Process Monitor what everyone uses for this purpose? Thank you.

    Read the article

  • checking google pagerank api

    - by Bharanikumar
    Hi , I am doing the small application for link exchange, so before i approve the URL , i want to check his/her site page rank, I know , there some site tell the Google page rank position , But am looking some API , for page rank checking... Thanks Bharanikumar

    Read the article

  • Checking method visibility in PHP

    - by phobia
    Is there any way of checking if a class method has been declared as private or public? I'm working on a controller where the url is mapped to methods in the class, and I only want to trigger the methods if they are defined as public.

    Read the article

  • null checking edit textbox android

    - by sara brown
    i want to make empty textbox checking for android. i tried try catch but it was force to close. below is my codes try{ name = (EditText)findViewById(R.id.name); }catch(NullPointerException ex){ new AlertDialog.Builder(KawalanAppXTVT.this).setTitle("Error" ) .setMessage("That's not a number") .setPositiveButton("OK", null).show(); can someone help me?

    Read the article

  • Checking array of censored words against user submitted content

    - by steve-o
    Hello, I have set up an array of censored words and I want to check that a user submitted comment doesn't contain any of these words. What is the most efficient way of doing this? All I've come up with so far is splitting the string into an array of words and checking it against the array of censored words, but I've a feeling there's a neater way of doing this.

    Read the article

  • Java checking connection via socket continuously

    - by Onca
    I'm developing a multiclient-server program with Java based on GUI and database. The demand regarding the program from the client side is to make sure all the time that there is a connection to the server, and if the connection is lost (server goes down/problem with socket or stream) it should be notified. In other words I need a solution for continuously checking the connection to the server. What is the best way to do that ?

    Read the article

  • How can I improve my error checking and handling?

    - by Google
    Lately I have been struggling to understand what the right amount of checking is and what the proper methods are. I have a few questions regarding this: What is the proper way to check for errors (bad input, bad states, etc)? Is it better to explicitly check for errors, or use functions like asserts which can be optimized out of your final code? I feel like explicitly checking clutters a program with a lot of extra code which shouldn't be executed in most situations anyway-- and not to mention most errors end up with an abort/exit failure. Why clutter a function with explicit checks just to abort? I have looked for asserts versus explicit checking of errors and found little to truly explain when to do either. Most say 'use asserts to check for logic errors and use explicit checks to check for other failures.' This doesn't seem to get us very far though. Would we say this is feasible: Malloc returning null, check explictly API user inserting odd input for functions, use asserts Would this make me any better at error checking? What else can I do? I really want to improve and write better, 'professional' code.

    Read the article

  • Ideas on C# DSL syntax

    - by Dmitriy Nagirnyak
    Hi, I am thinking about implementing a templating engine using only the plain C#/.NET 4 syntax with the benefit of static typing. Then on top of that templating language we could create Domain Specific Languages (let's say HTML4, XHTML, HTML5, RSS, Atom, Multipart Emails and so on). One of the best DSLs in .NET 4 (if not only one) is SharpDOM. It implements HTML-specific DSL. Looking at SharpDOM, I am really impressed of what you can do using .NET (4). So I believe there are some not-so-well-known ways for implementing custom DSLs in .NET 4. Possibly not as well as in Ruby, but still. So my the question would be: what are the C# (4) specific syntax features that can be used for implementing custom DSLs? Examples I can think of right now: // HTML - doesn't look tooo readable :) div(clas: "head", ul(clas: "menu", id: "main-menu", () => { foreach(var item in allItems) { li(item.Name) } }) // See how much noise it has with all the closing brackets? ) // Plain text (Email or something) - probably too simple Line("Dear {0}", user.Name); Line("You have been kicked off from this site"); For me it is really hard to come up with the syntax with least amount of noise. Please NOTE that I am not talking about another language (Boo, IronRuby etc), neither I am not talking about different templating engines (NHaml, Spark, StringTemplate etc). Thanks, Dmitriy.

    Read the article

  • Composite key syntax in Boost MultiIndex

    - by Sarah
    Even after studying the examples, I'm having trouble figuring out how to extract ranges using a composite key on a MultiIndex container. typedef multi_index_container< boost::shared_ptr< Host >, indexed_by< hashed_unique< const_mem_fun<Host,int,&Host::getID> >, // ID index ordered_non_unique< const_mem_fun<Host,int,&Host::getAgeInY> >, // Age index ordered_non_unique< const_mem_fun<Host,int,&Host::getHousehold> >, // Household index ordered_non_unique< // Age & eligibility status index composite_key< Host, const_mem_fun<Host,int,&Host::getAgeInY>, const_mem_fun<Host,bool,&Host::isPaired> > > > // end indexed_by > HostContainer; My goal is to get an iterator pointing to the first of the subset of elements in HostContainer hmap that has age partnerAge and returns false to Host::isPaired(): std::pair< hmap::iterator,hmap::iterator > pit = hmap.equal_range(boost::make_tuple( partnerAge, false ) ); I think this is very wrong. How/Where do I specify the iterator index (which should be 3 for age & eligibility)? I will include other composite keys in the future. What exactly are the two iterators in std::pair? (I'm copying syntax from an example that I don't understand.) I would ideally use std::count to calculate the number of elements of age partnerAge that are eligible (return false to Host::isPaired()). What is the syntax for extracting the sorted index that meets these requirements? I'm obviously still learning C++ syntax. Thanks in advance for any help.

    Read the article

  • Microsoft C Compiler: Inline variable declaration?

    - by Rosarch
    I'm writing C in Visual Studio 2010. The compiler doesn't seem to want to let me use inline variable declarations. The following code produces an error: unsigned int fibonacci_iterative(unsigned int n) { if (n == 0) { return 0; } if (n == 1) { return 1; } unsigned int prev_prev = 0; // error unsigned int prev = 1; // error unsigned int next = 0; // error for (int term_number = 0; term_number < n; term_number++) { unsigned int temp = prev_prev + prev; prev = next; prev_prev = prev; next = temp; } return next; } Error: error C2143: syntax error : missing ';' before 'type' error C2143: syntax error : missing ';' before 'type' error C2143: syntax error : missing ';' before 'type' Why is this happening? Is there a setting to make the compiler not so strict?

    Read the article

  • Syntax Error in MySql StoredProc

    - by karthik
    I am using the below stored proc in mysql to generate the insert statements. I am getting the following error : Script line: 4 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 '\’”\’,',’ifnull(‘,column_name,’,””)’,',\’”\’)')) INTO @S' at line 12 What would be the syntax problem in that ? DELIMITER $$ DROP PROCEDURE IF EXISTS `InsGen` $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `InsGen`(in_db varchar(20),in_table varchar(20),in_file varchar(100)) BEGIN declare Whrs varchar(500); declare Sels varchar(500); declare Inserts varchar(2000); declare tablename varchar(20); set tablename=in_table; select tablename; # Comma separated column names – used for Select select group_concat(concat(‘concat(\’”\’,',’ifnull(‘,column_name,’,””)’,',\’”\’)')) INTO @Sels from information_schema.columns where table_schema=’test’ and table_name=tablename; # Comma separated column names – used for Group By select group_concat(‘`’,column_name,’`') INTO @Whrs from information_schema.columns where table_schema=’test’ and table_name=tablename; #Main Select Statement for fetching comma separated table values set @Inserts=concat(“select concat(‘insert into “, in_db,”.”,tablename,” values(‘,concat_ws(‘,’,”,@Sels,”),’);’) from “, in_db,”.”,tablename,” group by “,@Whrs, ” INTO OUTFILE ‘”, in_file ,”‘”); PREPARE Inserts FROM @Inserts; EXECUTE Inserts; END $$ DELIMITER ;

    Read the article

  • C#/.NET library for source code formatting, like the one used by Stack Overflow?

    - by Lasse V. Karlsen
    I am writing a command line tool to convert Markdown text to html output, which seems easy enough. However, I am wondering how to get nice syntax coloring for embedded code blocks, like the one used by Stack Overflow. Does anyone know either: What library StackOverflow is using or if there's a library out there that I can easily reuse? Basically it would need to have some of the same "intelligence" found in the one that Stack Overflow uses, by basically doing a best-attempt at figuring out the language in use to pick the right keywords. Basically, what I want is for my own program to handle a block like the following: if (a == 0) return true; if (a == 1) return false; // fall-back Markdown Sharp, the library I'm using, by default outputs the above as a simple pre/code html block, with no syntax coloring. I'd like the same type of handling as the formatting on Stack Overflow does, the above contains blue "return" keywords for example. Or, hmm, after checking the source of this Stack Overflow page after adding the code example, I notice that it too is formatted like a simple pre/code block. Is it pure javascript-magic at works here, so perhaps there's no such library? If there's no library that will automagically determine a possible language by the keywords used, is there one that would work if I explicitly told it the language? Since this is "my" markdown-commandline-tool, I can easily add syntax if I need to.

    Read the article

  • Syntax error results in blank page

    - by Philipp
    I am new to wicket and trying to get some things working. One thing that annoys me a lot is that I get a blank (0 chars of text) page whenever there is a syntax error on a page. Striped down example: Test.html header stuff: doctype ... html ... head ... body ... <span wicket:id="msgTest" id="message">MSG</span> footer stuff: /body ... /html Test.java public class Test extends WebPage { public Test() { add(new Label("msgTest", "Hello, World!")); } } This will output the page as expected. Now, lets introduce an error: header stuff: doctype ... html ... head ... body ... <span wicket:id="msgTest2" id="message">MSG</span> footer stuff: /body ... /html I changed the label-id to something different then what the source-file expects. If I run this code I get the already mentioned blank page. However, for every request to a page with such a syntax error I get an error report in the log-file of around 1000+ lines. This error-report is basically just wicket-generated html of a page which describes the error. This makes me wonder why wicket isn't displaying the error-stuff instead of the blank page. I'm not very experienced with wicket but to me it somehow looks like wicket is having trouble rendering its own error-page code. It would be nice to know how one goes about finding syntax-errors with wicket. Reading through a 1000+ line error-report for a small error like a misplaced character seems a bit tedious. Thanks in advance for guiding me into the right direction :) PS: wicket-version: 1.4.9 stage: development

    Read the article

  • Cryptic Erlang Errors

    - by Jim
    Okay so I started learning erlang recently but am baffled by the errors it keeps returning. I made a bunch of changes but I keep getting errors. The syntax is correct as far as I can tell but clearly I'm doing something wrong. Have a look... -module(pidprint). -export([start/0]). dostuff([]) - receive begin - io:format("~p~n", [This is a Success]) end. sender([N]) - N ! begin, io:format("~p~n", [N]). start() - StuffPid = spawn(pidprint, dostuff, []), spawn(pidprint, sender, [StuffPid]). Basically I want to compile the script, call start, spawn the "dostuff" process, pass its process identifier to the "sender" process, which then prints it out. Finally I want to send a the atom "begin" to the "dostuff" process using the process identifier initially passed into sender when I spawned it. The errors I keep getting occur when I try to use c() to compile the script. Here they are.. ./pidprint.erl:6: syntax error before: '-' ./pidprint.erl:11: syntax error before: ',' What am I doing wrong?

    Read the article

  • jQuery form zip code to state function

    - by Dakota R.
    I'm trying to convert a preexisting javascript function into a jQuery function. The function comes from http://javascript.internet.com/forms/zip-to-state.html and aims to convert a user-entered zip code into a state. I'm using jQuery 1.3.2, with all the necessary plugins, but I'm not very familiar with jQuery syntax and how to convert this from plain ol' Javascript syntax. The setState function takes two parameters, the zip code element and the state element, so I'm trying to do something like this: $('$zip_code').change( function () { setState($(this), $('#state')); }); Any thoughts on this syntax? Thanks, Dakota function getState(zip) { if ((parseInt(zipString.substr(zip / 4, 1), 16) & Math.pow(2, zip % 4)) && (zip.length == 5)) for (var i = 0; i < stateRange.length; i += 7) if (zip <= 1 * stateRange.substr(i, 5)) return stateRange.substr(i + 5, 2); return null; } function setState(txtZip, optionBox) { if (txtZip.value.length != 5 || isNaN(txtZip.value / 4)) { optionBox.options[0].selected = true; alert("Please enter a 5 digit, numeric zip code."); return; } var state = getState(txtZip.value); for (var i = 0; i < optionBox.options.length; i++) if (optionBox.options[i].value == state) return optionBox.options[i].selected = true; for (var i = 0; i < optionBox.options.length; i++) if (optionBox.options[i].value == "XX") return optionBox.options[i].selected = true; }

    Read the article

  • Python Interactive Interpreter always returns "Invalid syntax" on Windows

    - by user559217
    I've encountered an extremely confusing problem. Whatever I type into the Python interpreter returns "Invalid Syntax". See examples below. I've tried fooling around with the code page of the prompt I run the interpreter from, but it doesn't seem to help at all. Furthermore, I haven't been able to find this particular, weird bug elsewhere online. Any assistance anyone could provide would be lovely. I've already tried reinstalling Python, but I didn't have any luck - the problem is also there in both 3.13 and 2.7. Running: Python version 3.1.3, Windows XP SP3. Getting: C:\Program Files\Python31>.\python Python 3.1.3 (r313:86834, Nov 27 2010, 18:30:53) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> 2+2 File "<stdin>", line 1 2+2 ^ SyntaxError: invalid syntax >>> x = "Oh, fiddlesticks." File "<stdin>", line 1 x = "Oh, fiddlesticks." ^ SyntaxError: invalid syntax

    Read the article

  • OCaml delimiters and scopes

    - by Jack
    Hello! I'm learning OCaml and although I have years of experience with imperative programming languages (C, C++, Java) I'm getting some problems with delimiters between declarations or expressions in OCaml syntax. Basically I understood that I have to use ; to concatenate expressions and the value returned by the sequence will be the one of last expression used, so for example if I have exp1; exp2; exp3 it will be considered as an expression that returns the value of exp3. Starting from this I could use let t = something in exp1; exp2; exp3 and it should be ok, right? When am I supposed to use the double semicol ;;? What does it exactly mean? Are there other delimiters that I must use to avoid syntax errors? I'll give you an example: let rec satisfy dtmc state pformula = match (state, pformula) with (state, `Next sformula) -> let s = satisfy_each dtmc sformula and adder a state = let p = 0.; for i = 0 to dtmc.matrix.rows do p <- p +. get dtmc.matrix i state.index done; a +. p in List.fold_left adder 0. s | _ -> [] It gives me syntax error on | but I don't get why.. what am I missing? This is a problem that occurs often and I have to try many different solutions until it suddently works :/ A side question: declaring with let instead that let .. in will define a var binding that lasts whenever after it has been defined? What I basically ask is: what are the delimiters I have to use and when I have to use them. In addition are there differences I should consider while using the interpreter ocaml instead that the compiler ocamlc? Thanks in advance!

    Read the article

  • syntax for MySQL INSERT with an array of columns

    - by Mike_Laird
    I'm new to PHP and MySQL query construction. I have a processor for a large form. A few fields are required, most fields are user optional. In my case, the HTML ids and the MySQL column names are identical. I've found tutorials about using arrays to convert $_POST into the fields and values for INSERT INTO, but I can't get them working - after many hours. I've stepped back to make a very simple INSERT using arrays and variables, but I'm still stumped. The following line works and INSERTs 5 items into a database with over 100 columns. The first 4 items are strings, the 5th item, monthlyRental is an integer. $query = "INSERT INTO `$table` (country, stateProvince, city3, city3Geocode, monthlyRental) VALUES ( '$country', '$stateProvince', '$city3', '$city3Geocode', '$monthlyRental')"; When I make an array for the fields and use it, as follows: $colsx = array('country,', 'stateProvince,', 'city3,', 'city3Geocode,', 'monthlyRental'); $query = "INSERT INTO `$table` ('$colsx') VALUES ( '$country', '$stateProvince', '$city3', '$city3Geocode', '$monthlyRental')"; I get a MySQL error - check the manual that corresponds to your MySQL server version for the right syntax to use near ''Array') VALUES ( 'US', 'New York', 'Fairport, Monroe County, New York', '(43.09)' at line 1. I get this error whether the array items have commas inside the single quotes or not. I've done a lot of reading and tried many combinations and I can't get it. I want to see the proper syntax on a small scale before I go back to foreach expressions to process $_POST and both the fields and values are arrays. And yes, I know I should use mysql_real_escape_string, but that is an easy later step in the foreach. Lastly, some clues about the syntax for an array of values would be helpful, particularly if it is different from the fields array. I know I need to add a null as the first array item to trigger the MySQL autoincrement id. What else? I'm pretty new, so please be specific.

    Read the article

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