Questions tagged [validation]

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

Filter by
Sorted by
Tagged with
6 votes
1 answer
2k views

NMEA 0183 checksum validation

I was hoping for a bit of advice on cleaning a couple of areas of this code up. In particular, the hex-to-binary section, the checksum is in hex, and the rest is in ASCII. I tried for a good day to do ...
Ohcir's user avatar
  • 61
6 votes
2 answers
219 views

Sudoku challenge driver program

For my planned Sudoku with Handicap challenge over at codegolf.SE, I need a driver program. I've decided to write it in Python, for learning purposes. Since I've got no Python experience, I thought I ...
celtschk's user avatar
  • 163
6 votes
2 answers
1k views

Google reCAPTCHA Validator: Iteration II

This is a follow-up to the other post I made (less than an hour ago) about my Google reCAPTCHA C# implementation: Google reCAPTCHA Validator This adds support for error messages, so that you can ...
Der Kommissar's user avatar
6 votes
5 answers
11k views

Validating that all open/close parentheses are correctly matched

It returns true for: a*(b+c) ()() (()) ((!!(123(x)))) and returns false for: ...
user39193's user avatar
6 votes
2 answers
285 views

Asynchronous IBAN API with validation

I am working on an iban api which is about saving the iban of some members after (iban validation) in a database. The code is split between Domain (entities, behaviour for iban validation), Database ...
Natalie Perret's user avatar
6 votes
3 answers
3k views

User input validation that might be unbreakable for C++

I am new to programming and have been having a lot of trouble with user input validation. Everything I found online I could break and I finally put this function together that appears to be ...
takintoolong's user avatar
6 votes
2 answers
13k views

Prompting for a positive integer and validating user input in Java

I'm just starting out with Java, and trying to make a method to get a positive integer input from the console. My currently working implementation is this: ...
Mikko Marttila's user avatar
6 votes
3 answers
2k views

JS validation and submission with AJAX

I've got an assignment to do pure JS validation as well as submit with AJAX. Here is the code I've got so far. I'm wondering if I can do away with the whole "reason" bit. That was because it was ...
justinae's user avatar
6 votes
2 answers
250 views

Simplifying this form validation script

Can anyone please help me to simplify this form validation script? It works great but I was just wondering if I can get some help to make it simpler. Your opinion on the approach I used below is ...
Leo's user avatar
  • 789
6 votes
2 answers
4k views

Rails validating API parameters

I wanted to keep my API request logic separate form the controller logic. I therefore make use of a separate model (EmailChecker) that creates an instance of this ...
MDekker's user avatar
  • 161
6 votes
2 answers
3k views

Angular control for inputting latitude and longitude with validation

I've built a custom control to handle user input in a human-readable format, but save in a machine-format. It needs to have input validation, and to convert UI-input to a base format. I'm interested ...
ANeves's user avatar
  • 2,882
6 votes
1 answer
113 views

Validating a StreamingPin

Recently I was thinking about the keyless entry on my car and how simple it has to be, so I wrote a C# programme to validate a StreamingPin, that is, a pin that is ...
Der Kommissar's user avatar
6 votes
1 answer
6k views

Checking input and email field

I've written this as part of my contact form on my website. It checks to see if required inputs are empty, if so adds a red warning color and text. It also checks the email field for a properly ...
Amir's user avatar
  • 163
6 votes
1 answer
186 views

Relative relationships

This is a question in Udacity JS course. I am starting to like Javascript. I feel its a misunderstood language :) We learned about relational operators and how they can classify the relationship ...
geoandroid23's user avatar
6 votes
1 answer
90 views

Agnostic means of identifying a member

I'm attempting to provide an agnostic means of identifying a member. I need a nickname, a guid, and one of ...
rhgrant10's user avatar
6 votes
1 answer
4k views

Using Rails concerns for validation in models

This is my first Rails project. I have read about concerns which are a great tool, but I am confused about how I should redesign my models. Some models have similar fields, but the validations are ...
Bóta László's user avatar
6 votes
2 answers
343 views

Validating ISBNs

I'm just looking for a cleaner way. Obviously I could store a variable for some of the int parts. Personally, I think the one-liner looks better and everyone's ...
user avatar
6 votes
1 answer
471 views

Using/storing server-side data on the client side

I've a slot booking script which is as follows: My Current Algorithm A calendar is shown to the user The user clicks on a date I make an ajax call to determine if at least 1 slot is booked on the ...
asprin's user avatar
  • 175
6 votes
1 answer
197 views

Simple function to create Tokens from user input

I am new to programming in Rust and as an exercise I was making a simple Lottery checker program. It has a simple menu, the user enters a number for the corresponding option such as 'Add a line', '...
user avatar
6 votes
2 answers
64 views

Checking for many alertable conditions before saving customer information

What's the best way to refactor this code? The method does a lot of checking before showing an alert. And the method is too long for my taste. I'm thinking of extracting the checkers into their own ...
Vilowapo's user avatar
6 votes
1 answer
1k views

MVC Model validation callback

I have made a simple MVC framework of my own for my personal website to learn a thing or two about how this whole thing even works. I think I've got the idea, but there's one thing I'm not sure about. ...
user2374794's user avatar
5 votes
3 answers
1k views

Extending Abstract Person Validator

I have the following code which is responsible for the validation in our app (just an example). Based on the particular tab where user can add person to the database we need to perform additional ...
ashur's user avatar
  • 423
5 votes
6 answers
128k 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 ...
CAD's user avatar
  • 1,753
5 votes
2 answers
822 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 ...
Muhammed's user avatar
  • 303
5 votes
2 answers
359 views

Is there a better way to optimize these conditionals?

...
Luis's user avatar
  • 161
5 votes
5 answers
1k views

Most efficient way to validate multiple textboxes against a tolerance value

I have a series of text boxes in a table to gather input as below: The user will input a target and actual value for each measurement point they require. I would then like to validate the actual ...
Jimsan's user avatar
  • 355
5 votes
4 answers
325 views

Validating a tab-delimited string

This code checks if string has correct format for passing to struct. Correct format needs to be [123456789'\t'First Name'\t'Last Name'\t'City]. I didn't know how to ...
Name's user avatar
  • 237
5 votes
2 answers
2k views

Simple form validation script

This is a simple form validation script. I'd like to: improve the jQuery validation simplify the jQuery code Questions: Should I be exporting pure JS validation to avoid potential conflicts with ...
kht's user avatar
  • 185
5 votes
2 answers
440 views

Validating username fields and showing CAPTCHA

I'm new to coding, and especially to OOP PHP. I'll highly appreciate if you expert programmers could review following code and give me your opinion to make it better. Also, how you see this code, is ...
jcb's user avatar
  • 53
5 votes
3 answers
173 views

Userform that calculates gas mileage

I created a project for a programming class that asks you to make a userform in Visual Studio that calculates mileage, given the user inputs of gallons of gas consumed and distance traveled. The code ...
Diogenes's user avatar
5 votes
2 answers
566 views

Electrical engine calculations

The ElectricalEngine class responds to the horsepower message. Because efficiency is calculated in percent a programmer can ...
Mohamad's user avatar
  • 2,034
5 votes
3 answers
182 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: ...
rootmeanclaire's user avatar
5 votes
3 answers
675 views

Chess Dictionary Validator (Python) (Automate The Boring Stuff)

This is an exercise in the Automate The Boring Stuff book. I am supposed to create a function that takes a dictionary argument that represents a chess board (ex: {'1h': 'bking', '6c': 'wqueen', '2g': ...
Nick 's user avatar
  • 99
5 votes
2 answers
242 views

Address form validation

I need help with this code. How can I make it shorter? How can I create an array with the names, for example, errors, and modify code without so many If statements? ...
Tomas13TO's user avatar
5 votes
3 answers
2k views

Validating a credit card number using Luhn's algorithm

I implemented Luhn's algorithm explained on Wikipedia to validate a credit card number, in Bash. Does this code follow good practices? ...
智障的人's user avatar
5 votes
3 answers
1k views

Validating email addresses through temporary mail message

I was given this project and have changed a lot of code on it, now I am going over the code to make sure that I know what everything does and can maintain it efficiently, and to make sure I want my ...
Malachi's user avatar
  • 28.6k
5 votes
3 answers
4k views

Returning a validation error from a command handler

...
User 12345678's user avatar
5 votes
3 answers
6k views

32-bit factorial calculator in x86 NASM assembly

This is how it handles input: if negative, terminate program if 0-2, display input without calculating if greater than or equal to 3, calculate and display result I have also used some macros from ...
Jamal's user avatar
  • 34.9k
5 votes
3 answers
4k views

Validating password rules

The following method is designed to return true if it passes all of the rules for a password. Does anyone see a way to improve it? Performance improvements are ...
Levi Morrison's user avatar
5 votes
2 answers
2k views

Apple receipt validator

I'm working on a solution for validating Apple receipts. Here's the repository as whole. I based it mostly on the gdx-pay-server library. In my implementation, one of the classes I want to improve is <...
Daniel's user avatar
  • 213
5 votes
4 answers
14k views

Asking the user to input a proper email address

The purpose of this code is to ask the user to input an email address but it must contain "@" and ".co". The code works but it is too long so I would like to know if there is any way to shorten it ...
student10002's user avatar
5 votes
3 answers
8k views

Custom exception for string that is too long

This is my first time working with Java exceptions. I have made a program that works to specifications, but I am wondering if there is anything I've done which is unconventional or not recommended. ...
RandomKaryotype's user avatar
5 votes
2 answers
3k views

Simple Java password rule enforcing

rule 1: length must be between 8 and 50 chars. rule 2: at least 3 of the 4 following rules: --------2a: at least one upper case --------2b: at least one lower case --------2c: at least one numeral ----...
skex's user avatar
  • 65
5 votes
3 answers
843 views

ISBN validation with Hibernate Validator

I've written a ISBN-validating annotation. It is to be used in conjunction with Hibernate Validator. I'm pretty satisfied with this code as it works as expected, but I've had to make a design choice ...
Olivier Grégoire's user avatar
5 votes
2 answers
25k views

JavaScript onKeypress validation

This is a function for JavaScript validation: ...
PNG's user avatar
  • 425
5 votes
2 answers
6k views

Validation and Form classes

I have written Validation and Form classes in PHP. Validation class allow you to define the ...
I'll-Be-Back's user avatar
5 votes
2 answers
132 views

Validating a user

This works well, but can anybody see any faults in this code? If so, could you suggest ways in which I can fix it? ...
Alexandre's user avatar
  • 273
5 votes
1 answer
292 views

Validating input variables

I have written the following JavaScript code and want to ask if it is written as per best practices. Please recommend any changes to be made in the code. The code is taking a few variables as input ...
me24hour's user avatar
5 votes
2 answers
335 views

Validation for registration password

Could someone tell me if this is a bad idea for coding my validation for a password and it is bad? This is for registration for my site. Could you please tell me why and how you would go about it (I ...
Ash's user avatar
  • 65
5 votes
2 answers
10k views

Checking for valid date range in Rails

I am getting a date range from form inputs - the "from" month, day, and year, and the "to" month, day, and year, and then running a report on data for within that date range. I want to first check ...
user3060126's user avatar

1 2 3
4
5
15