quote

Spécial HTML character ( & # 39; -> quot ) in XML file

醉酒当歌 提交于 2019-12-24 22:47:43
问题 I got an " & # 39; " in my XML file. (it is the char code for the quot in HTML) EX : < desc > blabla bla & # 39 ; bla bla la. < / desc> When i parse it with String tmp = itemOfEvent.getFirstChild().getNodeValue() it cut my text juste before the quot. I got a crash with URL.encode(tmp, "UTF-8") Better idea ? 回答1: You say that the text is HTML encoded so try this: String fixedTmp = Html.fromHtml(tmp).toString(); 回答2: The best solution i've found was to replace bad char xmlString = xmlString

Keep spaces when using sed command in kornshell script

青春壹個敷衍的年華 提交于 2019-12-24 05:26:12
问题 I'm having some trouble with the sed command : I'd like to replace in a string, a single quote by two single quote Here's my string : 04CA07807800106109XE00187200000081960 NI 0780643442 178'0700 I used this sed command to replace the single quote : line=`echo $line | sed "s/'/''/g"` The result is 04CA07807800106109XE00187200000081960 NI 0780643442 178''0700 As you can see, the single quote is properly replaced by two single quotes. But I lost all the spaces between each character of my string

PHP exec, system or passthru all remove single or double quotes

家住魔仙堡 提交于 2019-12-24 03:51:47
问题 When ever I try to execute a command to the shell via php's exec/passthru/system functions it seems to remove quotes from the command. $str_file = '1323988284_700.csv'; exec("/usr/bin/lftp -e 'set ftp:passive-mode true; set ftp:ssl-protect-data yes; put /web/files/{$str_file}; bye;' -u user,pass ftp://ftp.site.com/uploaddir/"); Here is the output from checking the process ps faxxx | grep lftp 4486 ? S 0:00 | \_ /usr/bin/lftp -e set ftp:passive-mode true; set ftp:ssl-protect-data yes; put /web

Is it possible to generate (quote (quote var)) or ''var dynamically?

╄→гoц情女王★ 提交于 2019-12-23 05:34:09
问题 In question Using AND with the apply function in Scheme , I proposed an solution to apply "and" onto a list of atoms (i.e. s-exp which is neither null, nor pair.) in PLT-Scheme 372. Welcome to DrScheme, version 372 [3m]. Language: Textual (MzScheme, includes R5RS). > (eval (cons 'and (list ''#f ''#f ''#t))) #f > (eval (cons 'and (list ''a ''b ''c))) c But right after that I realized that: it's not easy to generate (quote (quote var)) or ''var dynamically. To be specific, the following code

Why won't my little lisp QUOTE?

倖福魔咒の 提交于 2019-12-22 12:17:13
问题 I've been writing up a micro-mini-lisp based on the encoding in minilisp, the McCarthy paper (as emended by the Roots of Lisp), and using a (possibly objectionable) style based on the J Incunabulum. And using the PP_NARG macro from here. I was also motivated by my previous project, a codegolf'ed lambda calculus interpreter which I later discovered to be eerily similar to the 1999 ioccc Lisp interpreter, particularly in the use of cursors rather than pointers to refer to memory addresses. It

Common Lisp case and quoted elements

让人想犯罪 __ 提交于 2019-12-22 10:45:26
问题 I'm writing a dungeon crawler game in CL, and I'm having trouble with the case form. Two things: Common Lisp complains Duplicate keyform QUOTE in CASE statement (make-instance 'cl-rogue:tile tile-type 'wall) should print as "#", but the object prints as " " no matter which tile-type I use. The code: (in-package :cl-user) (defpackage :cl-rogue (:use :common-lisp) (:export :*rows* :*cols* :*levels* :tile :tile-type :tile-contents :tile-hidden :tile-locked :tile-closed :main)) (in-package :cl

Replace double quotes (within qualifiers) in CSV for SSIS import

大城市里の小女人 提交于 2019-12-22 00:34:18
问题 I have a SSIS package importing data from a .csv file. This file has doulbe quotes ( " ) qualifiers for each entry in it but also in between. I also added commas ( , ) as a column delimiter. I can't give you the original data I'm working with but here is an example how my data is passed in Flat File Source: "ID-1","A "B"", C, D, E","Today" "ID-2","A, B, C, D, E,F","Yesterday" "ID-3","A and nothing else","Today" As you can see the second column can contain quotes (and commas) which smashes my

What is the difference between 1 and '1 in Lisp?

孤街浪徒 提交于 2019-12-20 09:14:24
问题 I had never really thought about whether a symbol could be a number in Lisp, so I played around with it today: > '1 1 > (+ '1 '1) 2 > (+ '1 1) 2 > (define a '1) > (+ a 1) 2 The above code is scheme, but it seems to be roughly the same in Common Lisp and Clojure as well. Is there any difference between 1 and quoted 1? 回答1: Well, they are in fact very different. '1 is however precisely the same as (quote 1) . (car ''x) evaluates to the symbol 'quote'. 1 is an S-expression, it's the external

What is the difference between 1 and '1 in Lisp?

戏子无情 提交于 2019-12-20 09:13:41
问题 I had never really thought about whether a symbol could be a number in Lisp, so I played around with it today: > '1 1 > (+ '1 '1) 2 > (+ '1 1) 2 > (define a '1) > (+ a 1) 2 The above code is scheme, but it seems to be roughly the same in Common Lisp and Clojure as well. Is there any difference between 1 and quoted 1? 回答1: Well, they are in fact very different. '1 is however precisely the same as (quote 1) . (car ''x) evaluates to the symbol 'quote'. 1 is an S-expression, it's the external

Escaping quotes in a javascript string

无人久伴 提交于 2019-12-20 04:53:08
问题 I'm trying to escape the quotes (and apostrofes and escape char) in a text string in javascript: var text = 'Escape " and \' and /.'; var rx = new RegExp('/([\'"])/g'); console.log(text, ' ==> ', text.replace(rx,'//\1'));​​​​​ What I expect to be output is Escape /" and /' and //. , but instead I get Escape " and ' and /. . I just can't seem to get this working and don't know what's wrong. Here's a JSFiddle: http://jsfiddle.net/hvtgf/ 回答1: Escaping means using backslash \ but not slash / .