- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
"for a in existing if not a in db_list_names"
I think I just fell in love with Python
Admin
this is nice. don't forget (what appears to be) the plaintext admin password.
Admin
Please remove the host, password and comment from lines 11 through 13. I don't think the db admin would be happy having those floating about
Admin
The live password WAS present, but I changed it in the code before submitting. The mysql server wouldn't be too hard to guess, so no point of leaving that out =)
And yes - the admin_group_ro account had NO password until I re-discovered this code - a mysql database open for the world to connect and have fun with reading other users mailman passwords... (now how funny would that really be? =)
Admin
List comprensions [x for x in a if x not in b] are nice if written short enough, but Python also has Sets which makes this even nicer.
Typical:
from sets import Set
a=Set(1,2,3,4)
b=Set(3,2)
not_in_b = a - b
Admin
I'm blind!
Admin
You guys are too harsh on the coder. This looks like (from @studs.ntnu.no)a student project -- Oh yea, NTNU is a school and let student to ..... My gut feeling is that this is a student(may be parttime) who just did it for just making them to work. (with more Python knowledge but minimum SQL knowledge) Somehow a "pet" project become a release product.
I remember when I first learn about coding, the database i was using is just as well without any password (In DB1001 "Intro to database". who care about security in DB1001--I just barely made the final demo running in the "certain" demo path without crashing too badly. ;))
-Ming
Admin
Which editor is the one in the picture? Visual Studio?
Admin
The editor pictured is EditPlus. I generally open code files with that because it does syntax hilighting.
http://editplus.com
Admin
I think this is a bit unfair on the guy. It's actually pretty spiffy Python code. And perhaps building and installing a database driver wasn't quite as simple as apt-get install python-mysql, and perchance he didn't really have the time or inclination to learn how to use it (since one database API tends to be quite different from the next in Python).
Give the man a break!