1. Список говнокодов пользователя ods

    Всего: 2

  2. Python / Говнокод #11794

    −96

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    dash = []
    for row in menuconf.dashboard:
        _row = []
        for col in row:
            _col = [col[0]]
            for endpoint in col[1:]:
                if endpoint in streams.endpoints:
                    s = streams.endpoints[endpoint]
                    if issubclass(type(s), Stream):
                        if s.has_permission(request, 'x'):
                            _col.append(endpoint)
                    else:
                        _col.append(endpoint)
                else:
                    if type(endpoint) is tuple:
                        add_pair = False
                        for e in endpoint:
                            if e in streams.endpoints:
                                s = streams.endpoints[e]
                                if issubclass(type(s), Stream):
                                    if s.has_permission(request, 'x'):
                                        add_pair = True
                        if add_pair:
                            _col.append(endpoint)
                    else:
                        _col.append(endpoint)
            if len(_col) > 1:
                _row.append(_col)
        if _row:
            dash.append(_row)

    ods, 18 Сентября 2012

    Комментарии (3)
  3. Python / Говнокод #2345

    −409.2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    import urllib, sys, string
    from string import maketrans
    
    bbb = 0
    
    f = urllib.urlopen("http://www.pythonchallenge.com/pc/def/equality.html")
    while 1:
        buf = f.read(200000)
        if not len(buf):
            break
        for x in range(len(buf)):
            if buf[x] in string.ascii_lowercase:
               if buf[x+1] in string.ascii_uppercase:
                   if buf[x-1] in string.ascii_uppercase:
                       if buf[x+2] in string.ascii_uppercase:
                           if buf[x-2] in string.ascii_uppercase:
                               if buf[x+3] in string.ascii_uppercase:
                                   if buf[x-3] in string.ascii_uppercase:
                                       if buf[x+4] in string.ascii_lowercase:
                                           if buf[x-4] in string.ascii_lowercase:
                                               bbb = x
        sys.stdout.write(buf)
        print(buf[bbb-3:bbb+4])

    http://stackoverflow.com/questions/1972693/python-challenge-level-3

    ods, 29 Декабря 2009

    Комментарии (2)