escaping

How to invoke env from eLisp and escape the path to the target program properly?

£可爱£侵袭症+ 提交于 2020-01-06 08:37:30
问题 What I'm trying to do is as follows: (let ((pj-path (concat src haxe-project-generator))) (when (file-exists-p pj-path) (shell-command (concat "env " (haxe-build-env-vars <more arguments>) (format "'%s'" pj-path))))) I.e. I want to call a program pj-path in environment populated with some variables. In the line (format "'%s'" pj-path) I tried single and double quotes - but env doesn't do path expansion and if it is quoted, it will treat it as a string, not finding the file. However, if it is

How to store a string containing both single quote( ' ) and double quote( " ) in python

和自甴很熟 提交于 2020-01-06 02:31:20
问题 (+CMGL: 2,"REC READ","DD-Etopup",,"11/11/04,12:48:51+22" Hye! How's it going?) I want to store this sms message in python as a string. How can I do this? 回答1: Triple quotes - this will allow embedded single and double-quotes without escape characters. s = """(+CMGL: 2,"REC READ","DD-Etopup",,"11/11/04,12:48:51+22" Hye! How's it going?)""" 回答2: Backslash escaping is the quick answer: >>> '(+CMGL: 2,"REC READ","DD-Etopup",,"11/11/04,12:48:51+22" Hye! How\'s it going?)' '(+CMGL: 2,"REC READ","DD

How to escape Hibernate keyword in query?

放肆的年华 提交于 2020-01-06 02:14:25
问题 Unfortunatelly I live in Belarus, domain zone .BY I'm using Hibernate ORM and Spring Data JPA. I have difficulty in creating new Object in SELECT statement, because BY is a reserved word in SQL. import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import java.util.List; import by.naxa.project.model.Event; import by.naxa.project.model.Demo; import by.naxa.project.model.Pair;

Problems using a StringBuilder to construct HTML in C#

时光怂恿深爱的人放手 提交于 2020-01-06 02:00:54
问题 I have this line of code that forms an html string: StringBuilder builder = new StringBuilder(); builder.Append("<a href='#' onclick="); builder.Append((char)22); //builder.Append('\"'); builder.Append("diagnosisSelected('" + obj.Id + "', '" +obj.Name + "')"); builder.Append((char)22); builder.Append(" >" + obj.Name + "</a>"); In the browser I get <a href='#' onclick=\"diagnosisSelected('id', 'text')\" >some text here</a> and I get an error because of \". How can I output a "? 回答1: It's funny

MS SQL Backslash preceding new line/line feed removes line break

心已入冬 提交于 2020-01-05 23:15:09
问题 I'm working in classical ASP and am trying to simply insert some user input into my MS SQL 2008 database. This is something I do basically every day, but I don't think I've ever experienced this bug before. The bug I am getting is that, if a user ends a line of text in backslash, and starts a new line below, both the backslash and line break are lost after the data is stored in the DB. If i try the following statement, hardcoded from an ASP file: UPDATE TBLarticle_text SET Introduction =

Why does Jinja escape html in a macro?

ⅰ亾dé卋堺 提交于 2020-01-05 05:46:09
问题 I'm writing a Jinja macro to render some form data in a template, but for some reason the form data renders as escaped text instead of html! Here is my macro, with the first row of the form called: {% macro formrow(field) %} <tr> <td>form.{{ field }}.label|safe</td> <td>form.{{ field }}|safe</td> <td>form.{{ field }}.help_text|safe</td> <td>form.{{ field }}.errors|safe</td> </tr> {% endmacro %} {{ formrow('item_name') }} Ideas? What am I missing? 回答1: It seems you are not getting the Jinja

json_decode() does not work with this valid JSON string

我的未来我决定 提交于 2020-01-05 03:35:48
问题 Here is the JSON string my app is receiving from Postmark, an inbound email delivery service: { "From": "me@mydomain.com", "FromFull": { "Email": "me@mydomain.com", "Name": "Jack" }, "To": "\"test@email.mydomain.com\" <test@email.mydomain.com>", "ToFull": [ { "Email": "test@email.mydomain.com", "Name": "test@email.mydomain.com" } ], "Cc": "", "CcFull": [], "ReplyTo": "", "Subject": "Brussel Sprouts", "MessageID": "a97fb074-338e-48c5-97db-d9c5155e9307", "Date": "Sun, 30 Dec 2012 18:10:54 +0000

json_decode() does not work with this valid JSON string

百般思念 提交于 2020-01-05 03:35:15
问题 Here is the JSON string my app is receiving from Postmark, an inbound email delivery service: { "From": "me@mydomain.com", "FromFull": { "Email": "me@mydomain.com", "Name": "Jack" }, "To": "\"test@email.mydomain.com\" <test@email.mydomain.com>", "ToFull": [ { "Email": "test@email.mydomain.com", "Name": "test@email.mydomain.com" } ], "Cc": "", "CcFull": [], "ReplyTo": "", "Subject": "Brussel Sprouts", "MessageID": "a97fb074-338e-48c5-97db-d9c5155e9307", "Date": "Sun, 30 Dec 2012 18:10:54 +0000

Match multiple strings containing escape characters in R

∥☆過路亽.° 提交于 2020-01-05 03:05:00
问题 I have a vector of text strings containing smilies and a dictionary containing only the smilies. A <- c("This :/ :/ :) ^^","is :/ ^^", "weird^^ :)") B <- c(":)",":/","^^") I would like to extract all matches of smilies for each text string including duplicates, so my output should look like this: [[1]] [1] ":/" ":/" ":)" "^^" [[2]] [1] ":/" "^^" [[3]] [1] "^^" ":)" This is what I tried so far: # does not return duplicates sapply(A, function(x) B[str_detect(x, fixed(B))], USE.NAMES = FALSE) [

xslt 2.0 how replace $ by escaped dollar (for conversion to LaTeX)

让人想犯罪 __ 提交于 2020-01-05 02:58:25
问题 I am new to XSLT. I googled extensively but couldn't figure out how to do the following: I am transforming XML to LaTeX. Of course, LaTeX needs to escape characters such as $ and #. I tried the following in the replace function but it does not work. (They do work without the replace function.) <xsl:template match="xyz:doc"> \subsubsection{<xsl:value-of select="replace( xyz:headline, '(\$)', '\$1' )"/>} ... </xsl:template> <xsl:template match="xyz:doc"> \subsubsection{<xsl:value-of select=