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

    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
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    1419 guest
    234 j123123
    222 LispGovno
    202 wvxvw
    188 Говногость
    161 gost
    160 Lure Of Chaos
    158 Stertor
    155 bormand
    128 kyzi007
    123 pedarok
    120 qbasic
    116 Elvenfighter
    115 someone
    113 3.14159265
    102 dm_fomenok
    101 roman-kashitsyn
    100 eldachello
    94 Dummy00001
    93 TarasB
    88 Vasiliy
    86 cmepmop
    85 Dr_Stertor
    84 syoma
    73 7ion
    72 laMer007
    69 d_fomenok
    61 хуита
    60 Мартин
    60 BEPETEHO
    60 3_14dar
    58 AliceGoth
    58 CHayT
    56 Fai
    56 kegdan
    55 uiopqwertyasd
    55 munin
    54 HaskellGovno
    51 bugmenot
    51 Abbath
    51 vistefan
    50 nethak
    49 makc3d
    49 Fike
    48 inkanus-gray
    47 telnet
    47 Govnocoder#0xFF
    47 3_dar
    44 codemonkey
    44 OlegUP
    43 RaZeR
    42 Sulik78
    41 CPPGovno
    41 alexoy
    41 DrFreez
    41 varg242
    40 danilissimus
    39 taburetka
    39 KitKat
    38 dwinner
    38 absolut
    38 striker
    37 raorn
    37 jQuery
    37 inho
    35 psina-from-ua
    35 rat4
    35 1kasper
    35 brainstorm
    35 Stallman
    34 ursus
    34 KirAmp
    33 evg_ever
    33 invision70
    33 Lokich
    33 Xom94ok
    32 1_and_0
    32 istem
    32 volter9

    OCETuHCKuu_nemyx, 17 Ноября 2019

    Комментарии (137)
  2. Perl / Говнокод #26031

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    #!/usr/bin/perl -w
    use strict;
    use warnings;
    use v5.22;
    use Encode qw(encode decode);
    
    binmode $_, ':utf8' for qw(STDOUT STDIN);
    my $c = 'KOI8-R';
    print decode $c, join '', map {chr (ord() & 0x7F)} split '', encode $c, $_ while (<>);

    данный програмный продукт переводит русские буквы в забавные волапюки.
    Пользуйтесь на здоровье!

    $ echo "милости прошу к нашему шалашу" | ./koi.pl
    mILOSTI PRO[U K NA[EMU [ALA[U

    neTyx_npoTKHyTbIu, 16 Ноября 2019

    Комментарии (13)
  3. C++ / Говнокод #26030

    +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
    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
    QVariant AtdItem::data(int column, int role) const {
    	if (role == Qt::DisplayRole || role == Qt::EditRole || role == Qt::ToolTipRole) {
    		if (column == 0)
    			return m_name;
    		if (column == 1)
    			return m_id;
    		if (column == 2)
    			return m_shortName;
    		if (column == 3)
    			return m_code;
    		if (column == 4)
    			return m_code_alpha_2;
    		if (column == 5)
    			return m_capital;
    		if (column == 6)
    			return m_type_id;
    		if (column == 7)
    			return m_number;
    		if (column == 8)
    			return m_dir_id;
    		if (column == 9)
    			return m_area;
    		if (column == 10)
    			return m_pop;
    		if (column == 11)
    			return m_info;
    		if (column == 12)
    			return m_reduction_name;
    		if (column == 13)
    			return m_scheme_name;
    		if (column == 14)
    			return m_num_on_scheme;
    		if (column == 15)
    			return m_code_alpha3;
    		if (column == 16)
    			return m_code_hasc;
    		if (column == 17)
    			return m_level;
    	}
    
    	if (role == Qt::UserRole) {
    		return m_id;
    	}
    	return QVariant();
    };

    уроки по switch && enum будут после обеда

    mvngr, 15 Ноября 2019

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

    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
    $ objdump -f libyjpagent64.so
    
    libyjpagent64.so:     file format elf64-x86-64
    architecture: i386:x86-64, flags 0x00000150:
    HAS_SYMS, DYNAMIC, D_PAGED
    start address 0x00000000000c2690
    
    
    $ readelf -h  libyjpagent64.so
    ELF Header:
      Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
      Class:                             ELF64
      Data:                              2's complement, little endian
      Version:                           1 (current)
      OS/ABI:                            UNIX - System V
      ABI Version:                       0
      Type:                              DYN (Shared object file)
      Machine:                           Advanced Micro Devices X86-64
      Version:                           0x1
      Entry point address:               0xc2690
      Start of program headers:          64 (bytes into file)
      Start of section headers:          5131216 (bytes into file)
      Flags:                             0x0
      Size of this header:               64 (bytes)
      Size of program headers:           56 (bytes)
      Number of program headers:         7
      Size of section headers:           64 (bytes)
      Number of section headers:         30
      Section header string table index: 29

    куик, зачем на прыщах две дублирующие друг друга утилиты?

    MAKAKA, 14 Ноября 2019

    Комментарии (12)
  5. Java / Говнокод #26028

    +1

    1. 1
    float sales = new Integer(getSalesCount()).floatValue();

    someone, 13 Ноября 2019

    Комментарии (17)
  6. Си / Говнокод #26027

    +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
    #include <stdio.h>
    #include <inttypes.h>
    #include <string.h>
    
    // endian dependend
    #define PUT3(a,b,c) (((uint64_t)a<<8*0) | ((uint64_t)b<<8*1) | ((uint64_t)c<<8*2))
    
    void testswitch(uint64_t x)
    {
      switch (x) 
      { 
        case PUT3('a','b','c'): printf("abc\n"); 
          break; 
        case PUT3('d','e','f'): printf("def\n"); 
          break; 
        case PUT3('g','h','i'): printf("ghi\n"); 
          break; 
        default: printf("Choice other than abc, def and ghi\n"); 
          break;   
       }
    }
    
    int main() 
    { 
       uint64_t x = 0;
       char a[] = "abc";
       memcpy(&x, a, sizeof(a)-1);
       testswitch(x);
    
       char b[] = "def";
       memcpy(&x, b, sizeof(a)-1);
       testswitch(x);
    
       char c[] = "ghi";
       memcpy(&x, c, sizeof(a)-1);
       testswitch(x);
       return 0; 
    }

    switch для строк!

    Перечитывал несвежие говнокоды, где я выкладывал творчество вконтактоолимпиадников https://govnokod.ru/23170#comment388376

    j123123, 12 Ноября 2019

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

    0

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

    #1: https://govnokod.ru/18142 https://govnokod.xyz/_18142
    #2: https://govnokod.ru/18378 https://govnokod.xyz/_18378
    #3: https://govnokod.ru/19667 https://govnokod.xyz/_19667
    #4: https://govnokod.ru/21160 https://govnokod.xyz/_21160
    #5: https://govnokod.ru/21772 https://govnokod.xyz/_21772
    #6: https://govnokod.ru/24063 (потёр пидор сракер) https://govnokod.xyz/_24063
    #7: https://govnokod.ru/24538 https://govnokod.xyz/_24538
    #8: https://govnokod.ru/24815 (потёр пидор сракер) https://govnokod.xyz/_24815
    #9: https://govnokod.ru/24867 https://govnokod.xyz/_24867
    #10: https://govnokod.ru/25328 https://govnokod.xyz/_25328
    #11: https://govnokod.xyz/_25436 https://govnokod.ru/25436 (потёр пидор сракер)
    #12: https://govnokod.xyz/_25471
    #13: https://govnokod.xyz/_25590 (потёр пидор сракер)
    #14: https://govnokod.xyz/_25684
    #15: https://govnokod.xyz/_25694
    #16: https://govnokod.xyz/_25725
    #17: https://govnokod.xyz/_25731
    #18: https://govnokod.xyz/_25762
    #19: https://govnokod.xyz/_25767
    #20: https://govnokod.xyz/_25776
    #21: https://govnokod.xyz/_25798
    #22: https://govnokod.xyz/_25811
    #23: http://govnokod.ru/25863 https://govnokod.xyz/_25863
    #24: http://govnokod.ru/25941 https://govnokod.xyz/_25941

    syoma, 12 Ноября 2019

    Комментарии (1225)
  8. PHP / Говнокод #26025

    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
    DBconfig.php
    <?
    function sql_connect($mysqlhost,$mysqluser,$mysqlpass,$mysqldb){
             $sql_conn=mysql_connect($mysqlhost,$mysqluser,$mysqlpass) or die("mysql_query error: " .mysql_error());
             mysql_select_db($mysqldb);
             }
    
    function sql_execute($query, $get_counter = false)
    	{
    	static $sqlquerycounter = 0;
    	if(isset($_GET['_dbg']) && isset($_GET['_sql'])){pr('['.$sqlquerycounter.'] '.$query);}
    
    	if(!$get_counter)
    		{
    		 if (!$query = mysql_query($query)) {
    			trigger_error('MySQL Error: '.mysql_error());
    		  }
    		$sqlquerycounter++;
    		return $query;
    		}
    	else {return $sqlquerycounter;}
    	}
    
    function sql_close(){
            mysql_close($sql_conn);
            }
    
    		
    ?>
    
    file.php
    
    sql_connect($_CONFIG["mysqlhost"], $_CONFIG["mysqluser"], $_CONFIG["mysqlpass"], $_CONFIG["mysqldb"]);
    $sql = sql_execute("SET NAMES UTF8");
    
    $sql = sql_execute("SELECT * FROM publications WHERE id='$_GET[id]' LIMIT 0,1");
    $res = mysql_fetch_array($sql);

    phpBidlokoder2, 11 Ноября 2019

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

    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
    <? foreach ($arResult["ITEMS"] as $i => $arItem):
                $this->AddEditAction($arItem['ID'], $arItem['EDIT_LINK'], CIBlock::GetArrayByID($arItem["IBLOCK_ID"], "ELEMENT_EDIT"));
                $this->AddDeleteAction($arItem['ID'], $arItem['DELETE_LINK'], CIBlock::GetArrayByID($arItem["IBLOCK_ID"], "ELEMENT_DELETE"), array("CONFIRM" => GetMessage('CT_BNL_ELEMENT_DELETE_CONFIRM')));
                switch ($i) {
                    case(0):
                        $case = 'bgd1';
                        break;
                    case(1):
                        $case = 'bgd2';
                        break;
                    case(2):
                        $case = 'bgd2';
                        break;
                    case(3):
                        $case = 'bgd3';
                        break;
                    default:
                        $case = 'bgd4';
                        break;
    }
     ?>

    Вот что я кукареку

    phpBidlokoder2, 11 Ноября 2019

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

    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
    <?if($arParams["DISPLAY_PICTURE"]!="N" && is_array($arItem["PREVIEW_PICTURE"])):?>
    	<?if(!$arParams["HIDE_LINK_WHEN_NO_DETAIL"] || ($arItem["DETAIL_TEXT"] && $arResult["USER_HAVE_ACCESS"])):?>
    		<span class="article_image"><img class="preview_picture" src="<?=$arItem["PREVIEW_PICTURE"]["SRC"]?>" alt="<?=$arItem["NAME"]?>" title="<?=$arItem["NAME"]?>"></span>
    	<?else:?>
    		<span class="article_image"><img class="preview_picture" src="<?=$arItem["PREVIEW_PICTURE"]["SRC"]?>" alt="<?=$arItem["NAME"]?>" title="<?=$arItem["NAME"]?>"></span>
    	<?endif;?>
    <?endif?>
    
    ....
    
    <?if($arParams["DISPLAY_NAME"]!="N" && $arItem["NAME"]):?>
    	<?if(!$arParams["HIDE_LINK_WHEN_NO_DETAIL"] || ($arItem["DETAIL_TEXT"] && $arResult["USER_HAVE_ACCESS"])):?>
    		<header><?echo $arItem["NAME"]?></header>
    	<?else:?>
    		<header><?echo $arItem["NAME"]?></header>
    	<?endif;?>
    <?endif;?>

    От создателя if (true) return true elseif (false) return false;

    phpBidlokoder2, 11 Ноября 2019

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