1. Python / Говнокод #24006

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    #Seeing already precalculated answers... fills you with DETERMINATION
    
    ref = [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 
    #9000 элементов массива спустя...
    1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 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612, 26 Марта 2018

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

    −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
    def chicken():
    	print("Курица")
    	return egg()
    
    def egg():
    	print("Яйцо")
    	return chicken()
    
    try:
    	chicken()
    except RecursionError:
    	print("ТЫ ПИДОР")

    ScythepX, 21 Марта 2018

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

    −2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    assert exec("from my_runtime_analyze_lib import do_amazing_magic") or True
    
    
    if __name__ == '__main__':
        do_smth()
        assert do_amazing_magic()
        do_smth_else()

    Как вхерачить в код любую ересь для dev окружения, а потом отключить на продакшене. Только не забыть бы на проде при запуске флаг оптимизации.

    intestinalbrain, 16 Марта 2018

    Комментарии (5)
  4. Python / Говнокод #23921

    +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
    Pyhton 2:
    >>> (2**54/1) + 10 - 10 == 2**54
    True
    
    >>> (2**64/1) + 10  == 2**64
    False
    
    Pyhton 3:
    
    >>> (2**54/1) + 10 - 10 == 2**54
    False
    
    >>> (2**64/1) + 10  == 2**64
    True

    Pyhton 2: https://ideone.com/iqwl8L
    Pyhton 3: https://ideone.com/ltG9Fq

    Ну охуеть теперь.
    x + 10 - 10 != x в общем случае - это норма?
    Я всё понимаю - тяжёлое детство, инты, прибитые к железу, но на кой чёрт в современных интерпретируемых языках такое говнище?

    3.14159265, 13 Марта 2018

    Комментарии (30)
  5. Python / Говнокод #23682

    +1

    1. 1
    OrderedDict().fromkeys(['key1', 'key2', 'key3'], [])

    Снова сел на грабли с изменяемыми объектами

    syoma, 29 Января 2018

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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    def ajax_check_manager_promocode(promocode, type_license):
        if (not promocode):
            return False
        if (promocode is None):
            return False
        if (promocode.isdigit()):
            return False
        if (len(promocode) < 8):
            return False

    хуита, 18 Января 2018

    Комментарии (2)
  7. Python / Говнокод #23658

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    def normalize_phone(phone):
            if (not phone):
                return
            normalized_phone = phone.replace("(", "").replace(")", "").replace("+", "").replace("-", "").replace(" ", "")
            if normalized_phone[0] == "7":
                p = list(normalized_phone)
                p[0] = "8"
                normalized_phone = "".join(p)
            if normalized_phone[0] == "9":
                normalized_phone = "8" + normalized_phone
            return normalized_phone

    Питонокод пхпешника.

    хуита, 17 Января 2018

    Комментарии (23)
  8. Python / Говнокод #23627

    0

    1. 1
    Рубрика "плагины к Kodi" вернулась!

    http://kodi-addons.club/addon/plugin.video.viks.tv/4.2.0

    Качаем, открываем epg.db (формат sqlite), охуеваем. Можно еще поизучать файлы напитоне.

    syoma, 30 Декабря 2017

    Комментарии (14)
  9. Python / Говнокод #23626

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    def _get_list(self, string):
            """
                response to list parser, removes CSV list headers
            """
            def f(x):
                return x != '' and \
                        x != 'Created,e-Voucher number,Activation code,Currency,Batch,Payer Account,Payee Account,Activated,Amount' and \
                        x != 'Time,Type,Batch,Currency,Amount,Fee,Payer Account,Payee Account,Payment ID,Memo'
            if not string:
                return []
            rlist = string.split('\n')
            return filter(f, rlist)

    https://perfectmoney.is/acct/samples/python/class.txt
    Класс для работы с платёжным API

    хуита, 29 Декабря 2017

    Комментарии (1)
  10. Python / Говнокод #23598

    0

    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
    import re
    
    alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
                'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
    text = input('Enter your message: ')
    text = re.findall(r'\w', text)
    
    key = input('Enter your key: ')
    key = int(key)
    a = len(text)
    b = 0
    num = 0
    message = []
    c = ''
    
    for i in range(a):
        num = alphabet.index(text[b])
        num = num + key
        b = b + 1
        if num <= 25:
            message.append(alphabet[num])
        else:
            num = num%25 - 1
            message.append(alphabet[num])
           
    print(text)
    print(message)
    for i in range(a):
        c += message[(i)]
    print(c)

    Шифр Цезаря

    Alex1982, 19 Декабря 2017

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