Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!falk From: falk@sun.uucp (Ed Falk) Newsgroups: comp.graphics Subject: Re: North America (5 of 5) Summary: try debugging your code Message-ID: <68580@sun.uucp> Date: 15 Sep 88 20:29:49 GMT References: <1202@cleo.SW.MCC.COM> <4064@umd5.umd.edu> Organization: Sun Microsystems, Inc. - Mtn View, CA Lines: 168 In article <4064@umd5.umd.edu>, jonnyg@umd5.umd.edu (Jon Greenblatt) writes: > [FLAME ON!!!!!!!] > blah blah blah.. Perhaps your data was corrupted. Perhaps you should debug your code before posting flames. I used this program to view the data: main() { float x1,y1,x2,y2 ; int iret ; openpl() ; erase() ; space(-1800,0,-600,900) ; while( (iret = scanf("%f %f %f %f",&x1,&y1,&x2,&y2)) == 4 ) line((int)(x1*10), (int)(y1*10), (int)(x2*10), (int)(y2*10)) ; closepl() ; printf("iret = %d\n",iret) ; } And was quite happy with the results. This program is linked to the unix plot library by the way; it's standard on suns, and probably most other unix systems too. It took me less time to write and debug this than it probably took you to post your flame. > Please don't ask me for the code I wrote, I threw it out. Netters I > would not waste your time using this data for anything other than system > bashing. I almost believed this, but thought I'd try it for myself anyway. Good thing too. For those who are interested, I'm including a short shell archive containing the program above and two programs to pack and the files into a more compact form. If you follow these steps: % bpack < ar1 > d1 % compress d1 % uuencode d1.Z d1.Z > d1.uu you reduce the space to about half and get something that can still be sent out to the net. Follow these steps at the other end to unpack: % touch d1.Z % chmod a+w d1.Z % uudecode < d1.uu % uncompress d1 % bunpack < d1 > ar1 Perhaps Mr. Peterson could be persuaded to post the rest of the map in a compressed form one section per week? I'd really appreciate seeing the rest of this data. Also, does anybody have political boundaries? #! /bin/sh # this is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh to create the files: # bpack.c # bunpack.c # convert.c # This archive created: Thu Sep 15 12:50:28 PDT 1988 by falk # # export PATH; PATH=/bin:$PATH # if test -f bpack.c then echo shar: will not over-write existing file bpack.c else echo shar: extracting 'bpack.c', 332 characters sed 's/^X//' > bpack.c <<'SHAR_EOF' X#include X Xmain() X{ X int iret ; X short out[8] ; X int count = 0 ; X X while( (iret = scanf("%hd.%hd %hd.%hd %hd.%hd %hd.%hd", &out[0],&out[1], X &out[2],&out[3],&out[4],&out[5],&out[6],&out[7])) == 8 ) X { X ++count ; X fwrite(out,sizeof(short),8,stdout) ; X } X X fprintf(stderr,"%d lines written, iret = %d\n",count,iret) ; X} SHAR_EOF len=`wc -c < bpack.c` if test $len != 332 ; then echo error: bpack.c was $len bytes long, should have been 332 fi fi # end of overwriting check if test -f bunpack.c then echo shar: will not over-write existing file bunpack.c else echo shar: extracting 'bunpack.c', 327 characters sed 's/^X//' > bunpack.c <<'SHAR_EOF' X#include X Xmain() X{ X int iret ; X short in[8] ; X int count = 0 ; X X while( (iret = fread(in,sizeof(short),8,stdin)) == 8 ) X { X ++count ; X printf("%hd.%3.3hd %hd.%3.3hd %hd.%3.3hd %hd.%3.3hd \n", X in[0],in[1],in[2],in[3],in[4],in[5],in[6],in[7]) ; X } X X fprintf(stderr,"%d lines written, iret = %d\n",count,iret) ; X} SHAR_EOF len=`wc -c < bunpack.c` if test $len != 327 ; then echo error: bunpack.c was $len bytes long, should have been 327 fi fi # end of overwriting check if test -f convert.c then echo shar: will not over-write existing file convert.c else echo shar: extracting 'convert.c', 268 characters sed 's/^X//' > convert.c <<'SHAR_EOF' Xmain() X{ X float x1,y1,x2,y2 ; X int iret ; X X openpl() ; X erase() ; X space(-1800,0,-600,900) ; X X while( (iret = scanf("%f %f %f %f",&x1,&y1,&x2,&y2)) == 4 ) X line((int)(x1*10), (int)(y1*10), (int)(x2*10), (int)(y2*10)) ; X X closepl() ; X X printf("iret = %d\n",iret) ; X} SHAR_EOF len=`wc -c < convert.c` if test $len != 268 ; then echo error: convert.c was $len bytes long, should have been 268 fi fi # end of overwriting check exit 0 -- -ed falk, sun microsystems sun!falk, falk@sun.com terrorist, cryptography, DES, drugs, cipher, secret, decode, NSA, CIA, NRO.