Re: Converting a string to a number by using INT (no hash method)

2013-01-23 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 10:40:39 μ.μ. UTC+2, ο χρήστης John Gordon έγραψε: > In Ferrous Cranus > writes: > > > > > May i sent you my code by mail so for you see whats wrong and > > > http://superhost.gr produces error? > > > > I tried going to that address and got some error output.

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread alex23
On Jan 23, 1:02 pm, Steven D'Aprano wrote: > How many days was he posting here, pretending to be dumber than a box of > hammers? How many hours have we collectively wasted, reading and replying > to his posts? Trying to find some positive in this: the people sincerely responding at least stretche

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 17:32:58 -0800, alex23 wrote: > On Jan 23, 2:40 am, Dave Angel wrote: >> Unless you constrain your users to very restrictive filenames, what you >> ask here simply cannot be done. > > He's also INSISTED in other threads that these files should be moveable > at will by other u

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread alex23
On Jan 23, 2:40 am, Dave Angel wrote: > Unless you constrain your users to very restrictive filenames, what you > ask here simply cannot be done. He's also INSISTED in other threads that these files should be moveable at will by other users and still be recognisable as the same file. So yes: trol

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread John Gordon
In Ferrous Cranus writes: > May i sent you my code by mail so for you see whats wrong and > http://superhost.gr produces error? I tried going to that address and got some error output. I noticed this in the error dump: 186 if cursor.rowcount == 0: 187 cursor

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Dave Angel
On 01/22/2013 03:30 PM, Leonard, Arah wrote: The perl code will produce the same hash for "abc.html" as for "bca.html" That's probably one reason Leonard didn't try to transliterate the buggy code. Actually, to give credit where it's due, it wasn't me. I just modified someone else's inter

RE: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Leonard, Arah
> The perl code will produce the same hash for "abc.html" as for "bca.html" > That's probably one reason Leonard didn't try to transliterate the buggy code. > Actually, to give credit where it's due, it wasn't me. I just modified someone else's interesting solution in this thread and added t

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Alan Spence
On 22 Jan 2013, at 19:28, Ferrous Cranus wrote: > Τη Τρίτη, 22 Ιανουαρίου 2013 9:02:48 μ.μ. UTC+2, ο χρήστης Michael Torrie > έγραψε: >> On 01/22/2013 11:37 AM, Ferrous Cranus wrote: >> >>> == pin = int( >> >>> htmlpage.encode("hex"), 16 ) % 1 >

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 9:02:48 μ.μ. UTC+2, ο χρήστης Michael Torrie έγραψε: > On 01/22/2013 11:37 AM, Ferrous Cranus wrote: > > > == pin = int( > > > htmlpage.encode("hex"), 16 ) % 1 > > > == > >

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Dave Angel
On 01/22/2013 01:37 PM, Ferrous Cranus wrote: == pin = int( htmlpage.encode("hex"), 16 ) % 1 == Can you please explain the differences to what you have posted opposed to this perl coding? ===

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Michael Torrie
On 01/22/2013 11:37 AM, Ferrous Cranus wrote: > == pin = int( > htmlpage.encode("hex"), 16 ) % 1 > == > > Can you please explain the differences to what you have posted > opposed to this perl coding? > >

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread John Gordon
In <592233bd-3fc1-4e13-97f8-e11f89fbb...@googlegroups.com> Ferrous Cranus writes: > > pin int( htmlpage.encode("hex"), 16 ) % 1 > > > > It'll give you your number, but there are no guarantees of uniqueness. > You're looking at more blind random luck using that. > Finally!! THANK YOU VER

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 7:24:26 μ.μ. UTC+2, ο χρήστης Leonard, Arah έγραψε: > > No need, to turn the number back to a path anymore, just the path to a > > number, to identify the specific .html page > > > > > > Can this be done? > > > > Guaranteed to be unique? Not even remotely possib

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 7:24:26 μ.μ. UTC+2, ο χρήστης Leonard, Arah έγραψε: > > No need, to turn the number back to a path anymore, just the path to a > > number, to identify the specific .html page > > > > > > Can this be done? > > > > Guaranteed to be unique? Not even remotely possib

RE: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Leonard, Arah
> No need, to turn the number back to a path anymore, just the path to a > number, to identify the specific .html page > > Can this be done? Guaranteed to be unique? Not even remotely possible. Even with a lookup table approach (which defeats your purpose of not storing the path) with 4 digit

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread D'Arcy J.M. Cain
On Tue, 22 Jan 2013 16:27:32 + "Leonard, Arah" wrote: > > I just need a way to CONVERT a string(absolute path) to a 4-digit > > unique number with INT!!! That's all i want!! But i cannot make it > > work :( Why bother? Just wish for a zillion dollars and then you never have to program again.

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 6:27:32 μ.μ. UTC+2, ο χρήστης Leonard, Arah έγραψε: > > I just need a way to CONVERT a string(absolute path) to a 4-digit unique > > number with INT!!! That's all i want!! But i cannot make it work :( > > > > > > And the best part is that "that" number must be able

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Dave Angel
On 01/22/2013 11:15 AM, Ferrous Cranus wrote: I just need a way to CONVERT a string(absolute path) to a 4-digit unique number with INT!!! That's all i want!! But i cannot make it work :( And the best part is that "that" number must be able to turn back into a path. This way i DON'T EVEN HAVE T

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Mark Lawrence
On 22/01/2013 16:15, Ferrous Cranus wrote: I just need a way to CONVERT a string(absolute path) to a 4-digit unique number with INT!!! That's all i want!! But i cannot make it work :( And the best part is that "that" number must be able to turn back into a path. This way i DON'T EVEN HAVE TO S

RE: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Leonard, Arah
> I just need a way to CONVERT a string(absolute path) to a 4-digit unique > number with INT!!! That's all i want!! But i cannot make it work :( > > And the best part is that "that" number must be able to turn back into a path. > > This way i DON'T EVEN HAVE TO STORE THE ACTUAL HTML PAGE'S ABSOL

Converting a string to a number by using INT (no hash method)

2013-01-22 Thread Ferrous Cranus
I just need a way to CONVERT a string(absolute path) to a 4-digit unique number with INT!!! That's all i want!! But i cannot make it work :( And the best part is that "that" number must be able to turn back into a path. This way i DON'T EVEN HAVE TO STORE THE ACTUAL HTML PAGE'S ABSOLUTE PATH