Search Results

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

Page 201/448 | < Previous Page | 197 198 199 200 201 202 203 204 205 206 207 208  | Next Page >

  • C: Convert A ? B : C into if (A) B else C

    - by tur1ng
    I was looking for a tool that can convert C code expressions for the form: a = (A) ? B : C; into the 'default' syntax with if/else statements: if (A) a = B else a = C Does someone know a tool that's capable to do such a transformation? I work with GCC 4.4.2 and create a preprocessed file with -E but do not want such structures in it.

    Read the article

  • Find and replace date within a file

    - by user1629011
    My apologies if my title is not descriptive enough, I believe the following will be. I have 3 files which are just plain text, within each file, is a date Date: 2012-08-31 for example I would like to get a command/script to find this and update to the current date, but the date will be ever changing and may not be known going in (without viewing the contents of the file Knowing what the date is, its simple enough with sed, but how can I do this knowing the syntax of the line I want to modify, but not the specific values. ("Date: " at least is unchanging)

    Read the article

  • Applescript: cleaning a string

    - by Mike
    I have this string that has illegal chars that I want to remove but I don't know what kind of chars may be present. I built a list of chars that I want not to be filtered and I built this script (from another one I found on the web). on clean_string(TheString) --Store the current TIDs. To be polite to other scripts. set previousDelimiter to AppleScript's text item delimiters set potentialName to TheString set legalName to {} set legalCharacters to {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "?", "+", "-", "Ç", "ç", "á", "Á", "é", "É", "í", "Í", "ó", "Ó", "ú", "Ú", "â", "Â", "ã", "Ã", "ñ", "Ñ", "õ", "Õ", "à", "À", "è", "È", "ü", "Ü", "ö", "Ö", "!", "$", "%", "/", "(", ")", "&", "€", "#", "@", "=", "*", "+", "-", ",", ".", "–", "_", " ", ":", ";", ASCII character 10, ASCII character 13} --Whatever you want to eliminate. --Now iterate through the characters checking them. repeat with thisCharacter in the characters of potentialName set thisCharacter to thisCharacter as text if thisCharacter is in legalCharacters then set the end of legalName to thisCharacter log (legalName as string) end if end repeat --Make sure that you set the TIDs before making the --list of characters into a string. set AppleScript's text item delimiters to "" --Check the name's length. if length of legalName is greater than 32 then set legalName to items 1 thru 32 of legalName as text else set legalName to legalName as text end if --Restore the current TIDs. To be polite to other scripts. set AppleScript's text item delimiters to previousDelimiter return legalName end clean_string The problem is that this script is slow as hell and gives me timeout. What I am doing is checking character by character and comparing against the legalCharacters list. If the character is there, it is fine. If not, ignore. Is there a fast way to do that? something like "look at every char of TheString and remove those that are not on legalCharacters" ? thanks for any help.

    Read the article

  • If you use XML Serialization how do you validate data?

    - by chobo2
    Hi I am planning to try to use XML Serialization in C# but I am wondering if I get a .xml file how do I check if the xml file confirms to the right type? Like usually you would make a schema that you can validate against to make sure if it confirms to the right format. Can you hook a schema up to to XML Serialization or does it do this checking automatically? Thanks

    Read the article

  • How do I use a file grep comparison inside a bash if/else statement?

    - by openid_kenja
    When our server comes up we need to check a file to see how the server is configured. We want to search for the following string inside our /etc/aws/hosts.conf file: MYSQL_ROLE=master Then, we want to test whether that string exists and use an if/else statement to run one of two options depending on whether the string exists or not. What is the BASH syntax for the if statement? if [ ????? ]; then #do one thing else #do another thing fi

    Read the article

  • The table '#sql-5f8_9c' is full

    - by gansodesoya
    hello, im trying to delete a foreign key with the following syntax (5.0.45-community-nt): alter table [table] drop foreign key [fk_name] but I'm getting the folling error: The table '#sql-5f8_9c' is full – 99543 ms any ideas? thanks!

    Read the article

  • Enums in java compile error

    - by London
    Hi, I'm trying to learn java from bottom up, and I got this great book to read http://www.amazon.com/o/ASIN/0071591060/ca0cc-20 . Now I found example in the book about declaring Enums inside a class but outside any methods so I gave it a shot : Enum CoffeeSize { BIG, HUGE, OVERWHELMING }; In the book its spelled enum and I get this compile message Syntax error, insert ";" to complete BlockStatements Are the Enums that important at all?I mean should I skip it or its possible that I will be using those some day?

    Read the article

  • $_POST vs. $_SERVER['REQUEST_METHOD'] == 'POST'

    - by Scott
    Some guy called one of my Snipplr submissions "crap" because I used if ($_SERVER['REQUEST_METHOD'] == 'POST') instead of if ($_POST) Checking the request method seems more correct to me because that's what I really want to do. Is there some operational difference between the two or is this just a code clarity issue?

    Read the article

  • [VS2008] - Run Add-in from PrebuildEvent

    - by JBL
    I'm writing an VS 2008 add-in to synchronize Setup project Version with startup project assembly version. It works fine. But I was wondering if it was possible to call add-in from the Prebuild Event of my setup project. It works fine by command line window, but I didn't find any syntax to make it work in prebuildEvent. Is Someone has an idea ? Thanks

    Read the article

  • How do i use the top keyword in an insert statement?

    - by acidzombie24
    I was using it as LIMIT when i got the exception Incorrect syntax near the keyword 'TOP'. Maybe i can omit it in this case without problem? but if i couldnt where do i put top? INSERT INTO [user_data] (...) SELECT ... @14 WHERE not exists (SELECT * FROM [user_data] WHERE [email] = @15 OR [name] = @16 OR [unconfirmed_email] = @17 TOP 1);

    Read the article

  • Created query is not supported by my DB

    - by stacker
    I created an application using seam-gen. The created operation to search the DB ends with and exception (syntax error). The query has a where clause like this: lower(barcode0_.barcode_ean) like lower((?||'%')) limit ? Does hibnerate or seam create the where clause which my DB can't understand? Or is there a workaround for SQL statement related issues in seam?

    Read the article

  • Autohotkey to map F5 to Shift+Home and then F5 - eventually executing a single line query in sql server?

    - by puretechy
    Reading the syntax from autohotkey, I am trying to achieve this. But the first step of selecting the entire line is not working:- F5:: send {Shift Home} return I have tried few others too, but its not working. This is not sending Shift+Home combination on pressing F5 key. Please tell me what's wrong with this? Also if possible, what to do next?, as if I will write send {F5} I believe, it will recursively fire this script again and again..

    Read the article

  • Deprecate in Java 1.6

    - by iano
    In Java 1.5, to deprecate a method you would: @Deprecated int foo(int bar) { } Compiling this in Java 1.6 results in the following: Syntax error, annotations are only available if source level is 1.5 Any ideas?

    Read the article

  • Store html into MYSql database

    - by jouzef19
    hello I'm try to store String (that contain html ) to mysql database by using Longtext data type. but its always says "You have an error in your SQL syntax". (note : i tried to store normal text , and its work)

    Read the article

  • spliting the string

    - by prince23
    hi, i have an string like this string strdate =@"5/2/2006"; which is in a form of month/day/year i need to display it in a form of like this 02-05-2006 how do i format the data like this if the value is like this 12/28/2005 it should be displayed like this 28-12-2010 i know we should be splitting the data based on that we should do it. i am not getting the syntax how to do it . any help would be great

    Read the article

  • Rails - Always have to check exists, and then value?

    - by Jason B
    I am checking to see if a value in a related table exists quite often in my view, in this case, expenses have approvals. If they have not been submitted, then there is no record of them in the approvals table. I am ending up with some really awkward code <% if !expense_item.expense_approval || expense_item.expense_approval.approval_status == 0 %> Is there a way to do an if statement on a value, without having to check if it exists first? Or some default way to set it nil?

    Read the article

  • Default value for bool in c++

    - by greenguy1090
    I'm redesigning a class constructor in C++ and need it to catch an unspecified bool. I have used default values for all of the other parameters, but from my understanding bool can only be initialized to true or false. Since both of those cases have meaning in the class, how should I handle checking for change from a default value?

    Read the article

  • Why subtract a value from itself (x - x) in Python?

    - by endolith
    In NumPy functions, there are often initial lines that do checking of variable types, forcing them to be certain types, etc. Can someone explain the point of these lines? What does subtracting a value from itself do? t,w = asarray(t), asarray(duty) w = asarray(w + (t-t)) t = asarray(t + (w-w))

    Read the article

< Previous Page | 197 198 199 200 201 202 203 204 205 206 207 208  | Next Page >