quotes

Why are some object-literal properties quoted and others not?

I see this all the time: object literals declared such that some keys are surrounded with quotes and others are not. An example from jQuery 1.4.2: jQuery.props = { "for": "htmlFor", "class": "className", readonly: "readOnly", maxlength: "maxLength", cellspacing: "cellSpacing", rowspan: "rowSpan", colspan: "co...

Objective-C: Do You Have to Escape Single Quotes in Strings Destined fo SQL?

Hi, I'm an iPhone developer. I'm writing my unit test cases, one of which checks if the app accepts UTF8 strings to be written to a sqlite3 database. I created a test case to generate random UTF8 strings and I can see the ones that fail do so because they contain an apostrophe (') which I need to be accepted. I'm writing to the databa...

Adodb, escaping quotes?

I am using adodb with php. I need to insert html into my database, and need to know the best method to escape the quotes before inserting it into the database? I tried using pg_escape_string() but it still does not seem to insert. What is the best method to do this? ...

How do you replace double quotes with a blank space in Java?

For example: "I don't like these "double" quotes" and I want the output to be I don't like these double quotes ...

Trying to clean my data before reaching JSON.Simple

I think the word "clean" isn't the right idea, but I am trying to make sure that the data I am getting from the database is ready to be inserted into JSON objects. I would like to find a packaged deal for this, or if JSON.Simple does this and I just haven't run into it. But double quotes, single quotes (for obvious reasons), and new line...

Regex problem (PHP)

[quote=Username here]quoted text here[/quote] Reply text here I need a regular expression that stores the "Username here", "quoted text here" and "Reply text here" in a Array. This expression needs to support nesting aswell. Eks: [quote=Username2 here][quote=Username here]quoted text here[/quote] Reply text here[/quote] Reply text...

Convert XmlDocument to String

Here is how I'm currently converting XMLDocument to String StringWriter stringWriter = new StringWriter(); XmlTextWriter xmlTextWriter = new XmlTextWriter(stringWriter); xmlDoc.WriteTo(xmlTextWriter); return stringWriter.ToString(); The problem with this method is that if I have " ((quotes) which I have in attributes) it escapes the...

How do I replace double quotes with single quotes

Hy everyone how can I replace "" // i think its called double quotes with '' // i think its called single quotes using PHP ? ...

Quotes in tab-delimited file

Hi all, I've got a simple application that opens a tab-delimited text file, and inserts that data into a database. I'm using this CSV reader to read the data: http://www.codeproject.com/KB/database/CsvReader.aspx And it is all working just fine! Now my client has added a new field to the end of the file, which is "ClaimDescription", ...

Proper usage of double and single quotes?

I'm talking about the performance increase here. From all I know you can echo variables in double quotes ("), like so: <?php echo "You are $yourAge years old"; ?> But single quotes will just return You are $yourAge years old. But what about performance differences? I've always gone by the rule that single quotes are faster because t...

Do parameters of a JSON style object always need to be in quotes?

For Example: myJSON = { param1:val1, param2:val2 } vs. myJSON = { "param1":val1, "param2":val2 } Also are there any browser compatibility issues or possible exceptions that may arise out of using one or the other? ...

javascript - catch SyntaxError and run alternate function

Hello there, I'm trying to build something on javascript that I can have an input that can be everything like string, xml, javascript and (non-javascript string without quotes) as follows: //strings eval("'hello I am a string'"); /* note the following proper quote marks */ //xml eval(<p>Hello I am a XML doc</p>); //javascri...

Python: inserting double or single quotes around a string

Im using python to access a MySQL database and im getting a unknown column in field due to quotes not being around the variable. code below: cur = x.cnx.cursor() cur.execute('insert into tempPDBcode (PDBcode) values (%s);' % (s)) rows = cur.fetchall() How do i manually insert double or single quotes around the value of s? I've tryin...

Java Regex for matching quoted string with escaped quotes

I know there are already many questions like mine but I found no answer which works in Java. So I write a new question. I have text files with content like this: key1 = "This is a \"test\" text with escapes using '\\' characters"; key2 = 'It must work with \'single\' quotes and "double" quotes'; I need a regular expression which mat...

bash: expanding variables with spaces

I have a file called "physics 1b.sh". In bash, if i try x="physics 1b" grep "string" "$x".sh grep complains: grep: physics 1b: No such file or directory. However, when I do grep "string" physics\ 1b.sh It works fine. So I guess the problem is something to do with the variable not being expanded to include the backslash that gr...

c# webbrowser | pushed realtime quotes

Hi, I am programmer and share trader. Before I have written a day trading application. Until last week it was possible to fetch realtime quotes from http://aktien.boerse.de/aktien_startseite.php?view=2&amp;order=name%20asc&amp;liste=prime&amp;page=0 . Every time the site was surfed the quotes had changed. The HTML contents could then b...

Is there a Chilton's like resource for estimating software costs

Do you know if there is anything out there like Chilton's for cars for programming quotes: http://chilton.cengage.com/ Looking for a programming book or sites that may be like it, or about process. I am trying to get a better grip on quoting jobs and wondering if there is anything like this. ...

MySQL grouping by a previously declared alias, what do I wrap it in? ' OR `

I have an SQL query that has an alias in the SELECT statement SELECT CONCAT(YEAR(r.Date),_utf8'-',_utf8'Q',QUARTER(r.Date)) AS 'QuarterYear' Later, I want to refer to this in my group by statement. I'm a little confused...should I wrap this with backticks, single quote or just leave it unwrapped int he group by GROUP BY `Quarte...

Passing a Batch File an Argument Containing a Quote Containing a Space

Hi, On many occasions I have dealt with passing batch files arguments with spaces, quotes, percents, and slashes and all sorts of combinations of them. Usually I managed to figure out how to accomplish what I want, but this time I am stuck. I have tried a couple of hundred combinations now and my head is starting to hurt. I’ve reduced ...

html source encode

when I view source on my php page I get &quot; for a quote. But instead, I would like " to be used in the source code. I have no control over manually replacing it so Im wondering if there is a function to do such a thing. ...