console-application

Why does the Node.js scripts console close instantly in Windows 8?

妖精的绣舞 提交于 2020-01-11 05:45:07
问题 I've tried nearly every example for scripts I can find. Every sample opens the terminal for a split second. Even this closes as soon as input is entered. Is this normal? var rl = require('readline'); var prompts = rl.createInterface(process.stdin, process.stdout); prompts.question("How many servings of fruits and vegetables do you eat each day? ", function (servings) { var message = ''; if (servings < 5) { message = "Since you're only eating " + servings + " right now, you might want to start

Libraries for displaying a text-mode menu?

安稳与你 提交于 2020-01-10 20:11:07
问题 In a game project I was working on, I was seriously slowed down -- to the point of giving up -- by how there don't seem to be any libraries that can simplify the process of displaying a menu in text mode (i.e., 80x25 textbox, command.com/cmd.exe's native interface). I need something that can give a list of choices, ideally including multiple pages, and including values to be entered to choose one of these; prompt the user; gently chide the user (perhaps ringing a bell and redrawing the

Libraries for displaying a text-mode menu?

我的未来我决定 提交于 2020-01-10 20:08:30
问题 In a game project I was working on, I was seriously slowed down -- to the point of giving up -- by how there don't seem to be any libraries that can simplify the process of displaying a menu in text mode (i.e., 80x25 textbox, command.com/cmd.exe's native interface). I need something that can give a list of choices, ideally including multiple pages, and including values to be entered to choose one of these; prompt the user; gently chide the user (perhaps ringing a bell and redrawing the

C++ Change Output From “cout”

好久不见. 提交于 2020-01-10 05:05:14
问题 Is it possible to change text printed with "cout"? I would like to make it show the current percentage of something without having to have a new line for each percentage. Is this possible? 回答1: This works for me: std::cout << "1111"; std::cout << "\r"; std::cout << "2222"; \r is a carriage return symbol. Puts the "cursor" back to the beginning of the line. Alternatively you can use \b character. This is backspace. When printed it goes one character back. 回答2: In general it is not possible.

Console application freezes on mouse click

安稳与你 提交于 2020-01-09 10:51:29
问题 I have a very simple C# console application that displays some text and loops waiting for input until the escape key is pressed or the timeout period is served. using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading; namespace SampleApp { public static class Program { public static void Main (string [] args) { var key = new ConsoleKeyInfo(); var watch = Stopwatch.StartNew(); var timeout = TimeSpan.FromSeconds(5);

Console application freezes on mouse click

社会主义新天地 提交于 2020-01-09 10:51:16
问题 I have a very simple C# console application that displays some text and loops waiting for input until the escape key is pressed or the timeout period is served. using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading; namespace SampleApp { public static class Program { public static void Main (string [] args) { var key = new ConsoleKeyInfo(); var watch = Stopwatch.StartNew(); var timeout = TimeSpan.FromSeconds(5);

Sending e-mail by SmtpClient causes 'System.InvalidOperationException in system.dll

六眼飞鱼酱① 提交于 2020-01-07 06:24:54
问题 I wanted to send e-mail in my console application. I used: SmtpClient client = new SmtpClient(); MailMessage msg = new MailMessage(); MailAddress to = new MailAddress("informatyka4445@wp.pl"); MailAddress from = new MailAddress("informatyka4444@wp.pl"); msg.IsBodyHtml = true; msg.Subject = "Mail Title"; msg.To.Add(to); msg.Body = "Your message"; msg.From = from; try { client.Send(msg);//THIS CAUSES ERROR } catch (InvalidOperationException e) { Console.WriteLine(e); } and it causes: A first

How can I make a background, non-blocking input loop in python?

喜你入骨 提交于 2020-01-07 03:53:09
问题 So, I have a small console app I'm working on that runs a web-scraping process, and I want to be able to give it console commands mid-execution to control it. To do this I'll need some form of non-blocking keyboard input, as the program may self-terminate due to unexpected errors, and I don't want some thread hanging about and waiting for input when termination has occurred. I have the following already hashed out: import threading import time import queue input_queue = queue.Queue() command

C - How can open window explorer

☆樱花仙子☆ 提交于 2020-01-06 19:03:33
问题 I'm looking for function that Open window explorer in C language . I have found this [answer] (How can I open Windows Explorer to a certain directory from within a WPF app?) , but this is C# language. C can't have these features ? I use VS 2010. I'm a beginner of C. So my question may seem ridiculously easy. But if you give me the answer I really appreciate it. Thanks :) 回答1: The simplest way to open a certain directory in an explorer (here c:\program files) may be: system("start \"\" \"c:\

Creating a login page in java console application using a txt file

痴心易碎 提交于 2020-01-06 15:19:41
问题 I am creating a java console application and i need to use a notepad (txt) file to store PIN, AccountNo and Balance. When the user enters the PIN (from BufferedReader) it should get validated from the notepad file and login to thge system. However, the code fragment which I used below only displays Enter PIN, and when i click on Enter, the program exits. Could you please tell me what is the mistake which I have done here? BufferedReader getIt = new BufferedReader(new InputStreamReader(System