terminal

Getting issue on terminal command while creating opencv2.framework

丶灬走出姿态 提交于 2019-12-10 11:58:08
问题 I was facing some issues with opencv2.framework in iOS related to bitcode. While searching on the internet, I found this post regarding creating the opencv2.framework with bitcode support enabled. First 3 steps run successfully but on 4th step, i am facing some issue. I dont know whether these are issues regarding to python or something else. Kindly help me. Here are the logs. 回答1: I get the same issue. My solution is that: Check cmake has been installed. If not, use home brew to install

How to print a list of dicts as an aligned table?

妖精的绣舞 提交于 2019-12-10 11:54:11
问题 So after going through multiple questions regarding the alignment using format specifiers I still can't figure out why the numerical data gets printed to stdout in a wavy fashion. def create_data(soup_object,max_entry=None): max_=max_entry entry=dict() for a in range(1,int(max_)+1): entry[a]={'Key':a, 'Title':soup_object[a].div.text.strip(), 'Link':soup_object[a].div.a['href'], 'Seeds':soup_object[a](attrs={'align':'right'})[0].text.strip(), 'Leechers':soup_object[a](attrs={'align':'right'})

Rails Server Keeps Exiting (SocketError)

二次信任 提交于 2019-12-10 11:46:52
问题 Rails noob here. I'm trying to work through Michael Hartl's Ruby on Rails Tutorial, but every time I run rails server, it keeps Exiting and shows me a SocketError. I was able to run the server just fine this past weekend using wifi from a startup, so I'm guessing it has something to do with my internet connection/firewall? I also ran into the same problem with the server at the library this afternoon. Any help is appreciated! Thanks in advance. => Booting WEBrick => Rails 4.2.0 application

Write std::cerr to txt file

喜欢而已 提交于 2019-12-10 11:45:46
问题 I've added some methods to an existing project. It was writing correctly to a txt file. However i can only see my recently added std::cerr texts now, i execute my project like ./faceDemo > run.txt What are the possible reasons? 回答1: If you wish to redirect the error flow, you should use something like that : ./faceDemo > std.log 2> err.log And if you wish to redirect both flows in the same file use this : ./faceDemo > run.txt 2>&1 2>&1 means redirect error flow into std flow 来源: https:/

Open a Terminal window with Java

限于喜欢 提交于 2019-12-10 11:44:01
问题 I am aware that you can pass commands to the Terminal and it returns your result in Java. The problem is for undisclosed reasons I need a Terminal window to open and to have the command in it. This code works to open an empty Terminal window (on mac): p = Runtime.getRuntime().exec("/usr/bin/open -a Terminal"); And I have seen someone say on a different overflow question that you can do this: p = Runtime.getRuntime().exec("/usr/bin/open -a Terminal [Put Command to pass through here]"); But it

How do I get the color from the backticks command in ruby?

社会主义新天地 提交于 2019-12-10 11:24:17
问题 In a ruby file: When I do system("rspec file_spec.rb") I get a nice colored output . When I do this: result = `rspec file_spec.rb` puts result I get no color at all. Is there any way to preserve the color ? btw, I'm on OSX with Terminal.app if that matters. 回答1: From reading the code it looks like RSpec calls IO#isatty on the output stream to decide whether or not to colorize the output. The backquote method must work differently from system in this respect. EDIT This works if you add the

Why is the Git version I install with Homebrew different from the version on the website?

霸气de小男生 提交于 2019-12-10 11:17:14
问题 When I installed Git with Homebrew it shows as version 1.8.5.2 but on the website the download is for 2.0.1. Why is Homebrew installing a different version of Git? 回答1: Make sure the pre-installed git path ( /usr/bin/git ) isn't before the one installed by brew ( /usr/local/bin/git ). Check if /usr/local/bin/git --version returns the expected version. Or /usr/local/git/bin/git --version . See more at: "Homebrew installation of git won't take precedence over system version (in /usr/bin/)" "How

Find Node JS instance on Ubuntu

て烟熏妆下的殇ゞ 提交于 2019-12-10 11:15:37
问题 I wrote a script without putting process.exit(0) after I looked out for the ctrl c, process.on('SIGNIT', gracefulShutdown) I want to know if the process is still running on my machine, I used: ps -aux | grep node It came up with something but i'm not sure what it is. All I want to do is find a quick easy way of finding the process and kill it. Thanks 回答1: Example of output from ps -aux | grep node : foo 22210 0.0 0.5 779600 46088 pts/2 Sl Jan22 2:29 node ./server.js localhost:9999 foo 22794 0

Printing double-size characters with Ncurses

时光总嘲笑我的痴心妄想 提交于 2019-12-10 11:05:01
问题 Many terminal emulators (xterm, Konsole) support double-size characters. Ncurses does not support this and as far as I know, ncurses will not print escape characters (\033 will be unescaped and printed in clear text). Is it possible at all to print double-size characters in a ncurses application? 回答1: The "double-size" character capability you refer to is set by the following ANSI sequences (found here): ESC # 3 DEC double-height line, top half (DECDHL) ESC # 4 DEC double-height line, bottom

Bash pwd and open with pipe not working [duplicate]

百般思念 提交于 2019-12-10 10:59:33
问题 This question already has answers here : How to pass command output as multiple arguments to another command (4 answers) Closed 2 years ago . I'm learning how to work with I/O Redirection in bash and tried some examples with the pipe like: pwd | say ls -l | grep "staff" > out.txt But when I try using both pwd and open using pipe redirection, the command fails and I just receive open usage. What I'm trying is: pwd | open What is the correct way to open the current directory from bash? 回答1: