All Questions

62
votes
2answers
8816 views

Why does std::getline() skip input after a formatted extraction?

I have the following piece of code that prompts the user for their name and state: #include <iostream> #include <string> int main() { std::string name; std::string state; if...
100
votes
6answers
347924 views

input() error - NameError: name '...' is not defined

I am getting an error when I try to run this simple python script: input_variable = input ("Enter your name: ") print ("your name is" + input_variable) Lets say I type in "dude", the error I am get...
232
votes
16answers
288391 views

How to use unicode characters in Windows command line?

We have a project in Team Foundation Server (TFS) that has a non-English character (š) in it. When trying to script a few build-related things we've stumbled upon a problem - we can't pass the š let...
190
votes
19answers
188578 views

Python read a single character from the user

Is there a way of reading one single character from the user input? For instance, they press one key at the terminal and it is returned (sort of like getch()). I know there's a function in Windows for...
524
votes
8answers
1328621 views

How do I get the value of text input field using JavaScript?

I am working on a search with JavaScript. I would use a form, but it messes up something else on my page. I have this input text field: <input name="searchTxt" type="text" maxlength="512" id="sear...
501
votes
13answers
586193 views

Is there any way to change input type="date" format?

I'm working with HTML5 elements on my webpage. By default input type="date" shows date as YYYY-MM-DD. The question is, is it possible to change it's format to something like: DD-MM-YYYY?
80
votes
5answers
131935 views

How to read a single char from the console in Java (as the user types it)?

Is there an easy way to read a single char from the console as the user is typing it in Java? Is it possible? I've tried with these methods but they all wait for the user to press enter key: char tmp...
933
votes
18answers
608977 views

Best way to remove an event handler in jQuery?

I have an input type="image". This acts like the cell notes in Microsoft Excel. If someone enters a number into the text box that this input-image is paired with, I setup an event handler for the inpu...
35
votes
3answers
51838 views

java.util.NoSuchElementException - Scanner reading user input

I'm new to using Java, but I have some previous experience with C#. The issue I'm having comes with reading user input from console. I'm running into the "java.util.NoSuchElementException" error with...
206
votes
24answers
1106149 views

How can I get the user input in Java?

I attempted to create a calculator, but I can not get it to work because I don't know how to get user input. How can I get the user input in Java?

Previous Next