Guess I'm addicted to blogging

| | Comments (0)

Below you will find my schedule for Mon - Wed at DEC 2008.  The sessions I've decided to go on are in light turquoises.  If I haven't decided, there will be two white squares.

I am concentrating on the AD aspects of the conference and ignoring ILM and Federated Identity.

DEC2008Mon-Wed

There is also a Welcome reception on Sunday.

Event 6: Prime Time

| | Comments (0)

This one was fun.  Although, I knew what a Prime number is, I don't think I've ever learned methods to find them.  The method I used is fine for a small number, but really wouldn't scale.

Advanced Event 6 in the Microsoft Scripting Games 2008.

   1: '*********************************************************************

   2: ' Script Name: Event6.vbs

   3: '     Version: 1.0

   4: '      Author: Perry Harris (PHactotum)

   5: '     Updated: 8:45 AM Tuesday, February 26, 2008

   6: '     Purpose: Solves the 2008 winter Scripting Games Advance 

   7: '              Event 6: Prime Time

   8: '              

   9: '       Usage: cscript Event6.vbs

  10: '       Notes: 

  11: '    Keywords: 

  12: '  versioning: 1.0  Original release

  13: '*********************************************************************

  14: Option Explicit

  15: Dim StopPoint,StartPoint,i,j

  16: Dim Primes

  17: StopPoint = 200

  18: StartPoint = 2

  19: redim Primes(StopPoint + 1)

  20: For i = StartPoint to StopPoint

  21:     Primes(i) = True

  22: Next

  23: For i = StartPoint to StopPoint

  24:     If Primes(i) = True then

  25:         WScript.StdOut.WriteLine i

  26:     End If

  27:         for j = i to StopPoint

  28:             If i*j <=StopPoint then Primes (i*j) = False

  29:         Next

  30: Next

  31:  

  32:     


I'm not sure how well this one went.  I ran out of time and I'm not very good with regular expressions. Advanced Event 5 for the Microsoft Scripting Games 2008.

   1: '*********************************************************************

   2: ' Script Name: Event5.vbs

   3: '     Version: 1.0

   4: '      Author: Perry Harris (PHactotum)

   5: '     Updated: 10:45 AM Tuesday, February 26, 2008

   6: '     Purpose: Solves the 2008 winter Scripting Games Advance 

   7: '              Event 5: You Call That a Strong Password?

   8: '              

   9: '       Usage: cscript Event5.vbs

  10: '       Notes:

  11: '    Keywords: 

  12: '  versioning: 1.0  Original release

  13: '*********************************************************************

  14: 'Option Explicit

  15: Const ForReading = 1

  16: Dim strPassword

  17: Dim intPassScore

  18: Dim objRegEx

  19: Dim objFS, objFile

  20:  

  21: Set objRegEx = CreateObject("VBScript.RegExp")

  22: intPassScore = 13

  23:  

  24: if WScript.Arguments.Count < 1 then

  25:     WScript.StdOut.Write "Please enter your password to test: "

  26:     strPassword = WScript.StdIn.ReadLine

  27: else

  28:     strPassword = WScript.Arguments(0)

  29: end if

  30:  

  31: 'Open and read our WordList, we'll need this for some of the tests.

  32: Set objFS = CreateObject("Scripting.FileSystemObject")

  33: Set objFile = objFS.OpenTextFile("C:\Scripts\wordlist.txt", ForReading)

  34:  

  35: strAll = objFile.Readall

  36:  

  37: ' Test one: Make sure that the password is not an actual word.

  38:     objRegEx.Pattern = ucase(strPassword) & "\r\n"

  39:     Set colMatches = objRegEx.Execute(ucase(strAll))  

  40:     

  41:     If colMatches.Count > 0 Then

  42:         Wscript.StdOut.WriteLine "Password is found in the dictionary"

  43:         intPassScore = intPassScore - 1

  44:     End If

  45:  

  46: ' Test two: Make sure that the password, minus the last letter, is not an actual word.

  47:     objRegEx.Pattern = ucase(left(strPassword,len(strPassword)-1)) & "\r?\n"

  48:     Set colMatches = objRegEx.Execute(ucase(strAll))  

  49:     

  50:     If colMatches.Count > 0 Then

  51:         Wscript.StdOut.WriteLine "Password, minus the last letter, is found in the dictionary"

  52:         intPassScore = intPassScore - 1

  53:     End If

  54:  

  55: ' Test three: Make sure that the password, minus the first letter, is not an actual word.

  56:     objRegEx.Pattern = "\r\n" & ucase(right(strPassword,len(strPassword)-1)) & "\r\n"

  57:     Set colMatches = objRegEx.Execute(ucase(strAll))  

  58:  

  59:     If colMatches.Count > 0 Then

  60:         Wscript.StdOut.WriteLine "Password, minus the first letter, is found in the dictionary"

  61:         intPassScore = intPassScore - 1

  62:     End If

  63:  

  64: ' Test four: Make sure that the password does not simply substitute 0 (zero) for the letter o (either an uppercase O or a lowercase o).

  65:     if instr(strPassword,"0") then

  66:         objRegEx.Pattern = ucase(replace(strPassword,0,"o")) & "\r\n"

  67:         Set colMatches = objRegEx.Execute(ucase(strAll))  

  68:     

  69:         If colMatches.Count > 0 Then

  70:             Wscript.StdOut.WriteLine "Password is found in the dictionary after replacing zeros with ""o"""

  71:             intPassScore = intPassScore - 1

  72:         End If

  73:     end if

  74:  

  75: ' Test five: Make sure that the password does not simply substitute 1 (one) for the letter l (either an uppercase L or a lowercase l).

  76:     if instr(strPassword,"1") then

  77:         objRegEx.Pattern = ucase(replace(strPassword,1,"l")) & "\r\n"

  78:         Set colMatches = objRegEx.Execute(ucase(strAll))  

  79:         

  80:         If colMatches.Count > 0 Then

  81:             Wscript.StdOut.WriteLine "Password is found in the dictionary after replacing ones with ""l"""

  82:             intPassScore = intPassScore - 1

  83:         End If

  84:     end if

  85:  

  86: ' Test six: Make sure that the password is at least 10 characters long but no more than 20 characters long. 

  87:     If Len(strPassword) < 10 then

  88:         Wscript.StdOut.WriteLine "Password is two short"

  89:         intPassScore = intPassScore - 1

  90:     else if Len(strPassword) > 20 then

  91:             Wscript.StdOut.WriteLine "Password is two short"

  92:             intPassScore = intPassScore - 1

  93:         end if

  94:     end if

  95:  

  96: ' Test seven: Make sure that the password includes at least one number (the digits 0 through 9).

  97:     objRegEx.Pattern = "\d"

  98:     Set colMatches = objRegEx.Execute(strPassword)  

  99:     

 100:     If colMatches.Count = 0 Then

 101:         Wscript.StdOut.WriteLine "Password must contain at least one number (0-9)"

 102:         intPassScore = intPassScore - 1

 103:     End If

 104:  

 105: ' Test eight: Make sure that the password includes at least one uppercase letter.

 106:     objRegEx.Pattern = "[A-Z]"

 107:     Set colMatches = objRegEx.Execute(strPassword)  

 108:     

 109:     If colMatches.Count = 0 Then

 110:         Wscript.StdOut.WriteLine "Password must contain at least one upper case letter"

 111:         intPassScore = intPassScore - 1

 112:     End If

 113:  

 114: ' Test nine: Make sure that the password includes at least one lowercase letter.

 115:     objRegEx.Pattern = "[a-z]"

 116:     Set colMatches = objRegEx.Execute(strPassword)  

 117:     

 118:     If colMatches.Count = 0 Then

 119:         Wscript.StdOut.WriteLine "Password must contain at least one lower case letter"

 120:         intPassScore = intPassScore - 1

 121:     End If

 122: ' Test ten: Make sure that the password includes at least one symbol.

 123:     objRegEx.Pattern = "[^A-Za-z0-9]"

 124:     Set colMatches = objRegEx.Execute(strPassword)  

 125:     

 126:     If colMatches.Count = 0 Then

 127:         Wscript.StdOut.WriteLine "Password must contain at least one symbol"

 128:         intPassScore = intPassScore - 1

 129:     End If

 130:  

 131: ' Test eleven: Make sure that the password does not include four (or more) lowercase letters in succession.

 132:     objRegEx.Pattern = "[a-z]{4,}"

 133:     Set colMatches = objRegEx.Execute(strPassword)  

 134:     

 135:     If colMatches.Count > 0 Then

 136:         Wscript.StdOut.WriteLine "Password contains 4 or more lower case letters in succession"

 137:         intPassScore = intPassScore - 1

 138:     End If

 139:  

 140: ' Test twelve: Make sure that the password does not include four (or more) uppercase letters in succession.

 141:     objRegEx.Pattern = "[A-Z]{4,}"

 142:     Set colMatches = objRegEx.Execute(strPassword)  

 143:     

 144:     If colMatches.Count > 0 Then

 145:         Wscript.StdOut.WriteLine "Password contains 4 or more upper case letters in succession"

 146:         intPassScore = intPassScore - 1

 147:     End If

 148:  

 149: ' Test thirteen: Make sure that the password does not include any duplicate characters.

 150:     objRegEx.Pattern = "(.)(.*\1)"

 151:     Set colMatches = objRegEx.Execute(strPassword)  

 152:     

 153:     If colMatches.Count > 0 Then

 154:         Wscript.StdOut.WriteLine "Password contains duplicate characters"

 155:         intPassScore = intPassScore - 1

 156:     End If

 157:  

 158: 'Final Score

 159: WScript.StdOut.WriteLine

 160: WScript.StdOut.Write "A password score of " & intPassScore

 161: Select case intPassScore

 162:     case 11,12,13

 163:         WScript.StdOut.WriteLine " indicates a strong password."

 164:     case 7,8,9,10

 165:         WScript.StdOut.WriteLine " indicates a moderately-strong password."

 166:     case else

 167:         WScript.StdOut.WriteLine " indicates a weak password."

 168: End select


Event 4: Image is Everything

| | Comments (0)

Here is my submission for the Advanced Event 4 in the Microsoft Scripting Games 2008.

   1: '*********************************************************************

   2: ' Script Name: Event4.vbs

   3: '     Version: 1.1

   4: '      Author: Perry Harris (PHactotum)

   5: '     Updated: 1:30 AM Friday, February 22, 2008

   6: '     Purpose: Solves the 2008 winter Scripting Games Advance Event 4: Image is Everything

   7: '              

   8: '       Usage: cscript Event4.vbs

   9: '       Notes:

  10: '    Keywords: 

  11: '  versioning: 1.0  Original release

  12: '              1.1  Modified to put lines in our calendar using + - and |

  13: '*********************************************************************

  14: Option Explicit

  15: Dim intYear, i, intMonth

  16: Dim strText

  17: Dim StartDate, EndDate, CurrDate

  18: Dim intLeft, intRight

  19: Dim a

  20:  

  21: 'Get the desired Month and Year for the Calendar

  22: WScript.StdOut.Write "Please enter Month/Year using numeric digits: "

  23: strText = WScript.StdIn.ReadLine

  24:  

  25: 'Assuming the user used a / as the separator

  26: a = split(strText,"/")