input

Configure a PIC pin for Input and Output

I am working on a project which uses a PIC24FJ64GA002 mcu. I am working on a bit-banged serial communication function that will use one wire to send data and then switch to receive mode to receive data on the same pin. A separate pin will be used for clocking which will always be controlled by a different board (always an input). I am w...

Caesar Cipher in python (Please help me where am i going wrong)

The error which i am getting is Traceback (most recent call last): File "imp.py", line 52, in <module> mode = getMode() File "imp.py", line 8, in getMode mode = input().lower() File "<string>", line 1, in <module> NameError: name 'encrypt' is not defined Below is the code. # Caesar Cipher MAX_KEY_SIZE = 26 def getMod...

Android input dialog.

I have class for showing custom dialog public class Add_Category_Dialog { public String inputed_value; private Context context; public Add_Category_Dialog(Context context){ this.context=context; } public void showDialog(){ AlertDialog.Builder alert = new AlertDialog.Builder(context); alert.setTitle("Title"); ...

Triggering the return key on event unexpectedly refreshes page and gives undefined error - JavaScript

Hey all, When I click in field, type text, and press return on keyboard it triggers the initializeTable function that refreshes page and gives error form[0] undefined. However, when I use change event to change dropdown selection, it doesn't cause this unexpected behavior. So I'm not sure why pressing return key in text field is causin...

Determining the input of a function given an output (Calculus involved)

My Calculus teacher gave us a program on to calculate the definite integrals of a given interval using the trapezoidal rule. I know that programmed functions take an input and produce an output as arithmetic functions would but I don't know how to do the inverse: find the input given the output. The problem states: "Use the trapezoidal...

Letting users to choose what type of content they want to input

Hi, This is my first post here, and I'd like to describe what I want to do as specific as possible. I'd like to make a model that is 'selectable.' for example, class SimpleModel(models.Model): property = models.CharField(max_length=255) value = GeneralField() GeneralField can be "CharField", "URLField", "TextField" so that ...

Using label2value script, need it to validate form because other validation scripts cause issues

I'm using the following script to do inline field labels, but I would like to have it also validate the fields before the user submits the form. I only have 3 fields in the form, Name, Email and File upload, can anyone please help me? If I use a separate validation script, it will not recognize the fields as being empty because this scri...

ANTLR match to end of input

I'm trying to match my grammar to an entire string, and have it error out if it cannot consume the entire input. Basically, this pseudo regex: \whitespace* [a-zA-Z]+ [-]? [a-zA-Z]+ \whitespace* $ According to this, EOF should work. So, consider this grammar: start : CHARS EOF ; CHARS : ('a'..'z')+ ; If I set input t...

Delay from mouse button click until a window message is posted (Windows)

This questions is relevant to an application I'm currently working on, but I don't have much to go on in terms of finding an answer. The basic questions is what is the delay (or how to estimate it) between the time that a user presses one of the mouse buttons until the information is posted to the window message queue and is available fo...

Opera multiple file upload sends files to $_POST instead of $_FILES - suggestions?

I tried googling this with little success. Can I make Opera upload files to $_FILES or will I have to start editing the PHP script? ...

How to avoid manual entering of input file, when .exe file is run from Matlab?

I am using a trans.exe file, which when run asks for a parameter (=input) file. If I run trans.exe using Matlab, then how can I directly give the parameter file inside the program without being prompted by Matlab to type it manually each time trans.exe is run? ...

How do I make Opera upload files like other browsers?

When uploading one file using <input type="file" /> in Opera, it works as expected. That is, you find the expected file data in $_FILES in PHP server side. However, when I try to upload several files at once using Opera, by setting <input type="file" min="1" max="999" /> then all the files' contents are glued together in one long string...

How do I check if a sentence contains a certain word in Python and then perform an action?

Let's say that I ask a user for raw input and they said, "This is a message." If that raw input contained the word "message" it would perform an action after that. Could I see how this can be done? ...

jquery append form inputs?

i have this jquery script that is meant to append input boxes, its wont happen, i dont know why? jquery: $(document).ready(function() { $(".login").click(function(){ $(".login").hide(); $("div.swap").append("<input name="username" id="username" type="text" maxlength="16" />"); }); }); html: <div class="swap"...

Java Scanner - why do I get this error?

I'm not new to java, but I cannot figure out why I get this Scanner error. The code compiles fine, but I get the following runtime error Enter item number: Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Scanner.java:840) at java.util.Scanner.next(Scanner.java:1461) at java.util.Scan...

box shadow on an ipad / safari

Hi Guys, I'm having trouble adding the nice shadow on focus for an input box on my ipad for safari. Here's my code /* remember to define focus styles! */ :focus { outline: 0; } input[type=text]{ width: 494px; height: 44px; line-height: 44px; font-size: 24px; border: 2px solid #666666; ...

Keyboard Input In A Seperate Class?

Just started learning Java a week or so ago. I have made a little Java program that calculates the amount of reviews, and the average review rating that something has. For instance, on the app store, you would enter in 1 star, 2 star, 3 star, 4 star, and 5 star reviews and the program would calculate the average review score. Anyway, ...

Why does Firefox have a 3px wide border on input[type=submit]?

All my submit buttons have different size and it looks really weird. At least I want them to have the same height. Look at the pictures below. Firefox: IE7: Chrome & IE8 (how i want it): My CSS looks like this: input, select, textarea { margin-bottom:3px; } input, select, button, textarea { font-family: Tahoma, Verdana, sans...

JavaScript clear text box input not functioning properly

I know that this is an embarassingly easy question, but I can't figure out the problem, and that's why I'm asking the question, so please don't reiterate this point. Anyway, I'm just working on something here, and when I tested my page to see how things were going, I realized that my calculate() method isn't clearing text input like I w...

How can I style an HTML INPUT tag so it maintains CSS when focused on Android 2.2+?

I was delighted to discover that Android 2.2 supports the position:fixed CSS selector. I've built a simple proof-of concept, here: http://kentbrewster.com/android-scroller/scroller.html ... which works like a charm. When I attempt to add an INPUT tag to my header, however, I hit trouble. On focus, every device I've tried so far clone...