๐
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AUTH_PASSWORD_VALIDATORS = [ | |
{ | |
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', | |
}, | |
{ | |
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', | |
}, | |
{ | |
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.signUpForm = this.fb.group({ | |
first_name: ['', [ | |
Validators.required, | |
Validators.maxLength(100) | |
]], | |
last_name: ['', [ | |
Validators.required, | |
Validators.maxLength(100) | |
]], | |
email: ['', [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const errorObject = { | |
first_name: 'This field is required', | |
last_name: 'This field is required', | |
email: 'This field is required', | |
password: 'This field is required', | |
re_password: 'This field is required', | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- first name --> | |
<mat-form-field appearance="outline"> | |
<mat-label> First Name</mat-label> | |
<input matInput type="text" formControlName="first_name"> | |
<mat-error *ngIf="signUpForm.get('first_name').errors.required"> | |
This field is required | |
</mat-error> | |
<mat-error *ngIf="signUpForm.get('first_name').errors.minlength"> | |
Min length is {{signUpForm.get('first_name').errors.minlength.requiredLength}} | |
</mat-error> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {AbstractControl, FormArray, FormControl, FormGroup, ValidationErrors} from '@angular/forms'; | |
import {Injectable} from '@angular/core'; | |
import {debounceTime, distinctUntilChanged} from 'rxjs/operators'; | |
export declare interface ServerError { | |
[key: string]: []; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def get_char(): | |
return random.choice(characters) | |
def print_password(password): | |
print("auto-generated password is:") | |
print(password) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = int(input("enter n: ")) | |
number = [] | |
number.append(1) | |
number.append(1) | |
print(number[0]) | |
print(number[1]) | |
for i in range(2, n): | |
number.append(number[i-1] + number[i-2]) | |
print(number[i]) |
NewerOlder