Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [validation]

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

0
votes
0answers
12 views

Design pattern to validate class object field values

I have PostgreSQL DB and I am using SQLAlchemy to sync data with my DB. For example I have a following declarative class which represents a news article obtained by parsing one of the news websites <...
-2
votes
1answer
48 views

Simple calculator with validation [closed]

I've implemented a simple calculator in C# that takes in the left operand, the operator, and the right operand. Once the calculate button is clicked, I use four methods to validate the inputs: 1. The ...
0
votes
1answer
26 views

Assert LinkedHashMap element in jUnit test [closed]

So I have some test, maybe the given side of that test is not so important to catch the point of my confusion. I wrote ...
1
vote
0answers
29 views

Ruby - Create a bitmap editor that accepts user input to plot a matrix grid, points and lines

I recently didn't pass a take-home code test for a job interview - and one of the reasons for this was that the code was not as idiomatic as it could be. The premise is in the title - but below ...
2
votes
1answer
37 views

Check values in datatables, with validation rules that vary according to the data source

Background I receive dataframes from several sources (below I call these sources s1, s2 and ...
2
votes
1answer
43 views

Transactionally create something, if allowed

I have been looking over this block of code for hours trying to simplify it. Would there be a better way to check all those conditions before creating a transaction ...
1
vote
1answer
40 views

Check PHP validation code

I have made a form in HTML and the form data should be send via email. For that purpose I have created a PHP script. I did read a lot about the importance of form validation in order to prevent ...
2
votes
2answers
74 views

Validate Email as User is typing (JavaScript)

I have the following javascript function validateEmail(value). The goal of the function is to validate the users inputted email as they are typing. So if someone puts nfg@*gmail.com the email will be ...
1
vote
0answers
19 views

Business logic validation as custom Bean Validation annotations?

This is not my solution but that of an existing application I am enhancing. Basically what they are doing is annotating a Form.java with a custom validator that ...
1
vote
2answers
55 views

PHP login/signup validation class

I am working on a blog with PHP, specially in order to practice OOP. Since the blogging system will handle users, i thought that a Validation class would be a good idea in order to not repeat code ...
2
votes
1answer
144 views

Tkinter based calculator

I've recently finished building a calculator in Python using Tkinter, and would appreciate any and all feedback on it. Please ignore the use of the eval function, ...
1
vote
1answer
40 views

PHP validation class for username, email, and password

I'm relatively new to PHP OOP, currently I'm practising how to use it, however I am not really certain I'm building my classes correctly, I think perhaps I'm missing something out but I'm not entirely ...
3
votes
0answers
22 views

Use a pattern for fields validation

I need to validate the fields of user sent by an API. All works fine but the only one problem is that I don't like the solution is not an OOP solution. In the controller I call the service created by ...
1
vote
0answers
43 views

XML graphing, and attribute existence

I have been working on my own form of validation for XML other then xpath, as a toy project. First off, I use this class to add Validations to the graph to check for and validate they exist. ...
0
votes
0answers
21 views

Kotlin MVP design suggestion

I have implemented simple design for error-handling in MVP architecture in Kotlin language, but I'm not sure if it is poor or good design. My main idea was to transfer exceptions directly to functions ...
0
votes
1answer
694 views

Password and confirm password validation in Android Studio

I just wrote this password and password confirmation validation code function that checks to see if a password is empty or not, and is it match (password = confirmPassword). I'm not sure this is the ...
18
votes
8answers
3k views

Program to check if a date is valid or not

I am a novice programmer and am currently learning Python programming by myself through a book. I stumbled upon a question in a chapter and it took me 2 days to figure out a solution for it. Although, ...
2
votes
1answer
29 views

Finding incorrect yml headers

Introduction I am working on a semi large project with a few hundred files. In this project there is a series of lesson.yml files I want to check is formatted correctly. And, yes, every file I want ...
3
votes
1answer
72 views

Convert string to double and check for errors

The following program converts a string to a double, and checks for errors. It uses the strtod() function to do the conversion, and follows the example given for ...
0
votes
0answers
98 views

Candidate registration, with validation, using MVVM

I am new to MVVM. I Created Model class CandidateRegisterModel and ViewModel class CandidateRegisterViewModel ...
0
votes
2answers
47 views

jQuery function to display an alert when submitting blank fields

I am new to jquery and implemented following function in a js file in case of error- ...
2
votes
1answer
94 views

PHP contact form script

I have created a contact form that originally did not have any mechanism for sending out the email with whatever the user inputted in the fields. I have added it in here along with ReCaptcha check. I ...
5
votes
2answers
358 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 <...
1
vote
0answers
117 views

Form validation for multiple inputs - react

I created an example of a simple form for multiple inputs (name and phone number) in React. If user enters invalid data in input field, error text is displayed near the same field. I learned a lot of ...
2
votes
0answers
81 views

Form validation for the last name

I created an example of a simple form for a last name input in React, where I can check the validation of the data at the time of input. The last name should contain only small and capital letters. If ...
3
votes
4answers
94 views

Simplify form validation with function

In jQuery, I have been reluctant to create a better form validation, and I feel the time has come for me to do so. With that said, I have been using this particular type of form validation, and I ...
8
votes
2answers
295 views

Validating user-provided control points for a Bézier curve

I have made some code which will validate user input for getting 4 control points for a bezier curve. It works fine however I was just wondering If I could make this code any more compact or efficient?...
4
votes
1answer
60 views

Validator for vertices of a polygon

There is an object which has few properties. I wrote a function for test cases which check if the properties are satisfied or not. The function should throw an exception if the property is not ...
10
votes
4answers
345 views

Validator for mathematical expression in infix form

This program will validate whether a mathematical expression entered by the user is a valid expression based off whether the expression itself has been entered with the correct scope openers and scope ...
3
votes
2answers
70 views

Creating user accounts

I have a method which allows to create user account. It contains some conditions to control empty fields, wrong format of email, weak password, etc. ...
15
votes
6answers
5k views

Verifying IPv6 addresses

While trying to learn Python I stumbled upon a question which asks you to write a code that is able to take an input and verify it to see whether it meets the IPv6 Criteria. I wrote the following ...
5
votes
1answer
72 views

Basic input validation package in Lua

I'm very new to Lua (and programming in general). I wanted to start out with a simple package that validates input based on a set of rules. The code works as intended, but is what I have written is ...
2
votes
1answer
56 views

A basic form with React

I have been working of a basic from using React and I need your help to improve this part of my code, especially validate and ...
2
votes
1answer
93 views

Checking if all questions were answered with javascript

I made a quiz project and I made a code to see if all the questions were answered, using JavaScript. It works, but its way more exhaustive than I wanted it to be. I first check every single option ...
1
vote
0answers
267 views

CodeIgniter CRUD form validation

I've developed a crud "helper" of sorts. Fields/columns are derived from the database and contain everything from the name of the field to the type and size of the field. Part of the system integrates ...
1
vote
0answers
61 views

JSON validator using rules

I'm writing an application that is meant to validate data. The data comes in the form of JSON and I'm using JSON Schema to validate the structure and some of the logic along with functions to ...
1
vote
0answers
95 views

Using repository in a FormRequest in Laravel for custom business rule validation

This is my app/Http/Requests/Organisation/CreateOrganisationRequest.php ...
8
votes
2answers
1k views

Checking some rules before a Telegram bot replies to a message

So far, I've created a couple of programs, and the issue that comes up is how ugly and non-scalable they look. For example, currently I'm working on a telegram bot. Before replying to a message I ...
5
votes
2answers
2k views

Conditional validation on two input fields that depend on each other

My code consists of two input fields and a submit button. The business rules require the following rules: At least one field must be filled out. Both can be filled out but both cannot be blank. If ...
0
votes
0answers
267 views

Rails Strong Parameters Filtering

In my Rails controller with strong parameters, I have the typical my_model_params private function to filter out any "scary internet params". One of the parameters ...
3
votes
1answer
359 views

Credit card validator code in Python

I wrote a Python code that is validating Credit Card Numbers. Some of the advanced programmers told me my whole code is messy. How can I make my code cleaner? ...
3
votes
0answers
94 views

Define a class for latitude and longitude in C++ using boost::units and spheroidal coordinates

I am trying to write a class that defines latitude and longitude in C++ using boost::units and normalized spheroidal coordinates. I want to throw an exception if ...
0
votes
0answers
85 views

Handle and validate general input under certain constraints

I have been programming in C++ for less than six months, so please correct anything you can. I think one of the most annoying things programmers have to deal with is validating user input. For ...
3
votes
2answers
787 views

JSON Schema Validation helper method

This is what I wrote to validate JSON to the given schema. ...
3
votes
1answer
89 views

Function to validate data using up to four kinds of rules

Sometimes I end up with a function that requires checking multiple conditions to determine the outcome and the logic can get to be too much to handle on a single line. Here's an example of how I ...
2
votes
1answer
2k views

Server side validation for reCAPTCHA V2 or Invisible reCAPTCHA with Java (Servlet)

The main reason for this post is that I spent quite a lot of time searching the easiest way to validate recaptcha V2. So I'm going to share my knowledge to avoid further time wastage of developers. I'...
1
vote
1answer
52 views

Ensure multiple steps work/saving multiple models via a service

I just thought of something new re: saving multiple objects in Rails (though Rails is not necessary). Objectives: Create an author and a tomato, but both of those must be valid. If invalid creation, ...
2
votes
3answers
594 views

Integer validation in C++

I am studying C++ and after I learned about some functions of the library cctype like isdigit I decided to make a program that ...
1
vote
0answers
158 views

A rails controller needs to validate certain values exist

I need to pass some values from a CMS to a rails view. I should check these values are defined in the CMS. These values are meant to be use in all pages, hence the use of ...
-1
votes
1answer
35 views