quotes

How can I properly escape JavaScript in JavaScript?

This might be something I can't do but... parent.document.getElementById('<?php echo $_GET['song']; ?>') .innerHTML = '<img src="heart.png" onmouseover="heartOver('');" >'; The onmouseover="heartOver(''); portion breaks my JavaScript. Is there a way to escape the quotes so I can do this? ...

append removing quotes

Hi, This is a fairly simple problem but I can't find a solution. I write some xml to a hidden div on tha page and i read it later on. The problem is that some quotes are being removed when writing to the div and because of this I can't load the use the xml in IE using LoadXML this is the XML <parameters id='XXX'> <product_id value='...

Where can I download stock historical data for 5 years?

Where can I download stocks' historical data for 5 years for the stock markets: NASDAQ, DJIA, FTSE100, NIKKEI ? Thanks. ...

Importing comma separated data into Excel.

1,1,"Pound","The foe is physically pounded with a long tail or a foreleg, etc.",0,40,0,100,35,0,0,0,115,0 2,2,"Karate Chop","The foe is attacked with a sharp chop. It has a high critical-hit ratio.",43,50,1,100,25,0,0,0,115,0 3,3,"DoubleSlap","The foe is slapped repeatedly, back and forth, two to five times in a row.",29,15,0,85,10,0,0...

t-sql replacing double quotes

I have a t-sql statement like Replace(field,'\''','\"') because i have two different results ''field1'' and "field2" but what if i consider those two different results the same and want to group them. I choose to group those two by replacing the first double quotes with the second style but although replaced they are not interpreted as ...

What is the correct usage of (nested | double | simple) quotes

Hi all, I'm sure this question may seem foolish to some of you, but I'm here to learn. Are these assumptions true for most of the languages ? EDIT : OK, let's assume I'm talking about Perl/Bash scripting. 'Single quotes' => No interpretation at all (e.g. '$' or any metacharacter will be considered as a character and will be printed ...

PHP static variables in double quotes

Hi, How can I get PHP to evaluate a static variable in double quotes? I want to do something like this: log("self::$CLASS $METHOD entering"); I've tried all sorts of {} combos to get the variable value of self::$CLASS, but nothing has worked. I've currently settled with string concatenation but it is a pain to type: log(self::$CLA...

Escape Single Quote Characters when Importing to SQLite

Hi everyone. I have a records.txt file like this: INSERT INTO 'blogtitles' VALUES('Kelly's at house'); INSERT INTO 'blogtitles' VALUES('Nice catch!'); When i try to import records.txt into the db: sqlite3 my.db < records.txt It gives an error because of the first line. I have many lines like this in the records.txt file. I need a sed ...

character for single quote

(backtick) and ' are two different characters for single quote. I have a mysql script that shows the former two quote characters, if I change them to ', it breaks the syntax. how do I type ` from the keyboard? ...

fetch stock quotes from google finance, yahoo finance or the exchange itself

hello all, I am building a web based trading system where buy and sell signals would be generated by reading quotes from either Yahoo finance, google finance or the exchange(NSE of India) itself.My first preference would be to fetch data from this url: http://www.nseindia.com/content/equities/niftywatch.htm the page on the site uses ...

PHP: different quotes?

What is the difference between the quotes " and ' ? What about `? Is there an error in using different quotes ' and " below? $result = pg_query_params($dbconn, 'INSERT INTO users (username, email, passhash_md5) VALUES ($1, $2, $3)', array($username, $email, $passhash_md5 ) $result = pg_query_p...

MySQL choking on curly (smart) quotes

I'm inserting some data into a database from a form. I'm using addslashes to escape the text (have also tried mysql_real_escape_string with the same result). Regular quotes are escaped, but some other quotes are not. For example, the string: Homer's blood becomes the secret ingredient in Moe’s new beer. is converted to: Homer\...

why can't php just convert quotes to html entities for mysql?

PHP uses "magic quotes" by default but has gotten a lot of flak for it. I understand it will disable it in next major version of PHP. While the arguments against it makes sense, what I don't get it is why not just use the HTML entities to represent quotes instead of stripping and removing slashes? After all, a VAST majority of mySQL is ...

Regexes for quotations

Hello! I've already got help here for creating a quotation extraction function. Thanks alot, soulmerge! Now I'm looking for regular expressions (PHP) which extract the cited text and the cited person. The person should be in one index (substring), the text in another index (substring). For English texts, soulmerge proposed these regex...

Regular expression problems

I need some help with some regular expression problems I am having. First off, double quotes ". Anything between "" needs to be matched. Next problem I need to match anything that starts with a ' till the end of a line \n or <br />. I've tried all sorts, but nothing seems to match it. Any ideas? Sorry guys, just realised I need the qu...

PHP Mysql Auto Quote?

When inserting a row in mysql database, string values need to be enclosed in quotes where integer don't need to. Is there any class or library that takes care of this automatically so that I can just pass to a 3rd-party function an array of fieldnames and values and don't have to worry about putting string values in quotes? Thanks, ...

Quoting not respected inside a bash variable

I'm storing the arguments to a command in a variable. The final command I want is: mock -r myconfig --define "debug_package %{nil}" --resultdir results --rebuild mypackage.src.rpm Here's my attempt: set -x # for debugging RESULTDIR=results MOCK_CONFIG="myconfig" MOCK_ARGS="-r $MOCK_CONFIG --define \"debug_package %{nil}\" --resul...

Python Triple Quote / Multi-line indentation

I have a python editor where the user is entering a script or code, which is then put into a main method behind the scenes, while also having every line indented. The problem is that if a user has a multi line string, the indentation made to the whole script affects the string, by inserting a tab in every space. A problem script would be...

nested quotes in javascript

Hi Guys, A bit of a noob question here... I have a javascript function on a list of table rows <tr onclick="ClosePopup('{ScenarioID}', '{Name}');" /> However, the {Name} value can sometimes contain the character "'" (single quote). At the moment the error Expected: ')' comes up as a result because it is effectivly ending the javascr...

Literal quotes in flags for a command in a bash script

I'm writing a Bash script in which I am running a perl script which requires flags that have double quotes in them. Running the script normally, you would run $ perl script.pl -flag="something" -anotherflag="somethingelse" In my script, I'm using variables in these flags, but would like to preserve the doublequotes, so I have somethin...