escaping

How to disambiguate vim commands from shell commands

混江龙づ霸主 提交于 2019-12-24 18:13:18
问题 From How to easily escape a command-line filter: And actually, this has been a bit of an XY problem. I'll have to post the original problem in a different question, though, because the Y question is really interesting and I would like to know. I'll post a link to the X question in the comments. This is the "X" question. I had thought that by figuring out how to escape the % , I would solve the problem, but it turns out Vim's behavior goes deeper than I had thought. And that is that apparently

How to escape special characters in PowerShell?

…衆ロ難τιáo~ 提交于 2019-12-24 18:13:01
问题 When my PowerShell script runs, it prompts the user for a password parameter. That password can contain any number of special characters like *\~;(%?.:@/ That password is then used as a parameter for a .exe command, but it is often incorrect due to some special characters not being escaped properly. An example past password was $(?-.?-(. The only characters I needed to escape was '(', which I replaced with '`(' to make it work. However, that password is now expired. The new password is

how to escape colon in HQL

霸气de小男生 提交于 2019-12-24 18:05:40
问题 I have condition part of my query as follows: ... where foo.bar like '%:%' the query would execute but with no result. I think it's because of the colon since it is a reserved char in HQL. So how can I escape it without sending the : as a parameter to my query. I have already used '%\:%' and '%\\:%' with no success. 回答1: I found a solution: q=q.replaceAll(":","'||unistr('\\003A')||'"); 来源: https://stackoverflow.com/questions/18614960/how-to-escape-colon-in-hql

Cannot run escaped Windows command line on python

随声附和 提交于 2019-12-24 17:42:24
问题 When I run the following command on a Windows command prompt, no problem. java -jar "C:\Program Files (x86)\SnapBackup\app\snapbackup.jar" main I tried running the command in a python script. It fails. My python script is like this; import os command_line = 'java -jar "C:\Program Files (x86)\SnapBackup\app\snapbackup.jar" main' os.system(command_line) The error message received is Error: Unable to access jarfile C:\Program Files (x86)\SnapBackuppp\snapbackup.jar Can someone help? Thanks. I am

applying strptime to local data frame

霸气de小男生 提交于 2019-12-24 15:36:50
问题 I think I have a problem related to \ that I fail to handle. Here is an excerpt from a DateTime column of a data.frame I have read with read_csv : earthquakes[1:20,1] Source: local data frame [20 x 1] DateTime (chr) 1 1964/01/01 12:21:55.40 2 1964/01/01 14:16:27.60 3 1964/01/01 14:18:53.90 4 1964/01/01 15:49:47.90 5 1964/01/01 17:26:43.50 My goal is to extract the years here. Manully doing > format(strptime(c("1964/01/01 12:21:55.40","1964/01/01 12:21:55.40","1964/01/01 14:16:27.60"), "%Y/%m/

escaping quotes in execute insert statment

折月煮酒 提交于 2019-12-24 12:43:50
问题 I have a function that has an insert inside within loop. See the function below. create temp table temp2 (id serial, other_value uuid); CREATE OR REPLACE function verify_uuid() returns varchar AS $$ declare uu RECORD; BEGIN FOR uu IN select * from temp1 loop execute 'INSERT INTO temp2 values ''' || uu ||''':uuid'; END LOOP; END $$ LANGUAGE 'plpgsql' ; select verify_uuid(); The problem that I am having is the values part. With its present setup, I am getting the error: QUERY: INSERT INTO temp2

Escape xml characters within nodes of string xml in java

…衆ロ難τιáo~ 提交于 2019-12-24 11:24:11
问题 I have a string of XML data. I need to escape the values within the nodes, but not the nodes themselves. Ex: <node1>R&R</node1> should escape to: <node1>R&R</node1> should not escape to: <node1>R&R</node1> I have been working on this for the last couple of days, but haven't had much success. I'm not an expert with Java, but the following are things that I have tried that will not work: Parsing string xml into a document. Does not work since the data within the nodes contains invalid xml data.

Ruby string escape characters

帅比萌擦擦* 提交于 2019-12-24 10:48:16
问题 I want to get the quoted string in the line below into a string exactly as-is, but I am tripping on the necessary escape sequences for Ruby. mycommand.cmd is really a wrapper for powershell.exe so I want to preserve everything between the quotes, and hold onto the escape characters that are already there. mycommand.cmd "^|foreach-object { \"{0}=={1}\" -f $_.Name, $_.Found }" 回答1: Use single quotes : ruby-1.9.3-p0 :001 > '^|foreach-object { \"{0}=={1}\" -f $.Name, $.Found }' => "^|foreach

How does one escape the # sign in a Url pattern in UrlMappings.groovy?

荒凉一梦 提交于 2019-12-24 10:13:20
问题 In order to maintain the current set of Urls in a project, I have to be able to use the # (pound sign) in the Url. For some reason the pound sign does not appear to work normally in this project for UrlMappings.groovy. Is there a special escape-sequence that must be used when placing # signs in UrlMappings.groovy ? Am I missing some reason why one cannot use pound signs at all? In the following URL Mapping example, the browser goes to the correct page, but the pageName variable is null: "

how can I display the characters \t in a string?

丶灬走出姿态 提交于 2019-12-24 09:50:02
问题 Evening all, What would be the correct key sequence to display "\t" as a literal value, and not a text format? My code is below... Thanks a bunch. main() { int c; while ((c = getchar()) != EOF) { if (c == ' ') c = "\t"; putchar(c); } } So to clarify, I do not want to have a tabbed string, but instead display the characters \t. 回答1: You can escape a backslash with another backslash, i.e. "\\t" . Incidentally, you're trying to assign a string (i.e. more than one character) to an int . This