Validation is used to check data to make sure it fits whatever required specifications are set for it.
2
votes
1answer
38 views
Validate data for insert, server side
I have a function for parsing data, that goes to the database, (it's more validation, the sanitization process is taken care of by the framework). Here's my handmade script, based on a jQuery library, ...
0
votes
0answers
17 views
alphanumeric validation javascript without regex [on hold]
if i run, validation just can be work only on symbol "/", if I input the other symbol except / didnt working. I'm not use regex. loop like stop work.
...
1
vote
0answers
40 views
Model validation against database and extra business logic
The thing is that I asked this question on StackOverflow, but after some time thinking about it, I think it better go here first.
MainView
...
1
vote
3answers
57 views
0
votes
3answers
53 views
Validation null values (preconditions)
I would like to know an alternative, more elegant way to write the following methods.
I am especially not enthusiastic of the nested if statement or ...
0
votes
1answer
35 views
Validation for DTO using DataAnnotations
I need validation for all DTO objects using System.ComponentModel.DataAnnotations.
You can see how I implemented. Idea is to have one abstract class that will be inherited in all dto classes.
This ...
3
votes
1answer
39 views
Check that input is list of lists of coordinates
I have a factory method that should accept a list of coordinate lists, which are pairs of numbers, for example ...
1
vote
1answer
64 views
Checking if a user can withdraw money
This is purely testing my skills; I am not actually coding for a bank. This is part of a bank account class.
...
3
votes
1answer
42 views
Submitting form after validations using jQuery
This is my simple jQuery form validation/submit logic and it is working perfectly fine. But still I am posting this to see if someone check the logic and suggest me if there is any other simple way to ...
1
vote
1answer
34 views
Variable length string validation against whitelisted characters
I need to validate a variable length string against some white-listed characters. The algorithm that I have works but I have a sneaking suspicion that there is a more elegant solution. The code below ...
4
votes
1answer
54 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 ...
0
votes
0answers
10 views
2
votes
1answer
64 views
Registration, Validation & Storage functions
The last time I wrote any serious code was the 90's, so a lot has changed and I am finding I am having to relearn pretty much everything.
I have leaned a lot from previous posts and this is the ...
1
vote
0answers
16 views
PyQt5 validator for decimal numbers (V2)
This class is similar to QDoubleValidator, but it improves slightly on the editing comfort.
Are there any corner- or special cases of inputs I didn't consider, which would lead to bad behaviour?
Is ...
3
votes
1answer
28 views
PyQt5 validator for decimal numbers
This class is similar to QDoubleValidator, but it improves slightly on the editing comfort. The comments mention "comma" but it's actually the decimal point of your locale (comma for me).
...
4
votes
2answers
106 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 ...
7
votes
1answer
75 views
JavaScript date validation
I have a date control which has a dropdown for each date, month and year.
The issue is, I can select 31st Nov. 2015 as well, and when I create date object, I get 1st Dec. 2015.
Example
...
3
votes
3answers
209 views
Web page to add a notice, with some validation
I'm displaying multiple queries and if statements. In the if statement, it increments ...
3
votes
1answer
41 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 ...
2
votes
0answers
17 views
CF/jQ server-side session struct to replace hidden inputs
I have inherited a legacy ColdFusion app with gobs of <input type="hidden"> fields, and a user finally may have used F12/Inspect Element to submit a ...
6
votes
2answers
100 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 ...
-1
votes
1answer
90 views
Validation function using both for-loops and indexes at the same time
This function iterates through a open dialog box that has 4 values in it all optional except for aircraft1, aircraft2, warning_or_alert.
...
1
vote
1answer
106 views
A more optimized / cleaner way of validating WCF input parameter using IParameterInspector
I'm having a WCF Rest service which does input parameter validation by using the IParameterInspector, before calling the actual service method. I have Implemented ...
6
votes
3answers
405 views
Checking balanced parenthesis string
I recently wrote a code in online recruitment test. It was very good.
With each question, there were associated space and time limits check. If our code executed correctly within both limits, only ...
1
vote
2answers
246 views
Accepting a positive integer from either a command-line argument or System.in
I've been doing a lot of programs for classes that require a prompt from the program. I thought it would be much faster for me to rapidly test inputs if I didn't have to execute the program and then ...
1
vote
0answers
55 views
URL image validation
I'm trying to write a method to validate an image from a URL. The method will accept an array of image URL. The image should be validated by its type, size and dimensions. Right now, I'm able to ...
2
votes
2answers
49 views
Controller method to validate and save
I have built RESTful web services. The services endpoints have a similar logic:
If the input validation succeeds, do a database operation and return the result.
If the db operation fails, return the ...
5
votes
2answers
622 views
Program that tells if a date is valid in C
I'm reading a book about C programming, at the end of each chapter it has some training exercise and one of them was to make a program that tells if a date is valid or not, the code below is what I ...
3
votes
1answer
105 views
Phone number format and data entry restriction
I created a form that formats phone numbers, allows only allowable keys to be pressed, and converts a lettered entry into its corresponding phone keypad number. Is there some cleanup or better coding ...
21
votes
5answers
2k views
A completely repetitive console prompt, a completely repetitive console prompt
So I wrote this for my Mandelbrot Generator, to collect and use input from the user, and I made it dynamic enough to be useful anywhere.
I'm really interested in all critiques of it, as I'm going to ...
2
votes
0answers
101 views
Validating Card Number in Delphi
As part of processing card payments, before even attempting to process, I need to check and validate the card number to make sure it's valid. For this, I've encapsulated this validation in a record ...
12
votes
5answers
1k views
E-mail testing code
I made some code to check that e-mails given apply to the right format, and I'm sure there must be a better way to do this.
...
10
votes
5answers
474 views
Birthday validity-checking
I have written code to check any birthday input's validity. As I am new in programming, and after going through several debugging steps, the code became very ugly.
...
0
votes
0answers
43 views
jQuery form validator
I am new to the world of jQuery plugins, I don't know why I didn't get into this sooner. What I have a working validator that validates bootstrap styled forms. What I have discovered is that the way ...
12
votes
5answers
1k views
Credit card validation
I started following Harvard's CS50 (Introduction to Computer Science) on edX, and as part of their Hacker edition set 1 was the following assignment:
I am supposed to write a program (in C), that ...
8
votes
3answers
215 views
Simple Google ReCaptcha validation
Linked:
Google reCAPTCHA Validator: Iteration II
I have also created a simple Google Recaptcha Validation class to handle verification.
I used some code from CodingFusion's post Google New ...
6
votes
2answers
206 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 ...
3
votes
1answer
41 views
Validate profile completeness
This function checks these 6 fields for a user profile to determine if they have "completed" their profile. This just feels like it could be done better, but I can't figure how.
...
11
votes
2answers
294 views
Verify that a path doesn't contain . or .. or // and doesn't end with /
This is actually a function from the first commit of the git source code, for the purpose stated in the title:
...
0
votes
1answer
80 views
jQuery .validate() plugin, additional method to validate numbers
A while ago I've written a custom validation method for .validate(). It is a local validation plugin, with some limited validation.
I was required to write a validation method with the following ...
2
votes
2answers
50 views
Model object for form validation
In order to perform form validation, I have created a custom object:
...
7
votes
1answer
107 views
Calculations with FX
There have been a lot of calculators lately. It seems like this community challenge all over again, I didn't make a proper one then, so I'm joining the calculatrain now.
Building from the lessons ...
3
votes
2answers
67 views
0
votes
0answers
30 views
Generic Razor view Model property validation for Form
I have run into instances where someone would add columns to a table in the database, update the Entity Framework models for our solution, but forgot to update the forms to compensate for the added ...
3
votes
2answers
178 views
5
votes
2answers
49 views
PriceDialog - Prompt & price validation
In a recent CodeReview I presented a Product Manager that manages product listings and prices. Based on the great feedback I have refactored the mentioned Prompt and validator class and want feedback ...
1
vote
1answer
38 views
3D plot from lm model with a nonlinear parameter
I am trying to plot a 3Dplot of a linear regression with two variables.
My linear model:
ls = lm(mpg ~ disp + qsec, data = mtcars)
The minimum and maximum ...
4
votes
1answer
47 views
Long format data - fill episode based on conditional previous episode
The data are organised as long format data. 4 individuals are observed during 4 or 5 days (BCSID is the name of the unique key). Basically, the data describe ...
2
votes
1answer
40 views
Clean phone number
Program that cleans up user-entered phone numbers so that they can be sent SMS messages. The rules are as follows:
If the phone number is less than 10 digits assume that it is bad
number
If the ...
2
votes
1answer
440 views
AngularJS image size validation directive
I've written a directive to validate the width and height of an image in AngularJS. I'm not a JS genius but I get along with it. So I would appreciate some feedback on this directives code if this can ...