Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Ingres Topics / September 2008

Tip: Looking for answers? Try searching our database.

Django driver for Ingres project started

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris - 20 Sep 2008 00:16 GMT
I know there aren't that many Python users in this group... but......

If you have any interest in this, check out http://community.ingres.com/wiki/Django_1.0_Driver

Code is in SVN at http://code.ingres.com/apps/main/django/

It is too early yet to suggest using this driver (the test suite has a
number of failures) but if you want to help hack, the code is there. I
was able to create a demo application using inspectdb to generate a
quick model for the demodb airlines table. Ingres 9.1.1 partially
works with it but the admin interface does expect Unicode to integer
coercion to work so Ingres 9.2 is probably a better choice.

Chris
Martin Bowes - 23 Sep 2008 19:50 GMT
Hi All,

I'm currently implementing a verhoeff check digit calculator in the OME...and with a view to including it in the Opensource. What I'm proposing is:
There are three functions provided:
char = verhoeff_digit(varchar)
*        Calculates the verhoeff check digit for the given varchar input.
*        Using a varchar as input rather than integer allows the inclusion of leading zeroes.
*        The routine throws a wobbly if there are any non-numeric characters in the input.
*
int1 = verhoeff_valid(varchar)
*        Returns 1 (yes) or 0 (No), to indicate if the varchar input has a
*        valid verhoeff digit on the left (ie end) of the string.

varchar = verhoeff(varchar)
*        Return the varchar input with a verhoeff digit appended at the left (ie end).

I have validated my voerhoff_digit() against the numbers produced by the calculator in:
http://www.augustana.ab.ca/~mohrj/algorithms/checkdigit.html#verhoeff <http://www.augustana.ab.ca/~mohrj/algorithms/checkdigit.html#verhoeff>

What do people think of this? Do the function names make sense, seem reasonable to use?
For instance, some of the people at work have suggested that instead of verhoeff(), I should call that function verhoeff_append().

Also, in passing, I have heard that there is more than one verhoeff 'style' out there, and that they return different numbers. But I can't find a reference to these on wikipedia. Does anyone have any idea about the truth of this multiple style stuff?

Thanks in Advance,

Martin Bowes
--CELKO-- - 24 Sep 2008 17:16 GMT
>> What do people think of this?<<

Nice work.  You can do this in pure SQL via table look-up, but it is
awful.  I tried it when i wrote THINKING IN SETS.  Uggh!

>>  Do the function names make sense, seem reasonable to use? <<

Minor nit -- the current convention is "<verb>_<object>" name for code
modules, "computer_verhoeff()" or something might be better.

>> Also, in passing, I have heard that there is more than one verhoeff 'style' out there, and that they return different numbers. But I can't find a reference to these on wikipedia. Does anyone have any idea about the truth of this multiple style stuff? <<

I would guess "false" because you would need a group that had <= 10
elements to map to the digits and I think D-5 is the only one in that
range with the right properties.  However, if the number of elements
is increased, I don't know.
Martin Bowes - 25 Sep 2008 11:07 GMT
Hi Jim,

Thanks for the input. Doing that in SQL would have been an interesting
exercise!

FYI. I've changed the thing to be:
**    (char ) generate_digit((varchar )scheme, (varchar )string);
**         This generates the check digit on the string using the
nominated
**         scheme(verhoeff, Luhn and Luhn Mod N, etc)
**
**    (int1 ) validate_digit((varchar )scheme, (varchar )string);
**         Validates the string, returning 1 for yes and 0 for no.

In regards to the 'styles' of verhoeff, I've tracked down the source of
this to an algorithm in 'Numerical Recipes'. The essential difference
between that algorithm and the ones described in Wikipedia etc is:
(Numerical Recipes) k=ij[k][ ip[(c+2) % 10][7 &m++] ];
(mine) k = d[k][ F[7 & m++][atoi(&c)] ];

For some reason NR is adding 2 to each digit (c), and then modulo 10 to
get it to fit into their ip[10][8].

I'm in the process of setting up a trial of the NR algorithm against
mine to see if it actually produces different digits. I imagine it must.
In which case, I'll modify my code to accept an input of "verhoeff[N]"
where N is an offset, and code accordingly.

Marty

-----Original Message-----
From: info-ingres-bounces@kettleriverconsulting.com
[mailto:info-ingres-bounces@kettleriverconsulting.com] On Behalf Of
--CELKO--
Sent: 24 September 2008 17:17
To: info-ingres@kettleriverconsulting.com
Subject: Re: [Info-Ingres] verhoeff function for Ingres

>> What do people think of this?<<

Nice work.  You can do this in pure SQL via table look-up, but it is
awful.  I tried it when i wrote THINKING IN SETS.  Uggh!

>>  Do the function names make sense, seem reasonable to use? <<

Minor nit -- the current convention is "<verb>_<object>" name for code
modules, "computer_verhoeff()" or something might be better.

>> Also, in passing, I have heard that there is more than one verhoeff 'style' out there, and that they return different numbers. But I can't
find a reference to these on wikipedia. Does anyone have any idea about
the truth of this multiple style stuff? <<

I would guess "false" because you would need a group that had <= 10
elements to map to the digits and I think D-5 is the only one in that
range with the right properties.  However, if the number of elements
is increased, I don't know.

_______________________________________________
Info-Ingres mailing list
Info-Ingres@kettleriverconsulting.com
http://www.kettleriverconsulting.com/mailman/listinfo/info-ingres
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.