control-characters

Escaping control characters in Oracle XDB

筅森魡賤 提交于 2019-11-28 09:44:09
问题 I'm completely new to Oracle's XDB, in particular using it to generate XML output from a database table, and am working on an application which is moving from 9i (Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production) to 11g (Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production). Here's a small test case which illustrates the problem I'm having: select xmlelement("test", test) from (select 'a' test from dual); This works and gives me: <test>a</test> However in 11g

Why is '\\x' invalid in Python?

余生长醉 提交于 2019-11-28 08:09:21
I was experimenting with '\' characters, using '\a\b\c...' just to enumerate for myself which characters Python interprets as control characters, and to what. Here's what I found: \a - BELL \b - BACKSPACE \f - FORMFEED \n - LINEFEED \r - RETURN \t - TAB \v - VERTICAL TAB Most of the other characters I tried, '\g', '\s', etc. just evaluate to the 2-character string of a backslash and the given character. I understand this is intentional, and makes sense to me. But '\x' is a problem. When my script reaches this source line: val = "\x" I get: ValueError: invalid \x escape What is so special about

Differentiating text keycode from control keycode in Android KeyEvent

耗尽温柔 提交于 2019-11-28 06:48:03
问题 There are 284 KeyEvent key codes. Some of them represent Unicode characters (like KEYCODE_A and KEYCODE_1 ), while others represent control characters (like KEYCODE_DEL ). I am making a custom view that handles keyboard input. It gets most of its input from an Input Connection, but sometimes keyboards send key codes (normall associated with hard keyboard input). I need to handle that, too. Do I need to exhaustively handle every control key code and then convert the rest to text (with (char)

Match non printable/non ascii characters and remove from text

瘦欲@ 提交于 2019-11-27 20:07:54
My JavaScript is quite rusty so any help with this would be great. I have a requirement to detect non printable characters (control characters like SOH, BS etc) as well extended ascii characters such as Ž in a string and remove them but I am not sure how to write the code? Can anyone point me in the right direction for how to go about this? This is what I have so far: $(document).ready(function() { $('.jsTextArea').blur(function() { var pattern = /[^\000-\031]+/gi; var val = $(this).val(); if (pattern.test(val)) { for (var i = 0; i < val.length; i++) { var res = val.charAt([i]); alert(

Are Fortran control characters (carriage control) still implemented in compilers?

丶灬走出姿态 提交于 2019-11-27 14:28:31
In the book Fortran 95/2003 for Scientists and Engineers , there is much talk given to the importance of recognizing that the first column in a format statement is reserved for control characters. I've also seen control characters referred to as carriage control on the internet. To avoid confusion, by control characters, I refer to the characters "1, a blank (i.e. \s), 0, and +" as having an effect on the vertical spacing of output when placed in the first column (character) of a FORMAT statement. Also, see this text-only web page written entirely in fixed-width typeface : Fortran carriage

Get-Content and show control characters such as `r - visualize control characters in strings

风流意气都作罢 提交于 2019-11-27 06:24:00
问题 What flag can we pass to Get-Content to display control characters such as \r\n or \n ? What I am trying to do, is to determine whether the line endings of a file are in the Unix or Dos style. I have tried simply running Get-Content , which doesn't show any line ending. I have also tried using Vim with set list , which just shows the $ no matter what the line ending is. I would like to do this with PowerShell, because that would be mighty useful. 回答1: One way is to use Get-Content's -Encoding

Why is '\x' invalid in Python?

痴心易碎 提交于 2019-11-27 02:06:05
问题 I was experimenting with '\' characters, using '\a\b\c...' just to enumerate for myself which characters Python interprets as control characters, and to what. Here's what I found: \a - BELL \b - BACKSPACE \f - FORMFEED \n - LINEFEED \r - RETURN \t - TAB \v - VERTICAL TAB Most of the other characters I tried, '\g', '\s', etc. just evaluate to the 2-character string of a backslash and the given character. I understand this is intentional, and makes sense to me. But '\x' is a problem. When my

Are Fortran control characters (carriage control) still implemented in compilers?

拥有回忆 提交于 2019-11-26 16:45:26
问题 In the book Fortran 95/2003 for Scientists and Engineers, there is much talk given to the importance of recognizing that the first column in a format statement is reserved for control characters. I've also seen control characters referred to as carriage control on the internet. To avoid confusion, by control characters, I refer to the characters "1, a blank (i.e. \s), 0, and +" as having an effect on the vertical spacing of output when placed in the first column (character) of a FORMAT

Finding the Values of the Arrow Keys in Python: Why are they triples?

和自甴很熟 提交于 2019-11-26 16:11:18
I am trying to find the values that my local system assigns to the arrow keys, specifically in Python. I am using the following script to do this: import sys,tty,termios class _Getch: def __call__(self): fd = sys.stdin.fileno() old_settings = termios.tcgetattr(fd) try: tty.setraw(sys.stdin.fileno()) ch = sys.stdin.read(1) finally: termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) return ch def get(): inkey = _Getch() while(1): k=inkey() if k!='':break print 'you pressed', ord(k) def main(): for i in range(0,25): get() if __name__=='__main__': main() Then I ran the script, and hit UP DOWN

What are carriage return, linefeed, and form feed?

一世执手 提交于 2019-11-25 23:47:40
问题 What is the meaning of the following control characters: Carriage return Line feed Form feed 回答1: Carriage return means to return to the beginning of the current line without advancing downward. The name comes from a printer's carriage, as monitors were rare when the name was coined. This is commonly escaped as "\r", abbreviated CR, and has ASCII value 13 or 0x0D. Linefeed means to advance downward to the next line; however, it has been repurposed and renamed. Used as "newline", it terminates