HDTenEightyP/NetNews huggingface dataset:
From: jnomina@bgsu.edu (Aqualung)
Newsgroups: comp.programming
Subject: OCR Algorithms
Date: 9 Apr 92 08:58:39 GMT
Organization: Bowling Green State University B.G., Oh.


Hi.

     I'm programming for our Biology Department here in
Bowling Green State University, where we're doing
electron-microscope research on the contents of
chromosomes.  Sounds awsome, huh?  I don't know all
of the specifics, I just write the programs...  ;-)

     To delve a little deeper, I'm currently plotting
locations and distances of suspended 'stuff' in these
images we're getting from the 'scope.  My next step is
going to be a little more complicated, however.  Without
going into all the details, I will soon be in need of some
OCR algorithms (optical character recognition), in order
to be able to say what each and every island of suspended
'stuff' looks like.  Horseshoe up, horseshoe down, hollow
circle, solid rectangle, etc...  You get the idea.  And you
can also see where it could be a form of OCR.

     If anyone knows of any P.D. OCR algorithms floating
around or has any, preferably in a structured language
such as 'C' or Pascal (but I'll darn well take whatever
I can get!), could you please e-mail them to me, or let
me know where I might find them.

Thank you.

Jim Nomina
Undergrad.--C.S.
Junior
From: sra@ecs.soton.ac.uk (Stephen Adams)
Newsgroups: comp.programming
Subject: Re: functions & return values (was Re: Reinventing the wheel)
Date: 11 Apr 92 13:58:47 GMT
	<3595@caslon.cs.arizona.edu>
Organization: Southampton University Computer Science
In-reply-to: dave@cs.arizona.edu's message of 11 Apr 92 01:23:08 GMT

In article <3595@caslon.cs.arizona.edu> dave@cs.arizona.edu (Dave Schaumann) writes:

> I'm probably opening up another can of worms, but I don't think this is a good
> idea.  What is the purpose of this feature?  Seems like a rather extreme measure
> (not to mention bizarre and possibly ambiguous syntax) just to be able to write
> The Perfect Swap Macro...
> 
> The Right Way (TM, IMHO) to address this problem is to start by redefining the
> preprocessor.  If you let the preprocessor have access to the symbol table, you
> can define swap as something like
> 
>   #define SWAP( a, b ) { TYPEOF(a,b) tmp ; tmp = a ; a = b ; b = tmp ; }
> 
> (yeah, I know this should really be do{ ... }while(0))
> 
> Notice how TYPEOF() has a potential of being useful beyond a very limited
> context.  Also, giving the preprocessor access to the symbol table means you
> can have pre-defined macros like __FUNCTION__ (and __CLASS__ in C++).

I do not think that suggesting redefining the C preprocessor
is the right way to go.  The C preprocessor has alway been
an unsatisfactory tool for this kind of thing---what happens
if I use SWAP(tmp,x) in my program?

C++ and some other languages support parametric
polymorphism, which means that you can write a piece of code
with a type as a `parameter'.  In C++ this is done with
templates:

	template<class T>
	inline void swap(T& a, T& b) {
	    T temp;
	    temp = a;  a = b;  b = temp;
	}

	int i=5, j=19;
	swap(i,j);	/* i==19, j==5*/
	float f=1.0,g=2.7;
	swap(f,g);	/* f==2.7, g==1.0 */

Ada had generic procedures which are similar but you have to
instantiate (create) each version that you use.
--
Stephen Adams                           Email: S.R.Adams@ecs.soton.ac.uk
Electronics and Computer Science        Tel: 0703 593649
University of Southampton               Fax: 0703 593045 
Southampton  SO9 5NH,  UK
Newsgroups: comp.programming
From: pharr-matthew@CS.YALE.EDU (Matthew Pharr)
Subject: Re: Names
Organization: Yale University Computer Science Dept., New Haven, CT 06520-2158
Date: Mon, 13 Apr 1992 03:33:51 GMT

I write:
>
>I have seen occastional reference to 'the Hungarian Notation,' and
>from what I remember it's awfully weird stuff, although it does seem 
>to have its fanatics... Does anyone out there have any references on it?
>

and then solved the problem myself... Sorry to waste the bandwidth on something
that a simple 'archie' could have solved, but if anyone else is interested,
ftp to qusuna.qucis.queensu.ca, and get 'hungarian' from /pub/software-eng...

matt
From: stephen@estragon.uchicago.edu (Stephen P Spackman)
Newsgroups: comp.programming
Subject: Re: Perfect hash summary....
Date: 6 Apr 92 00:06:53 GMT
Organization: University of Chicago CILS

This may seem like an odd question, but does anyone have a USE for
minimal perfect hashing? The "obvious" one, in programming languages,
is somewhat bogus, since in that case you have a symbol table anyway,
and it's faster and easier just to treat keywords like identifiers
through until the parser (unless, I suppose, your language has really
different rules for the two classes so that the lexer is better off
making the discimination).

The only application I can remember was for storing information
associated with the textual words in a static database, but getting a
minimal perfect hash code for 400,000 distinct words is itself a
trick....

So I guess my question, has anyone out there used them in practise, in
a case where in retrospect it was clearly the best route?
----------------------------------------------------------------------
stephen p spackman         Center for Information and Language Studies
stephen@estragon.uchicago.edu                    University of Chicago
----------------------------------------------------------------------
Newsgroups: comp.programming
From: bill@Celestial.COM (Bill Campbell)
Subject: Re: PERL - what for?
Organization: Celestial Software, Mercer Island, WA
Date: Sat, 04 Apr 1992 20:05:48 GMT

In <1992Mar28.065710.20877@wheaton.wheaton.edu> gmribeir@wheaton.edu (Glauber) writes:

>Can someone enlighten me about PERL ?

>What does it do? Is it a pattern scanning language AWK-like? If so,
>what's it's intended use? Is it faster or slower than AWK?

>Thanks a lot for any info.

I've a few additions to the comments I've seen in response to
this posting.

Perl combines the features of the shell programming, sed, awk with
full access to functions and systems calls normally available only
with C programs allowing Real Work to be done on a site without a
C compiler.

A major advantage is that it doesn't spawn new processes for each
operation.

The regular expression syntax is uniform and an extension of the
normal egrep, regexp(3) including \s for space, \S for non-space,
\d for digit, \D for non digit...  This is much easier to
remember than which regex to use for sed, awk, grep...

Simple use of [ngc]dbm data files.  database access is done like
an associative array, and in fact a program can be converted from
an array to dbm by the simple addition of an opendbm() call
before referencing the array.

access to opendir, readdir... at a script level.

Perl is portable.  The same scripts will run on most platforms
without change.  It even runs on program loaders like MS-DOS.

Perl can be ugly or pretty depending on the programmer (if you
want to see ugly code, look inside many FSF programs --
obfuscation by random indentation :-).

Bill
-- 
INTERNET:  bill@Celestial.COM   Bill Campbell; Celestial Software
UUCP:   ...!thebes!camco!bill   6641 East Mercer Way
             uunet!camco!bill   Mercer Island, WA 98040; (206) 947-5591
SPEED COSTS MONEY -- HOW FAST DO YOU WANT TO GO?
Newsgroups: comp.programming
From: mab@wdl39.wdl.loral.com (Mark A Biggar)
Subject: Re: Programming Standards Question
Organization: Loral Western Development Labs
Date: Tue, 14 Apr 1992 18:43:43 GMT

In article <1992Apr14.173248.9363@src.honeywell.com> koontz@iasdv1.iasd.honeywell.com writes:
>Some colleagues and I were recently discussing proposed coding
>standards that should be checked for when doing code reviews.
>As a reference, we were using a list that someone had obtained
>from some book on Software Engineering.  One of the items on
>the list said that for code reviews one thing that should be 
>checked is the use of "negative Boolean logic".  It was stated
>that "negative Boolean logic" should not be used in order to 
>aid maintainability.  At this point, the group was divided on
>what was exactly meant by "No negative Boolean logic".  Does
>anyone have any idea what this means and how it applies to 
>increased maintainability?

I believe that this is doing something like:

if (some complex condition) 
	; /* do nothing */
else {
	...	/* some complex list of statements */
}

This is usualy done when a programmer (falsely) believes that the "complex
condition" is easier to write than its negation.   The other way this shows
up is after maintence when there used to be something in the then part but
it has gone away and the maintence programmer was too lazy to reform the
if statement the other way.  In any case this is a BAD programming practice.

--
Mark Biggar
mab@wdl1.wdl.loral.com
From: eriksea@carson.u.washington.edu (Erik Seaberg)
Newsgroups: comp.programming
Subject: keywords in the symbol table? (Re: Perfect hash summary....)
Keywords: symbol table keyword lexical
Date: 9 Apr 92 02:49:22 GMT
Article-I.D.: u.1992Apr9.024922.24759
Organization: University of Washington

stephen@estragon.uchicago.edu (Stephen P Spackman) writes:
>*WHY* do people want a lexer that picks up keywords?

IMHO, a lexer shouldn't know anything about symbol tables.  It doesn't
have anything useful to enter in one except "this identifier has been
mentioned by name."  And most all of the information in a symbol table
entry doesn't apply to keywords ("if" doesn't have a type or scope).  A
parser uses keywords to delimit large constructs; they don't have to look
like identifiers - I think it makes a lot of sense to give the lexer its
own fast little table to screen out keywords (if they happen to look like
identifiers) and leave the more expensive symbol table lookups for when
they're necessary, and keep the symbol table(s) internal to the parser.
-- 
This does not represent the views of Advanced Systems Technologies,
Computing and Communications, or the University of Washington.  But
I can hope.                 Erik Seaberg <eriksea@u.washington.edu>
  "If I want to see the sun rise, I'll put it on my background."
From: stephen@estragon.uchicago.edu (Stephen P Spackman)
Newsgroups: comp.programming
Subject: Re: Reinventing the wheel
Date: 9 Apr 92 01:44:08 GMT
	<PDS.92Apr2170934@lemming.webo.dg.com>
	<1992Apr08.115757.10212@ibmpcug.co.uk>
Organization: University of Chicago CILS

In article <1992Apr08.115757.10212@ibmpcug.co.uk> dylan@ibmpcug.co.uk (Matthew Farwell) writes:
|In article <PDS.92Apr2170934@lemming.webo.dg.com> pds@lemming.webo.dg.com (Paul D. Smith) writes:
|>
|>  * It *has* to be properly modularized, with well-defined interfaces
|>    even internally, and you *cannot* break the defined interface
|>    *anywhere*!  Be strong!  In the end the little speedup you gain by
|>    using that "undefined" feature will be more than taken up by the
|>    pain and torture you'll experience if you have to change the
|>    underlying functionality...  If there's a real need, rethink your
|>    interface a bit.
|
|I agree.  The only thing I don't like about this is doing stuff like
|having to return structures from functions around (in C).  I guess C++
|would help here.  It just seems ugly to pass back a
|{int foobar; char *blurf} instead of a base type.

Only because C doesn't support

	{foobar, blurf} = f(...stuff...);

which it should. Distinguishing in your mind between "basetypes" and
"the rest" is probably also a bad ide; you should use the type that
does the job cleanly and clearly. In general this is NOT as basetype,
becase the way C is defined they don't have strong semantic
guarantees; I certainly have always made a policy of using basetypes
only when interfacing with other people's (IMHO borken) routines.

If enough of us stop doing it the "easy way", maybe the NEXT round of
standardisation will fix some of the problems with doing it RIGHT....
----------------------------------------------------------------------
stephen p spackman         Center for Information and Language Studies
stephen@estragon.uchicago.edu                    University of Chicago
----------------------------------------------------------------------
Newsgroups: comp.programming
From: ucaa2385@ruscvx.rus.uni-stuttgart.de (Peter Hermann)
Subject: Re: Names
Organization: User ruscvx Comp.Center (RUS) University of Stuttgart, Germany
Date: Mon, 13 Apr 1992 10:37:48 GMT

look at "Ada Quality and Style"
guidelines for professional programmers
software productivity consortium
2214 Rock Hill Road
Herndon, Virginia 22070-4005
which is available via anonymous ftp 128.237.2.253
as a postscript document.
regards,
Peter Hermann
Newsgroups: comp.programming
From: vaccari@ghost.dsi.unimi.it (matteo vaccari)
Subject: Re: Names
Organization: Computer Science Dep. - Milan University
Date: Mon, 13 Apr 1992 10:03:08 GMT
Distribution: comp

aj3u@larch.cs.virginia.edu (Asim Jalis) writes:

>Do people have ideas on how to name entities in programs
>(local/global variables, functions, types etc): some sort of
>general guidelines.  I have seen some articles on the Hungarian
>notation and have developed some conventions of my own also.
>However, I remain unsatisfied with this and would like to get
>more opinions.  Clearly, this is a very subjective issue.

Apple has developed its own set of conventions for identifiers.
You can find a complete description in a document describing Apple
C++ style guidelines, that is in the Apple Developers CD-ROM,
and probably also ftp-able from ftp.apple.com. Sorry, I don't
remember the exact title of the document.

Anyway the idea in short is to prepend to identifiers a character 
that tells you what kind of identifier it is.

Global variables should start with 'g':
	gApplication, gOpenDocument, ...

Class names for C++ or Object Pascal start with 'T':
	TApplication, TList, ...

Constant names start with 'k':
	kMaxLength, kPi

Except for constants that are error codes, that start with 'e'
	eOutOfMemory

Member variable names for C++ or Object Pascal start with 'f':
	fListHead, fNext, ...


The case of the first char in a name is also meaningful:
	function names and types start with upper case
	variable and constant names start with lower case
	

These are minimal conventions. You are told nothing about what
to put in a name beyond that first character.  Anyway, I found
that they are very good to relieve a certain "name confusion"
that happens in large object oriented programs: when
you see the name of a variable being use in a member function, you never
know if it's a global variable, a member variable declared in the 
class of the object you are studying, or a member variable inherited
from parent classes, or a variable that is local to the function.
Often you have to do extensive research to find the place where the
name is defined.

Another useful thing that comes from these guidelines is that it makes
easier to invent names for related things: e.g. if you declare a class
that has one only (global) instance, you call the class TFoo and the variable
gFoo.

Sorry about the C++ terminology -- but I think it is becoming quite
common.

Matteo
From: eletanjm@nuscc.nus.sg (Tan Jin Meng @ NUS)
Newsgroups: comp.programming
Subject: Re: Multi-tasking kernel
Date: 11 Apr 92 12:26:28 GMT
Article-I.D.: nuscc.1992Apr11.122628.2131
Organization: National University of Singapore

cmdorat@tc.fluke.COM (Richard Kowalsky) writes:
: Hi,  I would like to learn more about embedded multi-tasking operating
: systems and to that end, I would like to to play arround with one on
: this little generic 80186 project board I have.
: 

Why don't you write one yourself? You can in fact write a simple and
completely portable non preemptive multitasking kernel by just using the
standard C routines setjmp() and longjmp().

I fact, I vaguely remember such a project in one of the computere
magazines I've read. I think its Dr. Dobbs. Maybe you can look it up.

However, I honestly think that if this is educational, then you should
write your own. Its not difficult for a really basic one.
Newsgroups: comp.programming
From: burleigh@bronze.ucs.indiana.edu (Frank Burleigh)
Subject: Multiple types of things in linked lists
Keywords: linked lists multiple object types
Organization: IU, Bloomington
Distribution: na
Date: Thu, 9 Apr 92 03:11:37 GMT

 need ideas but must sketch out what I'm up to before I can ask...

I'm working on a PC application that allows a user to manipulate lists of
objects in separate windows.  Each list/window has a controlling structure
that records the type of object in the list, etc:

typedef struct LIST
{
WORD        Object;     /* type of objects in this list */
void        **Lst;      /* pointer to pointers [array approach) */
WORD        Current;    /* current item in list (array approach) */
void        *Head;      /* first item in list (LL approach) */
void        *CurrentN;  /* current item in list (LL approach) */
void        (*wrF)();   /* function to display object */
...
} LIST;

Building a list is easy: malloc() a bunch of void pointers,

      LIST AList;
      AList.Lst=(void **)mallc(20*sizeof(void *));

and then malloc the items themselves as needed:

      AList.Lst[Current]=(void *)malloc(sizeof(SOME_OBJECT));

Navigation functions are easy because you only have to manipulate an array
index (Current) and pass that and AList.Lst to the function that writes the
object to the display.  A LIST holds a pointer to the write function to write
the type of object in the list.  Works well.

But now I'm thinking this whole strategy was a mistake: it's hard to insert
and delete items because the numbers of objects could vary wildly, which is
even more troublesome in the PC environment where memory is constrained. 
Yeah, that's the main drawback--sooner or later one of the realloc() calls for
AList.Lst is going to fail.

The logical step would seem to be linked lists.  This will facilitate adding
and deleting items but will:

1. make soring more difficult (how to sort linked lists);
2. references to a Prev and Next will be cumbersome if I want to continue to
have generic navigation functions that work on any list object type.

Right now, I need ideas on the second of these two points.  Suppose you have a
function to move to the next list object:

void moveNext(LIST *l)
{
      l->CurrentN=l->CurrentN->Next;  /* minimal, need to display etc */
}

That won't work because CurrentN in LIST is a void * and therefore you can't
get to *Next within the object pointed to by CurrentN.  Each nagivation func 
could have a switch{} with case()s that cast and dereference for each object
type handled by the program.  That would be ugly and bloat code.

The only solution I can think of is a general dereferencing function with this
switch{} with a case() for each possible cast, that'll return the Next pointer
to the calling navigation function.

Are there other options or approaches that I haven't thought of?


-- 
Frank Burleigh  burleigh@ucs.bronze.indiana.edu
USENET: ...rutgers!iuvax!bronze!burleigh   BITNET: burleigh@iubacs.BITNET
Department of Sociology, Indiana University, Bloomington, Indiana 47405
From: fisherc@bohra.cpg.oz.au (Craig Fisher)
Newsgroups: comp.programming
Subject: Re: The new international trade agreement...
Date: 9 Apr 92 05:14:30 GMT
Organization: Computer Power Software

In article <1992Apr7.213722.9003@mks.com> steven@mks.com (Steven White) writes:
> In article <1992Apr3.051942.27151@bohra.cpg.oz.au> you write:
>>There is another problem with this. How are we supposed to earn a living
>>writing software if we have to release everything into the public
>>domain??
>
> Perhaps by only putting out some of the algorithms that are likely
> to be patented, but not the application? After all, a significant
> program is likely to have a great many algorithms and massive support
> structures around these algorithms? Just enough for you can smirk and
> say 'prior art' to the patenter who comes by to annoy you. 
>
> I have to admit, there is a problem with programs that are based mainly
> on one algorithm, whose existence is the main advantage of your program.
> Then revealing it to others will cause other people to be able to match
> your products capabilities, even if the algorithm is just described, in
> a journal.  An example of this might be the new routing algorithm for
> your CAD program that is an order of magnitude faster.

Yeah, this was a large part of my concern. I work in an R&D area where
we develop products whose main competitive advantage comes from the
algorithms we develop. If we gave those away we'd be out of business.

Businesses in a lot of industries rely heavily on their trade secrets.
Somehow I can't imagine Kentucky Fried Chicken patenting their
'secret herbs and spices' chicken recipe! :-)

> Heh, The Secret Journal of Private Algorithms, that has a write only
> policy except where it comes to trash patents? :)

What we need is patent offices with people who understand the field,
enough to avoid 'trivial' things becoming patented.

-- 
=======================================================================
| Craig Fisher            | Computer Power Group | P.O. Box 686       |
| fisherc@bohra.cpg.oz.au | Canberra, AUSTRALIA  | Woden, ACT 2606    |
|- 3 is a random number. -|     "Ride the Wild Wind" - Queen, 1991    |
From: scc@rlgvax.Reston.ICL.COM (Stephen Carlson)
Newsgroups: comp.programming
Subject: Re: Programming Standards Question
Date: 16 Apr 92 00:10:19 GMT
Reply-To: scc@rlgvax.Reston.ICL.COM (Stephen Carlson)
Organization: International Computers Limited, Reston, Virginia, USA

In article <1992Apr14.173248.9363@src.honeywell.com> koontz@iasdv1.iasd.honeywell.com writes:
>Hi, I hope this is relevant to this newsgroup (I think it is).
>
>One of the items on
>the list said that for code reviews one thing that should be 
>checked is the use of "negative Boolean logic".  It was stated
>that "negative Boolean logic" should not be used in order to 
>aid maintainability.  At this point, the group was divided on
>what was exactly meant by "No negative Boolean logic".  Does
>anyone have any idea what this means and how it applies to 
>increased maintainability?

Basically, negative logic is the convention of setting 0 for truth and 1 (or
non-zero) for falsehood.  It is used in computer engineering to simplify the
logic of digital circuits.

This occasionally crops up in UN*X programming, too.  For example, the
access(2) system call returns 0 if it works and -1 if it fails.  Negative
logic.  It is most confusing when used in conjunction with an if statement:

	if (access("filename", 001))
		...;

The casual reader would likely get the wrong sense, causing him to overlook
a bug in the code or "fix" something that works.  Certainly both these cases
decrease maintainability.

P.S.  Explicitly testing those sytems calls against ERR (-1) converts them to
positive logic and is quite readable:

	if (access("filename", 001) != ERR)
		...;

-- 
Stephen Carlson           | ICL OFFICEPOWER Center    | In theory, theory and
scc@rlgvax.reston.icl.com | 11490 Commerce Park Drive | practice are the same.
..!uunet!rlgvax!scc       | Reston, VA  22091         |    (703) 648-3300
From: mnykanen@cs.Helsinki.FI (Matti Nykanen)
Newsgroups: comp.programming
Subject: SCCS & make
Summary: Does make get SCCS'ed .h headers?
Keywords: SCCS, make, C
Date: 10 Apr 92 11:41:28 GMT
Organization: University of Helsinki, Finland

The man entry on "make" states that it works with SCCS, i.e. when a file
is missing it tries to "SCCS get" a read-only copy for compilation
first. This works on C source files with suffix ".c" but *not* with
header files with suffix ".h". How could I correct this?
-- 

Internet: Matti.Nykanen@Helsinki.FI  Department of Computer Science
Voice:    +358 0 708 4207            University of Helsinki,Finland
From: dow@idtg.UUCP (Keith Dow)
Newsgroups: comp.programming
Subject: Re: How To Calculate Logarithm?
Date: 10 Apr 92 18:43:09 GMT
Distribution: comp
Organization: Integrated Device Technology, Santa Clara


A recent book on the "Standard C library" covers this in detail.