user-input

Cursors for data selection in matplotlib

丶灬走出姿态 提交于 2019-12-11 06:24:08
问题 I am trying to get user input from matplotlib XY plot. The plot contains multiple datasets and I need get from user selection of which dataset to use and the range. I need this to fit model to right dataset and range. Therefore I need two indicators, which would be "attached" to specific dataset, per user choosing. I need to get from them both the dataset info and the range info. Somehow in line with what commercial plotting packages (Igor Pro, Kaleidagraph, Sigmaplot...) provide as "cursors"

Best practice: throwing Exception or using Validator on User Input

﹥>﹥吖頭↗ 提交于 2019-12-11 05:33:54
问题 Recently I've been into multiple arguments on whether to throw an exception on false User Input. Example: I'm trying to login though my account is not activated. As the programmer in an OO-language, I could handle this in a few ways. For this case, lets stick to these two: Throw a custom Exception from the local Service with a representative way, extending Exception . Catching this in the class handling User Input. Use a Validator to call the local Service to check whether this account is

Validate user input to only accept type int or String “quit”

限于喜欢 提交于 2019-12-11 05:28:36
问题 My code prints out an array which is already declared then asks for user input. User is supposed to enter a number in the format xy or type quit to stop using the program. After getting user input it prints out the element of the array using x as row and y as column number which is followed by setting that index to 0 and printing the new array. I have so far achieved most of it apart from accepting only integers or "quit" from the user. If user enters another string apart from "quit" the

Multi-word scanner input in java?

不羁岁月 提交于 2019-12-11 05:06:23
问题 So I'm trying to use if-else statement dependant upon the user's input. It works when the user's input is only one word, however, multiple word inputs go unrecognized and triggers the else statement. How can i resolve this? import java.util.Scanner; public class MyFirstJavaClass { public static void main(String[] args) { @SuppressWarnings("resource") Scanner myScanner = new Scanner(System.in); String answer; System.out.println("Catch the tiger or run away?"); answer = myScanner.next(); if

Affordable options for multi touch desktop device (To test apps on Windows phone 7 emulator)?

偶尔善良 提交于 2019-12-11 03:55:36
问题 I am looking to get into Windows phone 7 development. I am running Windows 7 and i know it supports multi touch which i can then use in the emulator if enabled. Is there any way for me to try this out without me paying a premium for a tablet, phone or touch monitor? Many thanks, Kohan. 回答1: You could always emulate multitouch until you have an actual phone to test on. 回答2: Just found this, how to make your own surface like touch screen. Wow! http://geekswithblogs.net/kobush/archive/2009/03/10

Why am I having trouble comparing lines from input in Perl?

烈酒焚心 提交于 2019-12-11 03:54:17
问题 I don't know what I could be doing wrong with this simple transaction, but it's not working: print "OK? (y or n)\n"; $ans = <>; print "\n"; if($ans eq "y"){print $ans;} I basically want to know how to test the user input. This little bit of code won't work for me. I'm just trying to print $ans if y is entered by the user. Any suggestions? EDIT: - I have also tried single quotes 回答1: You're doing a couple things wrong. (1) Don't use the diamond operator (<>) when you want <STDIN>. The diamond

Prompting user to select directory in batch file

♀尐吖头ヾ 提交于 2019-12-11 02:55:58
问题 Issue: I am attempting to have users select which folder to choose from within a specified directory and then add that folder to the address in order to execute a program within that directory. For example, !acct! is the variable that I am using to ask the end user which account they want to access. This account is the starting or root folder for all other folders. The folder structure remains that same across all accounts EXCEPT for the second token of the folder. i.e) 123456789\*\program

Styling Open-Ended Text Inputs [closed]

眉间皱痕 提交于 2019-12-11 02:29:56
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . What's the best / recommended practice to treat a text input that contains HTML tags? The idea is to properly display the input e.g.

What is the most efficient way to test for duplicates in a user inputted array?

ⅰ亾dé卋堺 提交于 2019-12-11 02:10:53
问题 I am trying to write a simulator for playing the Powerball lottery , where the program would ask for 5 numbers (aka the white balls) and be inputted into a 6 element array and another number (the red Powerball) into the 6 th element. I need to figure out how to test for duplicates in the first 5 elements but the 6 th doesn't need to be unique. I have a loop that I thought would work but it doesn't even execute and is rather messy. Is there a more efficient way to test for duplicates, maybe

Force Bash-Script to wait for a Perl-Script that awaits input

时光总嘲笑我的痴心妄想 提交于 2019-12-11 01:46:23
问题 I'm having a Bash-Script that sequentially runs some Perl-Scripts which are read from a file. These scripts require the press of Enter to continue. Strangely when I run the script it's never waiting for the input but just continues. I assume something in the Bash-Script is interpreted as an Enter or some other Key-Press and makes the Perl continue. I'm sure there is a solution out there but don't really know what to look for. My Bash has this while-Loop which iterates through the list of Perl