terminal

Reading the Device Status Report ANSI escape sequence reply

拟墨画扇 提交于 2019-12-29 07:35:15
问题 I'm trying to retrieve the coordinates of cursor in a VT100 terminal using the following code: void getCursor(int* x, int* y) { printf("\033[6n"); scanf("\033[%d;%dR", x, y); } I'm using the following ANSI escape sequence: Device Status Report - ESC[6n Reports the cursor position to the application as (as though typed at the keyboard) ESC[n;mR, where n is the row and m is the column. The code compiles and the ANSI sequence is sent, but, upon receiving it, the terminal prints the ^[[x;yR

How to use SyntaxNet output to operate an executive command ,for example save a file in a folder, on Linux system

萝らか妹 提交于 2019-12-29 07:17:12
问题 having downloaded and trained SyntaxNet, I am trying to write a program that can open new/existed files, for example AutoCAD files, and save the files in an specific directory by analyzing the text: open LibreOffice file X . considering the output of SyntaxNet as: echo "save AUTOCAD file X in directory Y" | ./test.sh > output.txt Input: save AUTOCAD file X in directory Y Parse: save VB ROOT +-- X NNP dobj | +-- file NN compound | +-- AUTOCAD CD nummod +-- directory NN nmod +-- in IN case +--

Prevent “echo” from interpreting backslash escapes

前提是你 提交于 2019-12-29 07:15:51
问题 I'd like to echo something to a file that contains new line escape sequences, however I would like them to remain escaped. I'm looking for basically the opposite to this question. echo "part1\npart2" >> file I would like to look like this in the file $ cat file old part1\npart2 but it looks like $ cat file old part1 part2 回答1: This is a good example of why POSIX recommends using printf instead of echo (see here, under "application usage"): you don't know what you get with echo . You could get

Prevent “echo” from interpreting backslash escapes

爷,独闯天下 提交于 2019-12-29 07:15:09
问题 I'd like to echo something to a file that contains new line escape sequences, however I would like them to remain escaped. I'm looking for basically the opposite to this question. echo "part1\npart2" >> file I would like to look like this in the file $ cat file old part1\npart2 but it looks like $ cat file old part1 part2 回答1: This is a good example of why POSIX recommends using printf instead of echo (see here, under "application usage"): you don't know what you get with echo . You could get

How can I edit PYTHONPATH on a Mac?

两盒软妹~` 提交于 2019-12-29 06:16:23
问题 How can I permanently change the PYTHONPATH on a mac? I've tried editing .bash_profile, but when I use print sys.path in a file it gives a huge list of different URLs than the .bash_profile. In Terminal when I type echo $PYTHONPATH it shows a blank line. I don't want to use sys.path.append('...') because then I have to put that in every file. 回答1: You can append the path to $PATH and not to $PYTHONPATH. if you insist to change the PYTHONPATH , in some context that is prefferable: do this:

How can I edit PYTHONPATH on a Mac?

亡梦爱人 提交于 2019-12-29 06:16:09
问题 How can I permanently change the PYTHONPATH on a mac? I've tried editing .bash_profile, but when I use print sys.path in a file it gives a huge list of different URLs than the .bash_profile. In Terminal when I type echo $PYTHONPATH it shows a blank line. I don't want to use sys.path.append('...') because then I have to put that in every file. 回答1: You can append the path to $PATH and not to $PYTHONPATH. if you insist to change the PYTHONPATH , in some context that is prefferable: do this:

How to import file into sqlite?

╄→гoц情女王★ 提交于 2019-12-29 05:35:08
问题 On a Mac, I have a txt file with two columns, one being an autoincrement in an sqlite table: , "mytext1" , "mytext2" , "mytext3" When I try to import this file, I get a datatype mismatch error: .separator "," .import mytextfile.txt mytable How should the txt file be structured so that it uses the autoincrement? Also, how do I enter in text that will have line breaks? For example: "this is a description of the code below. The text might have some line breaks and indents. Here's the related

What does “|” mean in a terminal command line? [closed]

眉间皱痕 提交于 2019-12-29 05:01:09
问题 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 7 years ago . Sorry for posting it here, but Google does a very bad job when searching for symbols. What does the "|" mean in: "some string" | someexecutable.py 回答1: It is the pipe symbol. It separates two programs on a command line (see Pipelines in the bash manual), and the standard output of the first program (on the LHS

Mac Terminal - How to start Android Virtual Device Manager on CLI?

蹲街弑〆低调 提交于 2019-12-29 04:36:27
问题 I am currently developing a mobile web application and I don't have a test device yet so I'm using the android-emulator to check the site. On my mac, I have installed the stand-alone Android SDK. Every time I want to use the AVD Manager, I have to execute the following on my terminal: monitor This command (being executed on the installed android sdk path) will open the Android Device Monitor and from here, I go to its menu bar and select Window Virtual Device Manager just to open the AVD

Add Xcode project to github repo?

☆樱花仙子☆ 提交于 2019-12-29 02:33:08
问题 I have JUST created a new github repo on the website. Keep in mind that I am a noob but can do basic things in terminal. Anyway, so I just created the repo on my account on github.com and didn't do a single thing to it yet. So all I want to do is take my Xcode project folder and upload it to my new github repo. How do I do this via terminal? 回答1: The best way really is to follow the instructions GitHub gives you: First, go the correct directory cd <directory of your Xcode project> It sound