input

Assigning a 'for loop' to a variable in a python program

hi, Im writing a program at the moment(below) that interacts with a MySQL database and im having a problem. As you can see ive written a query that will look for products in the products table that corresponds to the barcode that the user has inputted. If the barcode that is inputted by the user is found in the products table, I want to ...

Python: C++-like stream input

Hi! Is there a pythonic way of reading - say - mixed integer and char input without reading the whole input at once and without worrying about linebreaks? For example I have a file with whitespace-separated data of which I only know that there are x integers, then y chars and then z more integers. I don't want to assume anything about l...

Matching jargon synonyms: This must be done by a human, but how can the human-entry part be optimized?

Background: Customer X has two lists of words. None of these words exists in any corpus of text in any known language. They are purely proprietary jargon. The first list is a list of words owned by Organization X. The second list is a list of words owned by his closest competitor, Organization Y. For a concrete example: Organization ...

Shell script user prompt/input

This is a crude korn shell script that someone else wrote. I don't know much about using shell syntax and I'm not even sure if this is possible. Is there any way for me to run this file and be prompted for the date so that I don't have to manually go into the script and change it each time? For example, I wan to replace the "1/12/09" ...

C non-blocking keyboard input

I'm trying to write a program in C (on linux) that loops until the user presses a key, but shouldn't require a keypress to continue each loop. Is there a simple way to do this? I figure I could possibly do it with select() but that seems like a lot of work. Alternatively, is there a way to catch a control-c keypress to do cleanup befor...

html <input> element ignores CSS left+right properties?

Hi, I've noticed that the <input> element in HTML ignores the CSS pair of "left" and "right" properties. Same for the pair "top" and "bottom". See the sample code below: <html> <head> <style><!-- #someid { position: absolute; left: 10px; right: 10px; top: 10px; bottom: 10px; } --></...

Handling input with the Zend Framework (Post,get,etc)

Hi, im re-factoring php on zend code and all the code is full of $_GET["this"] and $_POST["that"]. I have always used the more phpish $this->_request->getPost('this') and $this->_request->getQuery('that') (this one being not so much logical with the getquery insteado of getGet). So i was wondering if my method was safer/better/easier t...

<input type="file" /> opens file browse window in FireFox3 when clicking the form field part?

When clicking on the text box part of an <input type="file" /> in FireFox3, a file browsing window opens. This doesn't happen in IE7. You have to click the "browse" button to open the file browsing window. How can I prevent the file browsing window from opening in FireFox when a user clicks on the textbox area? I'd like it so it only...

Whats a Good Javascript Time Picker ?

What's a good time picker for jquery or standalone js? I would like something like google uses in their calendar where it has a drop down of common times in 15min intervals or lets you manually type in a time and it validates it. ...

Graphics tablet/stylus library

Does anyone know of any libraries for .net that allow you to use graphics tablets? specifically i am after the pressure sensitivity of the pen, but the 'eraser' and buttons on the pen would be useful too. thanks ...

Clean way to offer a 'review' stage in an ASP.NET form

I'm currently working on a reasonably complicated data input form, based around ASP.NET Web Forms. After the form has been completed, we'd like to offer a chance for the user to review their input before actually submitting the form (as well as going back to make changes to their data if requried). Due to the large number of fields, I w...

Is there a simple way to do GUI input for a relational database?

I'm building a student rostering application for a friend and I'm just about done except for the GUI. I'm writing it in wxpython but I'm not sure how to proceed with the input fields because it is a relational database. Is there a simple way to do this? ...

How do I fake input for form testing?

I'm building a test harness for my Delphi 2009 app. Testing the logic is fairly simple. Making sure the forms work properly is proving a bit more complicated. I'd like a way to simulate real user input, to open a form, make it think there's a user typing certain things and clicking in certain places, and make sure it reacts correctly....

Should I manually set Perl's @ARGV so I can use <> to open, scan, and close files?

I have recently started learning Perl and one of my latest assignments involves searching a bunch of files for a particular string. The user provides the directory name as an argument and the program searches all the files in that directory for the pattern. Using readdir() I have managed to build an array with all the searchable file nam...

Capture a Microphone Audio Stream Using .NET Framework

I need to capture the input stream from a microphone in my application, which is written in VB.NET. I need to be able to stream this data to a file or over HTTP and possibly encode it using LAME MP3. Can anybody help me get started with this? Thank you! ...

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 that there is a function in windows for it, but I'd like something that is cross-platform. Thanks. ...

Set cursor position in html textbox

Does anybody know how to move the cursor in a textbox to a particular position? For example if a textbox (e.g. input element, not textarea) has 50 characters in it and I want to position the cursor before character 20, how woould i go about it? Jon ...

How do I read UTF-8 with diamond operator (<>)?

I want to read UTF-8 input in Perl, no matter if it comes from the standard input or from a file, using the diamond operator: while(<>){...}. So my script should be callable in these two ways, as usual, giving the same output: ./script.pl utf8.txt cat utf8.txt | ./script.pl But the outputs differ! Only the second call (using cat) see...

Writing from one form to another

I have two forms. Form A has three text input; A1, A2, A3. Form B has one text input, B1. Whenever you type in any of the inputs on Form A, Form B should get updated, right away, with all three inputs from Form A. If one of the Form A inputs is empty, a 0 should replace it in B1. For example, if I'm typing "test" in A1 and leave A...

What HTML/CSS would you use to create a text input with a background?

I have a website design that includes text input fields that look like this: I'm wondering what the best solution for creating this input field is. One idea I have is to always have a div around the input with a background image and all the borders disabled on the input field and specified width in pixels, such as: <div class="borde...