user-input

How to make an input form in java code (NOT Netbeans using JForm) ?

Hi I want to make an input form so that the user can enter details in java code. Something like this : MY CODE import java.awt.GridLayout; import javax.swing.*; class JOptionPaneTest { public static void main(String[] args) { String[] items = {"One", "Two", "Three", "Four", "Five"}; JComboBox combo = new JComboBox(items)...

Simulate User Input To Call Script Multiple Times With Different Parameters

I have to use a provided script that takes user input while the script is running instead of parameters. I can't get around this. An example of script would be: #!/bin/bash echo "param one" read one doSomething echo "param two" read two doSomething echo "param three" read three doSomething echo "param four" read four doSomething e...

Single character console input in java/clojure

How can I read a single character/key from the console without having to hit Enter? There is an old entry in Sun's bug database claiming that it can't be done in pure java. I've found these approaches JNI JLine [http://jline.sourceforge.net/] Javacurses [http://sourceforge.net/projects/javacurses/] I'd expect to add a single magic-...

In how many ways we can take input values in C++ ??

How to take input values in C++, in how many ways we can take input values.? Please describe in brief with small examples ...

Summing all numbers in a matrix

I just need what to do to be simplified. But if you write the source code I still want to know how and what u did explained. Write a function that sums all the integers in a matrix of integers using the following header: const int SIZE = 4; double sumMatrix (const double m [] [SIZE] , int rowSize, int columnSize) ; Write a test pro...

Ruby on Rails customer-facing formbuilder?

I have a customer that wants to build their own questionnaires. Something like WuFoo (www.wufoo.com) but more secure and contained within the app. I've looked at Smerf (http://github.com/springbok/smerf) which provides the yaml-to-form conversion, but I'd like something the user can use to create their own forms. ...

Java Non-blocking Read

Hello, I'm trying to read in from two different input streams (stdin and stderr of a child application) and print them in one combine frame. I've never done this before, and am wondering about best practices. I can spawn two threads and let them both block on the input stream. Is there a better way? Thanks! ...

C++ Replacing system("pause") call

I've read that system("pause") is slow and not advisable to use. Is there any function that I can use instead of that? I've tried getchar() but if I have a scanf call before, it simply does not waits for an other input, only if I put an other getchar() under it (but I don't think it's a good solution). edit: I'm using Microsoft Visual S...

Showing Keyboard with Android Dialog

Hello, I want to show the Android version of a Model Dialog with text input however I think the keyboard will be behind the actual activity since dialogs weren't made to have inputs. Is there any way I can get the keyboard to show in an actual dialog. I did see this SO question -- however I'd rather not use an Theme.Dialog'ed activity...

Show beginning of HTML input value on blur with JavaScript

I have a fixed width input of type text. If the user was to enter a long value into this field I would like the beginning of the value to be shown when the input no longer has focus. Default behaviour in FF and IE leaves the view of the field value in the same state. Chrome on the other hand seems to behave as I want, it shows the beg...

python: getting user input

i am running this: import csv import sys reader = csv.reader(open(sys.argv[0], "rb")) for row in reader: print row and i get this in response: ['import csv'] ['import sys'] ['reader = csv.reader(open(sys.argv[0]', ' "rb"))'] ['for row in reader:'] [' print row'] >>> for the sys.argv[0] i would like it to prompt me to enter...

How do I get user input in the Self language?

I'm experimenting with the Self language and I just past the point of easy canned stuff. I want to prompt the user for a number, or perhaps provide a form for several numbers. Is there an equivalent a scripting language's stdin-input, or a simple dialog, or do I have to grok Mophic and build it from scratch? p.s. This should be tagged...

Check if directory path ends with DIRECTORY_SEPARATOR

In PHP I'm receiving a string from the user for a local file directory $path I want to know if they've included the trailing slash (/) or not. I would like this to be cross platform so I'd like to use the PHP constant DIRECTORY_SEPARATOR My failed attempts include trying to do a preg_match like preg_match("/" . DIRECTORY_SEPARATOR . ...

How to input into an array.

main(int c,char **args){ int i char input[100]; bzero(input,100); for(i=1;i<c;i++) { input=strcat(input,args); input=strcat(input," "); } } i have included the string.h header file.... I want the input i enter in the command line to be stored in the input array. could anyone please correct my code.. Thank you. ...

Running SQL from file MySQL - User Input?

Hi All, I'm running MySQL from the command line and executing SQL stored in files. What I'm trying to do, is prompt the user to enter input so that I can include this in the SQL script? Is there a way to do this with MySQL? Many thanks, James ...

Where to store values, for transport to the business layer?

Imagine a hypothetical object with a number of attributes: pseudocode: class Student { Name: String; Birthdate: DateTime; Height: int; //inches GPA: float; //"Grade Point Average" Citizenship: string; } Now the user enters in values, and the object gets them: Name: Shelby Lake Birthdate: 6/19/1991 Height: 63 GPA: 5.6 ...

The passed entity bound to my BindingSource is updated in realtime, how can I prevent that?

Hello, I have a Mainform + smallDialog. scenario: The Mainform has a datagrid with entities bound. The smallDialog updates the entity double-clicked-on-the-datagrid-in-Mainform wich is passed to the smallDialog and bound there again to a bindingsource. When I change now some data in the textfiels AND leave the textfield so the focus...

User Suggestions application/framework/SAS

My client wants users to make suggestions for what Jazz artists they'd like to see on the next Jazz Cruise. They were thinking of just letting users fill out up to 10 text boxes and submit those but I think it will be a nightmare to report on and tabulate the data (we expect over 10,000 suggestions). I considered trying to just use a jQu...

raw_input in python without pressing enter.

I'm using raw_input in Python to interact with user in shell. c = raw_input('Press s or n to continue:') if c.upper() == 'S': print 'YES' It works as intended, but the user has to press enter in the shell after pressing 's'. Is there a way to accomplish what I need from an user input without needing to press enter in the shell? I'...

Problem getting input from user

Here's the code : cout << "Please enter the file path: "; string sPath; getline(cin, sPath); cout << "Please enter the password: "; string sPassword; getline(cin, sPassword); Problem is, when I run it it displays "Please enter the file path: " then it displays "Please enter the password: " and then waits for the password. It seems to ...