Validation is used to check data to make sure it fits whatever required specifications are set for it.

learn more… | top users | synonyms

8
votes
1answer
44 views

Bitcoin address validator in C

Here is a Bitcoin address validator I am looking to have reviewed in C. Normally I would have the enum and function prototypes declared in a header file, but I ...
9
votes
2answers
164 views

Calculating the checksum digit with the Luhn-algorithm

I'm doing some exercises in Python and this one is about using the Luhn-algorithm to calculate the checksum digit in Swedish personal identification numbers. The description is the same as this ...
3
votes
2answers
97 views

Determining if an entity exists in a database via a stored procedure

Here is a short and simple Ajax method that returns "True" or "False" if an entity exists in a database via a stored procedure ...
8
votes
2answers
63 views

Calculating Luhn-algorithm checksum digit

Today I decided to learn some basic Haskell, and for starters I made a program for calculating the checksum of a Swedish personal identification number. It uses the Luhn-algorithm, aka. ...
2
votes
2answers
48 views

Validate multiple regexes without a for loop in JavaScript

For a project, I need to validate a VAT number against the correct algorithm. I found a library for this here (freeware, so I should be able to reuse it) that I'm grateful exists. However, I feel like ...
6
votes
3answers
188 views

Refactor a selection validator

I have a data table and have to validate every field in it. I have refactor this code to this below, but the complexity is 15(!!) Should I make something like dictionary with ...
5
votes
3answers
114 views

Regex to validate font names

/((([\w -]+)|("[\w -]+"))( *, *)?)+/ http://refiddle.com/18ql I'm trying to use a PHP regex to sanitize a user input for a list of fonts. The above one seems to ...
2
votes
2answers
53 views

Generate the Norwegian equivalent to social security numbers - follow-up

First of, here is my previous post. That should explain a fair bit. The reason I'm posting one more time, is I have changed a lot. Using more classes, let them do all the work, and the overall ...
6
votes
3answers
117 views

Pattern tokenization program

I am writing this program to try and get some practice at C++ and correct and proper styling. This code is meant to take user input from a pip and then run it through the program. The user enters a ...
8
votes
3answers
55 views

Validation/error handling of user input values

This is a tiny learning program that lead to an interesting question: how can I best/most elegantly handle user entered numbers? This method works, fails cleanly, and reads well. It doesn't apply to ...
2
votes
1answer
56 views

Validation invoking queries?

I have a question regarding whether it is viable or deemed correct if a validation object invoked a query. Essentially, I have some code that looks like this: ...
3
votes
1answer
43 views

Can this date-validation function can be simplified further or is it the correct approach?

I am doing a date validation. I have no. of pages, which have the date field. User can input the date like "220875" or "22AUG75" - I need to test both and check the length as well. ...
4
votes
1answer
45 views

Multiple drop down validation

I have written some jQuery which validates a group of drop downs. It checks the text value selected in all the drop downs (first three characters), and if there is a duplicate, it warns the user. ...
4
votes
1answer
41 views

Additional model validation

...
2
votes
2answers
79 views

Validator extended to handle domain objects / entities

I started improving my validator library even more, and I think I'm at the last final element (domain object / entity validations) before I can gladly say that my Validator library is completely done ...
6
votes
5answers
1k views

Regex validation for Email Address

I need to validate whether my regex is correct for below scenario. Suggestion's if the regex is correct: Wiki Link Local_part The local-part of the email address may use any of these ASCII ...
11
votes
3answers
487 views

Bank card validation module

I hope that someone could review a module I wrote for bank card validation. I included a class that tests some of the methods, this is purely to show the methods work, rather than unit testing. I ...
3
votes
3answers
70 views

Validating a string under few conditions

Following code validates NIC number of a person (National Identity Card, no like SSN) Requirements are... Length should be 10 digits or characters All should be digits except the last one Last one ...
2
votes
1answer
45 views

Using a single validation handler for all controllers in a form

In input validation I'm using this validation method in my all Forms. Here I have a single handler for all TextBoxes in my Form and if I have other controllers like ...
3
votes
4answers
161 views

Input validation for text boxes in a Form

In a Win Form I'm doing initial validation in the Form. So before saving data, I want to validate whether all the required fields are filled (Text Boxes) by the user. There are about 18 such Text ...
3
votes
1answer
75 views

Can this form validation be simplified made to memory leak free for all browsers?

I am doing a validation and I believe that there are many things that can be reduced or removed. I am still re-working this. But I am looking for some experts to look at my code and offer the very ...
2
votes
1answer
111 views

Checking if variable is defined before accessing its properties [closed]

I didn't write this but I noticed it in our codebase at work. ...
2
votes
1answer
73 views

User name and password validation in a MVP application

In a WinForms application I'm doing the password validation as follows: When the user presses the OK button after entering username and password, an event will be fired and the listener in the ...
1
vote
0answers
58 views

Validating a model and focus to the element if validation fails

I am using Backbone Marionette - I would like to set the user name and password if that passes the model validation method. I am highly confused with that. Please show me a handy approach or correct ...
5
votes
0answers
77 views

A general purpose GUI data input, with validation, but unclear about best object design

When I'm throwing together prototype code, I don't want to spend extra time setting up parameters, or chasing down problems from entering parameters wrongly. So this is a general purpose, fairly easy ...
15
votes
2answers
366 views

Allowing users to input a safe subset of HTML

I am currently working on a project that requires users to input text that may or may not be formatted (if it helps, just think of it as a Stack Exchange clone, even though that's not quite accurate). ...
1
vote
2answers
61 views

Validate fields in Python dictionary using dictionary of lambdas

I would love some feedback on this. I use it to validate web-form objects before persisting them in the dangerously-lazy MongoDb. I have a class and many validators for each of my collections. Is ...
7
votes
3answers
259 views

Scrubbing user input

I'm taking user input from a file in form (1, 2, 3) to create a color, and I just wanted to know if I was taking most cases into account, and if there is any way I ...
11
votes
3answers
736 views

Validate and import data from an Excel file

I have recently designed a module which will do bulk upload for different contents. Basically the user will upload an Excel file, I will have to read and validate headers of excel then each value of ...
3
votes
2answers
117 views

Client-side validator for contact information form (name, phone, e-mail)

My recent post had some things to fix. I think this should be well structured and written for you. How does this code look to you? If something needs to be changed please tell me. ...
5
votes
2answers
99 views

Possible security issues in email validation

I need feedback on this code regarding security issues. ...
10
votes
6answers
2k views

Can people understand my form validation code?

I've just finished creating this form validation but I want to make it public for beginner 'contact us forms'. I was wondering if I can have some peoples' input on if they can understand/read my ...
5
votes
2answers
446 views

Password strength checker

I would like to receive feedback about my code. Is there any better way to shorten the code or is it fine? Demo ...
3
votes
1answer
142 views

ISBN Number Check

I’ve recently coded a way of checking a 10-digit ISBN. I was wondering if the code works to check the numbers, and if there are any flaws in my code. ...
1
vote
0answers
63 views

Form Validation Evaluation

I've been trying several styles of validation code for a form. I was wondering if this is good or needs some improvement or just trash it and use jQuery validator code? ...
5
votes
3answers
111 views

Matching square brackets

I wrote this program to match square brackets as part of a Brainf**k interpreter. I'm aware that it gets caught in an infinite loop if brackets are entered like this: ...
4
votes
3answers
326 views

32-bit factorial calculator in x86 NASM assembly

This program calculates the factorial of a given positive number. This is how it handles input: if negative, terminate program if 0-2, display input without calculating if greater than or equal to ...
3
votes
1answer
81 views

Shortening if-statements of displaying errors

Is it possible to shorten this piece of PHP code? Honestly, I think it does not look clean but like a mess. ...
5
votes
2answers
261 views
4
votes
1answer
90 views

Amalgamation of the repository and command / query pattern

I am coding a web based solution which consists of N number of tiers, these are: UI Web API Business The question I have is related to validation, repository and CRUD operations. I am adopting the ...
1
vote
1answer
41 views

Auto-Format GPA while typing : REVISED

I need to further simplify this solution to auto-format a text-box field intended only for the user to enter their college Grade Point Average (GPA). Here is my code: ...
5
votes
1answer
111 views

Auto-Format GPA while typing

I'm looking for a more cleaner and simpler solution to auto-format a text-box field intended only for the user to enter their college Grade Point Average (GPA). Here is my code: ...
3
votes
2answers
198 views

Simple structure that would contain validation errors messages

Before I go too far, does this look right? This is mostly to have a "central" place that hold a "hierarchical/structured" errors message. ...
12
votes
3answers
175 views

Credit card verification: string conversion most optimal?

Below is some code which verifies a credit card number using the checksum as well as check if number of digits are appropriate as well if digits start with right numbers. I am not sure if converting ...
4
votes
5answers
338 views

Validating that all open/close parentheses are correctly matched

It returns true for: a*(b+c) ()() (()) ((!!(123(x)))) and returns false for: ...
12
votes
3answers
357 views

Celsius → Fahrenheit conversion table

It's harder to do than criticize. Here's my attempt to implement a Celsius-to-Fahrenheit conversion table in C++. ...
3
votes
1answer
59 views

Credit card validation with reversed array

I want a review of this code. ...
6
votes
2answers
227 views

iOS App - Interface for user log in using a call to a web service API

I have a navigation controller set up with a user code and password and a log in button. When the user clicks on the Log In button or the return key on the keyboard on the password text box - the ...
3
votes
1answer
166 views

Validating an entity using a dynamic list of predicates

I have a generic extension method for validating my entities. The main idea is to be able to specify at runtime (context related) the criteria for validating a specific entity (with the end goal of ...
5
votes
1answer
113 views

Date range validator

I have some code which works fine. First, it checks that dates format are valid and then, checks that first date is lower than second date. I had to use free input text and custom validator because ...