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
class RegisterForm(Form): | |
name = TextField('Username', [Required()]) | |
email = TextField('Email address', [Required(), Email()]) | |
password = PasswordField('Password', [Required()]) | |
confirm = PasswordField('Repeat Password', [ | |
Required(), | |
EqualTo('password', message='Passwords must match') | |
]) | |
accept_tos = BooleanField('I accept the TOS', [Required()]) | |
recaptcha = RecaptchaField() |
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 java.io.*; | |
import java.util.*; | |
class permutation { | |
public static void main(String[] args) { | |
String str1 = "abc"; | |
String str2 = "cba"; | |
if(permutation(str1, str2)) | |
System.out.println("They are each other's permutation"); | |
else |
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
#include <stdio.h> | |
#include <stdlib.h> | |
void reverse(char* str); | |
int main(){ | |
char* str = malloc(256); | |
strcpy(str, "this is for test"); | |
printf("%s\n",str); | |
reverse(str); |
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 java.util.HashSet; | |
import java.util.Set; | |
public class UniqueChar { | |
public static boolean check(String s) { | |
Set<Character> hashset = new HashSet<Character>(); | |
for (int i = 0; i < s.length(); i++) { | |
if (hashset.contains(s.charAt(i))) | |
return false; | |
else | |
hashset.add(s.charAt(i)); |