Questions tagged [validation]

20754 questions
1

votes
2

answer
39

Views

How to compose functions with applicative effects for Validation in the Cats in Scala

Here is an example from the Scala with Cats book: object Ex { import cats.data.Validated type FormData = Map[String, String] type FailFast[A] = Either[List[String], A] def getValue(name: String)(data: FormData): FailFast[String] = data.get(name).toRight(List(s'$name field not specified')) type NumFm...
Alexandr
1

votes
1

answer
11

Views

Wagtail not shows ValidationError correctly

I have XOR validation of wagtail.core.models.Page descedant: def save(self, *args, **kwargs): if self.video_playlist is not None and self.gallery is not None: raise ValidationError(_('Only gallery or only video playlist must be filled')) elif self.video_playlist is None and self.gallery is None: rai...
Vassiliy Vorobyov
1

votes
2

answer
37

Views

Disable Model Validation [Required] in ASP.NET Web API

So basically I have two classes which are Model and DTO, Model will be used to handle the APIs while the DTO will be handling the database (Firestore). I have a Company model, in this model, the CompanyName is required when I'm doing CreateCompany POST request. public class Company { public string C...
vomoxon
1

votes
1

answer
57

Views

How to change id to uuid?

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'where clause' (SQL: select count(*) as aggregate from shops where username = csesumonpro and id 5d4cb970-197d-41db-90e1-26988d543935) how to change id to uuid when execute query? i am using uuid in my model replace of id i already defin...
sumon sarker
1

votes
1

answer
18

Views

XSD for XML containing XSD

I have created XML Schema for an XML document that describes functionality of components of a complex modular system. Within that XML document, I want to include XML Schema which will be read and parsed to allow for configuration. meta-schema.xsd (heavily edited for brevity): The desired XML (writte...
Benjamin Riggs
1

votes
1

answer
35

Views

Cross_val_score is not working with roc_auc and multiclass

What I want to do: I wish to compute a cross_val_score using roc_auc on a multiclass problem What I tried to do: Here is a reproducible example made with iris data set. from sklearn.datasets import load_iris from sklearn.preprocessing import OneHotEncoder from sklearn.model_selection import cross_va...
Emmanuel-Lin
1

votes
0

answer
5

Views

Multiple file upload DRF

I have a requirement which I would like to allow multiple files to be uploaded within the same post request to create an object. I currently have a method of doing this, but after looking at some other examples it doesn't appear to be intended way to do it. models.py class Analyzer(models.Model): na...
geekscrap
1

votes
2

answer
1.1k

Views

Possible for two working ValidationSummary controls in an ASP.NET MVC app?

Since the validation summary just displays the modelstate errors in a html list, does this mean that I can have only one validation summary? Or is there a way I can associate some kind of context to say that these modelstate errors show up on this summary and these go to the other?
RailRhoad
0

votes
0

answer
24

Views

How to apply required validation for checkbox using dynamically

I'm setting dynamic form validation using the following JSON. base on these JSON i have create dynamically form field using the following JSON format. Data fields = [ { type: 'text', name: 'firstName', label: 'First Name', value: '', required: true, }, { type: 'checkbox', name: 'hobby', label: 'Hobb...
bhagwat tupe
3

votes
0

answer
39

Views

OneLogin php saml - Issues with SAML response

I have integrated OneLogin using php-saml to connect to our idp service. In our staging environment, everything works fine with the setup we are using. I am running into an issue using those same files on our production environment however. The problem is that the SAML response isn't correctly bei...
SBB
3

votes
2

answer
25

Views

How to customize java spring @NotNull validation error message

@POST @Path('') @Consumes({'application/x-www-form-urlencoded'}) TokenDTO login(@ApiParam(value = 'The id of the channel used', required = true ) @HeaderParam('channel') @NotEmpty(message = 'email.notempty') String channel) throws Exception; Hello guys, I am trying to validate the channel paramete...
ps138
1

votes
1

answer
1.9k

Views

XSD: Element with namespace is not expected

I have a simple XSD Schema: and XML file, which I want to validate: value1 value2 I use xmllint and I'm getting the following error: file.xml:5: element Signature: Schemas validity error : Element '{http://www.w3.org/2000/09/xmldsig#}Signature': This element is not expected. Expected is ( Signature...
trivelt
1

votes
1

answer
747

Views

How to create learning curve from cross-validated data?

I have an algorithm which uses 10 fold cross validation. Within the training set, I use one of the folds for validation of the training model before using the learned model on the fold held aside for testing. I would like to create a learning curve which means I need to vary the size of the training...
Nick
0

votes
0

answer
20

Views

(laravel 5.7) what is the problem in this request !! validation done but data insertion is not happening as expected

First I'm sorry for my english. I have a form with somme input and checkbox with dynamic id ,for example checkbox[] , input name='pointage_j[] ... validation in the controller is done but insertion data in table not as expected, for example when pointage_j.1 = 1 and pointage_j.2 = 1 all insertion is...
Samir Fahd
1

votes
1

answer
865

Views

Overriding the clean method in a Django model breaks other validations?

Assume I have a simple model in models.py that is intended to be edited via Django Admin: class Range(models.Model): gt = models.IntegerField('Greater than') lt = models.IntegerField('Lesser than') def clean(self): if self.gt >= self.lt: raise ValidationError('Incorrect range') The problem: While th...
gaazkam
1

votes
1

answer
625

Views

Client-side validation on <h:inputFile>

My JSF view uploads a file using plain . It has an AJAX action to start uploading as soon as a file is chosen (onchange event). I would like to do some basic validation on the file, using the HTML5 DOM File API and Javascript, on the client side to stop uploading in certain cases. (Yes, I do underst...
fr13d
0

votes
0

answer
23

Views

Both string and integer rules for a filed in laravel validation

I want to validate a field that can be integer or string both. When it is integer max value must be less than 30 and when it's string max value must be at most 10 character. Is there any way to solve without make a custom rule? If not, what is the best algorithm for create this rule?
mohsen hasani
3

votes
0

answer
43

Views

Forcing a validation step in an Unreasonably Effective RNN

Reading through Andrej Karpathy's 2015 post, 'The Unreasonable Effectiveness of Recurrent Neural Networks,' there's a section where LaTeX code is generated: Algebraic Geometry (Latex) The results above suggest that the model is actually quite good at learning complex syntactic structures. Impressed...
Mittenchops
0

votes
0

answer
3

Views

w3 validator no p element in scope but a p end tag seen

I'm currently checking the HTML of our website in w3 validator and I come across the following error: no p element in scope but a p end tag seen However, the code where it gives the error is the following: some text... some text... mostly consists of some text wrapped in p tags due to tinymce editor...
Joshua Bakker
1

votes
1

answer
18

Views

XML Validation Issue (S4s-elt-invalid-content.1)

I'm getting this error from validator: S4s-elt-invalid-content.1: The Content Of 'schema' Is Invalid. Element 'key' Is Invalid, Misplaced, Or Occurs Too Often. It works fine if I remove the key/keyref but doesn't if I include it. I cannot figure out what the error could be and google search and sear...
Naeem Khan
1

votes
1

answer
832

Views

Use of OneClassSVM with cross_val_score

I would like to use cross_val_score to validate my OneClassSVM training set. Doing so results in the below error message. Can it be that because OneClassSVM is an unsupervised algorithm and does not have a 'y' vector to pass to cross_val_score, the algorithm fails? clf = svm.OneClassSVM(nu=_nu, kern...
Milad M
1

votes
4

answer
1.6k

Views

Angular Custom Async Validator stays in pending state

I have a Custom Validator that validates if a user's email is unique or not. I've searched for related topic on stackoverflow and internet, but no help when I'm giving input in the form (sending the request), the request stays at pending state and doesnot resolves. I've tested the backend in postman...
Himanshu Mittal
1

votes
3

answer
35

Views

What to use instead of Exceptions when writing validation code?

I am writing some validation code and am not sure how to pass validation messages back to the calling code. Exceptions come to mind, but I think that Exceptions should not be used in user input validation. As @Blowdart puts it: Exceptions are not control flow mechanisms. Users often get passwords w...
Protector one
1

votes
2

answer
36

Views

Checkbox becomes unclickable after checkbox limit function occur reactjs

I have a mapping function which shows JSON values into checkboxes, each checkbox triggers another 2 checkboxes, the JSON I am using have a min/max value which I made a function for to set min/max for checkbox selections in each section. My problem is that once the parent & child checkboxes are click...
Alpub
0

votes
0

answer
5

Views

Hibernate validation custom message resolution

In this application there are several entities which come from user input, they have to be validated before processing. I need a validation annotation & validator reusable for several entites. One example is provider and handler. Several entites have provider and handler code fields. The validation...
deevelop
0

votes
0

answer
11

Views

Problem with phone number validation function

Working on a simple registration form in Javascript and I can't quite figure out why my phone validation function isn't working. What I'm trying to do is Make the field optional. If the user doesn't put anything in the field, the form will still be valid and submit If the user puts in a phone number...
magishine
1

votes
1

answer
1k

Views

AngularJS: Preventing form submission until asyncronous validator is complete

I want to prevent a submit button from being enabled while an async validator is running or will run. I have a custom directive in which I am listening to the change event on an input. On this input element is an asynchronous validator that will fire when the input value change event is fired. input...
Mike L.
0

votes
0

answer
6

Views

Laravel 5 validator passing when it should fail

I am validating an array in Laravel 5.7 but the validator passes when I expect it to fail. $validator = Validator::make($request->all(), [ 'user_reg_email' => 'required|max:255|email|exists:users,email', 'service_start_date' => 'required|before_or_equal:today', 'service_end_date' => 'nullable|after...
Tim Kariuki
0

votes
1

answer
14

Views

problem with use of val() in jQuery sometimes failing and setting a checkbox issues

I have a project where a form is required for inputs for a week, so for efficiency elsewhere an array of inputs is used (i.e. start[0] etc) this seems to have exacerbated the issue. The problem is when validating a form where some inputs are given initial values (its an update) jQuery only returns t...
Matt
2

votes
0

answer
28

Views

Checkbox Min/Max Validation from Selection limit function ReactJS

I have made a selection limit function which ensures that total checkbox is above min value and under max value, these values were taken from the JSON which the checkboxes are mapped from, now the selection limit works, but I want to add another validation function to show warnings, maybe using onbl...
Laflm
1

votes
2

answer
338

Views

How to trigger javax validations manually via reflection or any other way?

I am using validation-api-2.0.1.Final and hibernate-validator-6.0.13.Final. I would like to do validation for the below case, I have created a custom validation to validate List BookInfo.java @Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE}) @Retention(RetentionPolicy.RUNTI...
VelNaga
0

votes
0

answer
2

Views

VeeValidate multiple password constraints

I'm wondering if it's possible to have multiple password requirements passed to VeeValidate in order to display which requirements a user is missing. For instance, if we require that a user's password should have at least one uppercase letter and at least one number and be at least 5 characters long...
user2909019
2

votes
1

answer
12

Views

Training and evaluating accuracies different in keras LSTM model: why does evaluation not produce same results as during training?

We are building an LSTM for modeling a physical optical procees. So far, I have produced the following code in python using Keras with Tensorflow backend. #Define model model = Sequential() model.add(LSTM(128, batch_size=BATCH_SIZE, input_shape=(train_x.shape[1],train_x.shape[2]), return_sequences=...
M B
1

votes
2

answer
242

Views

Validating Same Password Input Angular 2/4 - ERROR Cannot find control with unspecified name attribute

I'm trying to validate that the password and ConfirmPassword fields are the same in my form, but when I add the validation provided by other posts on SO (aside from changing ControlGroup to FormGroup) I keep getting ERROR: Cannot find control with unspecified name attribute BUT, when I don't validat...
billy_comic
1

votes
2

answer
2.1k

Views

Angular 4 - Custom validator with dynamic parameter value

I have written a custom validator that checks if a date is above a certain minimum date. the code looks like this: export function validateMinDate(min: Date): ValidatorFn { return (c: AbstractControl) => { if (c == null || c.value == null) return null; let isValid = c.value >= min; if (isValid) { re...
Nicolas
1

votes
1

answer
7.7k

Views

How training and test data is split - Keras on Tensorflow

I am currently training my data using neural network and using fit function. history=model.fit(X, encoded_Y, batch_size=50, nb_epoch=500, validation_split = 0.2, verbose=1) Now I have used validation_split as 20%. What I understood is that my training data will be 80% and testing data will be 20%....
eshaa
1

votes
2

answer
489

Views

Angular 5 - Dynamic form validation using template driven form

I am creating form fields dynamically with ngFor and each field is having unique name attr. I am struggling in their validation. My sample code: inches feet Field is required.
Abdul Rafay
1

votes
2

answer
67

Views

ConstraintValidator for single field and colection as well

can you tell me how to create custom constraint validator which will work for single field and collection as well? For instance, I have an object Foo which contains the enum of status public class Foo { Status status; } Status can be of type active or disabled. I want to ensure when I use my annotat...
Denis Stephanov
1

votes
1

answer
1.1k

Views

Symfony 4 TextType required = false getting Expected argument of type “string”, “NULL” given

I have a TextType field which is set as below Type: ->add('zipCode',TextType::class, array( 'attr' => array('maxlength' => 10), 'required' => false, 'empty_data' => null ) ) When the data loads from the database the field is null. I just attempt to submit the form and I get Expected argument of typ...
Element Zero
1

votes
3

answer
49

Views

php used for password validation

I posted part of the below code to another question for a problem I had,and found the solution.I can register,login and logout from my android device,which is good. However,now I am getting something strange. I added an extra functionality,so as to validate that both $user_pass and $confirm password...
Theo

View additional questions