Search Results

Search found 1121 results on 45 pages for 'quotes'.

Page 8/45 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Convert XMLDocument to String

    - by mnh
    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 them. For Instance: <Campaign name="ABC"> </Campaign> Above is the expected XML. But it returns <Campaign name=\"ABC\"> </Campaign> I can do String.Replace "\" but is that method okay? Are there any side-effects? Will it work fine if the XML itself contains a "\"

    Read the article

  • Help with variables and new lines, and quoting in a bash script

    - by Scott
    I would like to automate the following svn command. Note this command produces the desired results on my system - Ubuntu 10.04, svn 1.6.6, bash shell, when issued from the command line: svn ci -m $'Added new File: newFile.txt\nOrig loc: /etc/networking/newFile.txt' /home/user/svnDir/newFile.txt I would like to run that command in a bash script, assuming that the original full path to the file is contained in the variable $oFileFull, and the filename is in $oFileName. The script is executed from the svn directory. I need to allow for the possibility that the file name and or path contain spaces. so the line inside my shel script might look like: svn ci -m$'Added new file: ${oFileName}\nOrig loc: ${oFileFull}' ${oFileName} But I want the variables (which may contain spaces) expanded before the command is executed, and I cannot figure out how to do this while enclosing the svn comment in single quotes which is necessary in order to get the new line in the subversion comment log. I am pulling my hair out trying to figure out how to properly quote and assemble this command. Any help appreciated.

    Read the article

  • Python "string_escape" vs "unicode_escape"

    - by Mike Boers
    According to the docs, the builtin string encoding string_escape: Produce[s] a string that is suitable as string literal in Python source code ...while the unicode_escape: Produce[s] a string that is suitable as Unicode literal in Python source code So, they should have roughly the same behaviour. BUT, they appear to treat single quotes differently: >>> print """before '" \0 after""".encode('string-escape') before \'" \x00 after >>> print """before '" \0 after""".encode('unicode-escape') before '" \x00 after The string_escape escapes the single quote while the Unicode one does not. Is it safe to assume that I can simply: >>> escaped = my_string.encode('unicode-escape').replace("'", "\\'") ...and get the expected behaviour?

    Read the article

  • Run a local script on a remote server using ssh with out having to worry about quotes

    - by Michael Irey
    So I have been running local scripts fine on a remote server: ssh user@server '`cat local-script.sh`' However, today I have a script that has both single and double quotes in it. Which causes the script to fail because the output of cat local-script.sh is wrapped in quotes. With out modifying the script itself, is there a better way to handle this? I thought this may work: ssh user@server $(<local-script.sh) But is does not seem to do anything...

    Read the article

  • Laws of Computer Science and Programming

    - by Jonas
    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 power of its position. 0. Semantics 1. Syntax 2. Lexical syntax 3. Lexical syntax of comments My question is this: What are the most important (or at least significant / funny but true / sad but true) laws of Computer Science and programming? I want named laws, and not random theorems, So an answer should look something like Surname's (law|theorem|conjecture|corollary...) Please state the law in your answer, and not only a link. Edit: The name of the law does not need to contain it's inventors surname. But I do want to know who stated (and perhaps proved) the law

    Read the article

  • Drupal UC "Quoting / Estimate" error

    - by Murtez
    Hi, I was playing around with Drupal UC and installed a module called "Quoting / Estimate" (http://drupal.org/project/quoting), I tried to run it and got this error: **warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'quoting_quote_clear_page' was given in /home/ergospec/public_html/d/includes/menu.inc on line 348** Has anyone run into this problem? Second question: anyone know of a good quotation module (where customer can request a price quote, not the brackets)? It doesn't have to be in Drupal. Any help is appreciated. Murtez

    Read the article

  • Unix: How to use Bash backticks recursively

    - by HH
    Either I missed some backlash or backlashing does not seem to work with too much programmer-quote-looping. $ echo "hello1-`echo hello2-\`echo hello3-\`echo hello4\`\``" hello1-hello2-hello3-echo hello4 Wanted hello1-hello2-hello3-hello4-hello5-hello6-...

    Read the article

  • bash: expanding variables with spaces

    - by adam n
    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 grep needs to recognize the space. How do i get this to work? using bash 3.2, mac os 10.6.

    Read the article

  • Elaboration of A quotation on 'Simple Design'

    - by HanuAthena
    An excerpt from Programming Perls: A Simple Design : Antonie de Saint-Exupery, the Fresh writer and aircraft designer, said that, *"A designer knows he has arrived at perfection not when there is no longer anything to add, but when there is no longer anything to take away."* More programmers should judge their work by this criteria. Can any one elaborate this, please? What does the author mean when he say "...TAKE AWAY"

    Read the article

  • Quote marks in controls' property in ASP.NET markup

    - by abatishchev
    Sounds dummy but I can't set to a server-side control's property a value contains quote marks ": <asp:CompareValidator ErrorMessage="Curreny-from can't be equal to currency-to" runat="server" /> I need to quote "from" and "to". I tried escaping \"from\" and double quote marks ""from"" - both doesn't work. How to do that?

    Read the article

  • javascript string difference

    - by Konrad
    What is the difference (if any) between the javascript strings defined below? var str1 = "Somestring"; var str2 = 'Somestring'; "" and '' mean two very different things to me predominantly writing code in C++ :-) EDIT: If there is no difference why are there two ways of achieving the same thing and which is considered better practice to use and why. Thanks!

    Read the article

  • How to insert result of mysql_real_escape_string() into oracle database?

    - by Prat
    For inserting special characters in data like (,')etc., I am using musql_real_escape_string() function & it's working fine. Now I want to use same variable while inserting values in Oracle. $str = 'N.G.Palace\'s Building', 'xyzcity', '12345678','India','100001',12 Here $str is result of mysql_real_escape_string(). so it escapes special character. Now my code for oracle is like this-: $qry ="INSERT INTO Ora_table(ship_to_street, ship_to_city,ship_to_country, ship_to_telephone, order_id, record_no) VALUES(".$str); So my doubt is Oracle is not accepting values return by mysql_real_escape_string i.e. Palace\'s (like this as this mysql function attach \ before 'single quote)? So can anybody tell me ho9w can I use that variable $str to insert data into Oracle? Also I tried like this also-: "q"."'"."c".$str."c"."'" can we use this for multiple values like in my case...though still I am unable to inser data in oracle? plz help.

    Read the article

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

    - by cgmojoco
    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 `QuarterYear ` or should I do this?: GROUP BY 'QuarterYear' or just this?: GROUP BY QuarterYear

    Read the article

  • How to combine wildcards and spaces (quotes) in an Windows command?

    - by Jan Fabry
    I want to remove directories of the following format: C:\Program Files\FogBugz\Plugins\cache\[email protected]_NN NN is a number, so I want to use a wildcard (this is part of a post-build step in Visual Studio). The problem is that I need to combine quotes around the path name (for the space in Program Files) with a wildcard to match the end of the path. I already found out that rd is the remove command that accepts wildcards, but where do I put the quotes? I have tried no ending quote (works for dir), ...example.com*", ...example.com"*, ...example.com_??", ...cache\"[email protected]*, ...cache"\[email protected]*, but none of them work. (How many commands to remove a file/directory are there in Windows anyway? And why do they all differ in capabilities?)

    Read the article

  • NSMutableDictionary is adding quotes to keys and values - why?

    - by TimD
    I'm trying to add some additional key/value pairs to an NSMutableDictionary, using: Tag *tag1 = [results1 objectAtIndex:0]; [resultsDict setObject:[tag1 retrieveTextUpToDepth:1] forKey:@"image_url"]; Tag *tag2 = [results2 objectAtIndex:0]; [resultsDict setValue:[tag2 retrieveTextUpToDepth:1] forKey:@"majority"]; This adds the k/v pairs with no problem, except when I come to retrieve them, some of the values have been wrapped with double quotes: po extendedDataDictionary: "image_url" = "/images/mpsL/11727.jpeg"; majority = 3460; Both keys and values are NSStrings, with no quotes - so I'm stumped as to where they're appearing from. Is there any way of preventing this? Or am I going to have to live with it and try to strip off the quotes once I've retrieved the value? Thanks...

    Read the article

  • Does Oracle 10g automatically escape double quotes in recordsets?

    - by bitstream
    I am encountering an interesting issue with an application that was migrated from Oracle 9i to 10g. Previously, we had a problem when a field contained double quotes since Oracle recordsets encapsulated fields in double quotes. Example: "field1"||"field2"||"field "Y" 3"||"field4" Since the move to 10g, I believe that the Oracle client-side driver is parsing the double quotes and replacing them with &quot; Unfortunately I don't have an old 9i environment to test my theory. Have you seen similar behavior or can someone validate if my theory is true?

    Read the article

  • What's the difference between single and double quotes in Objective-C?

    - by Alex Mcp
    I'm working through a book exercise to generate some random serial number, and here's my function: NSString *randomSerialNumber = [NSString stringWithFormat:@"%c%c%c%c%c", '0' + random() % 10, 'A' + random() % 26, '0' + random() % 10, 'A' + random() % 26, '0' + random() % 10]; This works and has an output like: 2J6X7. But before, the 0s and As I had wrapped in double quotes, and an example output was 11764iÒ˜. What did I do wrong my first time around, and why did using single quotes fix it?

    Read the article

  • Batch file reads in text file and replaces quotes with variables into new file?

    - by John
    I have customer Pizza lists that i have saved into 5 seperate txt files from my database in this format: Filename = 25Percent.TXT "555-1211" "555-1212" "555-1223" ... ect Each list is a phone number in quotes and each list varies in length. Part 1: I have two sets of variables that i would like to replace with each quote in the 5 text files. The two variables would be like: Var A = < Discount Pizza price for phone number is " Var B = " 25 % So i would like to run a batch file that reads each line in the text file and writes into another text file the following, replacing the quotes with the variables: New Filename = 25Percentfinished.TXT < Discount Pizza price for phone number is "555-1211" 25 % < Discount Pizza price for phone number is "555-1212" 25 % < Discount Pizza price for phone number is "555-1223" 25 % Then I would repeat for 30percent.txt, then 35percent.txt, 40percent.txt, and then finally 50percent.txt file. Part II: I would also like to append the 5 new files together, with the append command? I am assuming that the SET Var command would also be used? Not sure what to do here.

    Read the article

  • SQLAuthority News – The Best Quotes of “Who Wrote This?” Contest

    - by pinaldave
    I am a frequent reader of Brent Ozar PLF, it is one of my favorite blogs. A recent post announced a “Who Wrote This?” contest to see if readers could tell their three contributors apart based on some writing samples. Here are my favorite lines from the sample paragraphs, from each of the three “mystery authors.” Topic 1: Working with Bad Managers Mystery Author A – “Working with bad managers means working against my own happiness, and I’ve come to learn that there’s no changing bad managers.” I love this line because, as anyone who has had a bad manager knows, often a lot of self-doubt rises up. We all have to remember that sometimes the problem is out of our control. Mystery Author B – “Mentor your manager just like you would mentor a junior DBA.” Having a bad manager can be extremely depressing, and we often feel out of control. But we all need to remember that our work is a two-way street, and that sometimes we can subtly influence those above us. Mystery Author C – “The trick to working for all bad managers is to remember that they aren’t your parent. Take charge of your career.” We all also need to learn not to play the blame game. Would you rather stay in a place where you are unhappy, or would you rather take charge of your life? I hope most people would pick the latter. Topic 2: Working with Remote Teams Mystery Author A – “Like almost anything else the key is to make sure that everyone on the team has an understanding of how and when communication will occur.” Communication is so important. I cannot over emphasize how much. And this one line captures how I feel and even communicates the idea clearly! Mystery Author B – “The key to remote team success is verifiable trust: feeling confident that invisible team members are doing the right amount of the right thing at the right time.” I think this line not only captures the key aspects of remote work – verifiable work and trust – but there were so many lines that followed that I loved and could not fit here. The whole paragraph is a list for successful remote work. Everyone could benefit from reading it. Mystery Author C – “What seems clear, precise, and specific in one time zone comes across as vague, soupy, and just plain weird in another.” You know what? I just love this description. The author is right – sometimes vague e-mails really do seem soupy and weird! Topic 3: Working with Your Nemesis Mystery Author A – “Every job is temporary, but your reputation stays with you.” Everyone needs to remember this. The workplace is meant to be a professional arena, and many people have the opinion that work is temporary and disposable. No one wants to work with co-worker like that. Mystery Author B – “Unhealthy conflict is going to lead to leaving three week old tuna fish sandwiches in someone’s desk drawer.” Sometimes humor really is the best policy! Mystery Author C – “Oh no, it’s that guy.” This might seem like a weird phrase to choose as my favorite from an entire paragraph. But the whole piece was written in the form of a story of co-workers getting drunk and plotting against a nemesis. It was too funny to overlook, but too long to post here. A must read! Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority News, T SQL, Technology

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >