Sealeopard
(KiX Master)
2002-07-13 07:16 PM
New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Okay, everybody:

I think I have a new challenging KiXtart Golf tournament for you.
First of all, I'd like to credit BrianTX (I believe) for the idea to this challenge.
Secondly, the timeframe is a total of 10 days. A private coding phase with no code postings allowed will run from now to Wednesday afternoon.

Because of the complexity of the problem and time constraints of participants, the deadline for the first part has been extended to Saturday, July 20, 6pm EST. Part 2 (public improvements of code) will begin automatically after this date/time.

A second public coding phase, including postings of code, will run from Wednesday afternoon to Sunday evening.

Follwing are the official rules for the contest:
================================================================
KiXtart GOLF - How To Play
================================================================

Most importantly, anybody can play, no age restrictions, no penalties, no handicap!

The object in "real" golf is to hit the ball in the hole in the fewest strokes. The object in KiXtart Golf is to get from input (tee) to target (hole) in
the fewest keystrokes.

Example: How many positive elements are in array $a?

Array $a could be of structure $a=[1, 2 ,-3, 4, -5, -7, 8, 9]

One approach:
code:
for $b=0 to ubound($a)
if $a[$b]>0
$c=$c+1
endif
next

for a score of 45.

Another solution is:
code]DO
$b=$b+1
if $a[$b]>0
$c=$c+1
endif
UNTIL $b>(UBOUND($a)+1)[/code]

for a score of 53.

Better approach: Code sample 1

================================================================
KiXtart GOLF - The Rules
================================================================

1) The goal of KiXtart Golf is to score the lowest strokes.

2) Strokes are all characters in a piece of code except whitespace characters, unless the whitespace character is necessary for the line of code to work. Therefore, carriage returns and line feeds do not count or spaces in between the '=' sign when assigning variables, e.g. '$a = $b' scores 5.

3) Code can be constructed any way you like, as long as it is syntactically correct with KiXtart.

4) The final solution MUST pass all test scripts that accompagny the KiXtart golf challenge.

5) The use of '$' as a variable is allowed.

6) In case of questions about a particular way to count the KiXtart Golf Challenge organizer has the last call.

7) During the private coding phase, no code is allowed to be posted. Violations result in disqualification of said player.

8) During the public coding phase, code should be posted, reused, and borrowed from other players.

9) The following script can be used to count the KiXtart Golf score: http://81.17.37.55/board/ultimatebb.php?ubb=get_topic;f=2;t=003418

================================================================
KiXtart GOLF - The Duration of the Competition
================================================================

1) Private coding phase: From date/time of posting the tournament challenge to the following Wednesday, 3pm EST (BBS+6 time)

2) Public coding phase: From Wednesday 3pm EST (BBS+6 time) to the following Sunday, 7pm EST (BBS+6 time)

3) Final results: The following Monday, 11am EST (BBS+6 time)

******************************
* The KiXtart Golf Challenge *
******************************

Write a UDf that can replace the 'REGEDIT /S' registry import.

Three test registry files have been provided and should go into the same directory as the test script. The test script checks whether the written UDF imports the registry files correctly by checking for registry keys, registry types, and registry values.

The registry files can be imported into Windows 9x, NT, 2000, XP but have only been tested with Windows 2000.

Please insert your UDf inside the marked space at the end of the test script. The test script will the run your UDF and check whether all registry keys are correctly placed.

All necessary files are posted below:

All files can also be downloaded at http://people.bu.edu/jenmeyer/kixtart/golf.zip

GOLF.KIX
code:
; KiXtart Golf Test script

; please insert the UDF inside the marked space at the end of this script. It is sufficient to just post the UDF to the BBS once UDF posting is allowed.

; the .REG files are expected to be in the same directory as the script

Dim $rc, $regfile, $regfilearray[1], $errorcount
dim $registrykeys, $registrykey

; required options for the KiXtart Golf challenge
$rc=setoption('explicit','on')
$rc=setoption('novarsinstrings','on')

; registry files to be imported
$regfile=@SCRIPTDIR+'\import1.reg'
$regfilearray[0]=@SCRIPTDIR+'\import2.reg'
$regfilearray[1]=@SCRIPTDIR+'\import3.reg'

; import the registry files and return proper error codes

$rc=ImportRegFile($regfile)
if $rc or @ERROR
? 'test for $regfile failed'
endif
$rc=ImportRegFile($regfilearray)
if $rc or @ERROR
? 'test for $regfilearray failed'
endif

; please do not change the registry entry validation routine!

; check that all registry entries have been imported correctly
$errorcount=0
$registrykeys='HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1',
'HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1',
'HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2',
'HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2\Subsubdirectory1',
'HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2',
'HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory1',
'HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2',
'HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2\Subsubdirectory1',
'HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3',
'HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory1',
'HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2',
'HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2\Subsubdirectory1'

; check for all registry keys
for each $registrykey in $registrykeys
if not keyexist($registrykey)
$errorcount=$errorcount+1
endif
next
if keyexist('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1\Subsubdirectory1')
$errorcount=$errorcount+1
endif

; check for registry value types in import1
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1','Created 07-13-2002')<>'REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1','')<>'REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1','String1')<>'REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1','Number1')<>'REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1','Binary1')<>'REG_BINARY'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2','')='REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2','Binary1')<>'REG_BINARY'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2','Hexadecimal1')<>'REG_DWORD'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2\Subsubdirectory1','')='REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2\Subsubdirectory1','Multi1')<>'REG_MULTI_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2\Subsubdirectory1','Expand1')<>'REG_EXPAND_SZ'
$errorcount=$errorcount+1
endif

; check for registry value types in import2
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2','Created 07-13-2002')<>'REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory1','')<>'REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory1','String1')<>'REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory1','Number1')<>'REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory1','Binary1')='REG_BINARY'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2','')='REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2','Binary1')<>'REG_BINARY'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2','Hexadecimal1')<>'REG_DWORD'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2\Subsubdirectory1','')='REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2\Subsubdirectory1','Multi1')<>'REG_MULTI_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2\Subsubdirectory1','Expand1')<>'REG_EXPAND_SZ'
$errorcount=$errorcount+1
endif

; check for registry value types in import3
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3','Created 07-13-2002')<>'REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory1','')<>'REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory1','String1')<>'REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory1','Number1')<>'REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory1','Binary1')<>'REG_BINARY'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2','')='REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2','Binary1')<>'REG_BINARY'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2','Hexadecimal1')<>'REG_DWORD'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2\Subsubdirectory1','')='REG_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2\Subsubdirectory1','Multi1')<>'REG_MULTI_SZ'
$errorcount=$errorcount+1
endif
if readtype('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2\Subsubdirectory1','Expand1')<>'REG_EXPAND_SZ'
$errorcount=$errorcount+1
endif


; check for registry values in import1
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1','Created 07-13-2002')<>''
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1','')<>'This is a default value'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1','String1')<>'A string of type REG_SZ'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1','Number1')<>'A number of type REG_SZ'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1','Binary1')<>'4b69787461727420726f636b732120285245475f42494e41525929'
$errorcount=$errorcount+1
endif
$rc=readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2','')
if not @error=2
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2','Binary1')<>'4b00690078007400610072007400200069006e00200055006e00690063006f0064006500'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2','Hexadecimal1')<>'12345'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2\Subsubdirectory1','')='REG_SZ'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2\Subsubdirectory1','Multi1')<>'This is a MULTI_SZ registry key.It has two lines.|'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2\Subsubdirectory1','Expand1')<>'This is an EXPAND_SZ registry entry'
$errorcount=$errorcount+1
endif

; check for registry values in import2
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2','Created 07-13-2002')<>''
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory1','')<>'This is a default value'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory1','String1')<>'A string of type REG_SZ'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory1','Number1')<>'A number of type REG_SZ'
$errorcount=$errorcount+1
endif
$rc=readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2','')
if not @error=2
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2','Binary1')<>'4b00690078007400610072007400200069006e00200055006e00690063006f0064006500'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2','Hexadecimal1')<>'12345'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2\Subsubdirectory1','')='REG_SZ'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2\Subsubdirectory1','Multi1')<>'This is a MULTI_SZ registry key.It has two lines.|'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2\Subsubdirectory1','Expand1')<>'This is an EXPAND_SZ registry entry'
$errorcount=$errorcount+1
endif

; check for registry values in import3
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3','Created 07-13-2002')<>''
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory1','')<>'This is a default value'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory1','String1')<>'A string of type REG_SZ'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory1','Number1')<>'A number of type REG_SZ'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory1','Binary1')<>'4b69787461727420726f636b732120285245475f42494e41525929'
$errorcount=$errorcount+1
endif
$rc=readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2','')
if not @error=2
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2','Binary1')<>'4b00690078007400610072007400200069006e00200055006e00690063006f0064006500'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2','Hexadecimal1')<>'12345'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2\Subsubdirectory1','')='REG_SZ'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2\Subsubdirectory1','Multi1')<>'This is a MULTI_SZ registry key.It has two lines.|'
$errorcount=$errorcount+1
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2\Subsubdirectory1','Expand1')<>'This is an EXPAND_SZ registry entry'
$errorcount=$errorcount+1
endif


if $errorcount
? 'The UDF ImportRegFile failed the validation test with '+$errorcount+' errors.'
else
? 'The UDF ImportRegFile passed the validation test.'
? 'Please do not forget to post your KiXtart Golf score.'
endif

; following is the function prototype

;------------------------------------
; beginning of the ImportRegFile UDF, anything up to this comment will not be counted towards the KiXtart Golf score
;------------------------------------

;function ImportRegfile()
;
;endfunction

;------------------------------------
; end of the ImportRegFile UDF and all suporting UDFs, anything after this comment and the comments itself will not be counted towards the KiXtart Golf score
;------------------------------------

Registry file IMPORT1.REG
quote:

REGEDIT4

[HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1]
"Created 07-13-2002"=""

[HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1]
@="This is a default value"
"String1"="A string of type REG_SZ"
"String2"="This string will be deleted again"
"String2"=-
"Number1"="A number of type REG_SZ"
"Binary1"=hex:4b,69,78,74,61,72,74,20,72,6f,63,6b,73,21,20,28,52,45,47,5f,42,\
49,4e,41,52,59,29

[HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1\Subsubdirectory1]
@="This key will be deleted again"

[-HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1\Subsubdirectory1]

[HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2]
"Binary1"=hex:4b,00,69,00,78,00,74,00,61,00,72,00,74,00,20,00,69,00,6e,00,20,\
00,55,00,6e,00,69,00,63,00,6f,00,64,00,65,00
"Hexadecimal1"=dword:00003039

[HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory2\Subsubdirectory1]
"Multi1"=hex(7):54,68,69,73,20,69,73,20,61,20,4d,55,4c,54,49,5f,53,5a,20,72,65,67,69,\


73,74,72,79,20,6b,65,79,2e,49,74,20,68,61,73,20,74,77,6f,20,6c,69,6e,65,\
73,2e,00,00
"Expand1"=hex(2):54,68,69,73,20,69,73,20,61,6e,20,45,58,50,41,4e,44,5f,53,5a,20,72,65,\
67,69,73,74,72,79,20,65,6e,74,72,79,00

Registry file IMPORT2.REG
quote:

REGEDIT4

[HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2]
"Created 07-13-2002"=""

[HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory1]
@="This is a default value"
"String1"="A string of type REG_SZ"
"Number1"="A number of type REG_SZ"
"Binary1"=hex:4b,69,78,74,61,72,74,20,726f,63,6b,73,21,20,28,52,45,47,5f,42,\
49,4e,41,52,59,29

[HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2]
"Binary1"=hex:4b,00,69,00,78,00,74,00,61,00,72,00,74,00,20,00,69,00,6e,00,20,\
00,55,00,6e,00,69,00,63,00,6f,00,64,00,65,00
"Hexadecimal1"=dword:00003039

[HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import2\Subdirectory2\Subsubdirectory1]
"Multi1"=hex(7):54,68,69,73,20,69,73,20,61,20,4d,55,4c,54,49,5f,53,5a,20,72,65,67,69,\
73,74,72,79,20,6b,65,79,2e,49,74,20,68,61,73,20,74,77,6f,20,6c,69,6e,65,\
73,2e,00,00
"Expand1"=hex(2):54,68,69,73,20,69,73,20,61,6e,20,45,58,50,41,4e,44,5f,53,5a,20,72,65,\
67,69,73,74,72,79,20,65,6e,74,72,79,00

Registry file IMPORT3.REG
quote:

REGEDIT4

[HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3]
"Created 07-13-2002"=""

[HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory1]
@="This is a default value"
"String1"="A string of type REG_SZ"
"Number1"="A number of type REG_SZ"
"Binary1"=hex:4b,69,78,74,61,72,74,20,72,6f,63,6b,73,21,20,28,52,45,47,5f,42,\
49,4e,41,52,59,29

[HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2]
"Binary1"=hex:4b,00,69,00,78,00,74,00,61,00,72,00,74,00,20,00,69,00,6e,00,20,\
00,55,00,6e,00,69,00,63,00,6f,00,64,00,65,00
"Hexadecimal1"=dword:00003039

[HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import3\Subdirectory2\Subsubdirectory1]
"Multi1"=hex(7):54,68,69,73,20,69,73,20,61,20,4d,55,4c,54,49,5f,53,5a,20,72,65,67,69,\
73,74,72,79,20,6b,65,79,2e,49,74,20,68,61,73,20,74,77,6f,20,6c,69,6e,65,\
73,2e,00,00
"Expand1"=hex(2):54,68,69,73,20,69,73,20,61,6e,20,45,58,50,41,4e,44,5f,53,5a,20,72,65,\
67,69,73,74,72,79,20,65,6e,74,72,79,00



[ 16 July 2002, 15:37: Message edited by: sealeopard ]


MCA
(KiX Supporter)
2002-07-13 07:24 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

again a slow weekend? wouldn't it be very nice when Ruud is releasing a new version each week?
greetings.


LonkeroAdministrator
(KiX Master Guru)
2002-07-13 07:37 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

this is not good...
too drunk to participate today...


LonkeroAdministrator
(KiX Master Guru)
2002-07-13 08:15 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

ok, I made fully working script for just strings and it says: undefined variable even though the first line defines the variable as 0

have you tested your script?


LonkeroAdministrator
(KiX Master Guru)
2002-07-13 08:35 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

also...

your reg-files are not working.

reading first line gives:
˙ţR

when it is if I make it myself:
REGEDIT4


LonkeroAdministrator
(KiX Master Guru)
2002-07-13 08:43 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

had to "type" in dos your reg-files to get them working????

[ 14 July 2002, 03:15: Message edited by: Lonkero ]


Sealeopard
(KiX Master)
2002-07-13 08:47 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Lonkero:

did you use the .REG files from the downloadable ZIP-file that I provided or did you copy and paste the .REG files?

I did check my ZIP file and it seemed to be okay. The best way to test those .REG fiels is to just import tme with REGEDIT and see what they are doing.

Let me know if there are any problems.


LonkeroAdministrator
(KiX Master Guru)
2002-07-13 08:49 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

for what happened with them read my last post.

I did download your zip.


Sealeopard
(KiX Master)
2002-07-13 08:54 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Lonkero:

I did test the golf.kix script. I first imported the three .REG files with REGEDIT. I then ran the GOLF.KIX script under KiXtart 4.10a and it gave mo no errors. I did use a dummy function for ImportRegFile() though just so I can verify the registry entry testing part.

So, are you okay now? Or are there still any problems?


LonkeroAdministrator
(KiX Master Guru)
2002-07-13 09:18 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I'll download your zip again.
I'll run the reg files with my working code to see if them really work.
as I see it, reg-files are just text-files with reg-extension so they should open correctly with kixtart...

I'll return my feedback on this soon (if I don't passout!)

cheers,


Sealeopard
(KiX Master)
2002-07-14 12:20 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Yes, they are plain text files. The identifyer is 'REGEDIT4' in the first line denoting a registry file. Under Windows 2000 this first ID line is different if you export a regfile out of the registry.

LonkeroAdministrator
(KiX Master Guru)
2002-07-14 01:17 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

downloaded and tested again.
don't know. this is probably a windows unicode bug...
I have w2k sp2 here. finnish installation and the lines in your reg-files are showing up as symbols.
don't know about others non-us ppl, but for me those files are corrupted and I can't use them.

cheers,


**DONOTDELETE**
(Lurker)
2002-07-14 01:20 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

The REG files supplied are in Unicode format.
These don't work in Windows 98, have to be ascii
or REGEDIT won't recognise them.
Had to load into Wordpad and 'Save As' Text format

[ 14 July 2002, 01:22: Message edited by: AJH ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-14 01:37 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

ajh, you seem to be second one to try them and second one saying they do not work.

jens?


**DONOTDELETE**
(Lurker)
2002-07-14 01:52 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

The Error Checking code seems to check for the default subkey
entry existing (and = REG_SZ) when it should not be set.
(eg on 'ImportX\subdirectory2' etc)
On Windows 98 this key always exists (and is by default REG_SZ)
- showing 8 errors after merging the supplied files.
eg:
if readtype(HKCU\...\Import1\Subdirectory2','')='REG_SZ'
$errorcount=$errorcount+1
endif

[ 14 July 2002, 01:55: Message edited by: AJH ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-14 01:53 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I got this error when trying to reduce my code:
"out of beer"


Howard Bullock
(KiX Supporter)
2002-07-14 02:31 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I don't have a problem with the files. Ironing out the last couple bugs [Smile]

LonkeroAdministrator
(KiX Master Guru)
2002-07-14 02:33 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I got a bug not getting over with.
string and null can't be easily diffed with if...

going back.


LonkeroAdministrator
(KiX Master Guru)
2002-07-14 03:14 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

started to work with profilestring-functions and found out that the script is growing over 0.5k!

after spending some 200 minutes on that have to fall back to sleep or to previous state.


Howard Bullock
(KiX Supporter)
2002-07-14 08:42 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

This code seems to be incorrect.
code:
; check for registry values in import1
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1','Created 07-13-2002')<>''
$errorcount=$errorcount+1 "Import1','Created 07-13-2002'"
endif
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1','')<>'This is a default value'
$errorcount=$errorcount+1 "Subdirectory1',''"
endif
------
if readvalue('HKEY_CURRENT_USER\Software\KiXtart\KiXtart Golf\Import1\Subdirectory1','')<>'A string of type REG_SZ'
$errorcount=$errorcount+1
endif
------

Import1\Subdirectory1','' should be 'String1'

{edit}
A real sucky score but it works! [Big Grin]
KixGolf score = 1657

After some sleep, the score should drop some.

[ 14 July 2002, 09:23: Message edited by: Howard Bullock ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-15 12:58 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I'm stuck with something I cant understand.
if I make kix to read lines from those files they come out as:
7
9
,
2
0
,
6
5
,
6
e
....

what heck is going on?
all I do is:
while @error=0
readline(1) ?
loop

does not matter which version I use.

[ 14 July 2002, 13:00: Message edited by: Lonkero ]


**DONOTDELETE**
(Lurker)
2002-07-14 01:50 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Lonkero
Your problem is because the supplied .REG files are Unicode, and the Kix
ReadLine() function is for reading ascii files.
This topic Unicode Converter UDF discusses some unicode problems.
My input to the debate includes a UDF called ReadFile which (like PIPE)
returns an array containing the ascii text lines.
Both ascii and unicode input files can be used.


LonkeroAdministrator
(KiX Master Guru)
2002-07-14 02:41 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

ajh, so, is this kinda unicode right?
when I export from regedit as "regedit4 regfile" it works just fine.

jens, does my script have to work with your files too?


**DONOTDELETE**
(Lurker)
2002-07-14 03:31 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I think Jens need to clarify the matter.
Are the input files assumed to be:
a) Always ascii
b) always unicode
c) any combination
If Unicode is required then the Kix ReadLine function
is useless for this operation


LonkeroAdministrator
(KiX Master Guru)
2002-07-14 03:53 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

was going to ask 10 minutes ago about fso but then kpnqwest's net went down. back again.

so what external (not included strickly in kix. meaning com, dos utils etc...) things maybe used?


Howard Bullock
(KiX Supporter)
2002-07-14 04:07 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I elected COM (a native ability of KiX) to save some strokes. I think I may need to save a lot more by the time every else chimes in.

{edit} Also, in W2K SP2 Regedit.exe always shows a (default) value even when one doesn't exist. Regedt32.exe shows exactly want is there. I lost a couple hours last night trying to delete a key that wasn't there. [Mad] [Embarrassed] trying to save the stroke for if KeyExist().

[ 14 July 2002, 16:10: Message edited by: Howard Bullock ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-14 04:08 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

hoby, yes com is native ability but what you objects you call?
are they supported by default in all required os'es?


Sealeopard
(KiX Master)
2002-07-14 04:13 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Guys, I only tested the scripts under Windows 2000 SP2. I will go back and test the scripts under Windows 98 and reexport the .REG files again. The .REG files are supposed to be text files, not unicode-files.

I'm sorry for the lack of testing done.


Howard Bullock
(KiX Supporter)
2002-07-14 04:17 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I can't answer that. I only have W2K and the docs for WSH 5.5, 5.6. You have a choice of to two text based methods for FSO.

LonkeroAdministrator
(KiX Master Guru)
2002-07-14 04:20 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

that jens' post helped a lot.

makes the code almost halfsized...


Howard Bullock
(KiX Supporter)
2002-07-14 04:20 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

The UNICODE was a nice twist. It took a couple minutes to make that determination since W2K handles it transparently on most tools.

I guess I can re-code if you change them. That probably would more fair for those OS challenged individuals. [Wink]

[ 14 July 2002, 16:21: Message edited by: Howard Bullock ]


Sealeopard
(KiX Master)
2002-07-14 04:26 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Hmm, it seems ther are two different coding tracks right now, on using Windows scripting Host, and one without. It'll be interesting to see which one will be the more efficient one [Smile]

Howard Bullock
(KiX Supporter)
2002-07-14 04:35 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

In my approach WSH added strokes because of FSO object creation line and the long object and methods names used in WSH. It only added one line and some chars for me.

{edit}
Now if I use more WSH functionality for things other than just reading a file, I might be able to improve the product in areas where KiX is a little shy on functionality, I might be able to make a better product.

[ 14 July 2002, 16:39: Message edited by: Howard Bullock ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-14 05:36 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

also, do we have to catch the return codes or can we let the 0's take over the window?

LonkeroAdministrator
(KiX Master Guru)
2002-07-14 06:39 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

huh. longest part comes from multilined hex-values...

LonkeroAdministrator
(KiX Master Guru)
2002-07-14 06:51 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

done.
without fso.
it does not handle (as without any comstuff) the unicode files. only pure text reg-files

KixGolf score = 611!!!!!!!!!!!!!!!

hoby?

[ 14 July 2002, 18:53: Message edited by: Lonkero ]


Howard Bullock
(KiX Supporter)
2002-07-14 07:14 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Wow. (Scratching my head...)

Sealeopard
(KiX Master)
2002-07-14 07:30 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Okay guys, I investigated the UNICODE thing. If the export is done from e.g. Windows 9x (and I believe Windows NT, though I don't have one ready right now), then the exported .REG file is a normal text file with the first line being 'REGEDIT4'.
If the export is done from Windows 2000 (and Windows xP?), then the exported file is in UNICODE. This file cannot be reimported with REGEDIT /S under Windows 9x/NT. This type of file is identified by 'Windows Registry Editor Version 5.00' and is an UNICODE file.

Allowed is only pure KiXtart, no external programs, WMI/ADSI/WSH is allowed since most have it installed anyway.

I will post an updated .ZIP file soon not containing any UNICODE files, only REGEDIT4 .REG files. But it might take me an hour or so.


LonkeroAdministrator
(KiX Master Guru)
2002-07-14 07:35 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

yes!
I like what I'm reading!

if someone else get's under 1000 score too,
I'll start minimizing my code.
as didn't do it yet, just made it working...

[ 14 July 2002, 19:36: Message edited by: Lonkero ]


Les
(KiX Master)
2002-07-14 09:12 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Jens,
This unicode thing is a known issue. See my second post on the FAQ

Topic: Registry


**DONOTDELETE**
(Lurker)
2002-07-14 09:48 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Jens
There is a typo in both the original Import2 posting and in the Zip file
The Import2\Subdirectory1 "Binary1" entry
contains this string ...,726f,... (missing ',')
Not sure what WSH functions people are using...

[ 14 July 2002, 21:48: Message edited by: AJH ]


Howard Bullock
(KiX Supporter)
2002-07-14 10:00 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I thought the missing comma was a test to find BAD data and ignore it like Regedit does. The tests do not expect to find that Value.

LonkeroAdministrator
(KiX Master Guru)
2002-07-14 10:10 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

it works just fine for me!

kixtart fixes that automatically.

btw, the actual score was:
KixGolf score = 602

forgot to remove some debug code [Big Grin]

[ 14 July 2002, 22:13: Message edited by: Lonkero ]


Howard Bullock
(KiX Supporter)
2002-07-14 11:08 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Yeah, I "fixed" it too at first, but that particular value reported an error and in my zombie state late last night it seemed as though it was not suppose to exist according to the test code. So I recoded my script to check for missing commas and discard the line. [Mad] [Frown] [Confused]

Somebody let me know if it was a typo. Now that I am again awake, I might be able to collate the tasks at hand. [Roll Eyes]

[ 14 July 2002, 23:09: Message edited by: Howard Bullock ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-14 11:12 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

also, didn't get a reply to my question:
do we need to supress return codes?
I mean, function return 0 on success. can we let them be output to console as long as the function works?

when we must replace the regedit /s, do we also need to have setconsole("hide") in our function?


LonkeroAdministrator
(KiX Master Guru)
2002-07-15 12:02 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

ok, didn't read the test script well enough.
as didn't even used it.
as it does not have all reg types...
uttleast seems so.

anyway, forgot one feature. that means my score will increase. [Frown]

I'll be back.


LonkeroAdministrator
(KiX Master Guru)
2002-07-15 12:28 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

ok dudes.
I'm getting also over 1000 here.
didn't use the explicit and now it does not allow any of my lines.

if not getting it working, will leave this battle. too much frustration.


Sealeopard
(KiX Master)
2002-07-15 12:35 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Folks:

I just uploaded a new .ZIP file with the test script and the .REG files. Get it here: http://people.bu.edu/jenmeyer/kixtart/golf.zip

And yes, there is a faulty dataset in one of the .REG files, and I put this in deliberately [Big Grin]

There doesn't need to be UNICODE support in this routine, just support for REGEDIT4 .REG files.

With regards to return codes, the only return code is the one for ImportRegFile(), there shouldn't be any screen output inside the UDF.

I alos have put a Windows 2000 UNICODE file into the ZIP package, which is NOT part of the test script.

The test script basically checks whether the keys/values/types are correct, and whether the appropriate keys/values have been deleted.

BTW, my count is currently 1813 without shortened variables and using pure KiXtart (not even a call to an outside object) but including some error checking for correct file type and syntax.


Sealeopard
(KiX Master)
2002-07-15 12:41 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

quote:
when we must replace the regedit /s, do we also need to have setconsole("hide") in our function?
No, you don't need that. I was imagining a simple UDF that runs the .REG files fed to it and returns an error code inducation whether the file was imported correctlt or not (e.g. file not found). Since REGEDIT /S doesn't tell you if some imports haven't been doen because of syntax error, it is not necessary for the UDF to do this either.

Finally, I didn't put all types of registry entries into the test .REG files, just the most important ones. So, a UDF posted into the UDF section might need to contain those cases, too, but for this exercise, it is not necessary.


LonkeroAdministrator
(KiX Master Guru)
2002-07-15 01:13 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

no. I can admit this is getting weird.
if I loose explicit and novarsinstring and array support my script works fine.

if I try to make it work with any of those, only errors occurs... [Eek!]
I won't sleep tonight, that's for sure.


LonkeroAdministrator
(KiX Master Guru)
2002-07-15 01:16 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

btw, does regedit support array input?
I have used it only with multiple strings...

just to make a point...


LonkeroAdministrator
(KiX Master Guru)
2002-07-15 01:32 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

head is blowing away...
please give me something else to think about!

{edit}
record of the day:
5 boxes cigarettes and 3 litres of coffee...
unofficial though

[ 15 July 2002, 01:36: Message edited by: Lonkero ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-15 01:45 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

jens, this is really nice.
when vars in strings is off the values get there nicely.
when it's on, all valuenames get written as strings.
also it messes up my data fields.


Howard Bullock
(KiX Supporter)
2002-07-15 01:54 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I didn't sleep last night. [Frown] Been at this forever.

I am now exploring some alternatives. I haven't checked everything and I don't if everything works correctly yet, but I can correctly enum everything. It's interesting at (KixGolf score = 909).


LonkeroAdministrator
(KiX Master Guru)
2002-07-15 01:57 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

hoby, did you have any intresting time with those new restricking rules?

I'm almost there... don't know how will come around this last thing...
script size has about doubled because of those strict-rules.


Howard Bullock
(KiX Supporter)
2002-07-15 02:00 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Jens, was I correct in NOT correcting your faulting data set and not loading the value? Or should we repair it and load it?

LonkeroAdministrator
(KiX Master Guru)
2002-07-15 02:04 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I understood that it does not matter do we load or not.
as data correctness checking does not need to be.


LonkeroAdministrator
(KiX Master Guru)
2002-07-15 05:11 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

mmm...
golf.kix checks for defaultvalues. that's ok.
but, my script does not create them and still they come up in regedit. and your script says 7 errors found.
if I've understood correctly, default value is allways there when key is made and it can't be removed.
and when not set, it also is reg_sz.

anyway, my script is fine now with your strict rules and it also works with the reg-types not needed by this golf course.

KixGolf score = 775

btw, hoby, your v3 gave just score 0

cheers,


Howard Bullock
(KiX Supporter)
2002-07-15 05:22 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Did turn on counting by putting a ";!" at the beginning of your function?

LonkeroAdministrator
(KiX Master Guru)
2002-07-15 05:26 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

ah!
did not.
well, didn't cut of any chars...
result is the same:
KixGolf score = 775


Howard Bullock
(KiX Supporter)
2002-07-15 05:27 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Oh, and the "Default" values are not really there even though Regedit says they are. Use regedt32 to verify.

LonkeroAdministrator
(KiX Master Guru)
2002-07-15 06:13 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

another bloody bug.

cj
(MM club member)
2002-07-15 08:12 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Lonkero,

I have KiXGolfed your example script to this:

code:
for each $x in $a
if $x>0
$c=$c+1
endif
next

and it scores 35 now [Big Grin]

cj


LonkeroAdministrator
(KiX Master Guru)
2002-07-15 08:20 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

now the validator said that my script passed it.
I can't check it more right now.
score 803

not feeling happy. I'm so tired...
it was feeling too good to be really ahead of others so much. now back on earth.

hoby, are you allready under 800?

[ 15 July 2002, 08:25: Message edited by: Lonkero ]


Howard Bullock
(KiX Supporter)
2002-07-15 09:14 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I'm too tired to tell...>1000 with problems. I keep digging myself deeper because I'm too tired.

Goodnight 3:15AM here.


MCA
(KiX Supporter)
2002-07-15 09:18 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Dear Howard,

A good night's rest.

Are you still using kixtart. Hard to understand who so much failures. General it is something for
the MS club.
greetings.


Howard Bullock
(KiX Supporter)
2002-07-15 02:50 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I'm trying something different still using the Unicode import files. I will give this a little more effort before changing to the ASCII file and doing something a little simpler.

BrianTX
(Korg Regular)
2002-07-15 03:10 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Wow!

It looks like I've missed a lot of the fun! I've been busy entertaining my girlfriend all weekend. Hmm... so should I hazard participation in this project? I may give it a go... at least for awhile.

Brian


LonkeroAdministrator
(KiX Master Guru)
2002-07-15 03:23 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

brian, just don't loose your head like some of us have done.
ok, fixed a bug with more than 2 lined multistrings.

KixGolf score = 792

cheers,


Sealeopard
(KiX Master)
2002-07-15 03:24 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Brian:

Entertaining one's girlfirend is important (I just had friends split up because they didn't take enough time for each other, pretty messy for their kids).

It's not too late to join. The first round will run until Wednesday afternoon (or longer if people would like to have more time on it before seeing what others have coded).

Right now, you only need to import non-UNICODE files. Also, if a line is not properly formatted (there's one in one of the .REG files) then this line will NOT be processed. you also need to only cover those registry types that are part of the sample .REG files, which are the most common ones.


BrianTX
(Korg Regular)
2002-07-15 03:49 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

That's cool. I have a pretty good idea on how to do this.. but under 1000 seems pretty durn good.

Brian


BrianTX
(Korg Regular)
2002-07-15 04:28 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Hmm. are you guys using readprofilestring? Just curious.. I'm fiddling around with it because it seems like the easiest way to enumerate items. The only problem is the line breaks with a \.

Brian

[ 15 July 2002, 16:32: Message edited by: BrianTX ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-15 04:46 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

brian, you can make it enumerate really shortly (did that) but then comes that...
could also open the file...

this way, when \ occurs you could read to that line.
could get you under 1000...

I'm not using it anymore as the handling could get too tricky for my simple mind [Big Grin]

well, I'm just waiting now if someone has a glance to make shorter code cause I'm pretty much done with mine.

if you get the shorter one I can always take one stroke out of it as usual... [Razz]


Sealeopard
(KiX Master)
2002-07-15 06:59 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I'm not using it either, just straight-forward OPEN-READLINE-CLOSE and some parsing in between [Wink]

LonkeroAdministrator
(KiX Master Guru)
2002-07-15 07:14 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

mmm...
jens, you better be carefull how many keywords you use or you'll get disqualified by yourself! [Eek!]

I might say too that after 48 hours of coding and dissappoinment, you will be glad, if you get it even workin... correctly.


BrianTX
(Korg Regular)
2002-07-15 08:31 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

While doing more research, I discovered that:

code:
REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VBA]
"Vbe6DllPath"="C:\\PROGRA~1\\COMMON~1\\MICROS~1\\VBA\\VBA6\\VBE6.DLL"

MUST have double slashes in order to work... Just a comment.

Brian


**DONOTDELETE**
(Lurker)
2002-07-15 11:12 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

For your information:

Keys can have square brackets and quotes inside them (but not '\')
In the .REG file they are stored as-is
eg [hkcu\...\test[key"for'your]perusal]

The value-name / value-content pairs use escape sequences
with '\' as the escape character (eg " is \", \ is \\)
 
You should try parsing things like this "string\"quote:1"="first:string\"quote\\d"
Spaces are legal between constructs, eg:
      [hkcu\...]
   "test1"        =        dword:          11223344


LonkeroAdministrator
(KiX Master Guru)
2002-07-16 12:17 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

are legal...
jens, wasn't it enough to work with your example [Frown]

ok, have to test my script again tomorrow against spaces too... [Eek!]

must... sleep...


Howard Bullock
(KiX Supporter)
2002-07-16 04:04 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I am really [Confused] .

When view my key "07-13-2002", in Regedit and Regedt32 the Type shows REG_SZ. The input data to the WriteValue command was a variable of type string $D="" (which the VarTypeName was checked on the line preceding the WriteValue command), and "REG_SZ" as the 4th parm. Yet I get an error in Golf.kix because ReadType() returns "REG_NONE". [Confused] [Mad] [Roll Eyes]

REG_NONE No defined value type.
Can anyone shed some light on this?

{edit}
Just tested the ["b" ] inside the keyname and passed [Big Grin]

[ 16 July 2002, 04:35: Message edited by: Howard Bullock ]


cj
(MM club member)
2002-07-16 04:36 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I use REGDMP and REGINI from the reskit for registry work. They use the same format between NT4 and win2k and don't have all those brackets to worry about. You can also set registry permissions with them.

I am not aware of any shortcomings with them, but if anyone knows...

cj


Sealeopard
(KiX Master)
2002-07-16 05:14 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I'm at KiXGolf score 1873 and haven't even written to the registry. But I'm using normal variable names, haven't yet shortend them to one-letter ones. I'm successfuly parsing registry keys and registry entries, currently working on the values and regtypes.

I'm thinking of extending the deadline to Saturday evening (about 6pm EST). I'm not sure whether I can be online at that time since my in-laws will be in town for the weekend.


Howard Bullock
(KiX Supporter)
2002-07-16 05:38 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

KixGolf score = 1184: with the fore-mentioned issue. (using something different)
KixGolf score = 1123...
KixGolf score = 1151... [Frown]

[ 16 July 2002, 06:13: Message edited by: Howard Bullock ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-16 06:51 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

hoby, doesn't it feel good, when your score is taking it back up?

[ 16 July 2002, 07:22: Message edited by: Lonkero ]


Howard Bullock
(KiX Supporter)
2002-07-16 02:11 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I still have the problem mentioned a few post above.

I swapped out the WSH read file for KiX OPEN,READLINE loop for a reduction, but found that I was getting garbage for the last line when I read it all into a variable. A line:
quote:
333333333333333333333333333333333335555555555555555555555555555555555555555555555555
seemed to show up.

Brain hurt too much to figure it out. So I switched back for the time being.


LonkeroAdministrator
(KiX Master Guru)
2002-07-16 02:19 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

mmm...
so jens, are we ending tomorrow or should I keep minimizing my code the whole week?

hoby, you'll get there. just keep on coding [Big Grin]

cheers,


BrianTX
(Korg Regular)
2002-07-16 03:18 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Guys, I haven't even had time to make some reasonable code... I know a good way to parse the file (at least it seems to be a good way), but I haven't had the time to implement it because I've been EXTREMELY busy at work and at home! (geez.. people sure are demanding these days)

So, I would LOVE an extension on this stuff.

Here is a hint on the method being formulated in my noggin:

(READLINE/FOR/SELECT/ENDSELECT/NEXT for parsing)...

Is anyone/everyone else doing it like this?

Brian


Sealeopard
(KiX Master)
2002-07-16 03:33 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Brian:

I am using all of your functions, too, and additionally RIGHT/LEFT/SUBSTR/ADDKEY/DELKEY/WRITEVALUE [Wink]

So I guess you're on the right way.

BTW, I've been very busy, too, unfortunately, and I don't believe I can finish my code til tomorrow either.

I know that Lonkero must have pushed his code below the magic 1000-barrier by now (and his # of caffeine-containing-drinks above that same level [Wink] ) but for the sake of giving everybody a fighting chance, I will now officially extend the deadline for the first part to Saturday, July 20, 6pm EST (midnight BBS time). After this time, everybody can feel free (and is encouraged) to post their code solution even if it is only rudimentary or just a framework.

I might not be able to officially announce the beginning of the second round at that time because of a potential family commitment (entertaining the in-laws), but you can just go ahaead and post anyway (preferable as a new thread).

[ 16 July 2002, 15:37: Message edited by: sealeopard ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-16 07:46 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I used them too. at the time played with some other functions too...

but then discovered nice kixtart functions which save a lot of strokes compared to that...

no more will I say, just smile:
[Big Grin] [Big Grin] [Big Grin] [Big Grin] [Big Grin] [Big Grin] [Big Grin]


kholm
(Korg Regular)
2002-07-16 11:53 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Brian and AHJ,

You are right. When Regedit exports strings containing backslashes they are doubled.
An example is this:
code:
REGEDIT4
[HKEY_CURRENT_USER\Network\E]
"RemotePath"="\\\\Server\\Share"

In KiX, the code should be written as:
code:
$RC=AddKey('HKEY_CURRENT_USER\Network\E')
$RC=WriteValue('HKEY_CURRENT_USER\Network\E','RemotePath','\\Server\Share','REG_SZ')

So to make a fully functional Registry-UDF, we have to remove every second backslash in strings
read from reg-files and substitute every \" with "

Another problem is, that equal signs are allowed in both valuenames and stringvalues.

Try to make the logic for transforming this regfile to a KiX-script:
code:
REGEDIT4
[HKEY_CURRENT_USER\Software\KiXtart\Test ]
"A1=\"\\A2\"\\" = "A3=\\\"A4\\\""

The KiX script should look someting like this:
code:
$RC = AddKey('HKEY_CURRENT_USER\Software\KiXtart\Test')
$RC = WriteValue('HKEY_CURRENT_USER\Software\KiXtart\Test','A1="\A2"\','A3=\"A4\"','REG_SZ')

The problem is the equal sign in the valuename. You can's split the valuename from the value using
InStr() to find the first equal sign !!

There might be other exceptions, but i don't believe we shall count them in during this 'golfmatch'.
But the next challenge will be to make a fully functional UDF to take all these 'strange' behaviours
into account.

-Erik

Ps.
My KiX-score at this moment is about 2000.
Even without the issue of \\ \" and Equal-signs in valuenames, i have never been under 1300 in KiX-score,
so i belive i will just step back and wait for the final result [Wink]

Pps.
The second 'regfile' is fully legal, working on both Win9x and XP.
I can't imagine who should want to make values and valuenames with contents like this.
But you never know [Roll Eyes]

[ 16 July 2002, 23:56: Message edited by: kholm ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-17 12:13 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

mmm...
so, is it enough that we have code that works with these test scripts or do we have to take to account also these exceptions?

\\ i understand but "a=a"="a" gets my head hurt.

I just parsed my code to 785 and making addings to it is not easy anymore.


kholm
(Korg Regular)
2002-07-17 12:22 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Lonk,

I believe that the rules for the tournament is, that new hazards can't be build after playoff.

So your script has to handle the regfiles delivered from Jens and nothing more.

Maybe Jens can confirm this ?

-Erik


LonkeroAdministrator
(KiX Master Guru)
2002-07-17 12:25 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

wonderful!
so I might keep on parsing it...

no. I want some competition. just want to see is it hoby or brian the next one entering under M club [Big Grin]


BrianTX
(Korg Regular)
2002-07-17 03:06 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I'll be lucky to even get working code at this point. Life is staying pretty busy, so I don't know how much time I'm going to have to work on this. I suppose I'll have to give it a go at some point, just to see if I can come close.

Brian


Howard Bullock
(KiX Supporter)
2002-07-17 03:16 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I just noticed that in the latest downloaded zip file I have (Monday, July 15, 2002, 3:23:00 PM) the is a fourth reg file (unicode) and the Golf script includes it in the array of files to process. Is this a change or should I comment this line out?
code:
$regfilearray[2]=@SCRIPTDIR+'\import3_w2k.reg'



LonkeroAdministrator
(KiX Master Guru)
2002-07-17 03:18 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I removed the whole line...

{edit}
damn! I was supposed to leave this to the afternoon!

[ 17 July 2002, 15:19: Message edited by: Lonkero ]


Sealeopard
(KiX Master)
2002-07-17 03:44 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

This fourth .REG file (import3.w2k.reg) is NOT part of the challange, I just put it in there to illustrate the UNICODE issue with Windows 2000 exported .REG files.

Anyway, the challange only requires you to import the provided .REG files. It doesn't expect you to import any and all types of .REG files.

Nevertheless, if anybody would be willing to write a complete UDf for this, then all registry types and escape sequences must be taken into acount.


BrianTX
(Korg Regular)
2002-07-17 04:49 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I wonder... I'm still messing with parsing the file... only about half way through with that (I think) and already at 270ish... I'm wondering if Lonkero conquered a method to use the READPROFILESTRING instead.. hmmm.

Brian


LonkeroAdministrator
(KiX Master Guru)
2002-07-17 04:53 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

brian, readprofilestring has one take down:
it's call is long.
and if you use it with execute, execute is long.

brian, let's say that I started other way than many others of you.
that's why my starting code was just 611.
then added some functioning to small script was not so big case.
well, it was.
head hurted and so on...
but, I quess I'm the one who still has spent the longest time with this golf.
even now when I haven't been looking to my code for a while.


BrianTX
(Korg Regular)
2002-07-17 11:06 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Well, my first stab at it is 1057. I haven't fully tested it nor simplified the code much.

Brian


LonkeroAdministrator
(KiX Master Guru)
2002-07-17 11:29 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I was correct.

there is two dudes that can come close and brian can maybe even overcome me...

brian, once you get under 1000, I'm forced to cut me code.

until that, keep on working!


BrianTX
(Korg Regular)
2002-07-17 11:39 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I doubt it.. It mostly works, but I haven't built in support for arrays nor figured out the "bug" you guys were talking about (which causes validation errors). Although i see several ways to reduce the code once I finish all that.

Brian

{edit}
I'm tempted to try the READPROFILESTRING method... I'm thinking I could get tighter code with it.

{edit}
Ok.. should pass validation...except no support for arrays, yet.

{edit}
Ok.. supports arrays. I probably wont' have time to work on this until tomorrow.. so.. I'll take some more stabs at it then... 1160 is the score... I'm sure I can shave quite a bit.. but for now it's working with the validation script even.

[ 18 July 2002, 00:05: Message edited by: BrianTX ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-17 11:42 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

mmm...
btw, it takes 3o strokes to add support for all registry types.
I quess the final udf can be under 1000...


BrianTX
(Korg Regular)
2002-07-18 03:13 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Down to 1079.... It was probably more robust before, but to handle the .reg files from Jens, I could cut out some stuff.

Brian

{edit}
make that 1066 -- no issues with the .reg files Jens presented.
{edit}
make that 1050...

[ 18 July 2002, 16:51: Message edited by: BrianTX ]


Howard Bullock
(KiX Supporter)
2002-07-18 03:58 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

KixGolf score = 1036

Still trying to resolve the issue where REG_NONE is returned from Kix ReadType() when Regedit and Regedt32 say it is REG_SZ.


kholm
(Korg Regular)
2002-07-18 05:04 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

KixGolf score = 969

Report from UDF-checker:
The UDF ImportRegFile passed the validation test.
Please do not forget to post your KiXtart Golf score.

BUT:
The script dosn’t handle exeptions like : \” \\ end eqal signs in valuenames, and there is no errorchecking at all.

(I have a second script with exeptionhandling, the score for that is: 1538)

Scores counted with Howard’s KixGolf scoring script.

-Erik


LonkeroAdministrator
(KiX Master Guru)
2002-07-18 05:09 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

kholm, you don't seem a starter at all.
good to have company...

quess I have to start working on the parsing...

I understood that those special cases are not needed...

I understood, it's enough functionality if it works with the test scripts.

like it does not need deletion of value [Wink]


Sealeopard
(KiX Master)
2002-07-18 05:29 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Erik: Nice job.

BTW, it's okay if there's no error checking and if it doesn't handle all registry types and escape sequences. As long as it fulfills the challange requirements (importing the provided .REG files), ity is a valid script. However, a UDF to replace REGEDIT would of course need error checking and be able to parse all registry tyes and escape sequesnces and handle odd formatting.


kholm
(Korg Regular)
2002-07-18 05:39 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Lonkero,

You are right, there is no code to check if the value String2 is deleted (I belive Jens has forgotten that [Wink] )

If I omit the code for deleting values, my score is: 926, but i’m not shure if that would be considered as job done.

-Erik


BrianTX
(Korg Regular)
2002-07-18 05:49 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I'm down to 1025 so far... still working on it, though.

Brian


LonkeroAdministrator
(KiX Master Guru)
2002-07-18 05:50 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

jens, do we need to delete values?

I will get 10-15 hits more if we do...


Sealeopard
(KiX Master)
2002-07-18 05:51 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Erik: At least you found out that the vaule needs to be deleted. The checking routine was just put into the code to make it easier to verify all the registry edits. It's not totally comprehensive.

Howard Bullock
(KiX Supporter)
2002-07-18 08:20 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I beat you all. Mine deleted the value properly on Sunday. I still can't understand why Regedit and Regedt32 tell I all correct and ReadType cause the error checking code to report errors because ReadType returns REG_NONE [Mad]

Sealeopard
(KiX Master)
2002-07-18 09:17 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Not sure either. I basically copied the reg types from REGEDIT into the test script. After applying the .REG files with REGEDIT and running the test script it did tell me everything is okay. Maybe REGEDIT is doing something after the delete operation?

LonkeroAdministrator
(KiX Master Guru)
2002-07-18 09:23 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

well...
how it can work for others?


kholm
(Korg Regular)
2002-07-18 10:07 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Howard,

I believe that your script is not stripping of the double hyphens.

You are using: '"Created 07-13-2002"' as entryname in WriteValue()

You Should use: 'Created 07-13-2002'

The ReadType() statement looks for an entry with this name: Created 07-13-2002

That dosn't exist beacuse you have created an entry named: "Created 07-13-2002"

I have just checked, if you use ReadType() on a nonexisting entry then it reports: REG_NONE
(And @Error = 2)

-Erik


BrianTX
(Korg Regular)
2002-07-18 11:24 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

OK... i'm at 939... Might still be able to shave some..
{edit}
includes deleting keys/values...
Brian

Lonkero, what is your score?

[ 18 July 2002, 23:45: Message edited by: BrianTX ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-18 11:52 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I haven't added deletion of value as thought it was not needed.
the current score without it is in some post before...

something like 900

cheers,


BrianTX
(Korg Regular)
2002-07-18 11:57 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Let me know.. I'm approaching 900...
{edit}
I'm at 927 and done for the day... I think..

Brian

[ 19 July 2002, 00:03: Message edited by: BrianTX ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-19 12:02 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I know, but I don't have any wintosh system at home so can't compete.

my code has been done for a while so don't know I can make my head to it anymore.

anyway, I have to add that delvalue code tomorrow and that obviously adds the code size.

heh, we probably end up with same code with only diff being the var names.


kholm
(Korg Regular)
2002-07-19 12:04 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

My score now is 933

And unless i get really inspired i belive that only a few bytes can be cut of.

I'm not sure what to do with the eronious value that has been mentioned on several ocasions (Missing comma)
My regfile from the downloaded zip-file dosn't contanin any errors, if any of you check for that i'm truly out.

{edit}
Now 921

[ 19 July 2002, 00:17: Message edited by: kholm ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-19 12:18 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

now I'm feeling sad I didn't take my laptop at home.
dudes, go to sleep!

this is not fare!!!!


BrianTX
(Korg Regular)
2002-07-19 12:51 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

What erroneous value? I don't have a problem with any of mine. The golf.kix script says I got it right... I can probably shave a few more strokes, though, although I don't really have time right now. [Smile]

Enjoy!

Brian


LonkeroAdministrator
(KiX Master Guru)
2002-07-19 01:00 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

brian, does your script remove values correctly?
the golf kix says to my script it's ok but jens says something that also values marked for deletion needs to be deleted.


kholm
(Korg Regular)
2002-07-19 01:23 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Brian,

AHJ posted this
quote:
There is a typo in both the original Import2 posting and in the Zip file
The Import2\Subdirectory1 "Binary1" entry
contains this string ...,726f,... (missing ',')

And i have seen mentioned by Jens (The tournament master ) that this is by intend, AND it shouldn’t be imported.

If this has to be checked i wil have to add 20 points to my last scorechart.

Still no errorchecking, score is now: 908

I get a lot of 000000000000 on my screen AND the please post message

-Erik

ps.
Special for you Lonkero:
My script removes values as intended.


BrianTX
(Korg Regular)
2002-07-19 01:23 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Yes.. the ones marked for deletion are:

"name"=-

and [-HKLM\etc\etc\etc]

Mine deletes them fine.

I also get the 0000000, etc. message.

The golf.zip file I downloaded had no such error( nor the binary1 value even).. So, I didn't realize it was an issue.

P.S. It's a little hard to do this if there are different versions of the files...

Brian

[ 19 July 2002, 01:34: Message edited by: BrianTX ]


cj
(MM club member)
2002-07-19 07:07 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I reckon we should change the scoring system to give each command and variable a point each, rather than per length. The per length scoring system gives EXPANDENVIRONMENTVARS more points than GO for no reason.

To improve your score, you can make a UDF called A that contains your WRITEPROFILESTRING function and get a lower score. I think this goes against the whole concept/principle of golf by allowing a more complicated script to score better than a simpler one.

I propose that we change the scoring system to count keywords and variables instead, allowing a better indication of cleaner coding to show. This would also allow more meaningful variable names, increasing code readability.

my 2c
cj

[ 19 July 2002, 07:08: Message edited by: cj ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-19 07:18 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

erik, I think jens said that misspelled data does not have to be cared of.

this means two things:
the value may not get in.
the value may go in.

my script writes that value in just fine and I'm not going to drop it out and get 50 more hits by it.
as we don't need to make errorchecking or datavalidation of any type.


Howard Bullock
(KiX Supporter)
2002-07-19 08:26 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

cj, in your example "if you write a UDF 'A' and call it your get a lower score" is not correct. If you write a UDF, you have to include the code of that UDF as well.

[ 19 July 2002, 08:27: Message edited by: Howard Bullock ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-19 09:37 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

KixGolf score = 828

sh*t!
adding the delvalue code added 43 strokes!!! [Mad] (reference 785 from post "posted 17 July 2002 00:13" at page 4)

not funny anymore [Frown] [Frown] [Frown]

let's get some coffee and smoke a cigarette and find out what the heck is wrong...


kholm
(Korg Regular)
2002-07-20 12:24 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

CJ, I agree.

Counting varnames as one point would also make the use of $ alone as varname obsolete.

It would also be nice if decaring vaiables using Dim and Global were free. Right now i’m making a script that breakes all my own principles. I use nondescriptive varnames and reuse varibles for different purposes, which i would never do ’in the real world’

The backside of imlying new rules is that it wil be very difficult to count the points.

As for the function idea for long command names, i belive that if you have to use writeprofilestring more than 3 times in your script you would start to improve your score by creating a function for it.

-Erik

ps.
My score is now: 878 (And the script is nearly impossible to understand)


LonkeroAdministrator
(KiX Master Guru)
2002-07-19 01:03 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

cutting characters is not easy anymore.
KixGolf score = 823

{edit}
make that:
KixGolf score = 813

now:
KixGolf score = 811

now I can go again for cigarette:
KixGolf score = 805

came back took some coffee and:
KixGolf score = 801

[ 19 July 2002, 13:59: Message edited by: Lonkero ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-19 02:49 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I think I should start working now.

anyway, got some magic here:
KixGolf score = 799

{edit}
oh...
I forgot to parse one line...
KixGolf score = 786

[ 19 July 2002, 14:57: Message edited by: Lonkero ]


Sealeopard
(KiX Master)
2002-07-19 06:06 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I like the scoring system as is because it challanges you to think differently ('Think outside the bun', Taco Bell commercial), now it's not about beautiful code, or self-explanatory code. It's about optimizing as much functionality into a single line as possible. Of course, this also makes it harder to read/understand the script, but that's part of the challange.

BrianTX
(Korg Regular)
2002-07-19 06:23 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Somehow I seem to stay 100 behind you Lonkero.. I'm only at 893 so far.. [Smile] (Of course, I've only been working on this for a couple days!)

Brian

[ 19 July 2002, 18:24: Message edited by: BrianTX ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-19 06:33 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

brian, now you know how it felt with golf III! [Razz]

man, I've been so happy at work after I got it under 800...
I'm like flying.


BrianTX
(Korg Regular)
2002-07-19 08:21 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I'm only down to 888.. so far... [Smile]
{edit}
869
{edit}
861
{edit}
853.. It's getting harder to make smaller...
{edit}
840
{edit}
829
{edit}
814 -- 30 more to go. lol.. for now.
{edit}
808
{edit}
798

Brian

[ 19 July 2002, 21:40: Message edited by: BrianTX ]


BrianTX
(Korg Regular)
2002-07-19 09:56 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Ok... I have successfully shaved it down to:

773

I don't know if I can save any more strokes, but this is where it stands so far!

Brian
{edit}
766

[ 19 July 2002, 22:37: Message edited by: BrianTX ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-19 10:25 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

bastard. I tell my mom!

I have to change my logic if I want to cut more than 2 strokes!!!!

ok, let's put up a fight.

laptop, on...


kholm
(Korg Regular)
2002-07-19 10:49 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I'm looking forward to see the winning script.

I gave up at about 1200 i thougt, anyway i have tweaked it to 848 now, so i'm still in the medals [Wink]

-Erik


BrianTX
(Korg Regular)
2002-07-19 10:51 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I bet Howard will surprise us and post a nice score just before time's up... [Smile]

Brian

P.S. Now at 761.

{edit}
756
{edit}
753

{edit}
I can get it to 749, but I'm not going to unless challenged... (It appears I'm being challenged! lol)

[ 19 July 2002, 23:13: Message edited by: BrianTX ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-19 10:52 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

has anyone heard about hoby?
haven't got his current score...


LonkeroAdministrator
(KiX Master Guru)
2002-07-19 10:58 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

ok, got it to 773 but you have made it already lower...

continuing...

{edit}
760

[ 19 July 2002, 23:12: Message edited by: Lonkero ]


BrianTX
(Korg Regular)
2002-07-19 11:17 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I wish I didn't have to handle array input.. it would shave about 50 strokes.. maybe get me under 700. [Smile]

Brian
{edit}
now at 748.. should I quit, yet, Jooel?
{edit}
744
{edit}
740

Question to Jens:

I have assumed there will be no \'s in values.
I have also assumed there will be no errors in values.
I have also assumed there will be nothing like "="="hi" for registry entries.

For the purposes of this competition, are these assumptions okay?

Brian

{edit}
Assuming there are no "=" in the registry keys, I have shaved my score to 736.

Brian

[ 19 July 2002, 23:46: Message edited by: BrianTX ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-19 11:35 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I need a manual...

kholm
(Korg Regular)
2002-07-19 11:41 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Last improvement 61 [Eek!]

Now at 787

Can i do that again ???

-Erik


BrianTX
(Korg Regular)
2002-07-19 11:51 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Ok. I'm stopping at 736.. I don't see anything to do.. tired of scratching my head. Maybe I'll check back later to see if anyone has cracked that. Otherwise, I'm done! [Smile]

Brian


LonkeroAdministrator
(KiX Master Guru)
2002-07-20 12:40 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I did reorganize the whole thing...

I mean structurally it was whole new case.
quess what score I got?
760, the one I had before and it was even harder to understand it!


LonkeroAdministrator
(KiX Master Guru)
2002-07-20 01:54 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

heh.
I did change one keyword and got it to 759.

then parsed my code other way around and parsed and parsed and final was 759!


**DONOTDELETE**
(Lurker)
2002-07-20 02:19 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I hope I won't get laughed at for saying 842
(removed error checking after downloading new test files)


BrianTX
(Korg Regular)
2002-07-20 02:53 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I won't laugh at ya. I used a few tricks to get it down to 736... [Smile] Pity me if I didn't figure out those few tricks! [Smile]

Brian


LonkeroAdministrator
(KiX Master Guru)
2002-07-20 03:04 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I was just going to reply something similar but then some bloody woman took my attension...

brian is a leader now... really clearly and he was today at same score as you.

if I remember correctly, I was never over 828 so I should be able also to parse my code...

to something like 600 but I'm not.

you having under 900 is already a great victory as jens has not got under 1000 even though he is the host!


kholm
(Korg Regular)
2002-07-20 03:04 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

No laughing,

I'm down/up to 779 now and at the end of the rope.

Keep up trying, i'm getting curious to see the result.

-Erik

[ 20 July 2002, 03:08: Message edited by: kholm ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-20 04:15 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I tried with some case stuff and it got me up to 8??

so, if you're using it, with other means you might come closer...
or even ahead of me.


LonkeroAdministrator
(KiX Master Guru)
2002-07-20 02:15 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

I've tried after trying...
I can't cut even 1 out of 759


Howard Bullock
(KiX Supporter)
2002-07-20 02:32 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Sorry guys. I am dissappointment this go around. I thought I was going to to have a respectable score with my approach but hit some M$ limitations or just lack of knowledge of the M$ implimentation of my selected approach. and damn those long WSH object names.

C:\Data\Scripts\Golf>C:\Data\Kix2001\KiX2001.410\kix32 golf5a.kix

check for all registry keys Errors:0
check for registry value types in import1:0
check for registry value types in import2:0
check for registry value types in import3:0
check for registry values in import1:0
check for registry values in import2:0
check for registry values in import3:0
The UDF ImportRegFile passed the validation test.
Please do not forget to post your KiXtart Golf score.

KixGolf score = 918

I am still looking for that magic edit....


LonkeroAdministrator
(KiX Master Guru)
2002-07-20 08:19 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

heh...
been fighting with this stuff all day.
got of 3

score is 756

{edit}
2 hours got 753
just can't cut it more...
I quess brians winned this time too.

[ 20 July 2002, 21:05: Message edited by: Lonkero ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-20 09:21 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

ok... at 750 I start to think about what jens said that he can't end this part one.

I think this goes on until someone opens the part 2

and I'll keep parsing my code...

{edit}
737

{edit2}
KixGolf score = 735

[ 20 July 2002, 22:33: Message edited by: Lonkero ]


BrianTX
(Korg Regular)
2002-07-20 10:47 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

You actually got it to 735?

[Smile]

Brian


LonkeroAdministrator
(KiX Master Guru)
2002-07-20 10:51 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

yep...
have been with my laptop from morning...
10 hours...

but, score is now 734


BrianTX
(Korg Regular)
2002-07-20 11:12 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Hmm.. well, umm.err. i'm down to .. umm. err. 730!

Brian


BrianTX
(Korg Regular)
2002-07-20 11:35 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Ok... scratch that... I'm actually down to.....

716

Can you squeak any more, Lonkero? [Smile]

Brian


BrianTX
(Korg Regular)
2002-07-20 11:58 PM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

It looks like time is up as of right now. My score is 716. I'm going to create a new topic and post my UDF..

Brian


cj
(MM club member)
2002-07-22 10:00 AM
Re: New KiXtart Golf Challenge! (extended to Saturday, July 20, 6pm EST )

Howard, What Erik says is true. Making a UDF of a long named command only gives you a benefit when you use the command more than 3 or so times.

eg:

code:
$=writeprofilestring("c:\filename", "section", "key", "value")
$=writeprofilestring("c:\filename", "section", "key", "value")
$=writeprofilestring("c:\filename", "section", "key", "value")
$=writeprofilestring("c:\filename", "section", "key", "value")

scores 236

versus

code:
function a($section, $key, $value)
$=writeprofilestring("c:\filename", $section, $key, $value)
endfunction
a("section", "key", "value")
a("section", "key", "value")
a("section", "key", "value")
a("section", "key", "value")

scores 202

each line in the first program scores 59, so after 3 of them, the UDF becomes more economical.

Erik, it would be harder, but not impossible, to make a script to count. I wrote a script that converts KiX code to coloured HTML by doing a lookup of the valid KiX commands. It is too old to use now, but the principle is sound.

KiX uses space and CRLF as command separators, so using SPLIT with these 2 as delimiters makes parsing a KiX script relatively easy...

cj