escaping

curl - How to escape < in parameter value

十年热恋 提交于 2020-01-04 14:48:23
问题 Here is the curl command I'm executing curl -F "context=<http://example.com>" \ -F "Content-Type=text/plain" \ -F "source=file" \ -F "content=@members.nt;type=text/plain" \ http://localhost:8080/openrdf-workbench/repositories/XXX/add I'm trying to load openrdf repository. It gives me an error because there is a "<" character at in the value of "context" parameter. How to escape this "<" so curl does not think that I'm trying to load file content into "context" parameter The error from curl is

how to escape semicolons when writing to csv in python

…衆ロ難τιáo~ 提交于 2020-01-04 10:58:32
问题 I have a list of lists in python that represents data to be written in a csv file. My code for that is : for n, d, p in zip(names, dates, posts): writer.writerow([i, n, d, p]) However, some of the strings in posts contain semicolons, and this creates new cells in the csv. I've looked online and tried setting quoting=csv.QUOTE_ALL wrapping each post string inside double quotes wrapping the semicolons inside double quotes using normal python write instead of csv.writer Nothing's worked so far.

jQuery selector problem when using a single parenthesis

家住魔仙堡 提交于 2020-01-04 09:13:38
问题 If I include a single parenthesis in a :contains selector I get an error. e.g. $("a:contains('Speed (mph')") returns the error Syntax error, unrecognized expression: (mph') if I add the closing parenthesis at the end, the statement runs fine. however, I need to be able to query where there is often a single parenthesis. What's going on here and how do I sidestep this? EDIT In my actual code the :contains part is passed in as a variable e.g var searchText = 'Speed (mph'; var result = $("a

How to format a URL.Action() call in JQuery to set a link's href attribute?

旧街凉风 提交于 2020-01-04 06:44:18
问题 I need to set the href attribute of a link to point to a specific image, which has its id from the database set as its title. However, I am having trouble with trying to format the string to include a call to get the title attribute of the image. Here is the base string: $("#favoriteLink").hover(function() { $(this).attr("href", '<%: Url.Action("FavoriteWallpaper", "Wallpaper", new{wallpaperId='+$(this).children.attr("title")+'}) %>'); }); favoriteLink is a div and the child is just one image

Escaping special characters inside XPATH

喜欢而已 提交于 2020-01-04 02:32:29
问题 I have some elements with the tag <xxx:element> inside my xml. I want to get these using XPath. I've tried a few ways of getting them but so far unsuccessful. //xxx:element just doesn't return anything. I'm guessing this is because of the : characater //#xxx:element# gives the exception: "A location step was expected following the '/' or '//' token." //'xxx:element' same exception. Any suggestions? Based on choroba's answer I found Xml Namespace breaking my xpath! 回答1: The xxx: part is a

Reading java file with escape characters for newline

十年热恋 提交于 2020-01-04 01:29:53
问题 I have a Unicode file that needs to be exported to database(Vertica). The column delimiter is CTRL+B, record delimiter is newline(\n). Whenever there is a newline within a column value, CTRL+A is used as escape character. When I use BufferedReader.readLine() to read this file, the records with ID's 2 and 4, are read as two records. Whereas I want to read them as a single whole record as given in output. Here is the example input file. | stands for CTRL+B and ^ stands for CTRL+A. Input ID|Name

Unescape escaped string?

余生长醉 提交于 2020-01-03 17:47:52
问题 We store ContentDelimiter config (which we use to delimite the content) in Database as string (which could be "tab", i.e. \t , or new line \r\n) Later on we would like to use this config, how would I go about converting \t (which is string, not chat) to tab char ? Example: string delimiterConfig = config.GetDelimiter(); char[] delimiter = ConvertConfig(delimiterConfig); How would ConvertConfig will look like so that it will parse all escaped strings back into chars so that "\t" string will

bq tool, bat file | escaping characters not working when CALL

匆匆过客 提交于 2020-01-03 16:55:02
问题 Using bq tool I have no problem escaping the > operator with a caret ^: bq query "SELECT x FROM [presentation_dim.dim_events] WHERE event^>1" However, when I CALL the exact same command through a bat file whe whole thing breaks down. call bq query "SELECT x FROM [presentation_dim.dim_events] WHERE event^>1" I understand call is the problem here. I can't remove it, since I need to run additional commands after it ( bq extract and gsutil cp ). I've tried adaptations of what is shown on Escape

How to escape special characters in the regex ***(.*)

ぃ、小莉子 提交于 2020-01-03 15:54:10
问题 I am new to Java. Can somebody help me? Is there any method available in Java which escapes the special characters in the below regex automatically? Before escaping ***(.*) and after escaping \\*\\*\\*(.*) I don't want to escape (.*) here. 回答1: On the face of it, Pattern.quote appears to do the job. However, looking at the detail of your question, it appears that you want / expect to be able to escape some meta-characters and not others. Pattern.quote won't do that if you apply it to a single

What are the characters that stringByAddingPercentEscapesUsingEncoding escapes?

半城伤御伤魂 提交于 2020-01-03 09:04:11
问题 I've had to switch from stringByAddingPercentEscapesUsingEncoding to CFURLCreateStringByAddingPercentEscapes because it doesn't escape question marks (?). I'm curious what exactly it does escape, and the rationale behind the partial escaping vs RFC 3986. 回答1: Some good categories have been created for doing just what you need: http://iosdevelopertips.com/networking/a-better-url-encoding-method.html http://www.cocoanetics.com/2009/08/url-encoding/ The rationale for leaving certain characters