quotes

how to display custom quotation marks with sifr?

I have some text and quotation marks around it, but I want each of them to be a different font to be replaced by sifr. The problem is that the quotes need to go exactly around the text, but the text once turned into an tag becomes a block and the text isn't shaped necessarily like a rectangle. I thought about having the quotes be backgr...

How do you strip quotes out of an ECHO'ed string in a Windows batch file?

I have a Windows batch file I'm creating, but I have to ECHO a large complex string, so I'm having to put double quotes on either end. The problem is that the quotes are also being ECHOed to the file I'm writing it to. How to you ECHO a string like that and strip the quotes off? UPDATE: I've spent the last two days working on this an...

How to use environment variable inside a quoted string in BASH script

I've tried various forms of the following in a bash script: #!/bin/bash svn diff $@ --diff-cmd /usr/bin/diff -x "-y -w -p -W $COLUMNS" But I can't get the syntax to correctly expand the COLUMNS environment variable. I've tried various forms of the following: svn diff $@ --diff-cmd /usr/bin/diff -x '-y -w -p -W $COLUMNS' and svn d...

RegEx: Find quotes within a tag

Hi, I have a string like this: This <span class="highlight">is</span> a very "nice" day! How should my RegEx-pattern in VB look like, to find the quotes within the tag? I want to replace it with something... This <span class=^highlight^>is</span> a very "nice" day! Something like <(")[^>]+> doesn't work :( Thanks ...

Who wrote this programing saying? "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. I found this at somebody's blog, and it introduces as Rick Osborne's. But I google this, and other people says: Martin Golding's, John Woods' and Damian Conway's... Yes, Damian Conway used this quote in "Perl Be...

Laws of Computer Science and Programming

We have Amdahl's law that basically states that if your program is 10% sequential you can get a maximum 10x performance boost by parallelizing your application. Another one is Wadler's law which states that In any language design, the total time spent discussing a feature in this list is proportional to two raised to the ...

Proper use of quotes for output of JavaScript in a variable

I am creating a chunk of HTML/JavaScript with the below code: $result = mysql_query("SELECT * FROM posts WHERE userid = '$user_id' ORDER BY DATE desc LIMIT 5")or die (mysql_error()); while ($row = mysql_fetch_array($result)) { $source = $row[source]; $source = "'$source'"; $p = $p.'<div id="red-div"><div id="smartass"><di...

Why doesn't file_exists() work?

Here is my PHP code: [root@file htdocs]# vi test.php <?php var_dump(file_exists('/usr/local/apache2/resumes/28/"Chapel Hill"/franky_li/"CV.doc"')); ?> "test.php" [New] 5L, 100C written [root@file htdocs]# php test.php bool(false) which says the file doesn't exists,but in fact it does: [root@file htdocs]# ls -l /usr/local/apache2/r...

How can I encode Quotation marks without Asp.Net complaining?

On my site, an encoded quote (%22) in url path causes "Illegal characters in path" error I want specify search URLs like so: www.site.com/search/%22Vitamin+C%22 %22 is an encoded quotation mark " I'm using a Asp.Net URL Routing and the route is specified like this: "search/{searchTerm}" When Context["searchTerm"] is retrieved and De...

Inserting string with single quotes from Java into Postgresql

I'm inserting text from a Java application into a Postgresql database, but it all crashes when a ' char is encountered in the String. I've tried using replaceAll(" ' ", " \\' "); even diffrent variants of it with more \ chars, yet it still puts a single ' in the String without the escape sign. Is there any way of replacing the ' with a...

What does this software quote mean?

I was reading Code Complete (2nd Edition), and came across a quote in the margin on page 87 by Bertrand Meyer. Ask not first what the system does; ask WHAT it does it to! What exactly is the point Mr. Meyer is trying to get across here. I have some rough ideas, but I would like to make sure I really understand. ...

Need regex to parse keyword='value' with single or double quotes

I'm having trouble writing a regular expression (suitable for PHP's preg_match()) that will parse keyword='value' pairs regardless of whether the <value> string is enclosed in single or double quotes. IOW in both of the following cases I need to get the <name> and <value> where the <value> string may contain the non-enclosing type of quo...

replace symbol in javascript

Does anyone know how can I replace this 2 symbol below from the string into code? ' left single quotation mark into ‘ ' right single quotation mark into ’ " left double quotation mark into “ " right double quotation mark into ” ...

Regular expressions / parsing dig output / extracting text from double quotes

Hi, I need help figuring out some regular expressions. I'm running the dig command and I need to use its output. I need to parse it and get it neatly arranged as an array using php. dig outputs something like this: m0.ttw.mydomain.tel. 60 IN TXT ".tkw" "1" "20090624-183342" "Some text here1" m0.ttw.mydomain.tel. 60...

`&quot;` not becoming quotation mark when output

My quotation marks, when converted to &quot; by htmlentities() are not turning back into actual quotation marks when output after being stored in the [Postgres] database. Please help - this is time sensitive. ...

Get code outside quotes with regexp in javascript

Is there a way to get a piece of code that is not between quotes (single or double) in javascript with regular expressions? if i have this string: 'this is a test "this shouldn't be taken"' the result should be: 'this is a test' ...

Single quote issues with C++ find and replace function

Here is my code for finding a sequence in a string and replacing it with another: std::string find_and_replace( string &source, string find, string replace ) { size_t j; for ( ; (j = source.find( find )) != string::npos ; ) { source.replace( j, find.length(), replace ); } return source; } Everything works fine...

Help me understand this Brian Kernighan quote

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." --Brian Kernighan It seems to be a subjective question, but in your opinion, 'What exactly is he intending "clever" to be?' ...

VB Script Quote Character Issues, Need Help Badly!!

I have a very tricky problem going on with content inside a textarea on a classic ASP page. The trigger for the issue is that the end user copies and pastes content from Word into a textarea on the page. This page then sends the contents of the form via email to a 3rd party contact management system. This system display the following ch...

Properly handling spaces and quotes in bash completion

What is the correct/best way of handling spaces and quotes in bash completion? Here’s a simple example. I have a command called words (e.g., a dictionary lookup program) that takes various words as arguments. The supported ‘words’ may actually contain spaces, and are defined in a file called words.dat: foo bar one bar two Here’s my f...