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

learn more… | top users | synonyms

0
votes
0answers
15 views

Method for realtime form validation

A quick little method for validating form input with jQuery (and some built in bootstrap classes). I know the regex isn't perfect but it's close enough. Thoughts? ...
3
votes
1answer
38 views

PHP validation class using method dispatch

I wrote this validation class. I'm kinda new to the whole OO(PHP) style, so I don't know if my class is acceptable. I looked around at other people's validation classes, but most are huge (1k+ lines ...
-4
votes
0answers
30 views
5
votes
3answers
203 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 ...
3
votes
4answers
477 views

Validating Firstname and Lastname

I have written some code in Java that checks if the strings Firstname and Lastname are valid names. These are inputted by the ...
3
votes
1answer
94 views

Instantiating a kind of NumPy array

I am creating a class object which must inherit from numpy ndarrays. I perform an isinstance check and an ...
2
votes
1answer
45 views

Date validation in Java - take two

I read through and implemented the advice I received yesterday. I would, once again, really like some input on how this can be improved. e.g. encapsulation, interfaces, abstract classes etc.. Right ...
2
votes
1answer
35 views

Validate input of month/year, otherwise set it to current month/year

Is there a cleaner way of doing this? I'm using filter_input to first check for valid input, then using it again to assign the variable. Also, my condition in ...
3
votes
1answer
48 views

Validating a User via Save Method

I'm fairly new to object oriented programming here and am trying to get my head around the best way to go about creating Users and Validating them in the system. My first attempt is below and my main ...
2
votes
1answer
67 views

Date validation in Java

I'm learning Java, and would really appreciate any tips on how to improve this code. It's just a simple date validation class. ...
2
votes
1answer
43 views

Server side form validation library

Have I followed best practices for PHP development, or can this class be improved? GitHub ...
2
votes
2answers
75 views

Validation class

Can someone help me furnish my PHP validation class? I want to reduce its size and make it easier to use. ...
4
votes
2answers
158 views

TextField Validation for Teleport Feature in Game

I've implemented a teleport feature for my game and I would like some feedback on the way that I validate the user input. I am using the libGDX library. When the player clicks the Teleport Menu ...
2
votes
2answers
67 views

Verbose mailing function

I have multiple forms that do the same thing, send an email. As of this moment I have 3 forms that send mail. They vary only by number of inputs. One requires just an email. Another requires a name ...
4
votes
3answers
59 views

Reserving seats in a movie theater

I'm writing a C program to reserve seats in a movie theater. I am validating the selection of seats: ...
0
votes
2answers
66 views

Input and Validate Dates

Question: Write a function that accepts integer values for day, month and year and returns them in a valid format. If the day is above 30, then convert it to 30. If the month is above 12 then ...
2
votes
1answer
81 views

User input function keep looping until valid filename entered

The following function is basically asking the user to input a file name for a file that the calling program is going to do something with. If the user enters an invalid file name, I want the program ...
8
votes
2answers
98 views

Reference implementation of HTML-to-JSON converter for PCG

I have opened a puzzle at Programming Puzzles and Code Golf. The question is not perceived well (yet) and one of the reasons is that no reference implementation is provided. To mitigate this ...
3
votes
2answers
94 views

PHP contact form

I recently had my site hacked, with the main index file being overwritten (nothing else was touched). I'm assuming they hijacked my form input. Are there any vulnerabilities in the code or does this ...
2
votes
3answers
149 views

ADT for a TVM calculator

I wanted to get some criticism for the below ADT. This is just a basic ADT that will be fed into a TVM calculator. Main purpose is to have it initialized and correct for input errors. Full ...
3
votes
0answers
33 views

Validating JavaScript origins

I need to write a function in Python that makes sure the user entered a valid JavaScript origin. If I understand it correctly, the origin includes the scheme, hostname and port (port and scheme might ...
4
votes
1answer
47 views

Luhn algorithm MS-SQL

This a solution Luhn algorithm for credit validation. This algorithm is a basic one inspired by wikipedia. I mean no check for length, type, and so on. You can enhance the base code as you want it to ...
3
votes
1answer
111 views

Haskell Luhn Algorithm

Trying to get to grips with Haskell. The problem is taken from here. ...
3
votes
1answer
71 views

A User class for visitors to register and log in to a site

I'm just looking for some feedback on my User class. The class is designed to handle users being able to register, login, and logout of the site. I'll be using it in conjunction with a forum I'm also ...
2
votes
1answer
80 views

Sudoku validator

I've decided to learn some more Haskell writing a Sudoku validator, the function checkSudoku outputs True if the Sudoku is valid and False if it is not. I did not ...
4
votes
1answer
64 views

Class-based user input validation

Having contributed to this Community Wiki on StackOverflow regarding validating user input, I thought I'd finally sit down and write something more robust to do these kinds of tasks. I wanted ...
1
vote
1answer
109 views

Checking that a filename does not end with “Com.js”

I'm fairly new to JavaScript and I wonder if there is a way to write this function shorter and better? ...
5
votes
2answers
58 views

Validating config files and separating back-end from front-end

I'm writing a simple script which will search a source directory for certain types of files and move them to a destination directory. I'm using it as an opportunity to practice writing some ...
2
votes
2answers
56 views

Validate and Add Service Provider/Location in C#

I have a button that will validate the textbox for the service provider and the dropdown list for the locations. I have 3 tables: Locations, Service_Providers, and Service_Providers_Locations with a ...
1
vote
1answer
48 views

A simple Ruby EmailAddress class

I wrote this short, plain Ruby lib to handle email address validation inside and outside of Rails applications, and I would like to know what you think. ...
3
votes
2answers
64 views

Validator part 2

This is a follow up to: Validating individual properties and whole items I have a custom class I've written which allows me to validate individual properties of items, without firing validation ...
3
votes
1answer
62 views

Check secure image upload

I want to upload images to server from browser window. I'm using this function for image upload. Images are uploaded by GD library. What is your opinion of this code? Is there still a way to upload a ...
4
votes
1answer
52 views

Data-checking class supporting letters

I'm starting to learn OOP with PHP, and all I've learned so far is just by searching and reading. So I have this need to check input data for certain things like min of chars, max of chars, spaced or ...
2
votes
1answer
164 views

Validating individual properties and whole items

I have a custom class I've written which allows me to validate individual properties of items, without firing validation errors on other properties. This allows me to individually validate what my ...
3
votes
2answers
67 views

Removing synchronization from an agent for a trading system

Is there any way to easily remove synchronization from this code, when there is a validation step before acquiring a lock? I tried an ...
5
votes
2answers
383 views

Calculating the volume of a tetrahedron

Here's my function for calculating the volume of a tetrahedron. I've tried to comment well and perform a few checks on the types of the objects passed to it. Can ...
1
vote
1answer
59 views

An easier way to test a valid username

I have the following requirement for valid usernames: Only alphanumeric characters and - Must not start with a - I wrote this regex (on Rubular): ...
5
votes
3answers
162 views

Constraining data in idiomatic Java

Playing with a simple Java Point class where I would like to constrain the X and Y values to be doubles that must be in the range -10 to 10, inclusive. I've written ...
7
votes
2answers
747 views

Registration form with validation and error messages

I've been working on a registration form page in jQuery Mobile and I think I'm starting to get it fully complete. What I need feedback on is if I've forgotten anything in terms of accessibility, ...
6
votes
2answers
155 views

A way to handle integer input

I'm working on simple code that is to read input where: The first line is a number of cases to consider. The next lines are integers separated by a space that will be tested lately. Possible ...
3
votes
1answer
84 views

Flask form validation technique

This is currently the code that I'm using to validate and check for errors in a flask app, where the form fields are coming from a /registration html page: ...
4
votes
2answers
126 views

Credit card checking

I am practicing test-driven development in Python. Feedback about both the tests and the code is appreciated. I'm using luhn algorithm and regex to check credit card numbers for validity. Here are ...
5
votes
3answers
188 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 ...
2
votes
1answer
207 views

Laravel controller for form validation skinny

I'm trying to make controllers skinny as possible. I use repositories for accessing the database and I use Services to do other stuff. In this case, I use it to insert a new post to the database. For ...
7
votes
4answers
1k views

Calculating a specific entry in a Pascal’s triangle recursively

Our task was to calculate the entry of a Pascal’s triangle with a given row and column recursively. The triangle was specified in a way that the tip of the triangle is ...
4
votes
4answers
70 views

Validating a Collection of IPv4s

I have a method within a class that validates all proxy addresses are valid on initialization. I've tried to refactor this a bit, but this seems to be the best I can do. Any suggestions and/or tips as ...
2
votes
1answer
39 views

Sane ranges for DB queries

I have a function that has, as input, a ranges object which may define from, to and ...
2
votes
1answer
64 views

Validating input against rules

I have created a method that validates inputs based on a set of rules. If an error is found, it is put into an array which can later on be used to display the errors to the user. Below is my code: ...