Re: Python Greek mailing list [was Re: Why 'files.py' does not print the filenames into a table format?]

2013-06-16 Thread Ferrous Cranus
On 16/6/2013 1:33 μμ, Steven D'Aprano wrote: On Sun, 16 Jun 2013 11:28:00 +0300, Nick the Gr33k wrote: On 16/6/2013 8:06 πμ, Steven D'Aprano wrote: Nikos, Have you considered subscribing to this? http://mail.python.org/mailman/listinfo/python-greece [...] I prefer staying here but i can a

Re: A certainl part of an if() structure never gets executed.

2013-06-16 Thread Ferrous Cranus
On 16/6/2013 1:42 μμ, R. Michael Weylandt wrote: I believe you are mistaken. a here is not a pointer but variable, which is a memory location that stores value 6. b here is a pointer. It's value is the memory location of variable a which stores value 6. c here is just te same as a , a variabl

Re: Python Greek mailing list [was Re: Why 'files.py' does not print the filenames into a table format?]

2013-06-16 Thread Ferrous Cranus
On 16/6/2013 2:09 μμ, Mark Lawrence wrote: On 16/06/2013 11:57, Ferrous Cranus wrote: i did Steven that why i asked in the 1st place To post a message to all the list members, send email to python-gre...@python.org. this is not a valid nrewgroup name/ Not valid in the same way that supp

Re: A certainl part of an if() structure never gets executed.

2013-06-16 Thread Ferrous Cranus
On 16/6/2013 3:04 μμ, R. Michael Weylandt wrote: On Sun, Jun 16, 2013 at 12:06 PM, Ferrous Cranus wrote: I appreciate you've returned to your Ferrous Cranus persona for this interchange. It reminds me not to get hung up on concerns of futility... On 16/6/2013 1:42 μμ, R. Michael Wey

Re: A certainl part of an if() structure never gets executed.

2013-06-16 Thread Ferrous Cranus
On 16/6/2013 2:13 μμ, Jussi Piitulainen wrote: If, instead of the above, you have a = 6 b = a b = 5 you will find that b == 5 and a == 6. So b is not the same as a. Else one would have changed when the other changed. I would say that a and b are different variables. They had the same value, bri

Re: Why 'files.py' does not print the filenames into a table format?

2013-06-16 Thread Ferrous Cranus
On 16/6/2013 4:07 πμ, Nick the Gr33k wrote: On 16/6/2013 1:51 πμ, Chris Angelico wrote: On Sun, Jun 16, 2013 at 6:29 AM, Benjamin Schollnick wrote: cur.execute('''SELECT ID FROM counters WHERE url = %s''', page ) cur.execute('''INSERT INTO counters (url) VALUES (%s)''', page ) Sure, whoever w

Re: Why 'files.py' does not print the filenames into a table format?

2013-06-16 Thread Ferrous Cranus
On 16/6/2013 11:35 πμ, Nick the Gr33k wrote: On 16/6/2013 10:23 πμ, Denis McMahon wrote: On Sat, 15 Jun 2013 22:38:38 +0300, Nick the Gr33k wrote: PLEASE take a look, its not a huge code First, you need to start writing your code to less than 80 columns if you're going to keep posting it to

Re: Don't feed the troll...

2013-06-16 Thread Ferrous Cranus
On 17/6/2013 6:46 πμ, ru...@yahoo.com wrote: I could be wrong but I don't think Nikos is a pure troll -- someone motivated purely by provoking reaction and discord. He has a real website and his problems with Python seem like genuine problems many beginners have. He seems to have little knowledg

Re: Important features for editors

2013-07-04 Thread Ferrous Cranus
Στις 4/7/2013 9:40 μμ, ο/η Grant Edwards έγραψε: On 2013-07-04, ?? wrote: If you guys want to use it i can send you a patch for it. I know its illegal thing to say but it will help you use it without buying it. A new low. Now he's offering to help people steal others' work. Like y

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-04 Thread Ferrous Cranus
Στις 4/7/2013 11:08 μμ, ο/η Dennis Lee Bieber έγραψε: On Thu, 04 Jul 2013 13:38:09 +0300, ? declaimed the following: What character is 0xb6 anyways? It depends on the encoding... In EBCDIC it's unassigned. It's a paragraph mark in ISO-Latin-1 (ISO-8859-1). Apparently also a parag

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-04 Thread Ferrous Cranus
Στις 5/7/2013 3:06 πμ, ο/η Nobody έγραψε: On Thu, 04 Jul 2013 13:38:09 +0300, Νίκος wrote: So you are also suggesting that what gesthostbyaddr() returns is not utf-8 encoded too? The gethostbyaddr() OS function returns a byte string with no specified encoding. Python 3 will doubtless try to d

Re: crack a router passcode

2013-07-09 Thread Ferrous Cranus
Στις 9/7/2013 3:08 μμ, ο/η Neil Cerutti έγραψε: On 2013-07-09, saadharana wrote: I need to crack my router passcode to see what firmware it's running. There's a passcode set but I don't remember it and it's not written down anywhere. No you don't. If it's your router and you forgot the passwo

Re: crack a router passcode

2013-07-09 Thread Ferrous Cranus
Στις 9/7/2013 4:32 μμ, ο/η Chris Angelico έγραψε: On Tue, Jul 9, 2013 at 11:23 PM, Ferrous Cranus wrote: Could python somehow brute force http://192.168.1.1/login.php giving user and pass trying to guess the password? Could it be able to pass values to the input boxes of router's web

Re: crack a router passcode

2013-07-09 Thread Ferrous Cranus
Στις 9/7/2013 5:46 μμ, ο/η Dave Angel έγραψε: On 07/09/2013 10:26 AM, Ferrous Cranus wrote: Στις 9/7/2013 4:32 μμ, ο/η Chris Angelico έγραψε: On Tue, Jul 9, 2013 at 11:23 PM, Ferrous Cranus wrote: Could python somehow brute force http://192.168.1.1/login.php giving user and pass trying to

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-12 Thread Ferrous Cranus
Στις 12/7/2013 2:47 μμ, ο/η Wayne Werner έγραψε: On Thu, 4 Jul 2013, Νίκος Γκρ33κ wrote: Στις 4/7/2013 6:10 μμ, ο/η MRAB έγραψε: What do you mean "I don't know how to catch the exception with OSError"? You've tried "except socket.gaierror" and "except socket.herror", well just write "except OS

Forcing Python to detect DocumentRoot

2013-01-16 Thread Ferrous Cranus
When trying to open an html template within Python script i use a relative path to say go one folder back and open index.html f = open( '../' + page ) How to say the same thing in an absolute way by forcing Python to detect DocumentRoot by itself? -- http://mail.python.org/mailman/listinfo/pyt

Re: Forcing Python to detect DocumentRoot

2013-01-16 Thread Ferrous Cranus
Τη Τετάρτη, 16 Ιανουαρίου 2013 4:01:07 μ.μ. UTC+2, ο χρήστης Joel Goldstick έγραψε: > On Wed, Jan 16, 2013 at 8:51 AM, Ferrous Cranus wrote: > > When trying to open an html template within Python script i use a relative > path to say go one folder back and open index.html >

Re: Forcing Python to detect DocumentRoot

2013-01-17 Thread Ferrous Cranus
Document Root for me is /home/nikos/public_html Is where Apache store the user www files. How to tell it my using a variable? -- http://mail.python.org/mailman/listinfo/python-list

Re: Forcing Python to detect DocumentRoot

2013-01-18 Thread Ferrous Cranus
Τη Πέμπτη, 17 Ιανουαρίου 2013 5:14:19 μ.μ. UTC+2, ο χρήστης Joel Goldstick έγραψε: > On Thu, Jan 17, 2013 at 9:09 AM, Roy Smith wrote: > > In article <339d9d6d-b000-4cf3-8534-375e0c44b...@googlegroups.com>, > > > >  Ferrous Cranus wrote: > > > >

Re: Forcing Python to detect DocumentRoot

2013-01-18 Thread Ferrous Cranus
Τη Παρασκευή, 18 Ιανουαρίου 2013 3:28:10 μ.μ. UTC+2, ο χρήστης Joel Goldstick έγραψε: > DocumentRoot = os.environ['HOME'] + 'public_html' Yes, iam using this and it works. One last thing: my python script file is located at /home/nikos/public_html/addon_domain/cgi-bin/ How python is able to r

Uniquely identifying each & every html template

2013-01-18 Thread Ferrous Cranus
I use this .htaccess file to rewrite every .html request to counter.py # = RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^/?(.+\.html) /cgi-bin/counter.py?htmlpage=$

Re: Forcing Python to detect DocumentRoot

2013-01-18 Thread Ferrous Cranus
Yes, iam using this and it works. One last thing: my python script file is located at /home/nikos/public_html/addon_domain/cgi-bin/ How python is able to run the following statement? f = open( '/home/nikos/public_html/' + page ) which is clearly levels up of addon domain's DocumentRoot?

Re: Uniquely identifying each & every html template

2013-01-18 Thread Ferrous Cranus
Τη Παρασκευή, 18 Ιανουαρίου 2013 10:59:17 μ.μ. UTC+2, ο χρήστης John Gordon έγραψε: > Instead of inserting unique content in every page, can't you use the > document path itself as the identifier? No, i cannot, becaue it would mess things at later time when i for example: 1. mv name.html other

Re: Forcing Python to detect DocumentRoot

2013-01-19 Thread Ferrous Cranus
Τη Παρασκευή, 18 Ιανουαρίου 2013 11:34:05 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Sat, Jan 19, 2013 at 5:58 AM, Ferrous Cranus wrote: > > > Τη Παρασκευή, 18 Ιανουαρίου 2013 3:28:10 μ.μ. UTC+2, ο χρήστης Joel > > Goldstick έγραψε: > > > > > &

Re: Uniquely identifying each & every html template

2013-01-19 Thread Ferrous Cranus
Τη Σάββατο, 19 Ιανουαρίου 2013 12:09:28 π.μ. UTC+2, ο χρήστης Dave Angel έγραψε: > I don't understand the problem. A trivial Python script could scan > > through all the files in the directory, checking which ones are missing > > the identifier, and rewriting the file with the identifier adde

Re: Forcing Python to detect DocumentRoot

2013-01-20 Thread Ferrous Cranus
Τη Σάββατο, 19 Ιανουαρίου 2013 10:01:15 μ.μ. UTC+2, ο χρήστης Piet van Oostrum έγραψε: > Ferrous Cranus writes: > > > > > This is addon domain's counter.py snippet tried to load an image mail.png > > and failed because it ca

Re: Uniquely identifying each & every html template

2013-01-20 Thread Ferrous Cranus
Τη Σάββατο, 19 Ιανουαρίου 2013 11:32:41 μ.μ. UTC+2, ο χρήστης Dennis Lee Bieber έγραψε: > On Sat, 19 Jan 2013 00:39:44 -0800 (PST), Ferrous Cranus > > declaimed the following in > > gmane.comp.python.general: > > > We need to find a way so even IF: > > >

Re: Uniquely identifying each & every html template

2013-01-20 Thread Ferrous Cranus
Τη Σάββατο, 19 Ιανουαρίου 2013 11:00:15 π.μ. UTC+2, ο χρήστης Dave Angel έγραψε: > On 01/19/2013 03:39 AM, Ferrous Cranus wrote: > > > Τη Σάββατο, 19 Ιανουαρίου 2013 12:09:28 π.μ. UTC+2, ο χρήστης Dave Angel > > έγραψε: > > > > > >> I don't unde

Re: Uniquely identifying each & every html template

2013-01-21 Thread Ferrous Cranus
Τη Δευτέρα, 21 Ιανουαρίου 2013 9:20:15 π.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Mon, Jan 21, 2013 at 6:08 PM, Ferrous Cranus wrote: > > > An .html page must retain its database counter value even if its: > > > > > > (renamed && moved &&

Re: Uniquely identifying each & every html template

2013-01-21 Thread Ferrous Cranus
Τη Δευτέρα, 21 Ιανουαρίου 2013 11:31:24 π.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Mon, Jan 21, 2013 at 8:19 PM, Ferrous Cranus wrote: > > > This python script acts upon websites other people use and > > > every html templates has been written by diff

Re: Forcing Python to detect DocumentRoot

2013-01-21 Thread Ferrous Cranus
Τη Δευτέρα, 21 Ιανουαρίου 2013 2:33:22 μ.μ. UTC+2, ο χρήστης Dave Angel έγραψε: > On 01/21/2013 01:25 AM, Ferrous Cranus wrote: > > > Τη Σάββατο, 19 Ιανουαρίου 2013 10:01:15 μ.μ. UTC+2, ο χρήστης Piet van > > Oostrum έγραψε: > > >> Ferrous Cranus writes: > &g

Re: Uniquely identifying each & every html template

2013-01-21 Thread Ferrous Cranus
Τη Δευτέρα, 21 Ιανουαρίου 2013 2:47:54 μ.μ. UTC+2, ο χρήστης Joel Goldstick έγραψε: > This is trolling Ferrous.  you are a troll.  Go away Just because you cannot answer my question that doesn't make me a troll you know. -- http://mail.python.org/mailman/listinfo/python-list

Re: Uniquely identifying each & every html template

2013-01-21 Thread Ferrous Cranus
Τη Δευτέρα, 21 Ιανουαρίου 2013 2:56:24 μ.μ. UTC+2, ο χρήστης alex23 έγραψε: > On Jan 21, 7:19 pm, Ferrous Cranus wrote: > > > Renames and  moves are performed, either by shell access or either by > > cPanel access by website owners. > > > > These websites own

Re: Uniquely identifying each & every html template

2013-01-21 Thread Ferrous Cranus
Τη Δευτέρα, 21 Ιανουαρίου 2013 9:20:15 π.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Mon, Jan 21, 2013 at 6:08 PM, Ferrous Cranus wrote: > > > An .html page must retain its database counter value even if its: > > > > > > (renamed && moved &&

Re: Forcing Python to detect DocumentRoot

2013-01-21 Thread Ferrous Cranus
Ok i see its just a convention. Can you help on this: so we need to remove since the apache cant see to open it and let Python open it which we know it can because it has access to any system file the user has access too. httpd cannot open this file because the location of the image is past

Re: Uniquely identifying each & every html template

2013-01-21 Thread Ferrous Cranus
Τη Δευτέρα, 21 Ιανουαρίου 2013 10:48:11 μ.μ. UTC+2, ο χρήστης Piet van Oostrum έγραψε: > Ferrous Cranus writes: > > > > > This python script acts upon websites other people use and every html > > > templates has been written by different methods(notepad++,

Re: Uniquely identifying each & every html template

2013-01-21 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 6:04:09 π.μ. UTC+2, ο χρήστης Tim Roberts έγραψε: > Ferrous Cranus wrote: > > > > > >Renames and moves are performed, either by shell access or either by cPanel > >access by website owners. > > > > > >That being said

Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Hello, i decided to switch from embedding string into .html to actually grab the filepath in order to identify it: # = # open current html template and get the page ID number # ===

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
# == # produce a hash based on html page's filepath and convert it to an integet, that will be uses to identify the page itself. # == pin = int( hashlib.md5( htmlpage ) ) I just tried that but it pro

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
# # produce a hash string based on html page's filepath and convert it to an integer, that will then be used to identify the page itself #

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 2:29:21 μ.μ. UTC+2, ο χρήστης Dave Angel έγραψε: > On 01/22/2013 07:02 AM, Ferrous Cranus wrote: > > > # > > >

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 2:47:16 μ.μ. UTC+2, ο χρήστης Ferrous Cranus έγραψε: > Τη Τρίτη, 22 Ιανουαρίου 2013 2:29:21 μ.μ. UTC+2, ο χρήστης Dave Angel έγραψε: > > > On 01/22/2013 07:02 AM, Ferrous

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 3:04:41 μ.μ. UTC+2, ο χρήστης Steven D'Aprano έγραψε: > What do you expect int("my-web-page.html") to return? Should it return 23 > or 794 or 109432985462940911485 or 42? I expected a unique number from the given string to be produced so i could have a (number <=>

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 4:33:03 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Wed, Jan 23, 2013 at 12:57 AM, Ferrous Cranus > wrote: > > > Τη Τρίτη, 22 Ιανουαρίου 2013 3:04:41 μ.μ. UTC+2, ο χρήστης Steven D'Aprano > > έγραψε: > > > > > &g

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 5:05:49 μ.μ. UTC+2, ο χρήστης Dave Angel έγραψε: > On 01/22/2013 09:55 AM, Ferrous Cranus wrote: > > > Τη Τρίτη, 22 Ιανουαρίου 2013 4:33:03 μ.μ. UTC+2, ο χρήστης Chris Angelico > > έγραψε: > > >> On Wed, Jan 23, 2013 at 12:57 A

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Thank you but the number needs to be a 4-digit integer only, if its to be stored in the database table correctly. pin = int( htmlpage.encode("hex"), 16 ) I just tried whayt you gace me This produces a number of: 140530319499494727...677522822126923116L Visit http://superhost.gr to see that dis

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 5:25:42 μ.μ. UTC+2, ο χρήστης Peter Otten έγραψε: > Ferrous Cranus wrote: > > > > > I insist, perhaps compeleld, to use a key to associate a number to a > > > filename. Would you help please? > > > > > > I dont know

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

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 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: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 6:55:02 μ.μ. UTC+2, ο χρήστης John Gordon έγραψε: > In Ferrous Cranus > writes: > > > > > 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 ma

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 6:23:16 μ.μ. UTC+2, ο χρήστης Leonard, Arah έγραψε: > > Thank you but the number needs to be a 4-digit integer only, if its to be > > stored in the database table correctly. > > > > Okay, I think we need to throw the flag on the field at this point. What > you're

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 7:33:00 μ.μ. UTC+2, ο χρήστης rusi έγραψε: > On Jan 22, 8:59 pm, 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 m

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 6:11:20 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Wed, Jan 23, 2013 at 2:59 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!! Bu

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 9:02:48 μ.μ. UTC+2, ο χρήστης Michael Torrie έγραψε: > On 01/22/2013 11:37 AM, Ferrous Cranus wrote: > > > == pin = int( > > > htmlpage.encode

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 9:16:34 μ.μ. UTC+2, ο χρήστης Peter Otten έγραψε: > Ferrous Cranus wrote: > > > > > Τη Τρίτη, 22 Ιανουαρίου 2013 6:11:20 μ.μ. UTC+2, ο χρήστης Chris Angelico > > > έγραψε: > > > > >> all of it. You are asking somethi

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

Re: Uniquely identifying each & every html template

2013-01-23 Thread Ferrous Cranus
Τη Τετάρτη, 23 Ιανουαρίου 2013 1:55:07 π.μ. UTC+2, ο χρήστης Michael Torrie έγραψε: > You refuse to use a database in a way that it was designed to be used. > > If you're unwilling to identify a file based on name, path, and > > contents, then you're only solution is to use a database to associ

Re: Uniquely identifying each & every html template

2013-01-23 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 11:08:57 μ.μ. UTC+2, ο χρήστης Dennis Lee Bieber έγραψε: > On Mon, 21 Jan 2013 22:49:31 -0800 (PST), Ferrous Cranus > > declaimed the following in > > gmane.comp.python.general: > > > > > You are right, it cannot be done. >

Re: Uniquely identifying each & every html template

2013-01-23 Thread Ferrous Cranus
Τη Τετάρτη, 23 Ιανουαρίου 2013 11:37:29 π.μ. UTC+2, ο χρήστης alex23 έγραψε: > On Jan 23, 7:12 pm, Ferrous Cranus wrote: > > > They are getting frustrated because they do not want to follow the logic > > i'am imposing. > > > > No, it's because yo

Converting a number back to it's original string (that was hashed to generate that number)

2013-01-23 Thread Ferrous Cranus
Now my website finally works as intended. Just visit the following links plz. -- 1. http://superhost.gr 2. http://superhost.gr/?show=log 3. http://i.imgur.com/89Eqmtf.png (this displays the database's column 'pin',

Re: Uniquely identifying each & every html template

2013-01-23 Thread Ferrous Cranus
Τη Τετάρτη, 23 Ιανουαρίου 2013 2:03:51 μ.μ. UTC+2, ο χρήστης Joel Goldstick έγραψε: > On Wed, Jan 23, 2013 at 5:29 AM, Ferrous Cranus wrote: > > Τη Τετάρτη, 23 Ιανουαρίου 2013 11:37:29 π.μ. UTC+2, ο χρήστης alex23 έγραψε: > > > > On Jan 23, 7:12 pm, Ferrous Cranus wrote:

Re: Converting a number back to it's original string (that was hashed to generate that number)

2013-01-23 Thread Ferrous Cranus
Please DON'T tell me to save both the pin <=> filepath and associate them (that can be done by SQL commands, i know) I will not create any kind of primary/unique keys to the database. I will not store the filepath into the database, just the number which indicates the filepath(html page). Also no

Re: Converting a number back to it's original string (that was hashed to generate that number)

2013-01-23 Thread Ferrous Cranus
Τη Τετάρτη, 23 Ιανουαρίου 2013 3:58:45 μ.μ. UTC+2, ο χρήστης Dave Angel έγραψε: > On 01/23/2013 08:38 AM, Ferrous Cranus wrote: > > > Please DON'T tell me to save both the pin <=> filepath and associate them > > (that can be done by SQL commands, i know) > &

Re: Using filepath method to identify an .html page

2013-01-23 Thread Ferrous Cranus
Τη Τετάρτη, 23 Ιανουαρίου 2013 5:25:36 μ.μ. UTC+2, ο χρήστης Michael Torrie έγραψε: > On 01/23/2013 12:25 AM, Ferrous Cranus wrote: > > > > > > Using that method ABC.html and CBA.html now have different values > > > because each letter position's val

Re: Using filepath method to identify an .html page

2013-01-23 Thread Ferrous Cranus
Τη Τετάρτη, 23 Ιανουαρίου 2013 6:33:11 μ.μ. UTC+2, ο χρήστης Leonard, Arah έγραψε: > > "his quote string is Cyrillic"? > > > > > > If you're referring to the "Τη Τρίτη, 22 Ιανουαρίου 2013 6:23:16 μ.μ. > > > UTC+2, ο χρήστης Leonard, Arah έγραψε", that's Greek. > > > > > > Cyrillic or not,

mysql solution

2013-01-24 Thread Ferrous Cranus
# insert new page record in table counters or update it if already exists try: cursor.execute( '''INSERT INTO counters(page, hits) VALUES(%s, %s) ON DUPLICATE KEY UPDATE hits = hits + 1''', (htmlpage, 1) )

Re: mysql solution

2013-01-24 Thread Ferrous Cranus
Τη Πέμπτη, 24 Ιανουαρίου 2013 1:25:20 μ.μ. UTC+2, ο χρήστης Lele Gaifax έγραψε: > Ferrous Cranus writes: > > > > > I;am now convinced the hash solution isn't reversible and also isn't > > > unique. > > > > Great! > > > > >

Re: mysql solution

2013-01-24 Thread Ferrous Cranus
column 'pin' is an 5-digit integer auto_increment primary key. What i want is to insert a new record or update the existing one, if 'pin' column's value exist. The following statement fails. [code] cursor.execute( '''INSERT INTO counters(page, hits) VALUES(%s, %s) RETURNING (pin)

Re: mysql solution

2013-01-24 Thread Ferrous Cranus
Τη Πέμπτη, 24 Ιανουαρίου 2013 1:16:51 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Thu, Jan 24, 2013 at 10:04 PM, Ferrous Cranus > wrote: > > > I;am now convinced the hash solution isn't reversible and also isn't unique. > > > I'am trying the data

Re: mysql solution

2013-01-24 Thread Ferrous Cranus
Τη Πέμπτη, 24 Ιανουαρίου 2013 3:37:24 μ.μ. UTC+2, ο χρήστης Lele Gaifax έγραψε: > How? What's the error message/traceback? REURNING is not a correct mysql syntax thats why it produces errors. > If, as Chris said, MySQL does not support the “RETURNING” syntax, you > > cannot use that. I gave two

Re: mysql solution

2013-01-24 Thread Ferrous Cranus
Τη Πέμπτη, 24 Ιανουαρίου 2013 5:39:54 μ.μ. UTC+2, ο χρήστης Lele Gaifax έγραψε: > UPDATE visitors > >SET visitors.hits=visitors.hits+1, > >visitors.useros=%s, > >visitors.browser=%s, > >visitors.date=%s > > WHERE visitors.pin=(SELECT counters.pin > >

Re: mysql solution

2013-01-25 Thread Ferrous Cranus
Τη Πέμπτη, 24 Ιανουαρίου 2013 10:43:59 μ.μ. UTC+2, ο χρήστης Dennis Lee Bieber έγραψε: > On Thu, 24 Jan 2013 03:04:46 -0800 (PST), Ferrous Cranus > > declaimed the following in > > gmane.comp.python.general: > > > > > # insert new page record in table counters

Re: mysql solution

2013-01-26 Thread Ferrous Cranus
Τη Παρασκευή, 25 Ιανουαρίου 2013 11:56:44 μ.μ. UTC+2, ο χρήστης Dennis Lee Bieber έγραψε: = #find the visitor record for the (saved) cID and current host cur.execute('''SELECT * FROM visitors WHERE counterID = %s and host = %s

Formatting a column's value output

2013-01-26 Thread Ferrous Cranus
try: cur.execute( '''SELECT URL, hits FROM counters ORDER BY hits DESC''' ) except MySQLdb.Error, e: print ( "Query Error: ", sys.exc_info()[1].excepinfo()[2] ) else: data = cur.fetchall() for

Re: Formatting a column's value output

2013-01-26 Thread Ferrous Cranus
Τη Σάββατο, 26 Ιανουαρίου 2013 8:04:12 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Sun, Jan 27, 2013 at 4:51 AM, Ferrous Cranus wrote: > > > print ( " %s > > " % item ) > > > > > > > > In the aboce c

Re: Formatting a column's value output

2013-01-26 Thread Ferrous Cranus
Τη Σάββατο, 26 Ιανουαρίου 2013 8:04:12 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Sun, Jan 27, 2013 at 4:51 AM, Ferrous Cranus wrote: > > > print ( " %s > > " % item ) > > > > > > > > In the aboce c

Re: Formatting a column's value output

2013-01-27 Thread Ferrous Cranus
Τη Κυριακή, 27 Ιανουαρίου 2013 12:26:44 π.μ. UTC+2, ο χρήστης Michael Torrie έγραψε: > A tuple is one method for passing variables into the string formatter. > > So if you need to display something twice, just put in two "%s" in the > > format string, and pass it the same variable twice. Yes i

Re: Formatting a column's value output

2013-01-27 Thread Ferrous Cranus
Τη Κυριακή, 27 Ιανουαρίου 2013 11:08:15 π.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Sun, Jan 27, 2013 at 8:04 PM, Ferrous Cranus wrote: > > > Okey, so far BUT i want the url linking to happen only for the URL column's > > value, and not for the hits column too.

Re: datetime question

2013-11-12 Thread Ferrous Cranus
Στις 8/11/2013 11:11 μμ, ο/η Νίκος Αλεξόπουλος έγραψε: Is there someway to write the following line even better with the ability to detect daylight saving time by itself so i don't have to alter the line manually when time changes? lastvisit = ( datetime.utcnow() + timedelta(hours=2) ).strftime(

Re: datetime question

2013-11-12 Thread Ferrous Cranus
s_dst("Europe/Kiev") : diff = 2 else: diff = 3 return diff lastvisit = (datetime.utcnow() +timedelta(hours=dst_greece())).strftime( '%y-%m-%d %H:%M:%S' ) On 12 November 2013 10:15, Ferrous Cranus mailto:nikos.gr...@gmail.com>> wrote:

Re: To whoever hacked into my Database

2013-11-12 Thread Ferrous Cranus
Στις 11/11/2013 11:36 πμ, ο/η Νίκος Αλεξόπουλος έγραψε: Στις 6/11/2013 5:25 μμ, ο/η Νίκος Γκρ33κ έγραψε: Okey let the hacker try again to mess with my database!!! He is done it twice, lets see if he will make it again! I'am waiting! I can't believe your ignorance. You're actually telling a h

Re: datetime question

2013-11-12 Thread Ferrous Cranus
Στις 12/11/2013 4:03 μμ, ο/η Joel Goldstick έγραψε: On Tue, Nov 12, 2013 at 8:32 AM, Ferrous Cranus wrote: Στις 12/11/2013 2:47 μμ, ο/η Andy Lawton έγραψε: Firstly , I should clarify I have no idea how to program python, I joined this mailing list in anticipation of learning soon. And

Re: datetime question

2013-11-12 Thread Ferrous Cranus
Στις 12/11/2013 4:57 μμ, ο/η Chris Angelico έγραψε: On Wed, Nov 13, 2013 at 1:12 AM, Ferrous Cranus wrote: Joel i must thank you for your help. I cannot believe it was so simple. Tnhe server is self aware of its location so why use utcnow() + timedelte( some_digit_here ) when you can just

Re: datetime question

2013-11-12 Thread Ferrous Cranus
Στις 12/11/2013 5:54 μμ, ο/η Tim Chase έγραψε: On 2013-11-12 17:24, Ferrous Cranus wrote: But what of the server was in California and i live in Greece? How would datetime.now() work then? Best practices say to move the value from local time to UTC as soon as possible, then store/use the UTC

Re: To whoever hacked into my Database

2013-11-13 Thread Ferrous Cranus
Στις 13/11/2013 1:38 πμ, ο/η Mark Lawrence έγραψε: On 12/11/2013 23:27, Ian Kelly wrote: On Tue, Nov 12, 2013 at 2:59 PM, Ethan Furman wrote: Every time he uses foul language against somebody he's acting like a bully. Every time he reposts questions and ignores answers he's acting like a bull

Trying tcompile an use the Python 3.4a

2013-11-13 Thread Ferrous Cranus
$ mkdir temp $ cd temp $ wget http://www.python.org/ftp/python/3.4/Python-3.4.tar.bz2 $ tar -xjvf Python-3.4.tar.bz2 $ cd Python-3.3.2 $ ./configure $ make && make test $ su # make install # exit $ $ cd ../ && rm -rf Python-3.4 root@secure [/home/nikos/www/cgi-bin]# python3 -V Python 3.4.0a4 c

Re: Trying tcompile an use the Python 3.4a

2013-11-13 Thread Ferrous Cranus
Στις 13/11/2013 4:17 μμ, ο/η Ferrous Cranus έγραψε: $ mkdir temp $ cd temp $ wget http://www.python.org/ftp/python/3.4/Python-3.4.tar.bz2 $ tar -xjvf Python-3.4.tar.bz2 $ cd Python-3.3.2 $ ./configure $ make && make test $ su # make install # exit $ $ cd ../ && rm -rf Python-3

Re: Trying tcompile an use the Python 3.4a

2013-11-13 Thread Ferrous Cranus
Στις 13/11/2013 4:23 μμ, ο/η Chris “Kwpolska” Warrick έγραψε: On Wed, Nov 13, 2013 at 3:17 PM, Ferrous Cranus wrote: $ mkdir temp $ cd temp $ wget http://www.python.org/ftp/python/3.4/Python-3.4.tar.bz2 $ tar -xjvf Python-3.4.tar.bz2 $ cd Python-3.3.2 $ ./configure $ make && make t

Re: Trying tcompile an use the Python 3.4a

2013-11-13 Thread Ferrous Cranus
Στις 13/11/2013 4:23 μμ, ο/η Chris “Kwpolska” Warrick έγραψε: On Wed, Nov 13, 2013 at 3:17 PM, Ferrous Cranus wrote: $ mkdir temp $ cd temp $ wget http://www.python.org/ftp/python/3.4/Python-3.4.tar.bz2 $ tar -xjvf Python-3.4.tar.bz2 $ cd Python-3.3.2 $ ./configure $ make && make t

Re: Trying tcompile an use the Python 3.4a

2013-11-13 Thread Ferrous Cranus
Στις 13/11/2013 6:13 μμ, ο/η Steven D'Aprano έγραψε: and also is there a way to call it like #!/usr/bin/python Of course there is, but only if you wish to break your system. The OS will be expecting /usr/bin/python to be Python 2. Leave it be. Okey i will leave it be although i dislike the i

Re: Trying tcompile an use the Python 3.4a

2013-11-13 Thread Ferrous Cranus
Στις 13/11/2013 7:45 μμ, ο/η Chris “Kwpolska” Warrick έγραψε: On Wed, Nov 13, 2013 at 5:38 PM, Ferrous Cranus wrote: Στις 13/11/2013 6:13 μμ, ο/η Steven D'Aprano έγραψε: and also is there a way to call it like #!/usr/bin/python Of course there is, but only if you wish to break

Re: Trying tcompile an use the Python 3.4a

2013-11-13 Thread Ferrous Cranus
Στις 13/11/2013 11:30 μμ, ο/η Johannes Findeisen έγραψε: On Wed, 13 Nov 2013 23:19:53 +0200 Ferrous Cranus wrote: Στις 13/11/2013 7:45 μμ, ο/η Chris “Kwpolska” Warrick έγραψε:> Get ez_setup.py and get-pip.py, and run them with the desired Python. Why can't i just use that? roo

Re: To whoever hacked into my Database

2013-11-13 Thread Ferrous Cranus
root@secure:~/lib64# ls -al | grep libkey lrwxrwxrwx 1 root root 20 Jun 22 2012 libkeyutils.so.1 -> libkeyutils.so.1.3.0* -rwxr-xr-x 1 root root 10192 Jun 22 2012 libkeyutils.so.1.3* -rwxr-xr-x 1 root root 32920 Jun 22 2012 libkeyutils.so.1.3.0* root@secure:~/lib64# rpm -qf libkeyutils.so.1.3.

Re: Trying tcompile an use the Python 3.4a

2013-11-13 Thread Ferrous Cranus
Στις 13/11/2013 11:44 μμ, ο/η Ned Batchelder έγραψε: On Wednesday, November 13, 2013 4:39:59 PM UTC-5, Ferrous Cranus wrote: Στις 13/11/2013 11:30 μμ, ο/η Johannes Findeisen έγραψε: On Wed, 13 Nov 2013 23:19:53 +0200 Ferrous Cranus wrote: Στις 13/11/2013 7:45 μμ, ο/η Chris “Kwpolska” Warrick

Re: Trying tcompile an use the Python 3.4a

2013-11-13 Thread Ferrous Cranus
Στις 13/11/2013 11:56 μμ, ο/η Mark Lawrence έγραψε: On 13/11/2013 21:39, Ferrous Cranus wrote: Στις 13/11/2013 11:30 μμ, ο/η Johannes Findeisen έγραψε: On Wed, 13 Nov 2013 23:19:53 +0200 Ferrous Cranus wrote: Στις 13/11/2013 7:45 μμ, ο/η Chris “Kwpolska” Warrick έγραψε:> Get ez_setup.py

Re: Trying tcompile an use the Python 3.4a

2013-11-14 Thread Ferrous Cranus
Στις 14/11/2013 2:54 πμ, ο/η Johannes Findeisen έγραψε: On Thu, 14 Nov 2013 00:00:04 +0200 Ferrous Cranus wrote: Στις 13/11/2013 11:56 μμ, ο/η Mark Lawrence έγραψε: But i have gone to the link and did what it said and it didn't proved usefull thats why i re-ask. Try looking

Re: To whoever hacked into my Database

2013-11-14 Thread Ferrous Cranus
Στις 13/11/2013 11:46 μμ, ο/η Ferrous Cranus έγραψε: root@secure:~/lib64# ls -al | grep libkey lrwxrwxrwx 1 root root 20 Jun 22 2012 libkeyutils.so.1 -> libkeyutils.so.1.3.0* -rwxr-xr-x 1 root root 10192 Jun 22 2012 libkeyutils.so.1.3* -rwxr-xr-x 1 root root 32920 Jun 22 2012 libkeyutils

Re: To whoever hacked into my Database

2013-11-14 Thread Ferrous Cranus
Στις 14/11/2013 2:32 μμ, ο/η Alister έγραψε: On Thu, 14 Nov 2013 12:46:29 +0200, Ferrous Cranus wrote: This must have happened when i was handling my root passwords out in the open. Served me well. At least you seem to be learning this lesson Can somebody explain to me why there is so

  1   2   3   >