Page 1 of 1 1
Topic Options
#68607 - 2002-07-26 12:41 AM Results of the Kixtart Golf Tournament III
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Results of the Kixtart Golf Tournament III:

The task was to create a UDf that imports a couple of .REG files that were provided.

The tournament started out with some problems related to the .REG fiel export from Windows 2000 which resulted in Unicode-files that are not importable under Windows 9x/NT and not readable by KiXtart. Anyway, that one got fixed and new .REG files were provided.

It started out that Lonkero claimed that he's handicapped severly because he's drunk. Nevertheless, he performed pretty well even though he also encountered a short dry spell but I believe he got enough fluids to continue competing.

Results for the first part as of 22 July 2002 10:00:

Winning score for Lonkero!!

716 for BrianTX (does not count since he has additional '0' outputs and some registry keys are not imported [import1.reg])
734 for Lonkero
779 for Kholm (does not count since he has additional '0' outputs)
842 for AJH
918 for Howard Bullock

The second part consisted of optimizing the posted code and exchanging of ideas and coding tips. Pretty much everybody posted their code and Lonkero was the first one to improve his score from 734 down to 720.

Howard then improves his score from 918 down to 843 and then down to 840.

So, the final result is that Lonkero posted the most optimized score.

!! Therefore, Lonkero is a double-winner of the Kixtart Golf tournament. !!

The next KiXtart Golf tournament will most likey start on Saturday August 3rd.

[ 17. August 2002, 22:02: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#68608 - 2002-07-26 01:32 AM Re: Results of the Kixtart Golf Tournament III
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
I claime no position in the hall of fame [Wink] but:
I was wondering if any of you had noticed this:

I CAN shave 6 point of by this completely idiotic use of the split function:
I use: $=Split($a,'"')[1]
Instead of : $=SUBSTR($a,2,LEN($a)-2)

This is only useful if the string is surounded by a specific char, and you want to remove that, in this case ".

It is 6 chars shorter but as for speed ???

I published this in my script, but nobody seames to have noticed, not even Lonkero [Big Grin]

-Erik

Top
#68609 - 2002-07-26 01:56 AM Re: Results of the Kixtart Golf Tournament III
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Erik, I too used that construct in my final script, but not the same way.
C:\Data\Scripts\Golf>C:\Data\Kix2001\KiX2001.410\kix32 golf5b.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 = 822
code:
function ImportRegfile($)
Dim $A[4], $C, $D, $G, $i, $K, $N, $o
$o = createobject("VBscript.RegExp")
$o.Global = 1

if ubound($)<0
$=$,""
endif
for each $ in $
$=open(1,$)
do
$C=$C+ReadLine(1)+"`"
until @error
$=close(1)
next

$=join(split($C,"\` "),"")

$o.Pattern = '`\[(\-?)(.*?)\](?=`)|`"?([\w\- ]+)?@@?"?=("|.{3,6}\:)?(.*?)"?(?=`)'
for each $ in $o.Execute($)
for $i=0 to 4
$A[$i]=$.SubMatches($i)
next

if $A[1]
$K=$A[1]
if $A[0]
$=DelKey($K)
else
$=AddKey($K)
endif
else
;Add Values
$N=$A[2]
$D=$A[4]
for $i=0 to 5
if $A[3]=split('dword: hex: " hex(2): hex(7):')[$i]
$=$i
endif
next
if $=0
$D=val("&"+$D)
endif
for each $C in split($D,",")
if $=3 | $C>"00" & $=5
$i=execute('$C=Chr(&'+$C+')')
endif
$G=""+$G+$C
next
$D=$G
$G=""
if $=5
$D=join(split($D,'0000'),"|")
endif

;Write Value
if $D="-"
$=DelValue($K, $N)
else
$=WriteValue($K, $N, $D, "REG_"+split('DWORD BINARY SZ EXPAND_SZ MULTI_SZ')[$])
endif
endif
next
$ImportRegfile=0
exit 0
endfunction



[ 26 July 2002, 01:57: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#68610 - 2002-07-26 02:06 AM Re: Results of the Kixtart Golf Tournament III
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
kholm:

We found that out in one of the prior KiXtart Golf tournaments that you can address a specific element in the SPLIT array before assigning it to a variable.
So, yes, that's correct KiXtart syntax:
code:
$IP0=Split(@IPADDRESS0,'.')[0]

_________________________
There are two types of vessels, submarines and targets.

Top
#68611 - 2002-07-26 02:08 AM Re: Results of the Kixtart Golf Tournament III
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
jens, I don't accept your double winning stuff...
I'm bitter.
I did code under 700 (68?) which works and brians 716 don't.

I can't see script doing in HKCU hive new subkey named:
-HKEY...

is going to passed as working even though it passed the validation script.

also, this is not III but IV

{edit}
went back to results and found that code of mine which had the same disfunctionality as brians except that it did not produce trash in the hive and KixGolf score was 687...

still bitter.

[ 26 July 2002, 02:20: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#68612 - 2002-07-26 02:27 AM Re: Results of the Kixtart Golf Tournament III
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You're right, Lonkero. I just went by the scores and forgot about the incorrect output in the script. I am going to correct the first post to reflect the new scores.

Sorry, but I'm not myself today (and yesterday, and..., actually for the last weeks [Frown] )

[ 26 July 2002, 03:02: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#68613 - 2002-07-26 02:28 AM Re: Results of the Kixtart Golf Tournament III
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I have nothing against Brian but to get off on a technicality with that -HKEY garbage... tsk tsk tsk.

So Jooel, where's that 68? score code?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#68614 - 2002-07-26 02:33 AM Re: Results of the Kixtart Golf Tournament III
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
les, it's on that solution(s) topic.

I'm not against brian either as he has done damn good job with the 2 last tournaments I have been envolved with.
and without he's mad coding, I would have not got into this sport at all!
_________________________
!

download KiXnet

Top
#68615 - 2002-07-26 02:35 AM Re: Results of the Kixtart Golf Tournament III
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
btw, jens...

what has made you that way for whole week?
sounds pretty bad...
_________________________
!

download KiXnet

Top
#68616 - 2002-07-26 02:52 AM Re: Results of the Kixtart Golf Tournament III
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I think it's working on too many things at the same time without having the feeling of moving forward with any of them. Additionally, my big boss is constantly calling me into his office a) while I eat lunch, b) 5 minutes before I want to go home, c) while I'm eating a snack before heading out to a 3 hour accounting class (6pm-9:30pm), d) while working on something where I need to concentrate and he's asking how to change that 'red' button on his desktop to a less bright 'red'.

Just a bad week [Frown]
_________________________
There are two types of vessels, submarines and targets.

Top
#68617 - 2002-07-26 02:59 AM Re: Results of the Kixtart Golf Tournament III
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
The issue with the '0' outputs was posted during the tournament as not desirable. Now, changing the posted functions to not spit out the '0' would still leave Lonkero in the lead. Additionally, Brian's script does not import the first .REG file at all if I paste his function into my validation code.

[ 26 July 2002, 02:59: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#68618 - 2002-07-26 03:01 AM Re: Results of the Kixtart Golf Tournament III
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I feel sorry for you.
one of our big boss'es came from holiday this monday and he just could not step into work without asking me everyday:
"jooel, how can this be that you IT-professionals clame that things work and nothing work!"
some unprintable words and I ask:
"what is wrong?"
he answers:
"like yesterday, my deskjet is too slow! make it faster."

hang on there buddy, it's almost weekend!

-
_________________________
!

download KiXnet

Top
#68619 - 2002-07-26 03:04 AM Re: Results of the Kixtart Golf Tournament III
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
jens, did you check your registry hives?
all the deleted keys produce -key_to_be_deleted in there somewhere...

{edit}
btw, not so bitter anymore [Big Grin]

[ 26 July 2002, 03:05: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#68620 - 2002-07-26 03:09 AM Re: Results of the Kixtart Golf Tournament III
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I hope the first post is now correct. I double-tested all scripts in the GOLF.KIX that was part of the downloadable ZIP package (and not importing the UNICODE import3_w2k.reg file) Brian's script definitely fails to import the first .REG file completely in addition to the '0' as output. And Erik (kholm) has the same '0' output problem.

I will have to be really careful when I write the next challenge that I put all the details in and be very precise as to what is allowed and what not.

Nevertheless, I think that everybody did an outstanding job with this coding.
_________________________
There are two types of vessels, submarines and targets.

Top
#68621 - 2002-07-26 03:10 AM Re: Results of the Kixtart Golf Tournament III
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
quote:
jens, did you check your registry hives?
all the deleted keys produce -key_to_be_deleted in there somewhere...

Not on my Windows 2000 machine [Confused]

At least not where they were supposed to be imported.
_________________________
There are two types of vessels, submarines and targets.

Top
#68622 - 2002-07-26 03:11 AM Re: Results of the Kixtart Golf Tournament III
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Jooel,
A long time ago I was working in a construction camp and every morning in the cookhouse everyone would complain about the eggs. After about a week the cook had about enough so when the cookhouse was filled up, he came charging out of the kitchen brandishing a cleaver (which he firmly embeded into a table) and shouted. "LISTEN HERE YOU FU%$@&%*! I DIDN'T LAY THESE FU%$@&%*! EGGS! I JUST COOK 'EM!" "IF YOU HAVE ANY COMPLAINTS, TAKE IT UP WITH THE CHICKEN!"

Tell your boss to take it up with the chicken.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#68623 - 2002-07-26 03:15 AM Re: Results of the Kixtart Golf Tournament III
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
les, I'll have to try that... and probably will [Big Grin]

jens, I had them on my w2k in the current user hive at the bottom level.
also brian said he had them.
_________________________
!

download KiXnet

Top
#68624 - 2002-07-26 03:17 AM Re: Results of the Kixtart Golf Tournament III
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Found them!

Weird [Confused]
_________________________
There are two types of vessels, submarines and targets.

Top
#68625 - 2002-07-26 03:24 AM Re: Results of the Kixtart Golf Tournament III
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
not weird...
if you look at the code, it creates them with addkey.
if you specify addkey without correct path, it's made in there.
this way if user makes something silly, not all system gets messed up.
_________________________
!

download KiXnet

Top
#68626 - 2002-07-28 01:23 AM Re: Results of the Kixtart Golf Tournament III
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
erik!
didn't find that your shortening method until now!
how foolish of me!
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 483 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.072 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org