terminal

rename a function in C#

本秂侑毒 提交于 2019-12-13 05:17:04
问题 is there a way in C# to rename System.Console.WriteLine so that in my C#/console/visual studio program I could write printf("hello"); //instead of System.Console.WriteLine("Hello"); //?? What would this be, a class? a namespace? Do I do this in the header or inside of main? 回答1: Your target looks strange and there is no way to do this in c#. Alternatively you can add a method in a class and use it. private static void printf(string value) { System.Console.WriteLine(value); } Note: above

How can I change one string in multiple files in few subdirectories? [duplicate]

佐手、 提交于 2019-12-13 05:14:54
问题 This question already has answers here : Find and replace with sed in directory and sub directories (7 answers) Closed last year . My question is how can I change one word in many txt files in one directory and multiple subdirectories in BASH? I did as below (check all similar topics) but it is still not working. changePhrase is a name of directory where the subdirectories and files are. Inside that files there is a string that I want to change. I have to make it with a for loop (it's a task)

(Java) Proper use of command line execution

淺唱寂寞╮ 提交于 2019-12-13 05:14:00
问题 I'm following a tutorial on connecting a java class to MySQL (http://zetcode.com/db/mysqljava/). I can get the code to compile and run in Eclipse, but I'm doing something wrong when trying to run it at the command line. I'm using OSX's terminal btw. I perform the following to compile cd dropbox/workspace/mysqltut/src/zetcode javac Version.java This successfully creates the Version.class file. The simple version of my question is, how do I run this from the command line? The following details

Why does getchar work like a buffer instead of working as expected in real-time

两盒软妹~` 提交于 2019-12-13 04:58:36
问题 This is my first question on stackoverflow. Pardon me if I haven't searched properly but I do not seem to find an explanation for this. Was just attempting an example from Bjourne Stroustroup's papers. Added my bits to see the array get re-sized as I type the text. But it doesn't seem to work that way! getchar() simply waits till I am done with entering all the characters and then it will execute the loop. As per the logic, it doesn't actually go into the loop, get a character, perform its

Neo4j Java 7 Terminal Issue

北城余情 提交于 2019-12-13 04:55:31
问题 I'm having issues starting my neo4j instance (2.0.0 M03). I have java 7 installed as indicated in the code block below but when trying to start neo4j it apparently does not recognize this, gives and error and does not start. The terminal output is below. Any ideas on how to fix this or what exactly is going wrong? Thanks a lot. Tim-Bornys-MacBook-Pro:neo4j community 2.0.0 M03 BornyTM$ java -version java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM)

Bug with refresh in python curses

两盒软妹~` 提交于 2019-12-13 04:55:19
问题 I'm writing a program in curses and sometimes happens that if I leave the program opened and I use other terminal tabs for a while, when I go using the program again it seems like it has refreshed something and something has disappeared... I cannot show pics or screenshots because I haven't understood yet well when and how it happens... Is there a way to prevent or fix this? 回答1: screen.getch reads from stdscr , and if it refreshes (due to any change on the screen), will overwrite boxes . You

Color termcaps Konsole?

久未见 提交于 2019-12-13 04:54:19
问题 I've got a problem with ANSI escape codes in my terminal on OpenSuse 13.2. My Makefile use to display pretty colors on OSX at work but at home when I use it I get the litteral termcaps such as \033[1;30m ... \033[0m I know close to nothing about termcaps, I just found these escape characters that seemed to be working fine ! The strangest is that both my OSX and Linux terminal are configured with TERM=xterm-256color so I really don't know where to look for the correct setting I'm currently

Why does this preinstall script just partly run?

牧云@^-^@ 提交于 2019-12-13 04:52:13
问题 I use PackageMaker to create an installation package. The following is my preinstall script to be called by Installer : #!/bin/sh /usr/bin/osascript <<EOF tell application "System Events" if exists (application process "Dictionary") then tell application "Dictionary" to quit end if end tell set theFolder to (path to library folder as text) & "Dictionaries:" set fileNames to {"dict1.dictionary", "dict2.dictionary", "dict3.dictionary", "dict_n.dictionary"} set dict to {} repeat with aFile in

How to interact with a Terminal in python

假装没事ソ 提交于 2019-12-13 04:51:22
问题 I'm working on a small script. The script should open 3 terminals and interact with this terminals independently. I am pretty understand that subprocess is the best way to do that. What I've done so far: # /usr/bin/env python import subprocess term1 = subprocess.Popen(["open", "-a", "Terminal"], stdin=subprocess.PIPE, stdout=subprocess.PIPE) term1.communicate(input="pwd") My problem is I cannot interact with a new terminal. this part term1.communicate(input="pwd") is not working. I cannot

ERROR: Could not find a valid gem '2.12.3' (>= 0) in any repository

懵懂的女人 提交于 2019-12-13 04:48:02
问题 When I try to run: gem install sprockets 2.12.3 It says I have successfully installed sprockets but I have an error: Successfully installed sprockets-2.12.3 Parsing documentation for sprockets-2.12.3 Done installing documentation for sprockets after 1 seconds ERROR: Could not find a valid gem '2.12.3' (>= 0) in any repository 1 gem installed I was wondering whether anyone knew how to fix this problem?? Thank you. 回答1: You need to specify version with -v flag gem install sprockets -v 2.12.3