47 questions
-3
votes
1
answer
87
views
For or While loop to end table entry [closed]
I'm working on a square root table, with a start and end point. However, my points aren't correlating with my table. It's only using the numbers I put for my integers. I need it to use my start number ...
-1
votes
1
answer
137
views
Adding a time-out to console app in Java for user that takes too long [duplicate]
I am coding a hangman game using Java. I wanted to make things tougher so I added a timing condition for a user to guess the word (example:20 secs) now the problem I'm facing is that the while loop ...
0
votes
0
answers
103
views
How to start stopwatch again after restarting its time?
So I'm just starting to learn JavaScript, like its syntax and logic, therefore I'm still not implementing anything on a web page, just playing with the console before doing any web development with JS....
0
votes
1
answer
430
views
Java add console input to text file
I have a question regarding java io*.
How can I input things into the java console, which after inputting gets added to the java file linked to.
The problem is that I need to create a people database, ...
0
votes
1
answer
161
views
Prompting for user input as part of a reference to an out-of-script function in R
I have an issue similar to the one described in this post however mine involves a function being called in script 1 from a second script that stores the function. Essentially script1.R has reference ...
-1
votes
1
answer
51
views
Console only recognizes second input Java
I need to type a command twice into the Console, only then it recongnizes it as a input. I tried as the reader from the command file also a scanner instead of a bufferedReader. I hope you can help me!
...
0
votes
1
answer
410
views
<C#> The characters like "ä", "ö" or "å" drop out of the console input
I have a c# console application that needs input that contains characters like "ä", "ö" or "å". But these characters drop out of the input. For example if the user input ...
0
votes
0
answers
1k
views
How to check for command line argument and if none, prompt for input through console?
This question was part of an assignment for a software class in college. I've long since quit but I'd really like to learn python so I'm revisiting some assignments.
I've created a simple code that ...
1
vote
1
answer
789
views
How do use console to choose any file from a folder?
I need to be able to choose any file inside a folder by input on console.
Code
Instead of a predefined like "bridge_rgb.png" I want to be able to choose any file in the folder via console ...
1
vote
1
answer
3k
views
How to make the console accept input from the Enter key only?
I'd like to make the C# console only accept input from the Enter key on the startup screen.
I've made it so that it closes the console when anything but the Enter key is pressed.
How can I make it so ...
0
votes
0
answers
47
views
Problems with Python argparse library (order of variables, default parameters and so on)
I want to give my script named console parameters in any order, but my code won't work as it should.
import argparse, sys
parser = argparse.ArgumentParser()
parser.add_argument('n', help="some ...
2
votes
1
answer
146
views
Console I/O : printf & scanf not occurring in expected order
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void eat() // clears stdin upto and including \n OR EOF
{
int eat;while ((eat = getchar()) != '\n' && eat != ...
0
votes
2
answers
1k
views
Make this function synchronous?
I'm running the following bit of code to get input from the terminal in nodejs (I picked this method because it doesn't need dependencies) and I need it to work synchronously. It's inside a function ...
0
votes
1
answer
1k
views
How can I increase the maximum number of characters read by Read-Host?
I need to get a very long string input (around 9,000 characters), but Read-Host will truncate after around 8,000 characters. How can I extend this limit?
-4
votes
1
answer
536
views
Create random generator to make and count odd even pairs of numbers
I'm really, really stuck and confused. I've net searched several times, and can't find anything that helps me with this precise homework problem.
Involved: Java, while loops, randomly generating ...
0
votes
1
answer
1k
views
How to get input from the console without blocking?
I want to make a command to send a message to a text channel or a user,and the message should be input at console,but input() seems to "block" the program. Although I had tried threading to figure out ...
0
votes
2
answers
612
views
JUnit Testing Console Input Application
I am trying to use JUnit to test a java application which takes input from the console to make choices in the program. Here is a snippet of the program I am trying to test below.
PS: I am new to ...
0
votes
2
answers
1k
views
Input line from Scanner object gets printed before official print command
I have a the following method below that receives a Scanner object with N number of lines, each with a a one word string.
public static void longestName(Scanner console, int n) {
for (...
0
votes
1
answer
858
views
C# Console Application console Input and Listen to Handlers
I have a Skype for Business bot that is listening to a specific contact with handlers from the lync sdk.
Now I want to input some commands through the console.
But when I use the ReadLine method my ...
0
votes
3
answers
685
views
eliminate line break after read in C#
using A = System.Console;
public void point()
{
int hour, minute;
A.Write("Enter Time (HH:MM) = ");
hour = A.Read();
A.Write(":");
minute = A.Read();
}
I want it to be like
"...
1
vote
0
answers
51
views
JavaScript console input/output output trouble
Code output should be:
515
30
However, when I add variables a, b, c my output is 51530. I've added a + b just to test it, and the output was 515. I just can't figure out how to return the c so that ...
7
votes
2
answers
23k
views
High Order and Low-order byte
The prototypes for getchar() and putchar() are:
int getchar(void);
int putchar(int c);
As ,its prototype shows, the getchar() function is
declared as returning an integer.However, you can assign this ...
-1
votes
1
answer
47
views
i have to cin my name to enter my resources how do i do that
cin << name << endl;
cout >> "my name is " << name << endl;
1
vote
1
answer
1k
views
Getting console input with win32 api in x86 assembly
In my assembly program I called AllocConsole from the kernel32 library, however I do not know how to get input from the allocated console.
Is there any function that the winapi contains that will get ...
0
votes
1
answer
355
views
How can I store user-input as a vector (for a certain range e.g. c(-10:1)?
I'm new to R. And I want to make a program that asks for console input and then does some things, including making a graph. And now I want the user to specify the x-values for the graph. And then I ...
0
votes
1
answer
155
views
Internals of ncurses: console input [closed]
How exactly does Ncurses capture input into the console? I would like to implement it myself instead of using ncurses due to the overhead that ncurses is causing.
Thanks!
1
vote
3
answers
4k
views
Read An already Entered Line From The Console C++
I know this is an odd question, but is there any way of reading a previous input from the console?
Something like:
The fox is brown // line 1
The duck is yellow // line 2
Here where the control is ...
0
votes
0
answers
425
views
PhantomJS system.stdin.readLine without showing what user is typing
I'm using PhantomJS + CasperJS to do some headless web scraping. My application requires the user's login credentials, including an email and password.
Currently, I'm getting the user's password in ...
3
votes
1
answer
435
views
Haskell Foreign Function Interface with GHCI in Windows
First of all, I specify that I use Windows 10 64bit and Haskell Platform 8.0.1.
I try to use FFI of Haskell in Windows using following code.
import Control.Monad
import Data.Char
import Foreign.C
...
0
votes
1
answer
1k
views
Java Multi-Line Console Input and Cursor Handling
The following problem arised while building a REPL console application for a programming language. Essentially, the language relies on you being able to write multiple lines of text. However, the ...
-2
votes
1
answer
218
views
why does this input validation error occur in my java code?
/* This code reacts negatively when the input is received in the format mm / dd/ yyyy or mm/dd/yyyy. I've asked for help but I think there's more to it than simply a String vs. int syntax dynamic ...
-3
votes
1
answer
662
views
In Visual Basic, how can you input something in the same line?
Sorry if my question isn't that clear. We usually write it like:
dim num as integer
Console.writeline("Input num")
num = console.readline()
How can you write that input num and the value on num on ...
0
votes
4
answers
1k
views
Keep console input active without main thread? (Java)
I am writing a server in Java, which is multithreaded. I have three main active threads that I build and start from my main method:
public class Run{
public static void main(String[] args){
...
-1
votes
1
answer
147
views
Unable to read Inputs from Console in java
I need to read input test cases from console into a 2D array and a 1D array but unable to find the error in my code
import java.util.*;
import java.lang.*;
import java.io.*;
class ...
2
votes
2
answers
3k
views
In Go, is it possible to write to the console and read back?
I'm writing a wizard for a CLI in Go. What I'd like to do is ask the user what he wants to do, prepare the appropriate CLI command, and write it to the console. The user then would submit the ...
1
vote
2
answers
268
views
Run Java Console Input as Statement
I am writing a command-line matrix manipulation tool in Java, and was wondering if it is possible to run Java statements through console input.
I was thinking of using the java.util.Scanner object ...
0
votes
2
answers
53
views
Which way of using the Scanner is better, if any?
I'm talking about efficiency. I need to read an int from the console input. I know for sure that the input is the form of one int on each line and no other values.
I have a Scanner object defined:
...
12
votes
7
answers
51k
views
Read numbers from the console given in a single line, separated by a space
I have a task to read n given numbers in a single line, separated by a space ( ) from the console.
I know how to do it when I read every number on a separate line (Console.ReadLine()) but I need help ...
0
votes
3
answers
3k
views
how to create an array from one line of console input in C?
I want to create a two dimensional array where number of rows and columns are fixed and column values will be taken from console input.
void main() {
int myArray[3][5];
int i;
int a, b, ...
4
votes
3
answers
15k
views
What is the End Of File/Stream keyboard combination to use with System.in.read()
Apologize if this trivial question has already been answered, I cannot find it at SO.
Reading lines from the IDE console with this Java trivial code (Windows 7 and Eclipse Kepler):
int v;
try { while ...
3
votes
0
answers
525
views
Hide console input with Eclipse PyDev
I am quite new to Python and started using Eclipse with Pydev recently. I am writing a script where I'd like to enter a password via the console, and the password should not be displayed.
So far I ...
1
vote
1
answer
255
views
Leiningen freezing on console input
Why does trying to read a line from console with a BufferedReader freeze Leiningen REPL?
lein repl
nREPL server started on port 65142
REPL-y 0.2.0
Clojure 1.5.1
Docs: (doc function-name-here)
...
0
votes
2
answers
295
views
Java: The right way to make a scanner
First I'm a noob to Java so don't be mad at me if I'm acting stupid - Thanks.
As I said I'm trying to learn Java. Right now I'm trying to learn the right scanner for this mini-game, but I'm getting ...
0
votes
1
answer
256
views
Wait for instruction without stopping while loop
I designed a C++ application that represents an mechanical arm. The simulation is running inside a while loop.
I have the following class Motherboard that interacts with the simulation
class ...
3
votes
1
answer
361
views
A interesting practice about getchar() function
When I do practice on K&R,I found a very interesting question:
code as follows:
include <stdio.h>
main() ...
10
votes
3
answers
1k
views
Idiomatic way to write Clojure code for repeatedly reading lines from the console?
Recently I was writing a little CLI script which needed to repeatedly read dates from the console (the number of dates to read was calculated and could be different each time). Sample Ruby code to ...
1
vote
2
answers
507
views
What happens when I use javaw to run the java program in the following scenario?
Say suppose I am running a java program through command line. And this program requires some data to enter during the execution. So I was wondering on what happens if somebody uses javaw to run this ...