Many of us need to deal with user input, search queries, and situations where the input text can potentially contain profanity or undesirable language. Oftentimes this needs to be filtered out.
Where can one find a good list of swear words in various languages and dialects?
Are there APIs available to sources that contain good lists? ...
I'm relatively new to programming and I have to write a function that reads in input from the user and to fill two arrays then compare them. I guess what I'm confused on is how to read in both arrays.
This is what I'm supposed to do,
Write a table_diff fuction that compares two arrays of integers and returns the subscript of the first ...
What is the best way to block certain input keys from being used in a TextBox with out blocking special keystrokes such as Ctrl-V/Ctrl-C?
For example, only allowing the user to enter a subset of characters or numerics such as A or B or C and nothing else.
...
What are good ways to handle user input concurrency?
As the answers to this question already rule out database locking, how do you handle concurrent user inputs in general?
Is locking always a bad idea, even if it is not implemented by row locking? Are there best practices which are not use case dependant?
What were your experiences wi...
What is a good way to implement keyboard handling? In any language, where I write a keyboard-interactive program (such as a tetris game), I end up having some code that looks like this:
for event in pygame.event.get():
if event.type == KEYDOWN:
if False: pass #make everything an elif
elif rotating: pass
...
Is there a way to detect if a mouse button is currently down in JavaScript?
I know about the "mousedown" event, but that's not what I need. Some time AFTER the mouse button is pressed, I want to be able to detect if it is still pressed down.
Is this possible?
...
I have a site where users can post stuff (as in forums, comments, etc) using a customised implementation of TinyMCE. A lot of them like to copy & paste from Word, which means their input often comes with a plethora of associated MS inline formatting.
I can't just get rid of <span whatever> as TinyMCE relies on the span tag for some of i...
I have a form on an HTML page with multiple submit buttons that perform different actions. However, when the user is typing a value into a text input and hit enters, the browsers generally act as though the next submit button sequentially was activated. I want a particular action to occur, so one solution I found was to put in invisible ...
I need to design a program using python that will ask the user for a barcode. Then, using this barcode, it will search a mysql to find its corresponding product.
I am a bit stuck on how to get started. Does anyone have any tips for me?
...
I do most of programming work on the Windows terminals in my university. However, my computer is a Mac and, for some reason, the javac command throws up an error when I use UserInput methods. Is there anything to install or an alternative command to use to make this compile properly?
...
Hi all,
I have a simple search mechanism on ms sql server that uses full-text "contains".
I pass search value as a parameter to contains predicate - directly from user's input (via asp.net web site). The problem is that i get sql exception in variety of cases:
- when user inputs two words, like 'simple case'
- when user adds qoute to se...
Really my question has more to do with the server-side scrubbing of html that's accepted via the WYSIWYG form component. Right now I'm leaning toward using htmlpurifier.org's library. I'm using php strip_tags() function elsewhere. Anyone have an advice/preferences/recommendations?
...
For a program I am writing, I need to ask a user for an integer between 1 and 8. I've tried multiple (cleaner) ways of doing this but none of them worked, so I'm left with this:
int x = 0;
while (x < 1 || x > 8)
{
System.out.print("Please enter integer (1-8): ");
try
{
x = Integer.par...
Okay, there is a ton of stuff out there on sanitizing strings but very little, that I can find, on the best methods to prepare user input (like what I'm typing now) for inserting into a content management system then how to filter it coming out.
I'm building two multilingual (Japanese, English + other Romance languages) CMSs and having ...
What's the best way to convert search terms entered by a user, into a query that can be used in a where clause for full-text searching to query a table and get back relevant results? For example, the following query entered by the user:
+"e-mail" +attachment -"word document" -"e-learning"
Should translate into something like:
SELECT...
I'm working on a web site that includes creating appointments on the mobile site. I have to make it work on IE Mobile.
The biggest challenge is to come up with a way to do date selection on a mobile site that:
Is compact enough to not take forever to load on the limited-bandwidth cell network.
Will work on Windows Mobile 6
Prevents t...
I am building a site that is an interface used to create XML files that are read as input by a server side program.
The website allows users to dynamically create blocks of HTML. Each block can be thought of as an object and contains several input fields. When the user submits the form, the data is turned into an XML file.
What is th...
This is a wheel that's been re-invented again and again over the years.
The Problem: The user needs to input a Date/Time
Basic considerations
We want to make it as easy as possible for the user to enter the desired date/time
Some applications call for historical dates, some applications call for future dates only, some will need to ...
Say for example I am getting a range of integers from a user:
Generate between nnn and nnn widgets.
Yes, most users will ensure that the first number is equal to or less than the second number:
Generate between 3 and 7 widgets.
But then there's that user, who wants to enter this data "back to front";
Generate between 7 and 3 widgets...
I want to disable input pad on iphone when pressing 'done'. Any ideas about how to detect button press event?
...