1. Куча / Говнокод #27430

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    ­­
    ­
    ­
    Эклектика всякая
    CEMA.DE Edishun
    ­
    ­
    ­­

    #1: https://govnokod.ru/25437 https://govnokod.xyz/_25437/
    #2: https://govnokod.ru/25820 https://govnokod.xyz/_25820
    №3: http://govnokod.ru/26570 http://govnokod.xyz/_26570

    gologub, 17 Мая 2021

    Комментарии (120)
  2. Куча / Говнокод #27429

    0

    1. 1
    IT Оффтоп #87

    #57: https://govnokod.ru/26890 https://govnokod.xyz/_26890
    #58: https://govnokod.ru/26916 https://govnokod.xyz/_26916
    #59: https://govnokod.ru/26934 https://govnokod.xyz/_26934
    #60: https://govnokod.ru/26949 https://govnokod.xyz/_26949
    #61: https://govnokod.ru/26980 https://govnokod.xyz/_26980
    #62: https://govnokod.ru/26999 https://govnokod.xyz/_26999
    #63: https://govnokod.ru/27004 https://govnokod.xyz/_27004
    #64: https://govnokod.ru/27020 https://govnokod.xyz/_27020
    #65: https://govnokod.ru/27027 https://govnokod.xyz/_27027
    #66: https://govnokod.ru/27040 https://govnokod.xyz/_27040
    #67: https://govnokod.ru/27049 https://govnokod.xyz/_27049
    #68: https://govnokod.ru/27061 https://govnokod.xyz/_27061
    #69: https://govnokod.ru/27071 https://govnokod.xyz/_27071
    #70: https://govnokod.ru/27097 https://govnokod.xyz/_27097
    #71: https://govnokod.ru/27115 https://govnokod.xyz/_27115
    #72: https://govnokod.ru/27120 https://govnokod.xyz/_27120
    #73: https://govnokod.ru/27136 https://govnokod.xyz/_27136
    #74: https://govnokod.ru/27160 https://govnokod.xyz/_27160
    #75: https://govnokod.ru/27166 https://govnokod.xyz/_27166
    #76: https://govnokod.ru/27168 https://govnokod.xyz/_27168
    #77: https://govnokod.ru/27186 https://govnokod.xyz/_27186
    #78: https://govnokod.ru/27219 https://govnokod.xyz/_27219
    #79: https://govnokod.ru/27254 https://govnokod.xyz/_27254
    #80: https://govnokod.ru/27270 https://govnokod.xyz/_27270
    #81: https://govnokod.ru/27280 https://govnokod.xyz/_27280
    #82: https://govnokod.ru/27284 https://govnokod.xyz/_27284
    #83: https://govnokod.ru/27296 https://govnokod.xyz/_27296
    #84: https://govnokod.ru/27336 https://govnokod.xyz/_27336
    #85: https://govnokod.ru/27381 https://govnokod.xyz/_27381
    #86: https://govnokod.ru/27405 https://govnokod.xyz/_27405

    nepeKamHblu_nemyx, 16 Мая 2021

    Комментарии (2998)
  3. JavaScript / Говнокод #27428

    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
    enum En {
            A,
            B,
            C,
            D = 4200,
            E,
        }
    
        enum En2 {
            D0 = En.D,
            D1,
            D2 = 1,
        }
    
    function main()
    {
    	const a = En.A;
    	print (a, En.B, En.C, En.D);
    	print (En2.D0, En2.D1, En2.D2);
    }

    output: >>
    0 1 2 4200
    4200 1 1

    Ну что.. учись "С" как enum-ы делать надо....

    ASD_77, 14 Мая 2021

    Комментарии (4)
  4. Куча / Говнокод #27427

    +2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    Inductive my_bool :=
    | my_false
    | my_true.
    
    Theorem shit_happens:
      (if my_false then 42 else 100500) = 42.
    Proof.
      reflexivity.
    Qed.

    Какая типизация )))

    bormand, 14 Мая 2021

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

    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
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    from colorama import init, Fore, Back, Style
    init()
    print(Back.BLACK)
    print(Fore.RED)
    print(Style.NORMAL)
    print("Script mamoeba/Скрипт сделан")
    print("┌────────────────────────────────────┐")
    print("│Author : GovnoCode user                  │")
    print("│Github : https://:/│")
    print("└────────────────────────────────────┘")
    print("YouTube: utube")
    print("▄▀▄ █▄░▄█ ▀ █▄░█ ▄▀▄ ▄▀▄ █▀▄ ▐▌░▐▌ █▀▄ ▄▀▄")
    print("█▀█ █░█░█ █ █░▀█ █░█ █▀█ █░█ ░▀▄▀░ █▀█ █░█")
    print("▀░▀ ▀░░░▀ ▀ ▀░░▀ ░▀░ ▀░▀ ▀▀░ ░░▀░░ ▀▀░ ░▀░")
    print("Advertise Bot Amino")
    lz = []
    from concurrent.futures import ThreadPoolExecutor
    import concurrent.futures
    import amino
    def advertise(data):
        listusers = []
        for userId in data.profile.userId:
            listusers.append(userId)
        return listusers
        
    email = input("Email/Почта: ")
    password = input("Password/Пароль: ")
    msg = input("Message/Сообщение: ")
    client = amino.Client()
    client.login(email=email, password=password)
    clients = client.sub_clients(start=0, size=1000)
    for x, name in enumerate(clients.name, 1):
        print(f"{x}.{name}")
    communityid = clients.comId[int(input("Выберите сообщество/Select the community: "))-1]
    sub_client = amino.SubClient(comId=communityid, profile=client.profile)
    users = sub_client.get_online_users(size=1000)
    user = advertise(users)
    for i in lz:
            if i in user:
                user.remove(i)
         
            
    print("Sending Advertise")
    for _ in range(4000):
        with concurrent.futures.ThreadPoolExecutor(max_workers=40000) as executor:
            _ = [executor.submit(sub_client.start_chat, user, msg) for userId in user]
    
    print("Sending Advertise 2")
    for _ in range(4000):
        with concurrent.futures.ThreadPoolExecutor(max_workers=40000) as executor:

    Flow, 13 Мая 2021

    Комментарии (67)
  6. JavaScript / Говнокод #27425

    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
    function main()
    {
      let a: [string, number] = ["asd", 1.0];
      print(a[0], a[1]);  
    
    
      const b: [string, number] = ["asd", 1.0];
      print(b[0], b[1]);  
    
      const c = ["asd", 1.0];
      print(c[0], c[1]);  
    }

    Продолжаем будни говнописания говнокомпилятора. Хотел спросить а ваш компилятор может так, но думаю может. В кратце - это работа с таплами(tuples) а не с масивами :)

    ASD_77, 13 Мая 2021

    Комментарии (44)
  7. C++ / Говнокод #27424

    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
    struct X {
        int x;
        int y;
    
        X(int y_) :
            y(y_),
            x(y + 10)
        {
        }
    };
    
    int main()
    {
        X foo = X(16);
        std::cout << "foo == (" << foo.x << ", " << foo.y << ")" << std::endl;
    }

    PolinaAksenova, 12 Мая 2021

    Комментарии (194)
  8. C++ / Говнокод #27423

    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
    // Приведение численного типа к структуре с битовыми полями
    template <class STRUCT_T, typename T>
    STRUCT_T struct_cast(const T n)
    {
        static_assert(std::is_integral<T>::value, "Integral type required as T");
        static_assert(std::is_class<STRUCT_T>::value, "class or struct type required as STRUCT_T");
        static_assert(sizeof(T) == sizeof(STRUCT_T), "Incompatible types passed");
    
        return *(reinterpret_cast<const STRUCT_T*>(&n));
    }
    
    // Приведение структур с битовыми полями к численному типу
    template <typename T, class STRUCT_T>
    T integral_cast(const STRUCT_T& s)
    {
        static_assert(std::is_integral<T>::value, "Integral type required as T");
        static_assert(std::is_class<STRUCT_T>::value, "class or struct type required as STRUCT_T");
        static_assert(sizeof(T) == sizeof(STRUCT_T), "Incompatible types passed");
    
        return *(reinterpret_cast<const T*>(&s));
    }

    Почему это UB?

    YpaHeLI_, 12 Мая 2021

    Комментарии (4)
  9. PHP / Говнокод #27422

    +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
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    <?php
    
    function syoma_verify_spam($comment_post_ID) {
        // NOTE: На telegram этот метод не вызывается
    
        $content = trim($_POST['comment']);
        if (preg_match('#<a href=#', $content) && !preg_match('#\[code#', $content)) {
            die('Ня, пока.');
        }
        $content = strip_tags(apply_filters('gk_content', $content));
        $content = strtr($content, array(
            'A' => 'А',
            'a' => 'а',
            'B' => 'В',
            'E' => 'Е',
            'e' => 'е',
            '3' => 'З',
            'K' => 'К',
            'k' => 'к',
            'M' => 'М',
            'H' => 'Н',
            'O' => 'О',
            'o' => 'о',
            'P' => 'Р',
            'p' => 'р',
            'C' => 'С',
            'c' => 'с',
            'T' => 'Т',
            'Y' => 'У',
            'y' => 'у',
            'X' => 'Х',
            'x' => 'х',
            'b' => 'ь',
        ));
        $content = mb_strtolower($content);
        if (preg_match('#русня|хуйло|ватник|ватный|пидораш|пидорах#', $content)) {
            die('Рус-ня, пока.');
        }
    }

    Угадайте, почему фильтрация <a href не в конце функции?

    3_dar, 12 Мая 2021

    Комментарии (9)
  10. C++ / Говнокод #27421

    0

    1. 1
    2. 2
    3. 3
    Нужно реализовать thread-safe set.
    На сколько нормально разбить сет на N бакетов (по хешу, условно, 10000 штук),
    тогда при добавлении или удалении элемента делать лок соответствующего бакета

    Но будет хуево, когда пойдут запросы по одному ключу в нескольких тредах.
    Есть решение лучше?

    3_dar, 12 Мая 2021

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