Friday, April 30, 2010

Fremont DMV Test Route


Fremont DMV Driving Test Routes

When my friends took their driving test in Fremont, the following routes were some of the possible ones that came up. It depends on the mood of the examiner. Each examiner has a different route. Whatever may be the route, keep cool and drive, you will come out with flying colors. You can use the following routes to keep yourself well prepared for the D-day.

ROUTE #1

1. Come out of DMV, Take Right on Dusterberry Way. (Remember to be on the right most lane initially, then you can move to other lanes)
2. Turn Right on Peralta Blvd
3. Turn Right on Maple Street
4. Turn Right on Central Avenue
5. Turn Left on Glenmoor Dr
6. Turn Left on Norris Dr -- This is residential area usually they will test curb parking and straight reverse here.
7. Turn Right on Logan Dr
8. Turn Left on Mattos Dr
9. Slight Left onto Palmer Dr
10. Turn Right on Lombard Ave
11. Turn Left on Argyle Road
12. Turn Left on Central Ave
13. Turn Right into the DMV and park the car.

ROUTE #2

1. Come out of DMV, Take Left on Dusterberry Way. (Remember to get on to the center lane, and then go to left side of the street)
2. Turn Right on Central Ave
3. Turn Left on Glenmoor Dr
4. Turn Left on Norris Dr
5. Turn Left on Logan Dr - -- This is residential area usually they will test curb parking and straight reverse here.
6. Turn Right on Central Ave
7. Turn Left on Dusterberry Way
8. Slight Right onto Peralta Blvd (If there is a STOP Sign, Stop before turning)
9. Turn Right at Maple Street,
10. Turn Right at Central Ave (Go to the left most lane)
11. Turn Left on Argyle Road
12. Turn Right at Argyle Court (Go to the end and take a U-turn)
13. Turn Left at Argyle Road
14. Turn Left at Central Ave
15. Turn Right into the DMV and park the car.

ROUTE #3

1. Come out of DMV, Take Right on Dusterberry Way. (Remember to be on the right most lane initially, then you can move to other lanes)
2. Turn Left at Hansen Ave
3. Turn Right at Cabrillo Dr
4. Turn Right at Alameda Dr - This is residential area usually they will test curb parking and straight reverse here.
5. Turn Left at Contracosta Ave
6. Turn Right at Thornton Ave
7. Turn Right at Elm St
8. Turn Left onto Tomasek Terrace
9. Tomasek Terrace Turns Left and Becomes Baine Ave
10. Turn Right onto Peralta Blvd
11. Slight Left onto DusterBerry Way
12. Turn Left into the DMV and park the car.

Thursday, April 22, 2010

Pattern Matching for Password

Java introduced Pattern matching API from JDK 1.4 onwards. Its definitely a wonderful API for validating passwords, userId, etc in an application. There are some predefined regular expressions available. Here, Iam going to explain a regular expression for password validation.

You would have encountered password rules in several websites. Lets see how the regular expression is going to be for the following password rule:
It should contain at least one digit from 0-9
It should contain at least one letter from A-Z
It should not contain any lower case letter
The minimum length of the username must be 6 characters and the maximum may be 20.
It should contain at least one character from amongst @#*=
It should not contain any spaces


Regular Expression for the above conditions :

  • (?=.*[@#*=]) # must contains one special character "@#$%"
  • (?=.*[A-Z]) # must contains one UPPER Case Character
  • (?!.*[a-z]) # must not contain lower case Character (See ! instead of =)
  • (?=.*[0-9]) # must contains one number 0-9
  • (?!.*\\s) # must not contain any spaces
  • . # match anything with previous condition checking
  • {6,20} # length at least 6 characters and maximum of 20

Java Pattern Matching Code:
import java.util.regex.Pattern;
import java.util.regex.Matcher;

public class UserName
{
public static void main(String[] args)
{
String password="ABC3a#@@";
Pattern pattern = Pattern.compile("(?=.*[@#*=])(?=.*[A-Z])(?!.*[a-z])(?=.*[0-9])(?!.*\\s).{6,20}$");
Matcher m = pattern.matcher(userName);
boolean b = m.matches();
if (b==false)
System.out.println("FAIL");
else if(b==true)
System.out.println("PASS");
}
}