Questions tagged [validation]
Validation is used to check data to make sure it fits whatever required specifications are set for it.
724 questions
4 votes
2 answers
200 views
Class for validating code in different Conda environments with PyTorch
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 ...
1 vote
0 answers
85 views
SwiftUI: Handling number-inputs via TextField (actually String)
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 ...
3 votes
1 answer
73 views
Check if options are valid to create FAT12 image
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 ...
2 votes
2 answers
234 views
Improved input validation function
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 ...
1 vote
1 answer
356 views
Validate that the console input contains positive integers only
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 ...
1 vote
3 answers
494 views
Decorator to validate that Python function arguments are positive
I have a list of functions whose parameters in the signature should be validated with the same criteria each time. ...
2 votes
2 answers
228 views
Search/Query API cross parameter check
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 ...
2 votes
1 answer
275 views
Generic custom regular expression with dynamic pattern used as data annotation for Model
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 ...