user-input

Custom iPad 10-key popover possible.

Hello everyone, and thanks for your responses in advance. I have been looking around for the possibility of having a 10-key, numeric only, input available when a user clicks on certain fields that do not require the use of the full size keyboard. I know that popovers can properly display custom types of input, but does anyone know if ...

Android: custom view onClickEvent with X & Y locations

Hi, I've got a custom view and I want to get the X and Y coordinates of a user click. I've found that I can only get the coordinates from the onTouchEvent and an onClickEvent won't fire if I have an onTouchEvent. Unfortunately the onTouchEventfires when the user drags the screen as well as clicking. I've tried to differentiate betwee...

Solving a math problem/expression, which is a string, in PHP

The user can enter a math problem (expression) like 5 + 654, 6 ^ 24, 2!, sqrt(543), log(54), sin 5, sin(50). After some reformatting (e.g. change sin 5 into sin(5)), and doing an eval, PHP gives me the right result: $problem = "5 + 5324"; eval("$result = " . $problem); echo $problem . " = " . $result; However, this is quite unsafe: /...

Tracking graphics tablet input in C#

I'm writing an XNA application with C#, and I want to be able to control the application with a graphics tablet. All I need to be able to do is track the position and pressure of the pen on the tablet, it would be nice to have some built in gesture recognition but I'm willing to build that myself if needed. My first attempt at this was ...

Validating entered user data

Hello, this is a general question but I do a desktop application. Should I check for example the firstname exceeding 50 chars or is this a matter of taste? Or should I check for > 50 chars because the user could flood my database with 10000000 chars ? EDIT: Seems I made the ball rolling... I should have said, that the firstname/last...

How to set time limit on input

in python, is there a way to, while waiting for a user input, count time so that after, say 30 seconds, the raw_input() function is automatically skipped? ...

Should the function or the caller be resonsible for input validation?

I'm doing a security audit on a fairly large php application and was wondering where I should include my user-input validation. Should I validate the data, then send the clean data off to the back-end functions or should I rely on each function to do it's own validation? Or even both? Is there any standard or best-practice for this so...

InputManager ignores cut/copy/paste when initiated from menu

I'm using the InputManager to check if changes to controls are done by user or code. This works fine, except when user uses the context menu for cut/copy/paste. If the user do ctrl+v in a textbox, InputManager correctly notices it. However, if the paste is done from the context menu of the textbox, the InputManager never fires the PreNot...

PHP: File exists and is in a certain sub-directory

I get a file path to a user file and I want to make sure that this path is to a valid existing user file and not to something bogus or a system file or something like that. I know I can use file_exists to check that it exists, but I'm not sure how I should make sure that the file is in a certain sub-directory... ...

problem in batch script read user input

hi, i use set /p below to read user input it seems to work outside the if block but the one inside if block doesn't work. When i run the script second time the user input in the if block prints the previous user input. test script: @echo off set cond=true echo %cond% if %cond%==true ( echo "cond is true" REM the below input doesn't wo...

JAVA: storing input into array

I need to write a program where the program would generate random letter and i would need to store this random character into an array char[] arrayRandom = new char[10]; for (int i = 0; i < 8; i++) { randomNumLet = (generator.nextInt(20) + 1); System.out.print(arrayRandomLetter[randomNumLet] + ...

Opening a Dialog with text input from within a View in Android

Hi, I have an app with a View based on the SurfaceHolder (similar to the Lunar Lander tutorial). The whole GUI is drawn on a canvas, and I want to be able to prompt for user text input at a given moment using a custom layout Dialog, that is then taken care of and rendered to the canvas using standard procedure. My problem, however, is ...

Weird c++ input escaping and space behavior

I'm having an unpleasant problem with my c++ example. Everything works fine until I enter something with a whitespace. #include <iostream> using namespace std; int main (int argc, char * const argv[]) { int iteration = 0; while (true) { char * input = new char[256]; scanf("%s", input); cout << ++iteratio...

GUI control for representing amount of time

I have an input asking the submitter how long an event took. Right now it's a normal textbox that should error out if anything but an integer is submitted. I tell the submitter to input the length in whole minutes. However, thinking in minutes isn't the brains best ability... Neither is following instructions, so I often get "support-re...

Does rails 3 also escape field data that's sent via ajax?

I know that rails 3 automatically escapes user input, but does it also do this for user input that's submitted via ajax such as an auto-complete query? ...

Java - Efficient way to get specific input from user

Hello all, I am trying to get my options straight with some inputs that I want to enter in an application I am developing. I want the user to input a list(of Strings) of which the size will be his decision. I have thought of some crude solutions, like going with JOptionPane until user enters a specific input, but I would like a soluti...

JOptionPane Input to int

Hello all, I am trying to make a JOptionPane get an input and assign it to an int but I am getting some problems with the variable types. I am trying something like this: Int ans = (Integer) JOptionPane.showInputDialog(frame, "Text", JOptionPane.INFORMATION_MESSAGE, null, null, ...

Creating Expandable Forms in Microsoft Access 2007

Hey everyone! I need to gather some information from a Microsoft Access form and I need everything to be as organized as possible. There are a lot of columns that can be filled out, but don't necessarily apply to everyone and I want to keep everything as clean as possible. In a form, is there any way to have certain input boxes displa...

HTML/ASP.NET: <input type="hidden" name="reference" value="ABC"/>

Hi, I just wanna ask if there's a possibility to change: <input type="hidden" name="reference" value="ABC"/> into this: <input type="hidden" name="reference" value="any values I want"/> where I can set any values behind .cs/C# - making it dynamically. The payment gateway I'm using requires and I can't find a way to included an AS...

Ruby on Rails: file_field, how do I remove the upload button?

Cause I have a custom styled / positioned button. Currently, our set up is: Special upload button (Fancy) Hide the file_field in a div, cause the button can't be moved to be separate from the text. But we still want the text saying what file you've selected ...