Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Bonn Tipontipon
  Where is Bonn Tipontipon?
 Athens
 Greece
 Bonn Tipontipon
 To: Mz
  Where is Mz?
 Metro Manila
 Philippines
 Mz
 Tags
Subject: RE: hey im sorry! ;-)
Thread ID: 50259 Message ID: 50653 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Saturday, September 04, 2004 8:56:30 AM         
   


>
> hey sorry if you find me amusing! ;-) (actualy it sounds you don't he he)
>
> You quoted
> "With your 'easy and challenging solution', may I ask sir, how you'll be extracting the cases of matching recordIDs and fieldnames with different entries.
> "
>
> Ill give you some best info that I could give.
>
> by the way as you said "I just couldn't help but tell you to please grow up, be sensible, improve your grammar and try this formula:
> MoreAcceptable = YourMath + ShowMaturity + AwarenessOfExpressionsWhichMakesYouSoundSoNaiveAndUnprofessional"
>
> that is an advice and its up to me if i would swallow that or what. anyway thanks pal.
>
> however, sorry to say this, but if am not acceptable to you sorry, i am what i am and we are just like that. if i have offended your intellect,
> sorry aswell, the truth is there are people in this darn world that were just so good that they are not accepted because they were just darn
> good. anyway heres your soluation...


why so defensive, peter pan.


>
> --- cut here --->
>
>
> CREATE TABLE test1 ;
>   (vstr C(10), vdate D(8), vnum N(10,2), vcrc N(10))
>   
> CREATE TABLE test2 ;
>   (vstr C(10), vdate D(8), vnum N(10,2), vcrc N(10))  
> 
> *--- lets make a sample data --------
> SELECT test1
> APPEND BLANK
> REPLACE test1.vstr WITH '001', ;
>         test1.vdate WITH DATE(), ;
>         test1.vnum WITH 666.13
> 
> APPEND BLANK
> REPLACE test1.vstr WITH '002', ;
>         test1.vdate WITH DATE() + 1, ;
>         test1.vnum WITH 777.14
> 
> *--- hey do you wanna see their contents first ? ---
> BROW
>         
> SELECT test2        
> APPEND BLANK
> REPLACE test2.vstr WITH '001', ;
>         test2.vdate WITH DATE(), ;
>         test2.vnum WITH 666.13
> 
> APPEND BLANK
> REPLACE test2.vstr WITH '002', ;
>         test2.vdate WITH DATE() + 1, ;
>         test2.vnum WITH 555.69
> 
> *--- hey do you wanna see their contents first ? ---
> BROW
> 
> *--- then we apply a simple hash (this is summation) ----
> SELECT test1
> SCAN ALL
>   REPLACE test1.vcrc WITH GetCRC()
> ENDSCAN
> 
> *--- wanna c the contents with crc here ---
> brow
> 
> SELECT test2
> SCAN ALL
>   REPLACE test2.vcrc WITH GetCRC()
> ENDSCAN 
> 
> *--- wanna c the contents with crc here ---
> brow
> 
> 
> *-----------------------------------------------------------------------
> * Since the CRC is already computed, we could start comparing only the
> * first field that is the CODE or perhaps 2 or 3 fields, depending on
> * your key. The problem with the data alteration of other fields is that
> * you have to make all the necessary check of each field.
> *
> * The very reason I am presenting this is for security and to lessen the
> * leverage of computing each field (thats what i mean). Thus, the leverage
> * will be on every saved transaction. That is, whenever a record is save,
> * the checksum is computed.


That is, if you always assume that cases apply to new entries. What about existing data needed to be validated for discrepancies?

> *
> * Therefore, when you search thru the table, you only look for your first
> * field (that is if it is unique as you presumed). Otherwise if it is two
> * fields then you seach the 2 fields. Then you don't need to check all
> * the other fields since the CRC would be our way of checking... Thus
> * if the CRC are different with the same CODE (that is your first field),
> * the other contents was changed. 
> *
> * Thus, It minimize all your tedious task.
> *
> * The rest of the comparison is up to you (left as an exersice). Hey
> * this is spoon feeding if I give you all the meat.


Pardon me, I found your HASH brownies routine redundant since you could scan directly on the smaller table, seek matching records with uniqueID(s), compare the all fields with the other bigger table using FOR...ENDFOR, FCOUNT(), EVALUATE(FIELDS(field)), write the RECORD ID, FIELDNAMES with different entries into another file.

You actually got too excited promoting it and challenging your fellow cryptoanalyst, crackers, datadiddlerz, warez, wanabes that you missed the 'Can anyone help me please' phrase in the post.

> *
> * Have Fun!  MzRulez!
> *----------------------------------------------------------------------
> 
> 
> *============================================ internal procedure ===============================================
> PROCEDURE GetCRC
>   CAlias = ALIAS()
>   
>   AFIELDS(xxx)
>   
>   tfields = ALEN(xxx) / 18
>   
>   *--- findout what the fields are -----------------
>   MyLongStr = ''
>   FOR ictr = 1 TO tfields
>     vfldname = calias + '.' + xxx(ictr,1)
>     
>     *--- ignore our crcfield -----------
>     IF ALLTRIM(UPPER(xxx(ictr,1))) <> 'VCRC'
>       vfldtype = xxx(ictr,2)
>       DO CASE
>         CASE vfldtype = 'C'
>           MyLongStr = MyLongStr + &vfldname
>         CASE vfldtype = 'N'
>           MyLongStr = MyLongStr + TRANSFORM(&vfldname,'999,999,999.99')
>         CASE vfldtype = 'D'
>           MyLongStr = MyLongStr + DTOS(&vfldname)
>       ENDCASE 
>     ENDIF
>     
>   ENDFOR 
>   
>   *--- now we get the crc ---
>   MyCRC = 0
>   SLen = LEN(MyLongStr)
>   FOR Ictr = 1 TO SLen
>     MyCRC = MyCRC + (ASC(SUBSTR(MyLongStr,ICtr,1)) * ICtr)
>   ENDFOR
>   
>   RETURN mycrc
>   
> ENDPROC
> 
> 

>
> --- cut here --->



ENTIRE THREAD

Verify Records Posted by Satyapal Singh @ 8/31/2004 8:18:49 AM
RE: Verify Records Posted by Bernard Bout @ 8/31/2004 8:39:36 AM
RE: Verify Records Posted by Satyapal Singh @ 8/31/2004 10:32:48 AM
RE: Verify Records Posted by Boudewijn Lutgerink @ 8/31/2004 10:55:21 AM
RE: Verify Records Posted by Ken Blum @ 8/31/2004 4:10:53 PM
RE: Verify Records Posted by Boudewijn Lutgerink @ 9/2/2004 9:08:36 AM
the easiest way... Posted by Mz @ 9/3/2004 6:52:16 AM
RE: the easiest way... Posted by Bonn Tipontipon @ 9/4/2004 1:05:00 AM
hey im sorry! ;-) Posted by Mz @ 9/4/2004 5:36:21 AM
RE: hey im sorry! ;-) Posted by Bonn Tipontipon @ 9/4/2004 8:56:30 AM
RE: hey im sorry! ;-) Posted by Mz @ 9/4/2004 11:45:37 AM
RE: hey im sorry! ;-) Posted by Bonn Tipontipon @ 9/4/2004 11:49:43 AM
RE: hey im sorry! ;-) Posted by Mz @ 9/5/2004 7:58:21 AM
RE: hey i thought im sorry! ;-) Posted by Bonn Tipontipon @ 9/5/2004 11:05:42 PM
RE: hey i thought im sorry! ;-) Posted by Mz @ 9/6/2004 3:49:12 AM
Kabayan, Okay ba diyan. Posted by Rene Relucio @ 9/4/2004 7:46:38 AM
RE: Kabayan, Okay ba diyan. Posted by Bonn Tipontipon @ 9/4/2004 9:00:50 AM
RE: Kabayan, Okay ba diyan. ENGLISH PLEASE Posted by Boudewijn Lutgerink @ 9/4/2004 10:56:34 AM
RE: Kabayan, Okay ba diyan. ENGLISH PLEASE Posted by Bonn Tipontipon @ 9/4/2004 11:30:59 AM
RE: Kabayan, Okay ba diyan. ENGLISH PLEASE Posted by Rene Relucio @ 9/5/2004 8:58:55 AM
RE: Kabayan, Okay ba diyan. ENGLISH PLEASE Posted by Rene Relucio @ 9/4/2004 4:48:59 PM
RE: Fellow Countryman, is it ok there? Posted by Bonn Tipontipon @ 9/5/2004 11:17:09 PM
Here's a solution :-) Posted by aktayal @ 9/7/2004 10:24:02 AM