dbTalk Databases Forums  

[Info-Ingres] Insane user request...so why am I doing it?

comp.databases.ingres comp.databases.ingres


Discuss [Info-Ingres] Insane user request...so why am I doing it? in the comp.databases.ingres forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Martin Bowes
 
Posts: n/a

Default [Info-Ingres] Insane user request...so why am I doing it? - 10-29-2010 , 05:12 AM






Hi All,

I hope one day to develop a backbone...

I have a user request to make an OME function which mimics the quasi base64 encoding they are using on an old application.
That old application converts an integer4 into a char(5) by:
1. divide integer by 2
2. discard the most significant two bits. And break the remainder into 5 x 6 bit patterns.
3. Each 6 bits is used to key into the totally non MIME standard array of '0-9a-zA-Z.+'

In honour of that old application I have named these functions drug64() andundrug64().

So... select drug64(int4(336077308)) returns the char(5) field 'a113.'

At least drug64() was pretty damn easy to write...onto undrug64()! A part of me wants to call it cold_turkey64().

Martin Bowes

Reply With Quote
  #2  
Old   
Roy Hann
 
Posts: n/a

Default Re: [Info-Ingres] Insane user request...so why am I doing it? - 10-29-2010 , 06:48 AM






Martin Bowes wrote:

Quote:
Hi All,

I hope one day to develop a backbone...
It'd be nice if Ingres developed support for user-defined functions too,
because what you describe shouldn't require the OME sledge-hammer.

User defined functions was proposed as a sprint activity in 2009, so it
seems that someone thinks it ought not be too hard.

--
Roy

UK Ingres User Association Conference 2011 will be on Tuesday June 7 2011.
Put the date in your diary today.

Reply With Quote
  #3  
Old   
Martin Bowes
 
Posts: n/a

Default Re: [Info-Ingres] Insane user request...so why am I doing it? - 10-29-2010 , 07:26 AM



Hi Roy,

I know I've mentioned before that it'd be nice if it would be allowed for database procedures which return a single value to be called as if they were functions. If the function is essentially some simple SQL then why not...although what might happen if the function had a lot of table queries of its own is a very unpleasant thought. Caveat Emptor I suppose.

At least I've already got an extensive set of OME functions, so embedding an extra one is actually very easy. Its only the first one that's a bitch. At least we now have plenty of examples in the community wiki.

But for added fun in this particular case...the algorithm to encode an integer to the char(5) is not 'one to one' as it must first divide the number by 2. Ergo 2 integers can give the same string. But the decode function can only give one possible value...the even one. It appears that the old application knew from context whether the number should be odd or even and adjusted accordingly.

Marty

-----Original Message-----
From: Roy Hann [mailto:specially (AT) processed (DOT) almost.meat]
Sent: 29 October 2010 12:48
To: info-ingres (AT) kettleriverconsulting (DOT) com
Subject: Re: [Info-Ingres] Insane user request...so why am I doing it?

Martin Bowes wrote:

Quote:
Hi All,

I hope one day to develop a backbone...
It'd be nice if Ingres developed support for user-defined functions too,
because what you describe shouldn't require the OME sledge-hammer.

User defined functions was proposed as a sprint activity in 2009, so it
seems that someone thinks it ought not be too hard.

--
Roy

UK Ingres User Association Conference 2011 will be on Tuesday June 7 2011.
Put the date in your diary today.


_______________________________________________
Info-Ingres mailing list
Info-Ingres (AT) kettleriverconsulting (DOT) com
http://ext-cando.kettleriverconsulti...fo/info-ingres

Reply With Quote
  #4  
Old   
Martin Bowes
 
Posts: n/a

Default Re: [Info-Ingres] Insane user request...so why am I doing it? - 11-01-2010 , 04:54 AM



Hi Mark,

I agree with Benji Franklin on that one. The Turkey would have made an excellent symbol...its quirky, its unique, it'll sell to the kids.

Then again I still think that Oz should have adopted ACDC's Jailbreak as our National Anthem. I mean listen to the current national anthem...What sort of a word is 'girt' anyway?

Marty

-----Original Message-----
From: Mark R. Winston [mailto:winstonmr (AT) datavailable (DOT) com]
Sent: 30 October 2010 14:21
To: Martin Bowes
Subject: Re: [Info-Ingres] Insane user request...so why am I doing it?

On 10/29/2010 6:12 AM, Martin Bowes wrote:
Quote:
Hi All,
[snip]
At least drug64() was pretty damn easy to writeonto undrug64()! A part
of me wants to call it cold_turkey64().
You offend the honor of Turkey, good sir, with this reference. This
function should surely be called liverwurst64() or perhaps mince_meat64()

We, here across the pond, are partial to the Turkey, even considering it
as a candidate for our national symbol, for which the contemporary,
bitter irony is nothing less than...well, "ironical".



~~~~~~~~~~~~~~~~~~~~
Mark R. Winston
www.datavailable.com
~~~~~~~~~~~~~~~~~~~~

Quote:

Martin Bowes



_______________________________________________
Info-Ingres mailing list
Info-Ingres (AT) kettleriverconsulting (DOT) com
http://ext-cando.kettleriverconsulti...fo/info-ingres

Reply With Quote
  #5  
Old   
Chris
 
Posts: n/a

Default Re: Insane user request...so why am I doing it? - 11-01-2010 , 11:54 AM



On Oct 29, 5:26*am, Martin Bowes <martin.bo... (AT) ctsu (DOT) ox.ac.uk> wrote:
Quote:
Martin Bowes wrote:

Hi All,

I hope one day to develop a backbone...

It'd be nice if Ingres developed support for user-defined functions too,
because what you describe shouldn't require the OME sledge-hammer.
There is a community project (and release available) for "easy" OME
function, see http://community.ingres.com/wiki/PythonOmeFunctions

I've (still) not yet had chance to play with it but it takes away a
lot of the boiler plate code writing that OME needs. This was
something Tony Simpson contributed.

Chris

Reply With Quote
  #6  
Old   
Gorby
 
Posts: n/a

Default Re: [Info-Ingres] Insane user request...so why am I doing it? - 11-02-2010 , 12:07 AM



On 1/11/2010 9:24 PM, Martin Bowes wrote:
Quote:
Hi Mark,

I agree with Benji Franklin on that one. The Turkey would have made an excellent symbol...its quirky, its unique, it'll sell to the kids.

Then again I still think that Oz should have adopted ACDC's Jailbreak as our National Anthem. I mean listen to the current national anthem...What sort of a word is 'girt' anyway?

Marty

-----Original Message-----
From: Mark R. Winston [mailto:winstonmr (AT) datavailable (DOT) com]
Sent: 30 October 2010 14:21
To: Martin Bowes
Subject: Re: [Info-Ingres] Insane user request...so why am I doing it?

On 10/29/2010 6:12 AM, Martin Bowes wrote:
Hi All,
[snip]
At least drug64() was pretty damn easy to writeonto undrug64()! A part
of me wants to call it cold_turkey64().

You offend the honor of Turkey, good sir, with this reference. This
function should surely be called liverwurst64() or perhaps mince_meat64()

We, here across the pond, are partial to the Turkey, even considering it
as a candidate for our national symbol, for which the contemporary,
bitter irony is nothing less than...well, "ironical".



~~~~~~~~~~~~~~~~~~~~
Mark R. Winston
www.datavailable.com
~~~~~~~~~~~~~~~~~~~~



Martin Bowes



_______________________________________________
Info-Ingres mailing list
Info-Ingres (AT) kettleriverconsulting (DOT) com
http://ext-cando.kettleriverconsulti...fo/info-ingres


The aussie national anthem sounds a lot better when sung to the tune of
Jimmy Barnes "Working Class Man". Will Anderson (comedian) sang it. I
think you can find it on Youtube somewhere. It's a hoot!

Reply With Quote
  #7  
Old   
Martin Bowes
 
Posts: n/a

Default Re: [Info-Ingres] Insane user request...so why am I doing it? - 11-02-2010 , 02:34 AM



Quote:
The aussie national anthem sounds a lot better when sung to the tune of
Jimmy Barnes "Working Class Man". Will Anderson (comedian) sang it. I
think you can find it on Youtube somewhere. It's a hoot!
The 'Wierdies' did it to the tune of Gilligans Island.

And then did Gilligans Island to the tune of Advance Australia Fair.

Cracked me up at the time.

Marty

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.