special-characters

R: creating vectors of latin/greek expression for plot titles, axis labels, or legends

偶尔善良 提交于 2019-12-20 21:58:35
问题 I would like to merge vectors of Latin and Greek text to generate plot titles, axis labels, legend entries, etc. I have provided a trivial example below. I cannot figure out how to render the Greek letters in their native form. I have tried various combinations of expression , parse , and apply to the paste command but I have not been able to vectorize the code that readily generates mixed Latin/Greek text for the case of a single expression (e.g., expression("A ("*alpha*")") is suitable in

Escape String - Output rails string in Javascript [duplicate]

假装没事ソ 提交于 2019-12-20 11:30:35
问题 This question already has answers here : How to pass Ruby variables to a JavaScript function in a Rails view? (6 answers) Closed 5 years ago . I'm trying to assign a string value to a javascript object in my .erb file like so: var data = { 'name': '<%= @product.name %>', ... }; The problem is, if the value of name is Tom's small ears , the output of data.name would be Tom's small ears . Is there a way to escape special characters? I tried doing 'name': '<%= raw @product.name %>' but Uncaught

Replace Both Double and Single Quotes in Javascript String

微笑、不失礼 提交于 2019-12-20 10:29:35
问题 I am pulling in some information from a database that contains dimensions with both ' and " to denote feet and inches. Those characters being in my string cause me problems later and I need to replace all of the single and double quotes. I can successfully get rid of one or the other by doing: this.Vals.replace(/\'/g, "") To get rid of single quotes or this.Vals.replace(/\"/g, "") To get rid of double quotes How do I get rid of both of these in the same string. I've tried just doing this.Vals

How to run mysql command on bash?

时光总嘲笑我的痴心妄想 提交于 2019-12-20 09:47:52
问题 The following code works on the command line mysql --user='myusername' --password='mypassword' --database='mydatabase' --execute='DROP DATABASE myusername; CREATE DATABASE mydatabase;' However, it doesnt work on bash file on excecution #!/bin/bash user=myusername password=mypassword database=mydatabase mysql --user='$user' --password='$password' --database='$database' --execute='DROP DATABASE $user; CREATE DATABASE $database;' I receive the following error: ERROR 1045 (28000): Access denied

What is the first character in the sort order used by Windows Explorer?

做~自己de王妃 提交于 2019-12-20 08:24:15
问题 For example, in a Windows folder, if we create some files and name them 1.html, 2.txt, 3.txt, photo.jpg, zen.png the order will be as is. But if we create another file with the name _file.doc it will be placed at the top. (considering we sort by name in descending order) likewise, what would be the character that would be considered as the first, such that if i use that character, it would place the file on top of the hierarchy? 回答1: The first visible character is '!' according to ASCII table

error when uploading string with special characters

爱⌒轻易说出口 提交于 2019-12-20 07:45:00
问题 i am uploading a string which has special characters Example $what = Fay King suggests ‘Miss Airheart’ as name for ‘Lady Lindy'" and it uploads as Fay King suggests ⬠ÜMiss Airheart⬠"! as name for ⬠What should i do to avoid this decoding error? I have tried to use utf8_encode on the string, but it did not work out. 回答1: Please ensure, that the page that uploads the string and the one that displays the string have the same text encoding, e.g. this one: <meta http-equiv="Content-Type

Special characters pose problems with REST webservice communication

限于喜欢 提交于 2019-12-20 05:34:15
问题 I am trying to post a JSON-object to a REST webservice from an Android application. Everything works fine until I add special characters like å, ä, ö. JSONObject absenceObject = new JSONObject(); absenceObject.put(INFO_DESCRIPTION, "åka pendeltåg"); StringEntity entity = new StringEntity(absenceObject.toString()); httpPost.setEntity(entity); httpPost.setHeader("Accept", "application/json";character); httpPost.setHeader("Content-type", "application/json;charset=UTF-8"); HttpResponse response =

Can I make a code in python that ignores special characters such as commas, spaces, exclamation points, etc?

我们两清 提交于 2019-12-20 05:01:15
问题 I want to create a code that will return "true" (if I type in a palindrome regardless of case or if there are special characters in it), and "false" otherwise. The code I have so far works for phrases with no special characters such as commas, apostrophes, spaces, etc. def is_palindrome(my_str): my_str= my_str.casefold() rev_str= reversed(my_str) if list(my_str) == list(rev_str): print("True") else: print("False") when I do: print (is_palindrome("Rats live on no evil star")) it returns True

How to escape $ in java?

浪尽此生 提交于 2019-12-20 02:29:26
问题 I am trying below code but getting error String x = "aaa XXX bbb"; String replace = "XXX"; String y = "xy$z"; String z=y.replaceAll("$", "\\$"); x = x.replaceFirst(replace, z); System.out.println(x); Error Exception in thread "main" java.lang.IllegalArgumentException: Illegal group reference at java.util.regex.Matcher.appendReplacement(Unknown Source) at java.util.regex.Matcher.replaceFirst(Unknown Source) at java.lang.String.replaceFirst(Unknown Source) at Test.main(Test.java:10) I want

Prevent PHPExcel to calculate values when writing to file

你离开我真会死。 提交于 2019-12-19 17:48:48
问题 When writing my data in an Excel file with class PHPExcel. This is happening when the writer works, not when adding data to the cells $this->sheet->setCellValue() Fatal error: Uncaught exception 'PHPExcel_Calculation_Exception' with message 'Adressen!AF20955 -> Formula Error: Unexpected operator '>'' in \Cell.php:300 Stack trace: #0 \PHPExcel\Worksheet.php(754): PHPExcel_Cell->getCalculatedValue() #1 \PHPExcel\Writer\Excel2007\Worksheet.php(373): PHPExcel_Worksheet->calculateColumnWidths() #2