Page 3 of 8 <12345>Last »
Topic Options
#105825 - 2003-10-14 02:46 AM Re: KiXgolf: PxMagic
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
I have to wonder where everybody else is? [Confused] Long weekend in the US for a lot of people and nobody want's to post a score?
_________________________
There are two types of vessels, submarines and targets.

Top
#105826 - 2003-10-14 02:48 AM Re: KiXgolf: PxMagic
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Maybe I posted too soon or too good of a score and everyone is running scared? [Confused]

[ 14. October 2003, 02:49: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#105827 - 2003-10-14 03:45 AM Re: KiXgolf: PxMagic
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Or they still try to figure out how to convert to BMP/GIF/JPG files? I assume you're using KiXforms or did you figure out the alternate way?
_________________________
There are two types of vessels, submarines and targets.

Top
#105828 - 2003-10-14 03:51 AM Re: KiXgolf: PxMagic
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Using KixForms...(First time). Had learn about and figure out how colors and palattes worked too.

After I think this approach has been tightened up sufficiently, I may explore alternative methods.

This was not that difficult of a task. It looked as though it would be very difficult at first (see my initial posts.) But after breaking it down into little pieces and attacking each pieces it all fell together nicely.

[ 14. October 2003, 04:31: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#105829 - 2003-10-14 04:11 AM Re: KiXgolf: PxMagic
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Good to hear that [Smile] Hope you had some fun with it, though.
_________________________
There are two types of vessels, submarines and targets.

Top
#105830 - 2003-10-14 04:18 AM Re: KiXgolf: PxMagic
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
If it wasn't fun, I would not have ripped through the issues and posted first. I just wanted to show that if a dummy like me with no image or KixForms experience could do it anyone could.

[ 14. October 2003, 04:32: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#105831 - 2003-10-14 08:46 AM Re: KiXgolf: PxMagic
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, some questionary on the rules (reading them now):
-do we need to verify that the file indeed is PxM image?
-what level of error reporting we need to have? I mean, do we need to check error after each pixel and stuff?
-do we need to check for open file handle or can we just open any handle?
-can there be whitespace in the file BEFORE the header?
-do we need to close anything? like can we leave the files open etc.
-how well we should scan the files for whitespace?
as example, the feep-file could be 100k in size with a lot of whitespace in midst of it. should we code around this?

[ 14. October 2003, 09:02: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#105832 - 2003-10-14 01:34 PM Re: KiXgolf: PxMagic
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Hopefully Jens will answer favorably to my position. I put the smarts and effort into the ability to read, understand, and render these files. Since his script does not check for any return codes or errors, I did not include that in my code. But the solution I provided should render any valid PxM (P1, P2, or P3) file.

Valid input produces valid output. Garbage in/Garbage out (my error checking).
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#105833 - 2003-10-14 02:23 PM Re: KiXgolf: PxMagic
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
quote:
k, some questionary on the rules (reading them now):
-do we need to verify that the file indeed is PxM image?

If it is not a PxM image then you can't display it and you might need to return an appropriate error code. Covered in the "Inputs & Outputs" section.
quote:

-what level of error reporting we need to have? I mean, do we need to check error after each pixel and stuff?

That is entirely up to you, however, the rules say, if you can't display it (for any reason) then an appropriate error code needs to be returned.
quote:

-do we need to check for open file handle or can we just open any handle?

Again, if you can't display the image, then return the error code
quote:

-can there be whitespace in the file BEFORE the header?

According to the file format defnition, the first two bytes of the file are the "magic identifyer" Px with 0<x<7.
quote:

-do we need to close anything? like can we leave the files open etc.

Whaty happens if I run 15 images through the test suite? [Razz]
quote:

-how well we should scan the files for whitespace?
as example, the feep-file could be 100k in size with a lot of whitespace in midst of it. should we code around this?

The way I read the PxM definitions, they alwasy talk about a single whitespace as delimiters as they never use the plural of whitespace in anything.
_________________________
There are two types of vessels, submarines and targets.

Top
#105834 - 2003-10-14 02:47 PM Re: KiXgolf: PxMagic
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
whitespace = blankS,tabS,crS,lfS

says my definition... though.
way or another, it's only about 20-30 strokes.
_________________________
!

download KiXnet

Top
#105835 - 2003-10-14 02:51 PM Re: KiXgolf: PxMagic
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
don't forget about those pesky comments that could appear most anywhere [Wink]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#105836 - 2003-10-14 02:56 PM Re: KiXgolf: PxMagic
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
oh, I took care about those [Big Grin]
_________________________
!

download KiXnet

Top
#105837 - 2003-10-14 02:58 PM Re: KiXgolf: PxMagic
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Oh, we have another playing teeing off. [Big Grin]

Per your MSN comments...I expect to see you score posted in an hour. [Wink]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#105838 - 2003-10-14 06:16 PM Re: KiXgolf: PxMagic
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
lol.
like commented to jens on msn, I wrote over my "logic" file.
instead of starting again, decided to take a rest.
maybe continue tomorrow then... never know.
_________________________
!

download KiXnet

Top
#105839 - 2003-10-14 07:10 PM Re: KiXgolf: PxMagic
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Bummer J'Lo. [Frown]

Sorry to hear that I am still in the lead. [Wink]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#105840 - 2003-10-14 08:19 PM Re: KiXgolf: PxMagic
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
it's sopranos time now but after it I will check if I can come up with something.
_________________________
!

download KiXnet

Top
#105841 - 2003-10-14 09:33 PM Re: KiXgolf: PxMagic
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Howard,

I thought you were not going to play this time around? Instead, it appears that you are playing with yourself. [Big Grin]
_________________________
Jack

Top
#105842 - 2003-10-14 09:38 PM Re: KiXgolf: PxMagic
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You know some times one does not have anything better to do. [Wink] [Big Grin]

[ 14. October 2003, 21:39: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#105843 - 2003-10-14 10:33 PM Re: KiXgolf: PxMagic
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hoby, not sure why your code is so fast.
my code reads the first file in for about 5 mins.
and that's just read man.
the stuff before parsing...
uhm. [Eek!]

oh and btw, I didn't code any error stuff in it as don't know what errors should be reported.
I obviously could report if diskspace is low or virtual mem has been partly used or such.
but not wanting to leave this stuff too dynamic thus don't do it at all untill it's properly specified what is appropiate error and what means might need

[ 14. October 2003, 22:35: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#105844 - 2003-10-15 12:15 AM Re: KiXgolf: PxMagic
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
debugging the code is basta.
add some debug line, wait 3 mins for the image to display and realize nothing there, make a change to debug output and run again...
when coding the basta didn't took more than an hour this has taken about 5 already [Frown]
_________________________
!

download KiXnet

Top
Page 3 of 8 <12345>Last »


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

Who's Online
0 registered and 700 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.075 seconds in which 0.026 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