1. JavaScript / Говнокод #26441

    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
    $('#search-map').on('click', '.v-card-prev', function () {
                var v_next = $(this)
                    .parent()
                    .find('.v-card-img-block .v-card-img-hidden.active')
                    .prev();
                if ($(v_next).length == 0) {
                    $(this)
                        .parent()
                        .find('.v-card-img-hidden.active')
                        .removeClass('active');
                    $(this)
                        .parent()
                        .find('.v-card-img-hidden:last')
                        .addClass('active');
                } else {
                    $(this)
                        .parent()
                        .find('.v-card-img-hidden.active')
                        .removeClass('active');
                    $(this)
                        .parent()
                        .find(v_next)
                        .addClass('active');
                }
                $(this)
                    .parent()
                    .find('.v-card-img-hidden.active')
                    .click();
            });
    
            $('#search-map').on('click', '.offers-favorite', function () {
                var favorID = $(this)
                    .closest('.js__product')
                    .attr('data-item');
                if ($(this).hasClass('active')) var doAction = 'delete';
                else var doAction = 'add';
                updateFavorite(favorID, doAction);
                return false;
            });

    phpBidlokoder2, 18 Февраля 2020

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

    0

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

    #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.xyz/_24063
    #7: https://govnokod.ru/24538 https://govnokod.xyz/_24538
    #8: (оригинал удалён) 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
    #12: (оригинал удалён) https://govnokod.xyz/_25471
    #13: (оригинал удалён) https://govnokod.xyz/_25590
    #14: https://govnokod.ru/25684 https://govnokod.xyz/_25684
    #15: https://govnokod.ru/25694 https://govnokod.xyz/_25694
    #16: https://govnokod.ru/25725 https://govnokod.xyz/_25725
    #17: https://govnokod.ru/25731 https://govnokod.xyz/_25731
    #18: https://govnokod.ru/25762 https://govnokod.xyz/_25762
    #19: https://govnokod.ru/25767 https://govnokod.xyz/_25767
    #20: https://govnokod.ru/25776 https://govnokod.xyz/_25776
    #21: https://govnokod.ru/25798 https://govnokod.xyz/_25798
    #22: https://govnokod.ru/25811 https://govnokod.xyz/_25811
    #23: https://govnokod.ru/25863 https://govnokod.xyz/_25863
    #24: https://govnokod.ru/25941 https://govnokod.xyz/_25941
    #25: https://govnokod.ru/26026 https://govnokod.xyz/_26026
    #26: https://govnokod.ru/26050 https://govnokod.xyz/_26050
    #27: https://govnokod.ru/26340 https://govnokod.xyz/_26340
    #28: https://govnokod.ru/26372 https://govnokod.xyz/_26372
    #29: https://govnokod.ru/26385 https://govnokod.xyz/_26385
    #30: https://govnokod.ru/26413 https://govnokod.xyz/_26413
    #31: https://govnokod.ru/26423 https://govnokod.xyz/_26423

    gost, 17 Февраля 2020

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

    +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
    #include <iostream>
    #include <map>
    
    std::map<std::string, int> get_map()
    {
        return {
            { "hello", 1 },
            { "world", 2 },
            { "it's",  3 },
            { "me",    4 },
        };
    }
    
    int main()
    {
        for (auto&& [ k, v ] : get_map())
            std::cout << "k=" << k << " v=" << v << '\n';
    
        return 0;
    }

    govnokod3r, 15 Февраля 2020

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

    +5

    1. 1
    2. 2
    3. 3
    4. 4
    БОЖЕСТВЕННЫЙ СУДЪ
    МАТУШКА ЛИЧНОЕ ИМЯ РОДА В ЧЕСТИ ИНГА
    ЗАПРЕЩЕНО НАРУШАТЬ КОН СВОБОДНОЙ ВОЛИ
    УТВЕРЖДЕНО

    Пост для обсуждания, разработки и каталогизации живых доброй души коберодных вореций.

    Срать тут:

    gost, 15 Февраля 2020

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

    0

    1. 1
    https://mangalib.me/fisheye-placebo/v1/c1?page=3

    именно поэтому я за «‎SSH-соединение»

    Fike, 13 Февраля 2020

    Комментарии (120)
  6. Pascal / Говнокод #26436

    +5

    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
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    begin
                     G4.Caption:='X';
                     if G5.Caption='' then
                     begin
                       G5.Caption:='X';
                       if G6.Caption='' then
                       begin
                         G6.Caption:='X';
                         if G7.Caption='' then
                         begin
                           G7.Caption:='X';
                           if G8.Caption='' then G8.Caption:='X' else
                           if sg8=1 then
                              G8.Font.Style:=[fsBold,fsStrikeOut];
                         end else
                         if sg7=1 then
                            G7.Font.Style:=[fsBold,fsStrikeOut];
                       end else
                       if sg6=1 then
                          G6.Font.Style:=[fsBold,fsStrikeOut];
                     end else
                     if sg5=1 then
                        G5.Font.Style:=[fsBold,fsStrikeOut];
                   end else
                   if sg4=1 then
                      G4.Font.Style:=[fsBold,fsStrikeOut];
                 end else
                 if sg3=1 then
                    G3.Font.Style:=[fsBold,fsStrikeOut];
               end else
               if sg2=1 then
                  G2.Font.Style:=[fsBold,fsStrikeOut];
               if H2.Caption='' then H2.Caption:='X' else
               if sh2=1 then H2.Font.Style:=[fsBold,fsStrikeOut];
               if F2.Caption='' then
               begin
                 F2.Caption:='X';
                 if E3.Caption='' then
                 begin
                   E3.Caption:='X';
                   if D4.Caption='' then
                   begin
                     D4.Caption:='X';
                     if C5.Caption='' then
                     begin
                       C5.Caption:='X';
                       if B6.Caption='' then
                       begin
                         B6.Caption:='X';
                         if A7.Caption='' then A7.Caption:='X' else
                         if sa7=1 then
                         A7.Font.Style:=[fsBold,fsStrikeOut];
                       end else
                       if sb6=1 then
                       B6.Font.Style:=[fsBold,fsStrikeOut];
                     end else
                     if sc5=1 then
                     C5.Font.Style:=[fsBold,fsStrikeOut];
                   end else
                   if sd4=1 then
                   D4.Font.Style:=[fsBold,fsStrikeOut];
                 end else
                 if se3=1 then
                 E3.Font.Style:=[fsBold,fsStrikeOut];
               end else
               if sf2=1 then
               F2.Font.Style:=[fsBold,fsStrikeOut];
             end;
          6: begin //Король
        {E1}   if ((se1=1) and not ((E1.Caption<>'Ферзь') or (E1.Caption<>'Ладья') or (E1.Caption<>'Король')) or
        {D1}   ((sd1=1) and not ((E1.Caption='') and ((D1.Caption='Ферзь') or (D1.Caption='Ладья')))) or
        {C1}   ((sc1=1) and not (((E1.Caption='') and (D1.Caption='')) and ((C1.Caption='Ферзь') or (C1.Caption='Ладья')))) or
        {B1}   ((sb1=1) and not (((E1.Caption='') and (D1.Caption='') and (C1.Caption='')) and ((B1.Caption='Ферзь') or (B1.Caption='Ладья')))) or
        {A1}   ((sa1=1) and not (((E1.Caption='') and (D1.Caption='') and (C1.Caption='') and (B1.Caption='')) and ((A1.Caption='Ферзь') or (A1.Caption='Ладья')))) or
        {E2}   ((se2=1) and not ((E2.Caption='Слон') or (E2.Caption='Ферзь') or (E2.Caption='Пешка') or (E2.Caption='Король'))) or
        //ПРОДОВЖИТИ
        {D3}   ((sd3=1) and not ((E2.Caption='') and ((D3.Caption='Ферзь') or (D3.Caption='Слон')))) or
        {C4}   ((sc4=1) and not (((E2.Caption='') and (D3.Caption='')) and ((C4.Caption='Ферзь') or (C4.Caption='Слон')))) or
        {B5}   ((sb5=1) and not (((E2.Caption='') and (D3.Caption='') and (C4.Caption='')) and ((B5.Caption='Ферзь') or (B5.Caption='Слон')))) or
        {A6}   ((sa6=1) and not (((E2.Caption='') and (D3.Caption='') and (C4.Caption='') and (B5.Caption='')) and ((A6.Caption='Ферзь') or (A6.Caption='Ладья')))) or
        {F2}   ((sf2=1) and not (E2.Caption='Ладья') or (E2.Caption='Ферзь')) or
        {F3}   ((sf3=1) and not ((F2.Caption='') and ((F3.Caption='Ферзь') or (F3.Caption='Ладья')))) or
        {F4}   ((sf4=1) and not (((F2.Caption='') and (F3.Caption='')) and ((F4.Caption='Ферзь') or (F4.Caption='Ладья')))) or
        {F5}   ((sf5=1) and not (((F2.Caption='') and (F3.Caption='') and (F4.Caption='')) and ((F5.Caption='Ферзь') or (F5.Caption='Ладья')))) or
        {F6}   ((sf6=1) and not (((F2.Caption='') and (F3.Caption='') and (F4.Caption='') and (F5.Caption='')) and ((F6.Caption='Ферзь') or (F6.Caption='Ладья')))) or
        {F7}   ((sf7=1) and not (((F2.Caption='') and (F3.Caption='') and (F4.Caption='') and (F5.Caption='') and (F6.Caption='')) and ((F7.Caption='Ферзь') or (F7.Caption='Ладья')))) or
        {F8}   ((sf8=1) and not (((F2.Caption='') and (F3.Caption='') and (F4.Caption='') and (F5.Caption='') and (F6.Caption='') and (F7.Caption='')) and ((F8.Caption='Ферзь') or (F8.Caption='Ладья')))) or
        {G2}   ((sg2=1) and not (G2.Caption='Ферзь') or (G2.Caption='Слон')) or
        {H3}   ((sh3=1) and not ((G2.Caption='') and ((H3.Caption='Ферзь') or (H3.Caption='Слон')))) or
        {H1}   ((sh1=1) and not (H1.Caption'Ферзь') or (H1.Caption='Слон')) or
       {Кони}  ((sh2=1) and not (H2.Caption='Конь')) or ((sg3=1) and not (G3.Caption='Конь')) or  ((se3=1) and not (E3.Caption='Конь')) or  ((sd2=1) and not(D2.Caption='Конь'))
               ) then if (F1.Caption='') then F1.Caption:='X' else
               if sf1=1 then F1.Font.Style:=[fsBold,fsStrikeOut];
             end;

    Как-то на первом или втором курсе недоунивера возникло желание сделать шахматы в ООП на Паскале. Решил закодить 64 кнопки (8*8 поле). Сделал переменные для идентификации хода черных/белых, для 2 режимов, в первом из которых кликаешь на свою фигуру (надпись на кнопке) и тебе показывают доступные ходы ею (Х куда можно поставить фигуру, подчеркнутое название вражеской фигуры при возможность её забрать). Ты кликаешь, поле очищается от подсказок, фигура перемещается, проверка на шах/мат (ад), ход передается другому цвету фигур (Жирное начертание для определения) и режим взаимодействия с игровым полем опять переходит в выбор фигуры. Теоретически закодировав каждую кнопку на все возможные события шахматы были бы закончены полностью. Вот только спустя окончания кодировки первой кнопки я заYAYлся и забросил ибо говнокод вышел в 1000 строк на одну YAYдь кнопку. Разумеется, показать могу лишь часть

    Zick, 12 Февраля 2020

    Комментарии (38)
  7. Java / Говнокод #26435

    +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
    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
    package clojure.lang;
    
    import java.io.Serializable;
    import java.util.*;
    
    public abstract class APersistentVector extends AFn implements IPersistentVector, Iterable,
                                                                   List,
                                                                   RandomAccess, Comparable,
                                                                   Serializable, IHashEq {
    int _hash;
    int _hasheq;
    
    public String toString(){
    	return RT.printString(this);
    }
    
    public ISeq seq(){
    	if(count() > 0)
    		return new Seq(this, 0);
    	return null;
    }
    
    public ISeq rseq(){
    	if(count() > 0)
    		return new RSeq(this, count() - 1);
    	return null;
    }
    
    static boolean doEquals(IPersistentVector v, Object obj){
        if(obj instanceof IPersistentVector)
            {
            IPersistentVector ov = (IPersistentVector) obj;
            if(ov.count() != v.count())
                return false;
            for(int i = 0;i< v.count();i++)
                {
                if(!Util.equals(v.nth(i), ov.nth(i)))
                    return false;
                }
            return true;
            }
    	else if(obj instanceof List)
            {
    		Collection ma = (Collection) obj;
    		if(ma.size() != v.count() || ma.hashCode() != v.hashCode())
    			return false;
    		for(Iterator i1 = ((List) v).iterator(), i2 = ma.iterator();
    		    i1.hasNext();)
    			{
    			if(!Util.equals(i1.next(), i2.next()))
    				return false;
    			}
    		return true;
    		}
    	else
            {
    		if(!(obj instanceof Sequential))
    			return false;
    		ISeq ms = RT.seq(obj);
    		for(int i = 0; i < v.count(); i++, ms = ms.next())
    			{
    			if(ms == null || !Util.equals(v.nth(i), ms.first()))
    				return false;
    			}
    		if(ms != null)
    			return false;
    		}
    
    	return true;
    
    }

    Я решил попробовать Clojure: скачал Intellij Idea Comunity Edition поставил Cursive. Кодил значится, кодил, решил посмотре реализацию некоторых функци, начал шерстить по исходникам и дошел до джавовских исходников реализации кложура. Идея мне любезно предложила вместо декомпилированого кода скачать исходники и читать их. Я согласился и скачал, после чего увидел это. Исходное форматирование сохранено.
    Это пиздец, товарищи. Кложур как язык - очень хорош, вот прям очень. Но мне в голове не укладывается что вот эта патлатая курва https://github.com/richhickey создатель такого крутого языка, не умеет в форматирование кода. Весь репозиторий - тупо рандом. Как блять, можно делать реализацию языка и даже блять не сделать код стайл. Вы можете подумать, что это и есть код стайл. Но хер там плавал, местами есть привычное джавовское форматирование, местами куча закоментированного кода. Короче полный бардак. Вот, наслаждайтесь https://github.com/clojure/clojure

    На самом деле я не сильно то и разочарован. Да и вообще, я пытался смотреть видео с его докладами - меня просто тошнит от него. Тошнит точно так же, как от препода из универа, который вроде бы и шарит, вроде бы и что-то рассказывает, но без малейшего энтузиазма - просто поток текста, монотонный и неинтересный. У человека просто нету таланта/желания именно донести и поджечь интерес.
    За создание кложура я его уважаю. Мне просто непонятно, как человек который создал такой хороши язык, не имеет понятия код стайл. Ваши мисли?

    Lorip1971, 11 Февраля 2020

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

    +2

    1. 1
    Дорогие товарищи!

    В этом посте проводятся выборы говнозидента.
    Проявите свой гражданский говнодолг: проголосуйте за лучшего кандидата!

    Для кандидатов: баллотироваться под первым комментарием.

    gost, 11 Февраля 2020

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

    0

    1. 1
    https://pastebin.com/ABfdEgS5

    Выкладываю не глядя мой код примерно 12-го года.

    vistefan, 10 Февраля 2020

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

    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
    import std.stdio;
    import std.conv: to;
    import std.json;
    import std.path;
    import std.file;
    import std.process;
    import std.string: strip;
    import std.array;
    
    import core.stdc.stdlib;
    import core.exception: RangeError;
    
    void addServer(string* serverName, string* serverPath, int* t)
    {
    	JSONValue content = parseJSON(readConfig());
    	
    	string[][] json_arr;
    	if (content.array().length != 0)
    		for (int i = 0; i < content.array().length; ++i) {
    			string ps;
    			for (int x = 0; x < content[i].toString.strip("[\"").strip("\"]").split("\",\"")[1].length; ++x)
    				if (content[i].toString.strip("[\"").strip("\"]").split("\",\"")[1][x] != '\\')
    					ps ~= content[i].toString.strip("[\"").strip("\"]").split("\",\"")[1][x];
    			json_arr ~= [
    				content[i].toString.strip("[\"").strip("\"]").split("\",\"")[0],
    				to!string(ps),
    				content[i].toString.strip("[\"").strip("\"]").split("\",\"")[2]
    			];
    		}
    	foreach (string[] key; json_arr)
    		if (key[0] == *serverName)
    			crash("This server already exists!");
    	json_arr ~= [
    		*serverName,
    		*serverPath,
    		to!string(*t)
    	];
    	std.file.write(config, JSONValue(json_arr).toPrettyString);
    }
    
    void getServerList()
    {
    	writeln("\tServer:\tPath:\tTime:");
    	immutable content = parseJSON(readConfig());
    	for (int i = 0; i < content.array().length; ++i) {
    		string ps;
    		for (int x = 0; x < content[i].toString.strip("[\"").strip("\"]").split("\",\"")[1].length; ++x)
    			if (content[i].toString.strip("[\"").strip("\"]").split("\",\"")[1][x] != '\\')
    				ps ~= content[i].toString.strip("[\"").strip("\"]").split("\",\"")[1][x];
    		writeln('\t',
    			content[i].toString.strip("[\"").strip("\"]").split("\",\"")[0], ' ',
    			to!string(ps), ' ',
    			content[i].toString.strip("[\"").strip("\"]").split("\",\"")[2]
    		);
    	}
    }

    Парочка функций на языке D. Одна добавляет данные в JSON-файл, вторая их оттуда берёт и печатает в консоль.

    GDMaster, 10 Февраля 2020

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