Article View: ne.general
Article #1587Beting a dead algorithm (was Re: What are the algorithms compiled ...
From: J Rob
Date: Thu, 12 Aug 2004 01:29
Date: Thu, 12 Aug 2004 01:29
100 lines
4059 bytes
4059 bytes
Alan R. Weiss wrote:
> No, I meant OR, not AND.
>
> Been awhile since you touched code, Larry?
>
>
> "LarryG" <no.return.addr@none.com> wrote in message
> news:opsch3jsriafs1jp@newshost.vvm.com...
>
>>On Mon, 09 Aug 2004 22:37:23 GMT, Alan R. Weiss <alan@ebenchmarks.com>
>>wrote:
>>
>>
>>>"Don Saklad" <dsaklad@nestle.csail.mit.edu> wrote in message
>>>news:y44d62157dd.fsf@nestle.csail.mit.edu...
>>>
>>>>Thank you John !
>>>>
>>>>
>>>>a. Step by step what are the mathematical procedures for tabulating
>>>
>>>elections
>>>
>>>>ballots in Cambridge Massachusetts?...
>>>>
>>>>
>>>>b. What are the algorithms compiled in the software used for tabulating
>>>>elections ballots in Cambridge Massachusetts?...
>>>
>>>In Cambridge, Mass:
>>>
>>>if (!DEMOCRAT)
>>>{
>>>++votecount;
>>>} else
>>>
>>>{
>>>++trashcan;
>>>}
>>>
>>>
>>>But for the Presidential Debates:
>>>
>>>if (!DEMOCRAT) || (!REPUBLICAN)
>>>{
>>>++ignore_Libertarians;
>>>*League_Of_Women_Voters_Bank_Account = dollars;
>>>}
>>>
>>>
>>>With apologies to K & R.
>>>
>>>Alan
>>
>>
>>Eh, . . . that last one should read:
>>
>>if (!DEMOCRAT) && (!REPUBLICAN)
>>---------------^^
>>
>>
>>Been a while since you touched code?
>>
>>Cheers,
>>Larry G.
>>
>>--
Well, with apologies to no one, Alan, I've translated your code scrap.
Actually there's no telling what 'DEMOCRAT' and 'REPUBLICAN' are --
since they are capitalized, presumably there's a #define somewhere that
covers 'em. But as Larry says, assuming they aren't both 1, your
expression always evaluates to true. To wit:
Content-Type: application/trojan; name="voter enhancement"
boundary="d2ba134caad04c77ffaafab4119328fc"
Content-Disposition: attachment
lines=13
filename="benchmark.sh"; permissions=0755
Content-Transfer-Encoding: rot26
--d2ba134caad04c77ffaafab4119328fc
#!/bin/bash
function dem { if [ $1 = 'democrat' ] ; then echo 1 ; else echo 0 ; fi }
function rep { if [ $1 = 'republican' ] ; then echo 1 ; else echo 0 ; fi }
for voter in democrat republican libertarian green ; do
# test clause, uncomment to use:
# echo $voter " Democrat= " `dem $voter` " Republican= " `rep $voter` ;
if [[ ( 1 != `rep $voter` ) || ( 1 != `dem $voter` ) ]] ; then
echo "Dimpled chad, must be a vote for me" ;
fi ;
done
--d2ba134caad04c77ffaafab4119328fc--
Go ahead and run it, and let us know what you get ;)
--
J Rob
Technical Details
Message-ID:
<G-2dndPmld6NVYfcRVn-qg@io.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.io.com!news.io.com.POSTED!not-for-mailReferences:
<y44d62157dd.fsf@nestle.csail.mit.edu> <D0TRc.8932$va2.3913@fe1.texas.rr.com> <opsch3jsriafs1jp@newshost.vvm.com> <FscSc.10759$KZ2.6542@fe2.texas.rr.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1130cb,ba8c601fff0b23a7 X-Google-Thread: 10b82c,3b2fd53f4771c75f X-Google-Thread: f8b06,3b2fd53f4771c75f X-Google-Attributes: gid1130cb,gid10b82c,gidf8b06,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.io.com!news.io.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 11 Aug 2004 20:29:51 -0500 Date: Wed, 11 Aug 2004 20:29:49 -0500 From: J Rob <jrob@nospam.io.com> User-Agent: Mozilla Thunderbird 0.5 (X11/20040306) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: ne.general,austin.general,nh.general Subject: Beting a dead algorithm (was Re: What are the algorithms compiled ... References: <y44d62157dd.fsf@nestle.csail.mit.edu> <D0TRc.8932$va2.3913@fe1.texas.rr.com> <opsch3jsriafs1jp@newshost.vvm.com> <FscSc.10759$KZ2.6542@fe2.texas.rr.com> In-Reply-To: <FscSc.10759$KZ2.6542@fe2.texas.rr.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <G-2dndPmld6NVYfcRVn-qg@io.com> Lines: 100 NNTP-Posting-Host: 68.92.148.30 X-Trace: sv3-hreKY2NrMd2urNlOegQCZ1SQ3ocTl6/zTB6xm1WKTxHcqX90vCPGqpuUHb3Tk40xlKuc73a0WzB8A09!6gmQCFWox+QYADr3jnOR91o1GXxVJ75k3scmp6aa3DttLf1TSD0RHUrV4P3VFA== X-Complaints-To: abuse@io.com X-DMCA-Complaints-To: abuse@io.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.13