regex for multiple IPs comma separated with or without subnet

Issue I have regex for IPv4 address: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ and i have regex for IPv4 CIDR range : ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/([0-9]|[1-2][0-9]|3[0-2]))$ the issue is how should i repeat it using comma separated pattern: XXX.XXX.XXX.XXX, XXX.XXX.XXX.XXX/XX, XX.XX.XX.XX, XX.XX.XX.XX/X , XX.XX.XX.X test data– 123.123.13.11, 1.0.0.0,

Continue reading

Angular simple validation not working

Issue Here is some plunker I have created. I cant understand why it is not working. Here is the JS: angular.module(‘demo’, [ ]).controller(‘MainCtrl’, function($scope) { $scope.name = “Vlad”; $scope.age = 11; $scope.sendTest = function() { console.log($scope.name.$valid); console.log($scope.age.$valid); } }); Here

Continue reading

Angular setValidity not working when HTML is produced in a Directive

Issue I have dynamic html that i make in a directive, and it includes an input element with validation. Example HTML produced with error message: <input id=”bob” class=”personCheckbox” name=”bob” type=”checkbox” value=”bob” ng-model=”foobar” validate-foo/> <span style=”color:red” ng-show=”myForm.bob.$error.summary”>Need Summary</span> <input type=”text” name=”summary-bob”

Continue reading

AngularJS form input name validation not working in ngrepeat

Issue name=”number-{{$index+1}}” working in ng-repeat at the same time myform.number-{{$index+1}}.$invalid does not working for the form Demo: http://plnkr.co/edit/Z3EmpHu8w2iZcZko9dJv?p=preview var app = angular.module(‘plunker’, []); app.controller(‘MainCtrl’, function($scope) { $scope.choices = [{no: ‘1234567890’}, {no: ‘0987654321’}]; $scope.numberAdd = function() { $scope.choices.push({‘no’:”}); }; $scope.numberRemove =

Continue reading

AngularJS form validation issues

Issue I am trying to do a simple form validation using angular js. But it doesnt seems to work and I am not getting what I am missing. HTML <form role=”form” class=”ng-pristine ng-valid” name=”registerForm”> <fieldset> <div class=”form-group”> <input class=”form-control” placeholder=”First

Continue reading

how to plot training error and validation error vs number of epochs?

Issue how to plot training error and validation error vs number of epochs? train_data = generate_arrays_for_training(indexPat, filesPath, end=75) validation_data=generate_arrays_for_training(indexPat, filesPath, start=75) model.fit_generator(generate_arrays_for_training(indexPat, filesPath, end=75), #end=75),#It take the first 75% validation_data=generate_arrays_for_training(indexPat, filesPath, start=75),#start=75), #It take the last 25% #steps_per_epoch=10000, epochs=10) steps_per_epoch=int((len(filesPath)-int(len(filesPath)/100*25))),#*25),

Continue reading

Weird behaviour for my CNN validation accuracy and loss function during training phase

Issue Here is the architecture of my network : cnn3 = Sequential() cnn3.add(Conv2D(32, kernel_size=(3, 3), activation=’relu’, input_shape=input_shape)) cnn3.add(MaxPooling2D((2, 2))) cnn3.add(Dropout(0.25)) cnn3.add(Conv2D(64, kernel_size=(3, 3), activation=’relu’)) cnn3.add(MaxPooling2D(pool_size=(2, 2))) cnn3.add(Dropout(0.25)) cnn3.add(Conv2D(128, kernel_size=(3, 3), activation=’relu’)) cnn3.add(Dropout(0.2)) cnn3.add(Flatten()) cnn3.add(Dense(128, activation=’relu’)) cnn3.add(Dropout(0.4)) # 0.3 cnn3.add(Dense(4, activation=’softmax’))

Continue reading

When using a custom validator, formBuilder.group is displayed as deprecated

Issue I have built my PasswordValidator as follows: // Function to compare password with confirmPassword export function ConfirmedValidator(controlName: string, matchingControlName: string) { return (formGroup: FormGroup) => { const control = formGroup.controls[controlName]; const matchingControl = formGroup.controls[matchingControlName]; if (matchingControl.errors && !matchingControl.errors.confirmedValidator) {

Continue reading

Show errors in JavaScript in HTML5 form

Issue I have a HTML5 form with required fields: <form id=”my_form”> <input type=”text” name=”myfield1″ required> <input type=”text” name=”myfield2″ required> <input type=”text” name=”myfield3″ required> <button type=”button” id=”my_button”>Check</button> </form> Also, I have the following jQuery code: $(‘#my_button’).on(‘click’, function() { if ($(‘#my_form’).checkValidity() ==

Continue reading

Optional field validation in Yup schema

Issue I’m using react-hook-form with yup for my form validation and want some fields to be optional (null). Following their documentation, I’m using nullable() and optional() but it is still getting validated: export const updateAddressSchema = yup.object({ address: yup .string()

Continue reading

Is there a way to update VS' CSS validation to 3.0?

Issue I’m getting warnings about CSS3.0 properties like text-overflow. Is there a way to validate against 3.0? HTML5 and CSS3 support is coming to VS2010 in SP1. Link And now its here. http://visualstudiogallery.msdn.microsoft.com/7211bcac-091b-4a32-be2d-e797be0db210/view/Reviews/0?showReviewForm=True Solution Apparently, you can define your own

Continue reading

Nest.js unique dto validator

Issue Maybe someone know how to make custom unique validator with class-validator in nest.js.I found few articles in internet, but however those implementations was not reusable. I wanna my unique validator reuse in every dto for example: users, products. Solution

Continue reading

How do I compare two dates in HTML?

Issue This is my code: <input type="date" name="startDate" id="startDate" /> <input type="date" name="endDate" id="endDate" /> I want startdate to not exceed endDate. is there a way to compare dates without using jQuery? Like in ASP.NET, we can use CompareValidator. Solution

Continue reading

How do I compare two dates in HTML?

Issue This is my code: <input type="date" name="startDate" id="startDate" /> <input type="date" name="endDate" id="endDate" /> I want startdate to not exceed endDate. is there a way to compare dates without using jQuery? Like in ASP.NET, we can use CompareValidator. Solution

Continue reading

Validate select box

Issue I’m using the jQuery plugin Validation to validate a form. I have a select list looking like this: <select id=”select”> <option value=””>Choose an option</option> <option value=”option1″>Option1</option> <option value=”option2″>Option2</option> <option value=”option3″>Option3</option> </select> Now, I want to make sure that the

Continue reading

Validate select box

Issue I’m using the jQuery plugin Validation to validate a form. I have a select list looking like this: <select id=”select”> <option value=””>Choose an option</option> <option value=”option1″>Option1</option> <option value=”option2″>Option2</option> <option value=”option3″>Option3</option> </select> Now, I want to make sure that the

Continue reading

Reactjs – Form input validation

Issue My Contact page form is as follows, <form name=”contactform” onSubmit={this.contactSubmit.bind(this)}> <div className=”col-md-6″> <fieldset> <input ref=”name” type=”text” size=”30″ placeholder=”Name”/> <br/> <input refs=”email” type=”text” size=”30″ placeholder=”Email”/> <br/> <input refs=”phone” type=”text” size=”30″ placeholder=”Phone”/> <br/> <input refs=”address” type=”text” size=”30″ placeholder=”Address”/> <br/> </fieldset> </div>

Continue reading