Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

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
4 votes
2 answers
200 views

I wrote the Validator class. In the project, the presented code is located at the path ".../validator/init.py". It is needed for testing code in different virtual Conda environments, in the ...
Sindik's user avatar
  • 143
4 votes
4 answers
279 views

I am working on a blogging application in Laravel 8. I have added "live validation" to the registration form with JavaScript. For password strength, I use Zxcvbn. The registration form ...
Razvan Zamfir's user avatar
1 vote
0 answers
85 views

I'm creating a Settings-form in SwiftUI. One of the expected values is a double. I tinkered with NumberFormatter, but it didn't work well for me. Moreover I had to find a way making invalid values ...
michael.zech's user avatar
  • 5,044
0 votes
0 answers
88 views

I liked the idea of being able to authenticate using your own private key using Nostr protocol. The idea is based on events, so you prove your identity by signing an event. It's close to Wallet ...
uak's user avatar
  • 101
6 votes
4 answers
574 views

I would like to request a review of an Awk program I have written. This script meets an immediate business need and, ideally, serves as a coding style example for new hires (who may not yet be ...
Thure Dührsen's user avatar
3 votes
1 answer
73 views

This is a function that checks if a valid FAT12 image would be created. Since all the information to create it is available on the "boot sector", this is the parameter. I wanted the code to ...
Schilive's user avatar
  • 283
1 vote
1 answer
437 views

I am currently experimenting with self validating Java beans in order to avoid the creation of objects with invalid states, while keeping the validation knowledge inside the bean. The goals I have in ...
silver_mx's user avatar
  • 119
2 votes
2 answers
234 views

A week ago I posted this question and after reading the answers and accepting one I decided to refactor my code quite heavily. I would like to get some feedback on this newer version. The changes No ...
globalturist's user avatar
2 votes
3 answers
253 views

NOTICE: I refactored the code and made a new question like was advised. I'm making an input validator function that is inspired by @JDługosz from the following post so that other new C++ programmers ...
globalturist's user avatar
1 vote
1 answer
355 views

The function validates whether the input is an int, is there a way to make this more concise and is it best practise to use the try/except or just if/else? I then want to create a similar function for ...
Luca's user avatar
  • 67
1 vote
1 answer
72 views

I use the code below for building machine learning algorithm. In the end, I need to validate model performance. However, I am confused if I do it correctly or not. ...
vdu16's user avatar
  • 21
1 vote
3 answers
494 views

I have a list of functions whose parameters in the signature should be validated with the same criteria each time. ...
SeF's user avatar
  • 199
12 votes
3 answers
3k views

In multiple parts of my program, user input needs to be validated and categorized. As these "validation trees" can get pretty unwieldy, I've started splitting them out in different functions,...
Jan van Wijk's user avatar
2 votes
2 answers
228 views

Background I was working on a coding challenge as part of an interview process. I had to create a REST API where the user can report sensor data and query derived metrics based on several filter ...
Peter Csala's user avatar
  • 10.8k
2 votes
1 answer
166 views

I've been working on a simple form validation code in JavaScript coupled with an HTML form. The form asks for user's basic information, including name, email, country, gender, and skills. There's a ...
TAHER El Mehdi's user avatar
2 votes
1 answer
275 views

I want to apply custom regular expression as data annotation for all of my Model properties. So I create a custom regular expression with dynamic pattern like below:- Purpose:- So the purpose of ...
CodeJoker's user avatar
4 votes
2 answers
1k views

I have the requirement to validate product codes which include EAN-8, EAN-13 and UPC-A encoded as EAN-13. I have implemented a use-case to perform this check by comparing the actual check digit with ...
Droidman's user avatar
  • 153
0 votes
1 answer
129 views

I have a form in a WinForms application that has a Textbox called txtSupplier, a button called btnSrchSuppliers, a label called <...
user10191234's user avatar
1 vote
1 answer
155 views

I am working on a blogging application in Laravel 8. The application supports themes. In a nutshell, theme support works like this: In the views directory, I have ...
Razvan Zamfir's user avatar
2 votes
0 answers
263 views

I've got to make a form using Bootstrap and Angular, which validates the following requirements: Old password, new password and confirm password are mandatory fields. New password has to be equal ...
michael.zech's user avatar
  • 5,044
1 vote
0 answers
107 views

I have a method in a class that accepts either a datetime or string parameter. It is shown in the last code block (I didn't include the class). A little background is that I am defining a wrapper ...
Travis DePriest's user avatar
0 votes
1 answer
140 views

I want to write a function that validates the German tax identification number (Steuer-ID). The identification number consists of eleven digits. The last digit is ...
Daniel's user avatar
  • 353
2 votes
2 answers
189 views

I want to create a function that checks if an email has a username that is 5 to 20 characters long, starts with an alphabet letter and ends with one domain names of (.org, .net, .org). It also ...
Taylan GÜNAY's user avatar
2 votes
1 answer
110 views

I recently started TS. I was looking for feedback on my below function (for example maybe it can be written in shorter way). Let's assume we still use the reduce ...
user avatar
1 vote
1 answer
107 views

I'm trying to build a function to return an Iterator with no duplicated float values, its working, but there is a better way of handling this duplicated values? ...
eddyxide's user avatar
  • 141
4 votes
1 answer
711 views

Is it a bad thing to use asserts to validate user inputs? Or should I keep using an if statement in case the number isnt positive? Code with assert statement: ...
eddyxide's user avatar
  • 141
3 votes
1 answer
179 views

I'm practicing loops in Python and started trying to have a better approach with user inputs, is there better ways of dealing with inputs when coding? And I tried using deques too, it worked very well,...
eddyxide's user avatar
  • 141
4 votes
3 answers
557 views

I am a beginner, who is just learning the language (C++) from C++ Primer. I have been trying to build a side pico-project by writing functions for validation of user input for an signed double. The ...
SogaBan's user avatar
  • 63
10 votes
4 answers
701 views

Update After examining the NameRulesUnicode64k.xlsm spreadsheet in excel-names, it appears that my NameIsValid() is in close ...
Greg's user avatar
  • 569
2 votes
2 answers
272 views

This function below return true/false. How I could possibly improve the code quality? ...
Jefferson's user avatar
  • 423
1 vote
1 answer
105 views

I wrote the following JS function to check if a date comes in the right format and can be used further down in the application ...
Jakub's user avatar
  • 281
7 votes
2 answers
987 views

Yes, another PHP form builder... I wrote this solely to demonstrate OOP principles. My questions are: Could this be written better? OOP-wise. How could I better implement error handling? Index.php <...
PRobert's user avatar
  • 73
1 vote
1 answer
85 views

Code is posted after explanation. Due to the size of the project, this is being posted in three separate posts. This also ensures each post is more focused. Post 1 of 3, Core: UPDATE 1 on Newspaper ...
eccentricOrange's user avatar
0 votes
1 answer
64 views

I have the following part of code. I dislike this, because if I need to add additional validation rule, I have to make changes in loop and create a varaible to store boolean result. For example check ...
George's user avatar
  • 11
0 votes
1 answer
46 views

This (minimal demo) code obviously works, but I am a bit taken aback by the hoops I needed to jump through (and little to no mention in Angular (v13) documentation about the technique). I'm still ...
frIT's user avatar
  • 153
3 votes
1 answer
189 views

Code is posted after explanation. Due to the size of the project, this is being posted in three separate posts. This also ensures each post is more focused. Post 1 of 3, Core: Newspaper Bill ...
eccentricOrange's user avatar
2 votes
1 answer
147 views

Code is posted after explanation. Due to the size of the project, this is being posted in three separate posts. This also ensures each post is more focused. Post 2 of 3, CLI: Newspaper Bill ...
eccentricOrange's user avatar
6 votes
2 answers
856 views

I have built a sample Parser class on top of the csv module for basic checks that we normally need as the first step of pre-processing. I would love a bit of feedback on the code and any areas that I ...
SDRJ's user avatar
  • 181
3 votes
2 answers
141 views

I'm writing a function that validates array-like container to have correct type, length or to be hashable. Some of conditions may not be used for validation. ...
True do day's user avatar
1 vote
3 answers
3k views

This comes from an answer I provided to a question on stackoverflow here: https://stackoverflow.com/a/71482194/3258131 To make c# record parameter validation concise and maintain all the benefits of ...
Adriaan's user avatar
  • 55
2 votes
1 answer
145 views

This is my first serious shell script, so it is probably horrible. Problem statement I decided to improve my profiling skills as so far they were mostly about hand-rolling counters and timers. After ...
Incomputable's user avatar
  • 9,722
1 vote
1 answer
728 views

I have the following form that creates a new "activity": For which I want to enforce the following requirements: Name => minimum # of chars: 1; maximum # of chars: 50 Description => ...
Enrique's user avatar
  • 145
1 vote
1 answer
176 views

I want to know if that code is correct and readable. In class avatar the method getAvatar() validates the data. It checks if the field is not empty and if the photo extension is correct. If not, an ...
user254603's user avatar
2 votes
2 answers
122 views

I have this controller method to add a course and it works fine but I really don't like this code because I think it's too large and a little bit ugly I was trying to do it cleaner and a little bit ...
user avatar
0 votes
1 answer
159 views

I am creating a social network and part of the features allows people to upload a profile pic. I want to know how secure my code is. From start to finish. ...
user13477176's user avatar
1 vote
2 answers
133 views

I'm experimenting with some variations of validation pattern. I've created Validator class: ...
Mateusz's user avatar
  • 113
3 votes
1 answer
302 views

Here is my starting point for a laravel CRUD controller. I would appreciate it if someone could do a review and show me how an experienced developer would approach this. I do not want to progress with ...
Jake Feeley's user avatar
1 vote
1 answer
1k views

I want some opinions about my code that implements store and update for a Laravel 8 form request. The make function is for storing the data and the ...
Zikri Munandar's user avatar
3 votes
3 answers
2k views

Originally written in C (which was abysmal, you may check here if you want), I rewrote my simple credit card validation program using Python ...
flamethrower10's user avatar

1
2 3 4 5
15