control-characters

What's the file/group/record/unit separator control characters and its usage?

蓝咒 提交于 2019-12-20 09:11:18
问题 Unicode defines several control characters from ASCII. http://www.unicode.org/charts/PDF/U0000.pdf I see many control characters are widely used but I really don't see where "information separators" are used. (U+001C~U+001F) What are them? What's the history of them? Where did they used for? 回答1: Lammert Bies explains both their usage and the history behind. 28 – FS – File separator The file separator FS is an interesting control code, as it gives us insight in the way that computer

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

▼魔方 西西 提交于 2019-12-17 03:38:23
问题 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

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

混江龙づ霸主 提交于 2019-12-17 03:38:14
问题 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

How to process the backspace terminal control character in Java? [closed]

本小妞迷上赌 提交于 2019-12-13 09:53:54
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am coding a basic telnet server in Java and I would like to process the backspace terminal control character denoted by '\b'. The backspace character deletes/removes the preceding character in the string. I am currently using the example method below to successfully achieve this but does anyone know of a

Node.js: How to send control C to child process

让人想犯罪 __ 提交于 2019-12-12 02:08:39
问题 I am writing one web-like linux shell using node.js + socket.io. Simple command like, ls, cd are working well. But when issue command like ping google.com, the stdout is printing endlessly. I tried to send Ctrl +C to stdin, but no luck. 1) spawn 'bash' process spawn = require('child_process').spawn; var sh = spawn('bash'); 2) send bash stdout to socket.io sh.stdout.on('data', function(data) { console.log('stdout' + data); listener.sockets.emit("stdout",new Buffer(data)); }); 3) Sending Ctl C

Bug caused by non printable character embedded by Visual Studio

喜欢而已 提交于 2019-12-11 01:33:29
问题 I have some cross platform code that I regularly share between Visual Studio and Xcode (and Vim). At some point, I modified a string in this code, using Visual Studio. That string somehow ended up with an errant ' ^H ' control character (ASCII 0x08) embedded in it. The trouble is, this control character is non-printable. It wasn't visible in Visual Studio, nor was it visible in Xcode. Viewing the source in Vim, I could clearly see the problem. Vim helpfully displays the control character, and

Are all non-printable characters control characters?

自闭症网瘾萝莉.ら 提交于 2019-12-10 20:53:51
问题 Does this (perldoc unicode) mean that all non-printable characters are control-characters? \p{Print} This matches any character that is graphical or blank, except controls. 回答1: If invisible whitespace/blank characters are considered printable, then yes, that only leaves control characters as unprintable. But if you don't consider whitespace/blank characters such as line separator printable, then no. 回答2: This will tell you for sure: diff -U0 \ <( unichars -au '\P{Print}' ) \ <( unichars -au

Node JS REPL, Sockets, and Telnet - Tab Completion, Arrow Keys, etc

会有一股神秘感。 提交于 2019-12-10 20:24:31
问题 I have been playing around with Node's REPL. I thought it would be pretty cool to make it available via a Socket, connect to it via Telnet/puTTY/whatever, and debug my server on-the-fly. I used the example found here: http://nodejs.org/docs/latest/api/repl.html, which basically looks like this... net.createServer(function (socket) { var cmd = repl.start(">", socket); //... some other stuff here.... not important }).listen(5001); OK, great! Now I can connect to port 5001 with Telnet and

How To read control characters in a pdf using java

≡放荡痞女 提交于 2019-12-10 00:21:42
问题 I'm using PDFBox to read PDF files. But some characters are not printing well and printing like control characters. Some one help to read the values from the control characters. I've attached the image Kindly have a look at that image Sample PDF: Screenshot: Sample Code class PDFManager { private PDFParser parser; private PDFTextStripper pdfStripper; private PDDocument pdDoc ; private COSDocument cosDoc ; private String Text ; private String filePath; private File file; public PDFManager() {

Removing binary control characters from a text file

限于喜欢 提交于 2019-12-08 01:55:01
问题 I have a text file that contains binary control characters, such as "^@" and "^M". When I try to perform string operations directly on the text file, the control characters crash the script. Through trial and error, I discovered that the more command will strip the control characters so that I can process the file properly. more file_with_control_characters.not_txt > file_without_control_characters.txt Is this considered a good method, or is there a better way to remove control characters