quotes

Help me remember a quote from Alan Kay

Alan Kay was quoted several years ago to the effect that there had been only three new things in software in the preceding 20 years (effectively the lifespan of PCs). One of them was Spreadsheets. Does anyone remember the other two? (EDIT: Who is Alan Kay (a few may ask.) His work at Xerox Parc arguably did more to shape our current so...

Escaping double quotes with tcsh alias

I'm trying to run the following commands: replace -x "must " A2input.txt replace -x " a" -f -s ## A2input.txt replace -x to -s ## -a A2input.txt replace -x faith -f "unequivocal" A2input.txt And it'd be nice if I could just alias it to something short and simple like "a", "b", "c", "d", etc... However, some of those arguments have a ...

Are quotes around hash keys a good practice in Perl?

Is it a good idea to quote keys when using a hash in Perl? I am working on an extremely large legacy Perl code base and trying to adopt a lot of the best practices suggested by Damian Conway in Perl Best Practices. I know that best practices are always a touchy subject with programmers, but hopefully I can get some good answers on this...

Apostrophes replacing quotation marks in script tag in input field.

I have this input in a form: <input type="text" value="<script src='/js/script.js' type='text/javascript'></script>" name="embed"/> The quotations in general have to be double, so I put single-quotes within the value property. However, when I do that, the result is: <script src=’/js/script.js’ type=’text/javascript’></script> Not...

How can I convert JavaScript code into one big Java string

So I have 1000 lines of javascript. I need to turn it into a Java String so that I can output (via System.out.println or whatever). I'm looking for an online tool to escape all the quotes... something geared toward my specific need would be nice as I don't want other special characters changed. Lines like: var rgx = /(\d+)(\d{3...

LDAP Query Failure due to single quote

Hi, I'm trying to find an employee in Active Directory using the following c# code: "Select userPrincipalName, ADsPath, Department, Mail, HomeMDB, cn, ssn FROM 'LDAP://" + DomainName + "' WHERE objectCategory = 'person' and sAMAccountName = '" + UserName.Replace("'", "''") + "'"; When I run this for an employee with a single quote...

Coding of parameter-value for SELECT in PHP-MySQL

alt A below is a statement from a php-mysql tutorial. It works as it should. I found the id-value rather obfuscated and tested alt B. This also worked! What is the point with the id-value of alt A? MySQL 5.0.51, PHP 5.2.6 // alt A : $sql="SELECT * FROM exempel WHERE id = '".$q."'"; // alt B : $sql="SELECT * FROM exempel W...

Dealing with quotes in Windows batch scripts

In a Windows batch file, when you do the following: set myvar="c:\my music & videos" the variable myvar is stored with the quotes included. Honestly I find that very stupid. The quotes are just to tell where the string begins and ends, not to be stored as part of the value itself. How can I prevent this from happening? Thanks. ...

Escaping Double Quotes in Batch Script

How would I go about replacing all of the double quotes in my batch file's parameters with escaped double quotes? This is my current batch file, which expands all of its command line parameters inside the string: @echo off call bash --verbose -c "g++-linux-4.1 %*" It then uses that string to make a call to Cygwin's bash, executing a L...

QTextEditor returns quotes as question marks in QT Ruby

When I copy and paste from a Word document into a QT TextEditor, It seems to look fine. But when I try to access the text using toPlainText or toHTML, it returns the text with all of the quotes (double and single) as question marks. Is there a way around this? I am using the qt4-qtruby bindings. ...

Regex to pick commas outside of quotes

Hi Folks - Im not quite sure if this is possible, so I turn to you. I would like to find a regex that will pick out all commas that fall outside quotesets. For example: 'foo' => 'bar', 'foofoo' => 'bar,bar' this would pick out the single comma on line 1, after "'bar'," I don't really care about single vs double quotes. Has anyone...

Linq to SQL - double quote issue

I have a problem wherein if I have a text area in ASP.NET and enter 2 double quotes at the very end of the sentence, I get a error in my sql statement. I have traced thru the sql profiler but with no luck. eg. The lazy fox jump over the dog"". This fails.... ""The "lazy" fox jumps over the dog. This seems fine Any pointers most welcom...

Which quotes does a programmer need?

My keyboard only has normal quotes, not the smart ones. I have obversed that I need normal ones in cgi development and the backward ones in AWK/SED. Is there any rule when I should use smart quotes, normal ones and backward ones? Obviously, I need to edit my keyboard layout to get the smart quotes. ...

What's the best way to add double quotes in sql server 2000

I have the following. SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO ALTER FUNCTION doublequotestring(@str nvarchar(1998)) RETURNS nvarchar(4000) AS BEGIN DECLARE @ret nvarchar(4000), @sq char(1) SELECT @sq = '"' SELECT @ret = replace(@str, @sq, @sq + @sq) RETURN(@sq + @ret + @sq) END...

Writing PHP Code to a File

Hi all, I am wondering if it is possible to write php code to a file. For example: fwrite($handle, "<?php $var = $var2 ?>"); I would like it produce the exact string in the file and not the eval'ed code. Is this possible? I am currently getting the following output (where $var = 1 and $var2 = 2): <?php 1 = 2 ?> Whereas I want t...

Stripping single and double quotes in a string using bash / standard Linux commands only

Hello Stack Overflow :-) I'm looking for something that will translate a string as follows, using only bash / standard Linux commands: Single-quotes surrounding a string should be removed Double-quotes surrounding a string should be removed Unquoted strings should remain the same Strings with unmatched surrounding quotes should remain...

Turning off json key quoting in Rails

One of the features in Rails 2.3 was json key quoting. I was wondering if there was an easy way to turn the key quoting off or modify the way quoting is done (change to single quotes for example). I'd like to output a json format that Google's Visualization API will accept (http://code.google.com/apis/visualization/documentation/dev/im...

Escaping Strings in JavaScript

Hello, Does JavaScript have a built-in function like PHP's addslashes (or addcslashes) function to add backslashes to characters that need escaping in a string? For example, this: This is a demo string with 'single-quotes' and "double-quotes". ...would become: This is a demo string with \'single-quotes\' and \"double-qu...

How to insert text with single quotation sql server 2005

I want to insert text with single quote Eg john's to table in sql server 2005 database ...

Testing Dynamic Pages using Google Website Optimizer

Assume I have a site which shows information regarding restaurants. All the urls are named as /restaurants/some-dynamic-restaurant-name/ eg.../restaurants/somename**1**/, /restaurants/somename**2**/ etc... How can I A/B test or Multivariate test using GWO, all the restaurant pages in one single experiment? Update: I have created a quest...