user-input

What is the easiest way to get an int in a console app?

I want to process user input as an integer, but it seems as though C has no way to get an int from stdin. Is there a function to do this? How would I go about getting an int from the user? ...

Is RegEx from user input safe?

I'm working on an app that needs to accept a RegEx from the user, to do so I'm using the following code: Regex user_searchPattern = new Regex(this.userInput_regEx.Text); Is doing this safe? Is there a need to sanitize the user input, and if so how? ...

Recommendations on HTML Form Input Field Lengths (e.g. username, e-mail)

Are there any guidelines/recommendations on how long the input fields should be on HTML forms. Specifically: Viewable length (the length of the input field the user can see on the screen - without having to scroll horizontally. i.e. SIZE, not MAXLENGTH) Capture length (the number of characters the HTML form will save to the database) ...

"Safe" markdown processor for PHP?

Is there a PHP implementation of markdown suitable for using in public comments? Basically it should only allow a subset of the markdown syntax (bold, italic, links, block-quotes, code-blocks and lists), and strip out all inline HTML (or possibly escape it?) I guess one option is to use the normal markdown parser, and run the output th...

Delimiting User Input

What is the best character to use to delimit user input? For example if a user has an infinite number of textboxes to type things into, but each textbox's value will be concatenated into a single database field, what is the safest character to delimit each input? I think it should be a character not on your typical keyboard. Is there a...

Problem with user input in my batch file

Hi, here is the portion of code giving me trouble: IF EXIST TH_BUILD_* ( ECHO A current build of Test Harness exists. set /p delBuild=Delete preexisting build [y/n]?: if "%delBuild%"=="y" (GOTO deleteandcontinue) else ( EXIT) ) For some reason, no matter the input, the batch file exits. Why is this happening (deleteandcontinue is nev...

What causes problems with this piece of code ?

Hi! I was just wondering why this certain problem happens to me. If you can help me, I will appreciate it. Program factorial; uses crt; var f, i: Integer; begin f:=1; for i:=1 to 5 do f:= f * i; write(f); readkey; end. Okay, That works fine and the result is 120. And it's true. Now, here's the problem. If I asked the u...

Error trapping when a user inputs incorect information

So, i have recently started learning python...i am writing a small script that pulls information from a csv and i need to be able to notify a user of an incorrect input for example the user is asked for his id number, the id number is anything from r1 to r5 i would like my script to be able to tell the user that they have input someth...

BlackBerry LongClickListener implementation

I need to implement OnLongClickListener for BlackBerry platform. It may be used for user input (ex phone keyboard implementation) or other functionality (navigation, rewind control, zoom control, etc). There are requirements: target control to listen - custom ButtonField it should be version compiliant with 4.5 and 4.6, so no touchEv...

Desirable Features for the "ideal IDE" ?

Imagine you could ask someone to develop your ideal IDE for you, what features would it need to have? This is largely inspired by a related SO question ("Improving the way we write code") and a response to it listing various interesting and desirable IDE features from a user interface point of view. By asking this question, I am hoping...

User Input filtering in PHP

Hello guys, Am currently working on an application that requires users to submit posts and comments which is displayed on the site. As we all know that user input can't be trusted so i used htmlspecialchars($string,ENT_QUOTES) to process user's posts and comments. Now, i want some certain html tags ignored. such as <b><br /> and a few...

How do I pass login ID as parameter to SharePoint login page?

I have an ASP.NET home page where user provides his login ID. Depending on the application (SharePoint Site) the ID is associated to- the user is directed to the respective sharepoint site. For example, if user is site1user, the ASP.NET page directs the user to sharepointsite1. I got it working this far. Now, how do I pass the login...

What are the common practices for notifying a user of invalid input?

In my company, I've seen several approaches for notifying a user when their input is invalid (our validation is generally done when the user clicks some form of a "Submit" button). Here are the most common approaches I've seen: Using the ErrorProvider class to communicate which controls contain invalid input. (this is my current pref...

User input parsing - city / state / zipcode / country

I'm looking for advice on parsing input from a user in multiple combinations of City / State / Zip Code / Country. A common example would be what Google maps does. Some examples of input would be: "City, State, Country" "City, Country" "City, Zip Code, Country" "City, State, Zip Code" "Zip Code" What would be an efficient and corre...

best approach to analyze text in PHP?

Hi, I need to analyze a users' post and categorize it. For example: I have to categorize every post as a "buy" post or a "sell" post based on the text - "I'm looking to sell my house" is categorized as "sell". The problem is that often its not so simple - "I'm looking to get rid of my old house" also needs to be categorized as "sell". "...

JSF inputText and inputSecret differ in size

Hi %, again just a short one: I've done a login page in JSF which contains an inputText for the username and a inputSecret for the password. Size is set to 20 for both. FF manages to show it correctly, IE shows them in different sizes. Is there a way to make them look similar in both? rgds, KB ...

How to get user input in Clojure ?

Hello everyone I'm currently learning clojure, but I was wondering how to get and store user input in a clojure program. I was looking at the clojure api and I found a function called read-line, however I'm not sure how to use it if it's the right function to use... Anyhow, how do you get user input in clojure ? ...

Stop Submit With Empty Input Values

Im Looking for a simple solution to stop a login form from submitting with empty input fields. The code for the form is below. I would like to use a simple Javascript soluiton if possible. <form id="login" method="post" action=""> <input type="text" name="email" id="email" /> <input type="password" name="pwd" id="pwd" /> ...

Getting a User Input In Ruby

Hi, I have a quick question in Ruby Lets say I ask the user to enter a name ( for a new class that i want to create) my code is: puts "enter the name for a new class that you want to create" nameofclass = gets.chomp nameofclass = Class.new Why does this not work? Also, I want to ask the user to enter the name of a method that i wan...

Where does user input come from in a MVC architecture?

I'd like to know where the controller gets the user input from (to feed the model with). Because input media is strongly related to the user shouldn't the view be aware of the concrete way to get the user's data? But how can I separate the controller from the view then? Is it possible to make both completely independent of each other as ...