All Questions
Tagged with error-handling validation
20 questions
3
votes
1
answer
170
views
Take in 10 numbers, validate each input, append then in a list and then prints the sum of the list values
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,...
3
votes
1
answer
2k
views
Handle database validation (exists, unique constraint, etc) [closed]
Let's assume you are writing a REST Api with a common structure like Controller > Service > Repository > Database.
In the database there's a table with a column with a unique constraint:
<...
2
votes
2
answers
1k
views
Beginning BMI calculator in Java
This is my first program so no doubt I've made mistakes. The code works and meets all requirements as far as I can see.
(Further info: program to calculate Body Mass Index (BMI) allowing user to ...
3
votes
1
answer
77
views
Validating partially filled objects
The following classes are a simplification of an auto-generated code of an ORM (targeting Microsoft's Dynamics CRM):
...
2
votes
2
answers
172
views
Validating that a Java program has two equal-length arguments
I'm writing a small almost one method Java class for a job application and the advice given was to write it as though it was a piece of commercial software.
The ...
2
votes
1
answer
3k
views
Asking user input until a valid datetime is given (bloated try-except blocks)
Originally asked this on SO but was redirected here.
I have a script that's asking the user to input a lot of dates, mostly in functions similar to the one below. These need to account for invalid ...
0
votes
3
answers
140
views
Opening and validating an XML file
I have a section of code that repeats many lines and I am looking to refactor this code possibly so that a function can be used instead of the same lines of code each time. Below is the section of ...
4
votes
1
answer
196
views
Validating attributes of a page in Adobe Experience Manager
I am reviewing the following code written by a fellow developer. I am not an java expert but IMHO i did not feel this is efficient use of exceptions — the reason I feel so is:
The below code throwing ...
1
vote
1
answer
1k
views
Make sure the user enters a valid floating-point number in C
I would like to know if this is a good way to make sure the user enters a valid number.
...
12
votes
5
answers
12k
views
Validation that also returns error messages
My Create, Update and Delete methods should return a ...
1
vote
1
answer
104
views
Validation of uploading images and adding records to the database
I am doing a php project with the codeigniter framework. In my controller, I have a function that does the following.
Uploads an image to the server
Add a row to the database. The data would be ...
1
vote
1
answer
227
views
Implementation of API to create a company account in a database
I'm working on an API that has a lot of controller functions like this:
...
1
vote
2
answers
11k
views
Validating username, password, and email in PHP
Let's pretend the following:
...
2
votes
2
answers
86
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 ...
4
votes
3
answers
914
views
Error-handling / Self-Validating mechanism
The below idea seemed to look clean, to allow the object itself to validate its values for different scenarios.
For eg:
While creating the object, the value of Object1 and Object2 in SelfValidator ...