console

Set console title in C++ using a string

半世苍凉 提交于 2020-05-08 18:10:17
问题 I would like to know how to change the console title in C++ using a string as the new parameter. I know you can use the SetConsoleTitle function of the Win32 API but that does not take a string parameter. I need this because I am doing a Java native interface project with console effects and commands. I am using windows and it only has to be compatible with Windows. 回答1: The SetConsoleTitle function does indeed take a string argument. It's just that the kind of string depends on the use of

How to run rake tasks from console?

走远了吗. 提交于 2020-03-17 03:37:27
问题 I want to invoke my rake task from console. Is it doable? if yes, how to do so? I tried this on console: require 'rake' Rake::Task['my_task'].invoke but it give me this error: RuntimeError: Don't know how to build task it's like the rake cannot found the task. any help would be appreciated. Thank you Edit: I am using rails 2.3.5 回答1: Running your Rake tasks requires two steps: Loading Rake Loading your Rake tasks You are missing the second step. Normally this is done in the Rakefile, but you

How to clear console in gdb while in TUI

馋奶兔 提交于 2020-03-01 05:56:26
问题 While i am debugging my code in GDB in TUI mode Control + L wont work to clear console. So how am i able to clear console while i am in TUI mode? It just refreshes the screen but doesnt clear the console. I looked at the GDB's official website but as i said, there is only Control + L , but that only clears console while not in TUI mode. The website is here: https://sourceware.org/gdb/onlinedocs/gdb/TUI-Keys.html#TUI-Keys 回答1: The following works, but is a bit of a cheat: control x-a control L

Detect Ctrl + S in Console

£可爱£侵袭症+ 提交于 2020-02-24 14:42:53
问题 I'm developing a console application in which I need to detect several hotkeys such as Ctrl + N , Ctrl + O and Ctrl + S . Here's a part of the code that I use to recognize these hotkeys: ConsoleKeyInfo input = Console.ReadKey(true); if (input.Modifiers == ConsoleModifiers.Control) { if (input.Key == ConsoleKey.N) { // ... } else if (input.Key == ConsoleKey.O) { // ... } else if (input.Key == ConsoleKey.S) { //... } } The code above works without any issues for Ctrl + N and Ctrl + O . But, I

Detect Ctrl + S in Console

孤者浪人 提交于 2020-02-24 14:41:38
问题 I'm developing a console application in which I need to detect several hotkeys such as Ctrl + N , Ctrl + O and Ctrl + S . Here's a part of the code that I use to recognize these hotkeys: ConsoleKeyInfo input = Console.ReadKey(true); if (input.Modifiers == ConsoleModifiers.Control) { if (input.Key == ConsoleKey.N) { // ... } else if (input.Key == ConsoleKey.O) { // ... } else if (input.Key == ConsoleKey.S) { //... } } The code above works without any issues for Ctrl + N and Ctrl + O . But, I

C++ : Using background colors with clrscr()

Deadly 提交于 2020-02-23 07:27:41
问题 I am currently making a simple game. The initial screen is the welcome screen with the following for color: system("color f3")//background:white , text:aqua then when I invoke the following from my main() function void display() { Sleep(2000); clrscr(); system("color f3"); cout<<"Levels:\n\n"; int d; cout<<"1.Easy\n"; cout<<"2.Medium\n"; cout<<"3.Hard\n"; cout<<"4.Insane!\n"; cout<<"Choose your difficulty:"; cin>>d; } without the statement system("color f3"); in my display() the background is

How to use the console within Sublime Text

旧城冷巷雨未停 提交于 2020-02-18 05:13:06
问题 I'm using Sublime Text 2 to code my programs, and want to run the console within it to compile and run them. Is there any way to embed the console command line inside Sublime Text 2? Is it already there? I'm using both Windows and Linux. 回答1: I think you can try creating a custom Build System . Tools --> Build System --> New Build System... This is a simple build script for the C programming language: { "cmd" : ["gcc", "$file", "-o", "$file_base_name"], "cmd" : ["$file_base_name"], "selector"

How to use the console within Sublime Text

青春壹個敷衍的年華 提交于 2020-02-18 05:09:41
问题 I'm using Sublime Text 2 to code my programs, and want to run the console within it to compile and run them. Is there any way to embed the console command line inside Sublime Text 2? Is it already there? I'm using both Windows and Linux. 回答1: I think you can try creating a custom Build System . Tools --> Build System --> New Build System... This is a simple build script for the C programming language: { "cmd" : ["gcc", "$file", "-o", "$file_base_name"], "cmd" : ["$file_base_name"], "selector"

How to use the console within Sublime Text

断了今生、忘了曾经 提交于 2020-02-18 05:09:11
问题 I'm using Sublime Text 2 to code my programs, and want to run the console within it to compile and run them. Is there any way to embed the console command line inside Sublime Text 2? Is it already there? I'm using both Windows and Linux. 回答1: I think you can try creating a custom Build System . Tools --> Build System --> New Build System... This is a simple build script for the C programming language: { "cmd" : ["gcc", "$file", "-o", "$file_base_name"], "cmd" : ["$file_base_name"], "selector"

How to use the console within Sublime Text

心不动则不痛 提交于 2020-02-18 05:08:05
问题 I'm using Sublime Text 2 to code my programs, and want to run the console within it to compile and run them. Is there any way to embed the console command line inside Sublime Text 2? Is it already there? I'm using both Windows and Linux. 回答1: I think you can try creating a custom Build System . Tools --> Build System --> New Build System... This is a simple build script for the C programming language: { "cmd" : ["gcc", "$file", "-o", "$file_base_name"], "cmd" : ["$file_base_name"], "selector"