Hey i love this thread, heres mine: this is a python function to classify abundant, defficiant and perfect numbers.
Code:
def classify(n):
def factors(n):
result = []
for i in range(1, n+1):
if n % i == 0:
result.append(i)
return result
if sum(factors(n)) -n == n:
print "perfect"
elif sum(factors(n))-n > n:
print "abundant"
elif sum(factors(n))-n < n:
print "deficiant"
else:
print "WTF u moronic twit dont screw around with my program!!!!"
These are from a windows app I just wrote for another company.
Code:
// we found and existing container
// this should never happen @ config load.
// but since it did happen lets check rules
// shall we. Can a new instance of this module
// be added to the container?
// oh no. We didn't get a lock. that's bad.
// Uh-Oh. There should be a module container. Someone screwed up.
// Blame the architect.
// The module is null? Oh no.. nothing we can do.
// Call the developer, he/she blundered something.
This is from a web app I wrote last year. Probably one of my favorites.
Code:
// HACK: Larry B**** Approved By:
// THIS IS THE CODE THAT IDENTIFIES ALL CREDIT
// CARDS. YET ANOTHER VISCIOUS HACK THAT SHOULD
// BE FIXED IN THE FUTURE.
// Code to hide left column in the case of ***** ******* authentication.
// This is currently a horrible hack. A better way of doing this should
// probably be devised in the future. Currently it hides the left column
// div and hides the left column base div. It also outputs NoLeftColumn
// at the end of the css class declaration of the right column.
// Larry
My favorite funny code comments statistic is the number of swear words present in the Linux kernel at all times. Here's a fancy little graph that shows it: LINK
__________________
Please login or register to view this content. Registration is FREE - Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.