special-characters

Using Unicode characters in batch file

空扰寡人 提交于 2019-11-27 15:51:09
I am making a batch file that uses these characters: ˧ ˥ ˪ ˫ It is not working, it just terminates itself. I have seen people use characters like this: Å It isnt the character but it turns into a character, can someone give me a list of these, shows the type of letter above and what it turns into? If you want to write console batch files that use those characters, you need an editor that will save the batch file using the console's code page. To check what that is, type: C:\>chcp Active code page: 437 This is the result for my US Windows system. A good editor is Notepad++ . Set that encoding

Alt attribute encoding with JavaScript

僤鯓⒐⒋嵵緔 提交于 2019-11-27 15:34:47
Html entities must be encoded in alt attribute of an image in HTML page. So <img id="formula" alt="A → B" src="formula.png" /> will work well. On the other hand, the same JavaScript code will not work document.getElementById('formula').alt = 'A → B'; and will produce A → B instead of A → B . How to do it through JavaScript, when it is not possible to put the special (unencoded) characters in the source code? Here's an alternative if you can't save your file using a Unicode format: function decodeHTML(str) { return str.replace(/&#(\d+);?/g, function() { return String.fromCharCode(arguments[1])

How to escape a square bracket for Pattern compilation

泪湿孤枕 提交于 2019-11-27 14:18:39
I have comma separated list of regular expressions: .{8},[0-9],[^0-9A-Za-z ],[A-Z],[a-z] I have done a split on the comma. Now I'm trying to match this regex against a generated password. The problem is that Pattern.compile does not like square brackets that is not escaped. Can some please give me a simple function that takes a string like so: [0-9] and returns the escaped string \[0-9\] . You can use Pattern.quote(String) . From the docs: public static String quote​(String s) Returns a literal pattern String for the specified String . This method produces a String that can be used to create a

Display hidden characters in NSTextView

久未见 提交于 2019-11-27 14:10:52
问题 I am writing a text editor for Mac OS X. I need to display hidden characters in an NSTextView (such as spaces, tabs, and special characters). I have spent a lot of time searching for how to do this but so far I have not found an answer. If anyone could point me in the right direction I would be grateful. 回答1: Have a look at the NSLayoutManager class. Your NSTextView will have a layout manager associated with it, and the layout manager is responsible for associating a character (space, tab,

Java- Extract part of a string between two special characters

ε祈祈猫儿з 提交于 2019-11-27 13:12:01
I have been trying to figure out how to extract a portion of a string between two special characters ' and " I've been looking into regex, but frankly I cannot understand it. Example in Java code: String str="21*90'89\""; I would like to pull out 89 In general I would just like to know how to extract part of a string between two specific characters please. Also it would be nice to know how to extract part of the string from the beginning to a specific character like to get 21. Try this regular expression: '(.*?)" As a Java string literal you will have to write it as follows: "'(.*?)\"" Here is

R: What are operators like %in% called and how can I learn about them?

最后都变了- 提交于 2019-11-27 11:58:25
I know the basics like == and != , or even the difference (vaguely) between & and && . But stuff like %in% and %% and some stuff used in the context of sprintf() , like sprintf("%.2f", x) stuff I have no idea about. Worst of all, they're hard to search for on the Internet because they're special characters and I don't know what they're called... There are several different things going on here with the percent symbol: Binary Operators As several have already pointed out, things of the form %% , %in% , %*% are binary operators (respectively modulo, match, and matrix multiply), just like a + , -

How to detect line breaks in a text area input?

試著忘記壹切 提交于 2019-11-27 11:46:45
What is the best way to check the text area value for line breaks and then calculate the number of occurrences, if any? I have a text area on a form on my webpage. I am using JavaScript to grab the value of the text area and then checking its length. Example enteredText = textareaVariableName.val(); characterCount = enteredText.length; // One line break entered returns 1 If a user enters a line break in the text area my calculation above gives the line break a length of 1. However I need to give line breaks a length of 2. Therefore I need to check for line breaks and the number of occurrences

Post UTF-8 encoded data to server loses certain characters

心不动则不痛 提交于 2019-11-27 11:19:20
I am working on project which includes communication of the server (JavaEE app) and client (Android app). XML is sent as one of POST parameters of the HTTP request (named "xml"). There are also few other POST parameters which I pass to server, but in function below I removed them for simplicity. Problem that occurs is that certain letters are not properly delivered to the server - for example character Ű (Note that this is not German Ü , which is properly delivered, by the way). Code for sending is the following: private String postSyncXML(String XML) { String url = "http://10.0.2.2:8080

jQuery: Check if special characters exists in string

不打扰是莪最后的温柔 提交于 2019-11-27 11:07:26
I know this question is asked more often here on Stack, but I can't seem to get a straight answer out of the questions already posted. I need to check if all special characters (except -) are in a string, if so, then give the user an alert. What I have so far is this: if($('#Search').val().indexOf('@') == -1 || $('#Search').val().indexOf('#') == -1 || $('#Search').val().indexOf('$') == -1 || $('#Search').val().indexOf('%') == -1 || $('#Search').val().indexOf('^') == -1 || $('#Search').val().indexOf('&') == -1 || $('#Search').val().indexOf('*') == -1 || $('#Search').val().indexOf('(') == -1 ||

writing some characters like '<' in an xml file

你。 提交于 2019-11-27 10:59:08
since the beginning of my programmation, I used some special character like "<-", ""<<" im my string.xml in Eclipse while developping for Android. All worked fine for one year, but today, i just wanted to make some minor changes and began to edit my xml files. I get now compilation error on these characters because eclipse believe it's part of the xml blocks. Any idea on how I could add this symbol "<" in my xml files? Thank a lot. reece Use < for < > for > & for & NguyenDat Another way to insert special character follow Moss guide: How can I write character & in android strings.xml by used