escaping

runas does not allow complex arguments?

眉间皱痕 提交于 2019-12-23 19:27:38
问题 I have an app that I'm trying to run elevated on windows 7 and windows xp thin clients but I cant seem to get the runas.exe cmd line correct. I know I need the backslash escape character in there so runas interprets the spaces correctly. This works when sending runas a single argument that has been escaped with a backslash. This scenario is all I found as a solution and it works however, I need to send multiple arguments that are all escaped with backslashes because of spaces in the

PHP: Convert single-quoted string into double-quoted

≡放荡痞女 提交于 2019-12-23 18:41:38
问题 I need to convert string with unicode \xCODEs into regular string. The issue is that string which I have as input seems to be single-quoted. Is there any way to convert single-quoted string into double? Here's some code for better understanding: $s1 = '(single quotes): Conductivity @ 20\xc3\x82\xc2\xb0C'; $s2 = "(double quotes): Conductivity @ 20\xc3\x82\xc2\xb0C"; echo "<br>"; echo iconv("UTF-8", "ISO-8859-1//IGNORE", $s1); echo "<br>"; echo iconv("UTF-8", "ISO-8859-1//IGNORE", $s2); will

Rails 4, replacing “\n” with “
” for use in XML spreadsheets in excel

删除回忆录丶 提交于 2019-12-23 18:09:53
问题 I'm writing an application that exports certain data into a specifically formatted Excel document. I'm building an XML spreadsheet file using this document (http://msdn.microsoft.com/en-us/library/aa140066(v=office.10).aspx#odc_xmlss_x:pagesetup) and so far have it all working. BUT to get it working I had to use ".html_safe" in several fields which is dangerous in this instance as some of the fields being exported contain user entered data. Basically to get a new line inside an excel cell you

write escaped character to file so that the character is visible

萝らか妹 提交于 2019-12-23 17:58:18
问题 I want to write "\t" to a file. Not a "tab character", but literally "\t". How do I do this? It has been driving me crazy for more than an hour; everything I try produces an actual "tab character" (empty space). Why would I want this? Because I'm generating a config file with a ConfigParser() which also includes some delimiters, and I want that file to be human-readable. I do not consider empty space readable. EDIT: sorry, the problem was not clear: I want to do this for variables that

Unable to escape pipe character (|) in powershell

对着背影说爱祢 提交于 2019-12-23 17:33:33
问题 I am trying to find number of pipe(|) characters in each line of a file. I am using following command to do so. gc .\test.txt | % { ($_ | select-string "|" -all).matches | measure | select count } Its not counting the pipe symbol. I also tried `| '|' | Can anyone tell me how to escape pipe character in power shell? If i am using strings or characters other than pipe the command is working properly. 回答1: A backslash \ is the escape character for a regular expression. gc .\test.txt | % { ($_ |

XmlReader chopping off whitespace after ampersand entity?

爱⌒轻易说出口 提交于 2019-12-23 16:10:33
问题 This is strange. I've got a WCF Message and I'm trying to read the contents of the body into an XmlDocument. The contents of the message body look like this on the wire (when inspected with WCF tracing turned on): <abc> <timeZone>(GMT-05:00) Eastern Time (US & Canada)</timeZone> </abc> The code for the reader looks like this: XmlReaderSettings settings = new XmlReaderSettings(); settings.IgnoreWhitespace = false; settings.CheckCharacters = false; XmlReader bodyReader = XmlReader.Create(

How do I escape colons in an attribute name with Python's ElementTree?

£可爱£侵袭症+ 提交于 2019-12-23 15:26:37
问题 Background I am using ElementTree in Python version 2.6 to create an XML file (using data retrieved from a database). Code The following line of code is the problem area, as I keep getting a syntax error because of the colons within my attribute names. # Please ignore any errors the "^" characters would cause if they were # actually part of my code - just using them as placeholders. root = ET.Element("databaseConfiguration", xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance", ^ xsi

How do I disable Django's autoescape from a view?

青春壹個敷衍的年華 提交于 2019-12-23 15:19:28
问题 Django says there's 3 ways to turn off autoescape: Use |safe after the variable Use {% autoescape on %} and {% endautoescape %} within blocks Use a Context like context = Context({'message': message}, autoescape=False) (1) and (2) work fine. But I have the situation where I have templates to generate plain-text push notifications, and I have LOADS of templates to build and maintain. I could go through and put the {% autoescape on %} and {% endautoescape %} tags in all of them, but (3) should

Is there a difference with the HTMLEditFormat function in ColdFusion CF9 versus CF10?

我只是一个虾纸丫 提交于 2019-12-23 14:02:32
问题 I'm seeing a difference in how HTMLEditFormat works in CF9 and CF10. HTMLEditFormat(">") In CF9: showing up as ">" (no difference) In CF10: showing up as "&gt;" (double-escaped, which seems correct to me) I've looked through the CF10 notes and reviewed the HTMLEditFormat documentation, but cannot find any mention of there being a difference in how this function works. Does anyone know of a difference, or know of documentation that proves there is no difference? ...Or know of any other

how to echo a double backslash plus a variable (version number) like “\\hostname\release\1.02A01” by using sh?

本小妞迷上赌 提交于 2019-12-23 13:34:08
问题 I want to echo a Windows shared folder address to users in a Linux shell script, the address are strings like this: \\hostname\release\1.02A01. and the last string(1.02A01) is a version number, it's changed each time when I run the script. I tried something like this in sh (not bash ), but it doesn't work: version=$1 # version number are get from the parameter repository="\\\hostname\release\$version" echo $repository # I get this: \hostname\dir$version Here are the two errors: the double