Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'charset:iso-8859-7': 0.04; 'debug': 0.07; "subject:' ": 0.07; 'append': 0.09; 'data:': 0.09; 'expected.': 0.09; 'subject:Why': 0.09; 'subject:into': 0.09; 'sure,': 0.09; 'try:': 0.09; 'utilizing': 0.09; 'cc:addr:python-list': 0.11; 'wrote': 0.14; 'benjamin': 0.16; 'received:192.168.1.20': 0.16; 'subject:format': 0.16; 'skip:= 10': 0.16; 'weird': 0.16; 'hire': 0.16; 'fix': 0.17; 'trying': 0.19; 'cc:addr:python.org': 0.22; 'entries': 0.24; 'software.': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'script': 0.25; 'code:': 0.26; 'primary': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'record': 0.27; 'rest': 0.29; 'code': 0.31; 'skip:= 20': 0.31; 'unique,': 0.31; 'noticed': 0.34; 'subject:the': 0.34; 'received:google.com': 0.35; "didn't": 0.36; 'subject:?': 0.36; 'should': 0.36; 'detail': 0.37; 'list': 0.37; 'needed': 0.38; 'files': 0.38; 'does': 0.39; 'new': 0.61; 'first': 0.61; 'you.': 0.62; 'here:': 0.62; 'header:Message- Id:1': 0.63; 'url:png': 0.68; 'behavior': 0.77; '<img': 0.84; '(url)': 0.84; "else's": 0.84; 'irrelevant': 0.84; 'ready,': 0.84; 'to:addr:support': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schollnick.net; s=schollnick; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to:x-mailer; bh=+WpUtJ+UYkD8iu36p5TusDc6c4y3dlWASZD8dyFJ+1w=; b=DY4TLHkfMc1inPGcic1H4rfrqiBUobluHgtCAktafD/0rFjczqi9Q5+/DeAJ8a82bZ 5zOmCi4xPGt9Bsklc7EjtjDnj6R+JipQKWNE+vAvQpcOI6kH8PRh9TzHqmwq8Dq8BWMd BRDiIQ8Y/ASnewBkGV+sx5OsrgSg/FyZ/bW3U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to:x-mailer:x-gm-message-state; bh=+WpUtJ+UYkD8iu36p5TusDc6c4y3dlWASZD8dyFJ+1w=; b=TXCBwLaEcV6CpzgIH5jpcfgPLwnzfoXr+4Gbj6EOGXcP3i8DBa441lU9YXL67i23wh uSrBwQjpe7lZ7k9nRfc1n/bhr9RRNy0w/EPKLfPW0wdxpxw1dqEouPUxdy7WN+tuuNbr EVolONN7CjNnI2WqJiRP9Fp0iFdPwReUqgT1KPs5FmUEX/VMmAEEIqho18Gy2xJxU7Hc Q3+dpLcJyNj/hEUp1y3HqL+Om271rn3CU9J23mY/uzs2HVDdIT1bLlD+x0VPucSD7IjL Zd61y1Py1TLFHeVGmgamIXtaf2LcdqKsf8z1dXjvyx7TCWoHNLHFUUyU/tWAn4icKQ/L 0KrQ== X-Received: by 10.50.11.13 with SMTP id m13mr1650211igb.32.1371328201537; Sat, 15 Jun 2013 13:30:01 -0700 (PDT) Sender: Benjamin Schollnick Content-Type: multipart/alternative; boundary="Apple-Mail=_4F17A3F4-E5C8-412B-9286-5B5F1F54C800" Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: Why 'files.py' does not print the filenames into a table format? From: Benjamin Schollnick In-Reply-To: Date: Sat, 15 Jun 2013 16:29:57 -0400 References: To: Nick the Gr33k X-Mailer: Apple Mail (2.1508) X-Gm-Message-State: ALoCoQlUGnffHu79D+dg5u3mbh7Dt6PgNl/IEKfu77KzQJZPybwR/itsshkQQ+q0hcs9uttnisot Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 135 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371328210 news.xs4all.nl 15954 [2001:888:2000:d::a6]:52845 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48365 --Apple-Mail=_4F17A3F4-E5C8-412B-9286-5B5F1F54C800 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-7 >> Nick, at this point, you need to hire someone to do your work for = you. >=20 > The code is completely ready. > Some detail is missing and its not printing the files as expected. Then the code is not completely ready, it has bugs, and your trying to = have the list debug and fix it for you for free. > Irrelevant to my question i just noticed weird behavior about my = pelatologio.py script which can be seen here: >=20 > http://superhost.gr/?show=3Dstats >=20 > The first 3 files are of my doing. > All the rest are of someone else's that managed to append entries into = my counters database utilizing this code: >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > try: > #find the needed counter for the page URL > cur.execute('''SELECT ID FROM counters WHERE url =3D = %s''', page ) > data =3D cur.fetchone() #URL is unique, so should = only be one > =09 > if not data: > #first time for page; primary key is automatic, = hit is defaulted > cur.execute('''INSERT INTO counters (url) VALUES = (%s)''', page ) > cID =3D cur.lastrowid #get the primary = key value of the new record > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > Does someone want to state something? Sure, whoever wrote that code is a fool. http://xkcd.com/327/ They didn't sanitize your database inputs. My suggestion would be for you to stop trying to re-invent the wheel, = and use COTS software. =20 - Benjamin --Apple-Mail=_4F17A3F4-E5C8-412B-9286-5B5F1F54C800 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-7
Nick, at this = point, you need to hire someone to do your work for = you.

The code is completely ready.
Some detail is = missing and its not printing the files as = expected.

Then the code is not completely = ready, it has bugs, and your trying to have the list debug and fix it = for you for free.

Irrelevant to = my question i just noticed weird behavior about my pelatologio.py script = which can be seen here:

http://superhost.gr/?show=3Dsta= ts

The first 3 files are of my doing.
All the rest are of = someone else's that managed to append entries into my counters database = utilizing this code:

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=

= try:
= = #find the needed counter for the page URL
= cur.execute('''SELECT ID FROM counters WHERE url =3D %s''', page = )
= = data =3D cur.fetchone() =        #URL is unique, so should only = be one
= = =
= = if not data:
#first time for page; primary key = is automatic, hit is defaulted
cur.execute('''INSERT INTO = counters (url) VALUES (%s)''', page )
cID =3D cur.lastrowid =        #get the primary key value of = the new record
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D

Does someone want to state = something?

Sure, whoever wrote that code is a = fool.



They didn't sanitize your = database inputs.

My suggestion would be for you = to stop trying to re-invent the wheel, and use COTS software. =  

- = Benjamin

= --Apple-Mail=_4F17A3F4-E5C8-412B-9286-5B5F1F54C800--