Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Python Enterprise Application Kit

Name: Anonymous 2007-09-28 6:54 ID:uTAkQTIE

The road less traveled is the way to the top.

http://peak.telecommunity.com/

Name: Anonymous 2007-09-28 7:07 ID:Heaven

> ENTERPRISE

Name: Anonymous 2007-09-28 7:48 ID:Gb2Ld+ih

PEAK is the "Python Enterprise Application Kit". If you develop "enterprise" applications with Python, or indeed almost any sort of application with Python, PEAK may help you do it faster, easier, on a larger scale, and with fewer defects than ever before. The key is component-based development, on a reliable infrastructure.

godamn i lold at the keywords

Name: Anonymous 2007-09-28 8:17 ID:Heaven

someone tell me how fucking ugly this would be in python

    boolean bValidNum = (LuhnCheck(cCard.getCardNumber())
        && validateCCNum(cCard.getCardType(),cCard.getCardNumber()));
    boolean bValidDate = isValidExpDate(cCard.getDate());

    return (bValidNum ? "" : "Invalid Credit Card Number")
           + ((bValidNum && bValidDate) ? "" : " , ")
           + (bValidDate ? "" : "Invalid Expiry Date");

Name: Anonymous 2007-09-28 9:01 ID:vGk48urQ

>>4
Yes, let's see if it's "fucking ugly" or not, Javafag. I've used common Python conventions for a full Pythonic effect.

errors = []
if not LuhnCheck(ccard.number) and ValidateCCNum(ccard.type, ccard.number):
    errors += ['Invalid credit card number']
if not ValidExpDate(ccard.date):
    errors += ['Invalid expiry date']
return ', '.join(errors)


As for you, lol @ Javafag, lol @ Hungarian, lol @ stupid getters, lol @ unnecessary and completely pointless parens such as the first pair (not sure about the language?), lol @ hackish logic, lol @ readability (or lach thereof), lol @ maintainability (what if you want to add 4 more possible errors?), lol @ ENTERPRISE.

Name: Anonymous 2007-09-28 9:03 ID:vGk48urQ

Alternate option if you want to do it in such a hackish way, but a single expression to return and no extra variables required:

return ','.join(
    ['Invalid credit card number'] if LuhnCheck(ccard.number) and ValidateCCNum(ccard.type, ccard.number) else []
  + ['Invalid expiry date'] if ValidExpDate(ccard.date) else []
)


This version is beautifully maintainable as well.

Name: Anonymous 2007-09-28 9:06 ID:370per+r

>>4
This is probably not ENTERPRISE enough, for I haven't tried out PEAK yet.

checks = [
    (luhn_check(card.number) and validate_ccnum(card.type, card.number),
     'Invalid Credit Card Number'),
    (validate_exp_date(card.date),
     'Invalid Expiry Date')
    ]

return ', '.join([err for val, err in checks if not val])

Name: Anonymous 2007-09-28 9:18 ID:Heaven

>>5, 6
DRY

Name: Anonymous 2007-09-28 13:15 ID:Or3bPApN

>>7

return ', '.join(err for val, err in [
    (luhn_check(card.number) and validate_ccnum(card.type, card.number), 'Invalid Credit Card Number'),
    (validate_exp_date(card.date), 'Invalid Expiry Date')
] if not val)

Name: Anonymous 2007-09-28 13:23 ID:65u+6JmJ

# Trust user input was correct
return ''

Name: Anonymous 2007-09-28 13:32 ID:370per+r

>>9
Let's stuff everything in one expression because we can. Who cares about readability anyway?
Fix'd.

That was the exact form I started with. >>7 is the second iteration.

Name: Anonymous 2007-09-28 14:55 ID:Heaven

>>5
>lol @ Hungarian

teneked bezony a jó kurva anyádat

Name: Anonymous 2007-09-28 15:30 ID:uTAkQTIE

>>1
i clicked that link and got a virus

Name: Anonymous 2007-09-28 15:51 ID:Heaven

ONE WORD, THE FORCED INDENTATION OF JAVA, THREAD OVER

Name: Anonymous 2007-09-28 16:05 ID:Heaven


', '.join(filter(None, map(lambda (a,b): a and b,
    ((luhn_check(card.number) and validate_ccnum(card.type, card.number), 'invalid card number'),
     (validate_exp_date(card.date), 'invalid expiry date')))))

Name: Anonymous 2009-02-25 7:38


Errors As for you   all there is   no way in   fucking hell knuths.

Name: Anonymous 2009-02-25 8:15


Python become so cool   to program in   Head First Java.

Name: Trollbot9000 2009-07-01 11:13

Validate ccnum card type ccard number else?

Name: Anonymous 2010-12-17 1:24

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

Name: Anonymous 2011-02-03 5:24

Name: Anonymous 2011-02-17 19:24

check 'em

Name: Anonymous 2012-06-25 23:53

坂晵吴ቧ焑䌣ጇݠ鐵≙᠘楔け鄠焨恷ĵ茶➙⍦腧鞆蚙ݤ禐≕こ㍡h蜲成䑴増楰ܒ″葸蘦։᜶呉⍣逃砩䜦ᔵ片厂杣Ⅰ慇餲ူՆ薖違瘈㘃坥㌣g单厀⦙⁄冄獇暉館t灇营堲硷䚄鄴ᐷ㥢⡥ᜤ┈灅ဨᕱ䄧捓㉙w࡙ݤ錐噓␶噔㉳煰琡艴煰草鄲鑄㍁喐✢妁蝔㝔噅ኖ判灕蝠㘘ℷ⡨镢鈨䒕㈆攸࠵喈䀠⁸Γ遤偣摲鞙⦓㑢ᠡ鐴㉷䒇䞓砒ᕧᢐ隕鄂唳䉵嘹䤖ԇű悗ጷ嘐鉹㜒Ȕހ␁ᖔȁ愡唒㘗撃唘䘵鎉䄢᎖芓㤡硱饑愑戨ᄖ➁ㅷ館①ᤐ昆撃堁ش逨茦朷頂斃煶朥㖄邓袓癲蠈址䥕ᤒ䢆遙圩呆镵㘸ر⍧嘵ࡠ጑䢒杹梄∆ࠤ䉅祄ႆᐵ䂀‘㘖耸ቈ≱ၓܔ✢搥敨袂薀ᕘ⍁ၘ➀᠘䥤噆銙Ũ✣ኑب≥✱䑅䘳㍳榄蚆䜳᎔慘椱䂃㝑㔨垒đ餶⎒ͤ䂇玄衈␧血晨喔䙖ᅸ匀镁䂆堕栐憃蠷褐።┅畠销ᅸᦃŰ❈̧镄♂㠇唲颒摅ғ㢖吱刦䔰̣

Don't change these.
Name: Email:
Entire Thread Thread List