From owner-freebsd-hardware Thu Apr 4 19:07:09 1996 Return-Path: owner-hardware Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id TAA05617 for hardware-outgoing; Thu, 4 Apr 1996 19:07:09 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id TAA05605 for ; Thu, 4 Apr 1996 19:07:02 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id NAA13354; Fri, 5 Apr 1996 13:03:18 +1000 Date: Fri, 5 Apr 1996 13:03:18 +1000 From: Bruce Evans Message-Id: <199604050303.NAA13354@godzilla.zeta.org.au> To: Brett_Glass@ccgate.infoworld.com, msmith@atrad.adelaide.edu.au Subject: Re: Some solutions to disk problems.... I think. Cc: hardware@FreeBSD.org, jkh@time.cdrom.com Sender: owner-hardware@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk >> Here's a suggestion. Write a function that performs simple string >> matching using a table of ten IDs. Write ten functions which each parse >> for these ID's. Compare the size of the two. Repeat the process for >> twenty, and so on. >I hope you are jesting! Only the most abysmal programmer would have to >write ten functions to replace ten table entries. You'll need the 10 entries at least in comments for checking. >Seagate alone has several HUNDRED model numbers. In my hard disk guide, >they go on for PAGES in fine print. And that's just one brand. Recognizing >substrings of different lengths, and knowing when to look for suffixes as >well as the corresponding CDC and Conner model numbers, will be key to >identifying drives efficiently. An interesting problem! :-) Given a telephone book sized list of model numbers, write an is_in_telephone_book(char const *s) function that is significantly smaller than the strings for the model numbers. If you don't want to simply use a (compressed) table of the entries, then you'd better start by writing test code to prove that there are no false positive or false negative matches. Bruce