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

    0

    1. 1
    Политота #11

    #1: https://govnokod.ru/15804 https://govnokod.xyz/_15804
    #2: https://govnokod.ru/19910 https://govnokod.xyz/_19910
    #3: https://govnokod.ru/23643 https://govnokod.xyz/_23643
    #4: (vanished) https://govnokod.xyz/_24822
    #5: https://govnokod.ru/24868 https://govnokod.xyz/_24868
    #6: (vanished) https://govnokod.xyz/_26648
    #7: https://govnokod.ru/26673 https://govnokod.xyz/_26673
    #8: https://govnokod.ru/27052 https://govnokod.xyz/_27052
    #9: https://govnokod.ru/27852 https://govnokod.xyz/_27852
    #10: https://govnokod.ru/28060 https://govnokod.xyz/_28060

    nepeKamHblu_nemyx, 24 Марта 2022

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

    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
    def getMyIPAddress():
        global __ip__
        if __ip__:
            return __ip__
        with suppress(Exception):
            __ip__ = get('https://api.my-ip.io/ip', timeout=.1).text
        with suppress(Exception):
            __ip__ = get('https://ipwhois.app/json/', timeout=.1).json()["ip"]
        with suppress(Exception):
            __ip__ = get('https://ipinfo.io/json', timeout=.1).json()["ip"]
        with suppress(Exception):
            __ip__ = ProxyTools.Patterns.IP.search(get('http://checkip.dyndns.org/', timeout=.1).text)
        with suppress(Exception):
            __ip__ = ProxyTools.Patterns.IP.search(get('https://spaceiran.com/myip/', timeout=.1).text)
        with suppress(Exception):
            __ip__ = get('https://ip.42.pl/raw', timeout=.1).text
        return getMyIPAddress()

    Что имел в виду автор? Кто понял?

    inho-pidar, 24 Марта 2022

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

    +3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    function main()
    {
        for (const i of [1, 2, 3])
            print("Hello World!", i);
    }

    ну что вершилось чудо.. теперь на https://godbolt.org/ можно попробывать альфа версию компилятора
    пока показывает только - LLVM IR и вывод выполнения
    https://i.postimg.cc/Kj3Bd78d/god-bolt-tsc-native.jpg

    [god-bolt-tsc-native.jpg](https://postimg.cc/QKsF7T5b)

    ASD_77, 23 Марта 2022

    Комментарии (10)
  4. Си / Говнокод #28088

    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
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    /*
     *  libcaca       Colour ASCII-Art library
     *  Copyright (c) 2002-2010 Sam Hocevar <[email protected]>
     *                All Rights Reserved
     *
     *  This library is free software. It comes without any warranty, to
     *  the extent permitted by applicable law. You can redistribute it
     *  and/or modify it under the terms of the Do What The Fuck You Want
     *  To Public License, Version 2, as published by Sam Hocevar. See
     *  http://sam.zoy.org/wtfpl/COPYING for more details.
     */
    
    /*
     *  This header contains a conio.h reimplementation.
     */
    
    #ifndef __CACA_CONIO_H__
    #define __CACA_CONIO_H__
    
    /* Since we're going to redefine standard functions, include these
     * headers first to avoid errors upon later inclusion. */
    #if !defined(__KERNEL__)
    #   include <stdio.h>
    #endif
    
    #include <caca.h>
    
    #if !defined _DOXYGEN_SKIP_ME && !defined __LIBCACA__
    #   undef BLINK
    #   define BLINK CACA_CONIO_BLINK
    #   undef BLACK
    #   define BLACK CACA_CONIO_BLACK
    #   undef BLUE
    #   define BLUE CACA_CONIO_BLUE
    #   undef GREEN
    #   define GREEN CACA_CONIO_GREEN
    #   undef CYAN
    #   define CYAN CACA_CONIO_CYAN
    #   undef RED
    #   define RED CACA_CONIO_RED
    #   undef MAGENTA
    #   define MAGENTA CACA_CONIO_MAGENTA
    #   undef BROWN
    #   define BROWN CACA_CONIO_BROWN
    #   undef LIGHTGRAY
    #   define LIGHTGRAY CACA_CONIO_LIGHTGRAY
    #   undef DARKGRAY
    #   define DARKGRAY CACA_CONIO_DARKGRAY
    #   undef LIGHTBLUE
    #   define LIGHTBLUE CACA_CONIO_LIGHTBLUE
    #   undef LIGHTGREEN
    #   define LIGHTGREEN CACA_CONIO_LIGHTGREEN
    #   undef LIGHTCYAN
    #   define LIGHTCYAN CACA_CONIO_LIGHTCYAN
    #   undef LIGHTRED
    #   define LIGHTRED CACA_CONIO_LIGHTRED
    #   undef LIGHTMAGENTA
    #   define LIGHTMAGENTA CACA_CONIO_LIGHTMAGENTA
    #   undef YELLOW
    #   define YELLOW CACA_CONIO_YELLOW
    #   undef WHITE
    #   define WHITE CACA_CONIO_WHITE
    #endif

    3_dar, 22 Марта 2022

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

    0

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

    #118: https://govnokod.ru/27685 https://govnokod.xyz/_27685
    #119: https://govnokod.ru/27701 https://govnokod.xyz/_27701
    #120: https://govnokod.ru/27703 https://govnokod.xyz/_27703
    #121: https://govnokod.ru/27710 https://govnokod.xyz/_27710
    #122: https://govnokod.ru/27728 https://govnokod.xyz/_27728
    #123: https://govnokod.ru/27729 https://govnokod.xyz/_27729
    #124: https://govnokod.ru/27730 https://govnokod.xyz/_27730
    #125: https://govnokod.ru/27732 https://govnokod.xyz/_27732
    #126: https://govnokod.ru/27733 https://govnokod.xyz/_27733
    #127: https://govnokod.ru/27737 https://govnokod.xyz/_27737
    #128: https://govnokod.ru/27742 https://govnokod.xyz/_27742
    #129: https://govnokod.ru/27747 https://govnokod.xyz/_27747
    #130: https://govnokod.ru/27755 https://govnokod.xyz/_27755
    #131: https://govnokod.ru/27766 https://govnokod.xyz/_27766
    #132: https://govnokod.ru/27790 https://govnokod.xyz/_27790
    #133: https://govnokod.ru/27828 https://govnokod.xyz/_27828
    #134: https://govnokod.ru/27834 https://govnokod.xyz/_27834
    #135: https://govnokod.ru/27839 https://govnokod.xyz/_27839
    #136: https://govnokod.ru/27845 https://govnokod.xyz/_27845
    #137: https://govnokod.ru/27857 https://govnokod.xyz/_27857
    #138: https://govnokod.ru/27867 https://govnokod.xyz/_27867
    #139: https://govnokod.ru/27887 https://govnokod.xyz/_27887
    #140: https://govnokod.ru/27900 https://govnokod.xyz/_27900
    #141: https://govnokod.ru/27914 https://govnokod.xyz/_27914
    #142: https://govnokod.ru/27942 https://govnokod.xyz/_27942
    #143: https://govnokod.ru/27960 https://govnokod.xyz/_27960
    #144: https://govnokod.ru/27972 https://govnokod.xyz/_27972
    #145: https://govnokod.ru/27996 https://govnokod.xyz/_27996
    #146: https://govnokod.ru/28008 https://govnokod.xyz/_28008
    #147: https://govnokod.ru/28049 https://govnokod.xyz/_28049

    nepeKamHblu_nemyx, 22 Марта 2022

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

    0

    1. 1
    Пиздец-оффтоп #45

    #15: https://govnokod.ru/27322 https://govnokod.xyz/_27322
    #16: https://govnokod.ru/27328 https://govnokod.xyz/_27328
    #17: https://govnokod.ru/27346 https://govnokod.xyz/_27346
    #18: https://govnokod.ru/27374 https://govnokod.xyz/_27374
    #19: https://govnokod.ru/27468 https://govnokod.xyz/_27468
    #20: https://govnokod.ru/27469 https://govnokod.xyz/_27469
    #21: https://govnokod.ru/27479 https://govnokod.xyz/_27479
    #22: https://govnokod.ru/27485 https://govnokod.xyz/_27485
    #23: https://govnokod.ru/27493 https://govnokod.xyz/_27493
    #24: https://govnokod.ru/27501 https://govnokod.xyz/_27501
    #25: https://govnokod.ru/27521 https://govnokod.xyz/_27521
    #26: https://govnokod.ru/27545 https://govnokod.xyz/_27545
    #27: https://govnokod.ru/27572 https://govnokod.xyz/_27572
    #28: https://govnokod.ru/27580 https://govnokod.xyz/_27580
    #29: https://govnokod.ru/27738 https://govnokod.xyz/_27738
    #30: https://govnokod.ru/27751 https://govnokod.xyz/_27751
    #31: https://govnokod.ru/27754 https://govnokod.xyz/_27754
    #32: https://govnokod.ru/27786 https://govnokod.xyz/_27786
    #33: https://govnokod.ru/27801 https://govnokod.xyz/_27801
    #34: https://govnokod.ru/27817 https://govnokod.xyz/_27817
    #35: https://govnokod.ru/27822 https://govnokod.xyz/_27822
    #36: https://govnokod.ru/27826 https://govnokod.xyz/_27826
    #37: https://govnokod.ru/27827 https://govnokod.xyz/_27827
    #38: https://govnokod.ru/27833 https://govnokod.xyz/_27833
    #39: https://govnokod.ru/27862 https://govnokod.xyz/_27862
    #40: https://govnokod.ru/27869 https://govnokod.xyz/_27869
    #41: https://govnokod.ru/27933 https://govnokod.xyz/_27933
    #42: https://govnokod.ru/27997 https://govnokod.xyz/_27997
    #43: https://govnokod.ru/28042 https://govnokod.xyz/_28042
    #44: https://govnokod.ru/28080 https://govnokod.xyz/_28080

    nepeKamHblu_nemyx, 21 Марта 2022

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

    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
    p = []
    m = []
    
    import telebot
    import pyodbc
    from telebot import apihelper
    connection = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER=(тут сервер);DATABASE=(наим базы);UID=(логин);PWD=(пароль)')
    
    cursor = connection.cursor()
        
    mySQLquery = ("""
                    select  фамилия from OPCFIO)
                      """)
    cursor.execute(mySQLquery)
    results = cursor.fetchall()
    i=0
        
    for row in results:
        quality = row[0] #присваиваю имя
        id = row[1] #присваиваю фамилию
            
        p.append(id) #добавляю в массив
        m.append(quality) #добавляю в массив
        
        for j in range(len(p)):   
            bot = telebot.TeleBot('токен бота')
            apihelper.proxy = {
                           "http": "айпи прокси",
                            "https": "айпи прокси",
                            }
            @bot.message_handler()  
            def start(message):
                print(str(p[j]))
                if message.text == str(p[j]):
                        bot.send_message(message.chat.id, 'Вы выбрали имя '+ str(quality[j])  +"   " + "Фамилия будет" + str(m[j]))
                else:
                        bot.send_message(message.chat.id, 'Такого имени нету {}'.format(message.text))
    
    bot.polling()

    Что я такого сделал, что я должен был это увидеть...

    Vindicar, 18 Марта 2022

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

    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
    void SoftSPIB::setClockDivider(uint8_t div) {
        if (div == SPI_CLOCK_DIV2) _delay = 2;
        else if (div == SPI_CLOCK_DIV4) _delay = 4;
        else if (div == SPI_CLOCK_DIV8) _delay = 8;
        else if (div == SPI_CLOCK_DIV16) _delay = 16;
        else if (div == SPI_CLOCK_DIV32) _delay = 32;
        else if (div == SPI_CLOCK_DIV64) _delay = 64;
        else if (div == SPI_CLOCK_DIV128) _delay = 128;
        else _delay = 128;
    }
    
    uint8_t SoftSPIB::transfer(uint8_t val) {
        ...
        uint8_t del = _delay >> 1;
    
        uint8_t bval = 0;
        for (uint8_t bit = 0; bit < 8; bit++) {
            digitalWrite(_sck, _ckp ? LOW : HIGH);
    
            for (uint8_t i = 0; i < del; i++) {
                    asm volatile("nop");
            }
    
            if (...) {...} else {
                    digitalWrite(_mosi, val & (1<<bit) ? HIGH : LOW);
            }
        ...
        ...
        ...
        }
        return out;
    }

    - А это точно частота CLOCK_DIV2? /* Fosc/2 */
    - Не боись, я все рассчитал!

    Steve_Brown, 17 Марта 2022

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

    0

    1. 1
    https://pvs-studio.com/ru/blog/posts/cpp/0094/

    3_dar, 17 Марта 2022

    Комментарии (28)
  10. PHP / Говнокод #28082

    +1

    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
    mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
    $mysql = new mysqli($host, $db_user, $db_pass, $db_name);
    mysqli_set_charset($mysql, "utf8");
    
    
    $region = mysqli_query($mysql, "SELECT *  FROM `rubric_subsection`");
    while ($rows_rubriki = mysqli_fetch_array($region)) 
    {
    	
    //	$razdel = mysqli_query($mysql, "SELECT *  FROM `city_region` LIMIT 1");
    	//while ($raz = mysqli_fetch_array($razdel)) {
    	
    $rubriki = mysqli_query($mysql, "SELECT `region`, `subsection`, COUNT(region) as count FROM `big_baza` where `region` =  'Республика Бурятия' AND `subsection` = '".$rows_rubriki['name']."'");
    $data = mysqli_fetch_assoc($rubriki);
    echo ''.$rows_rubriki['name'].' / '.$data['count'].'<br>';
    //mysqli_query($mysql,  "INSERT INTO `calculator_region`(`id`, `region_id`, `subsection_id`, `count`) VALUES ('','".$raz['id']."','".$rows_rubriki['id']."','".$data['count']."')");
    
    //	}
    
    }

    dlyaspama7771, 16 Марта 2022

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