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

    +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
    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
    package com.javarush.task.task10.task1013;
    
    /* 
    Конструкторы класса Human
    */
    
    public class Solution {
        public static void main(String[] args) {
        }
    
        public static class Human {
            // Напишите тут ваши переменные и конструкторы
            private String name;
            private int age;
            private int height;
            private String profession;
            private String sex;
            private String citizen;
    
            public Human(String name, int huy) {
                this.name = name;
                huy = huy;
            }
    
            public Human(String name, int huy, int pizda) {
                this.name = name;
                huy = huy;
                pizda = pizda;
            }
    
            public Human(String name) {
                this.name = name;
            }
    
            public Human(String name, int age, String sex) {
                this.name = name;
                this.age = age;
                this.sex = sex;
    
            }
    
            public Human(String name, int age, String sex, String profession) {
                this.name = name;
                this.age = age;
                this.sex = sex;
                this.profession = profession;
    
            }
    
            public Human(String name, int age, String sex, String profession, String citizen) {
                this.name = name;
                this.age = age;
                this.sex = sex;
                this.profession = profession;
                this.citizen = citizen;
    
            }
    
            public Human(String name, int age, int height, String sex, String profession, String citizen) {
                this.name = name;
                this.age = age;
                this.height = height;
                this.sex = sex;
                this.profession = profession;
                this.citizen = citizen;
    
            }
    
            public Human(String name, int age, int height, String sex, String profession, String citizen, boolean pidor) {
                this.name = name;
                this.age = age;
                this.height = height;
                this.sex = sex;
                this.profession = profession;
                this.citizen = citizen;
                pidor = pidor;
    
            }
    
            public Human(String name, int age, int height, String sex, String profession, String citizen, boolean pidor, boolean govno) {
                this.name = name;
                this.age = age;
                this.height = height;
                this.sex = sex;
                this.profession = profession;
                this.citizen = citizen;
                pidor = pidor;
                govno = govno;

    IIIyqpymuHckuu_nemyx, 03 Сентября 2021

    Комментарии (22)
  2. Си / Говнокод #27641

    +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
    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
    // https://github.com/layerfsd/WorkPlatForm/blob/f14a8cdd2bc3772ea4bd37a0381f5f8305a0a2c2/Common/BuilDefine.h
    
    // source file build_defs.h
    
    #ifndef BUILD_DEFS_H
    
    #define BUILD_DEFS_H
    
    #define VERSION_MAJOR 1
    // Example of __DATE__ string: "Jul 27 2012"
    //                              01234567890
    
    #define BUILD_YEAR_CH0 (__DATE__[ 7])
    #define BUILD_YEAR_CH1 (__DATE__[ 8])
    #define BUILD_YEAR_CH2 (__DATE__[ 9])
    #define BUILD_YEAR_CH3 (__DATE__[10])
    
    
    #define BUILD_MONTH_IS_JAN (__DATE__[0] == 'J' && __DATE__[1] == 'a' && __DATE__[2] == 'n')
    #define BUILD_MONTH_IS_FEB (__DATE__[0] == 'F')
    #define BUILD_MONTH_IS_MAR (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'r')
    #define BUILD_MONTH_IS_APR (__DATE__[0] == 'A' && __DATE__[1] == 'p')
    #define BUILD_MONTH_IS_MAY (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'y')
    #define BUILD_MONTH_IS_JUN (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'n')
    #define BUILD_MONTH_IS_JUL (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'l')
    #define BUILD_MONTH_IS_AUG (__DATE__[0] == 'A' && __DATE__[1] == 'u')
    #define BUILD_MONTH_IS_SEP (__DATE__[0] == 'S')
    #define BUILD_MONTH_IS_OCT (__DATE__[0] == 'O')
    #define BUILD_MONTH_IS_NOV (__DATE__[0] == 'N')
    #define BUILD_MONTH_IS_DEC (__DATE__[0] == 'D')
    
    
    #define BUILD_MONTH_CH0 \
    	((BUILD_MONTH_IS_OCT || BUILD_MONTH_IS_NOV || BUILD_MONTH_IS_DEC) ? '1' : '0')
    
    #define BUILD_MONTH_CH1 \
    	( \
    	(BUILD_MONTH_IS_JAN) ? '1' : \
    	(BUILD_MONTH_IS_FEB) ? '2' : \
    	(BUILD_MONTH_IS_MAR) ? '3' : \
    	(BUILD_MONTH_IS_APR) ? '4' : \
    	(BUILD_MONTH_IS_MAY) ? '5' : \
    	(BUILD_MONTH_IS_JUN) ? '6' : \
    	(BUILD_MONTH_IS_JUL) ? '7' : \
    	(BUILD_MONTH_IS_AUG) ? '8' : \
    	(BUILD_MONTH_IS_SEP) ? '9' : \
    	(BUILD_MONTH_IS_OCT) ? '0' : \
    	(BUILD_MONTH_IS_NOV) ? '1' : \
    	(BUILD_MONTH_IS_DEC) ? '2' : \
    	/* error default */    '?' \
    	)
    
    #define BUILD_DAY_CH0 ((__DATE__[4] >= '0') ? (__DATE__[4]) : '0')
    #define BUILD_DAY_CH1 (__DATE__[ 5])
    
    
    #define BUILD_HOUR_CH0 (__TIME__[0])
    #define BUILD_HOUR_CH1 (__TIME__[1])
    
    #define BUILD_MIN_CH0 (__TIME__[3])
    #define BUILD_MIN_CH1 (__TIME__[4])
    
    #define BUILD_SEC_CH0 (__TIME__[6])
    #define BUILD_SEC_CH1 (__TIME__[7])
    
    
    #if VERSION_MAJOR > 100
    
    #define VERSION_MAJOR_INIT \
    	((VERSION_MAJOR / 100) + '0'), \
    	(((VERSION_MAJOR % 100) / 10) + '0'), \
    	((VERSION_MAJOR % 10) + '0')
    
    #elif VERSION_MAJOR > 10
    
    #define VERSION_MAJOR_INIT \
    	((VERSION_MAJOR / 10) + '0'), \
    	((VERSION_MAJOR % 10) + '0')
    
    #else
    
    #define VERSION_MAJOR_INIT \
    	(VERSION_MAJOR + '0')
    
    #endif
    
    
    #endif // BUILD_DEFS_H

    Генерация даты через разковыривание макроса __DATE__

    j123123, 03 Сентября 2021

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

    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
    -module(pqueue).
    
    -export([ in/3
            , out/1
            , new/0
            , close/1
            ]).
    
    -type prio() :: non_neg_integer().
    
    -record(priority_queue,
            { tab :: ets:tid()
            }).
    
    -define(size, {size, size}).
    -define(seqno(PRIO), {seqno, PRIO}).
    
    -opaque t() :: #priority_queue{}.
    
    -export_type([ prio/0
                 , t/0
                 ]).
    
    -spec new() -> t().
    new() ->
      Tab = ets:new(pqueue_tab, [ordered_set]),
      ets:insert(Tab, {?size, 0}),
      #priority_queue{tab = Tab}.
    
    -spec close(t()) -> ok.
    close(#priority_queue{tab = Tab}) ->
      true = ets:delete(Tab),
      ok.
    
    -spec in(term(), prio(), t()) -> ok.
    in(Val, Prio, #priority_queue{tab = Tab}) when Prio >= 0 ->
      Key = {get_next_seqno(Tab, Prio), Prio},
      true = ets:insert_new(Tab, {Key, Val}),
      ets:update_counter(Tab, ?size, {2, 1}, {?size, 0}),
      ok.
    
    -spec out(t()) -> {value, term()} | empty.
    out(#priority_queue{tab = Tab}) ->
      case ets:first(Tab) of
        Key = {SeqNo, _Prio} when is_integer(SeqNo) ->
          Val = ets:lookup_element(Tab, Key, 2),
          ets:update_counter(Tab, ?size, {2, -1}),
          ets:delete(Tab, Key),
          {value, Val};
        _ ->
          empty
      end.
    
    %% This function generates keys that go in sequence for each
    %% individual priority level, but interleave for different priority
    %% levels. Keys with lower priority are more sparse, so they are
    %% consumed less often in the total sequence
    get_next_seqno(Tab, Prio) ->
      Delta = Prio + 1,
      Key = ?seqno(Prio),
      ets:update_counter(Tab, Key, {2, Delta}, {Key, 0}).

    Творение безумца или гения.

    CHayT, 02 Сентября 2021

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

    +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
    Complex numbers:
    >> Complex()({r: 2, i: 0} / {r: 1, i: 1} + {r: -3, i: 2}))
    <- {r: -2, i: 1}
    
    Automatic differentiation:
    Let f(x) = x^3 - 5x:
    >> var f = x => Dual()(x * x * x - {x:5, dx:0} * x);
    
    Now map it over some values:
    >> [-2,-1,0,1,2].map(a=>({x:a,dx:1})).map(f).map(a=>a.dx)
    <- [ 7, -2, -5, -2, 7 ]
    i.e. f'(x) = 3x^2 - 5.
    
    Polynoomials:
    >> Poly()([1,-2,3,-4]*[5,-6]).map((c,p)=>''+c+'x^'+p).join(' + ')
    <- "5x^0 + -16x^1 + 27x^2 + -38x^3 + 24x^4"

    В ЙажаСцрипт завезли перегрузку операторов.
    https://gist.github.com/pyrocto/5a068100abd5ff6dfbe69a73bbc510d7

    3.14159265, 02 Сентября 2021

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

    +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
    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
    .chamfer { 
      display: table;
      border-collapse: separate;
      empty-cells: show;
      background: transparent;
      display: inline-block;
      margin-bottom: 25px;
      margin-right: 25px;
      vertical-align: top;}
    .chamfer .row { 
      display: table-row;}
    .chamfer .boxcontent {
      display: table-cell;
      background: #FFFFFF;
      font-size: 24px;
      vertical-align: middle;
      min-width: 200px;
      width: 200px;
      height: 173px;}
    .chamfer .transparentbox {
      display: table-cell; 
      background: transparent;
      font-size: 24px;
      vertical-align: middle;
      min-width: 200px;
      width: 200px;}
    .chamfer .row .north-west { 
      display: table-cell;
      border: 100px solid transparent;
      border-top-width: 0px;
      border-right-width: 0px;
      border-bottom: 173px solid #FFF;
      width: 0px;}
    .chamfer .row .north-east { 
      display: table-cell;
      border: 100px solid transparent;
      border-top-width: 0px;
      border-left-width: 0px;
      border-bottom: 173px solid #FFF;
      width: 0px;}
    .chamfer .row .south-west { 
      display: table-cell;
      border: 100px solid transparent;
      border-bottom-width: 0px;
      border-right-width: 0px;
      border-top: 173px solid #FFF;
      width: 0px;}
    .chamfer .row .south-east { 
      display: table-cell;
      border: 100px solid transparent;
      border-bottom-width: 0px;
      border-left-width: 0px;
      border-top: 173px solid #FFF;
      width: 0px;}
    .chamfer .row3 .north-west { 
      border: 100px solid yellow;
      border-top-width: 0px;
      border-right-width: 0px;
      border-bottom: 173px solid red;}
    .chamfer .row3 .north-east { 
      border: 100px solid yellow;
      border-top-width: 0px;
      border-left-width: 0px;
      border-bottom: 173px solid red;}
    .chamfer .row2 .south-west { 
      border: 100px solid yellow;
      border-bottom-width: 0px;
      border-right-width: 0px;
      border-top: 173px solid #FFF;}
    .chamfer .row2 .south-east { 
      border: 100px solid yellow;
      border-bottom-width: 0px;
      border-left-width: 0px;
      border-top: 173px solid #FFF;}
    .chamfer .row4 .south-west { 
      border: 100px solid transparent;
      border-bottom-width: 0px;
      border-right-width: 0px;
      border-top: 173px solid red;}
    .chamfer .row4 .south-east { 
      border: 100px solid transparent;
      border-bottom-width: 0px;
      border-left-width: 0px;
      border-top: 173px solid red;}
    .chamfer .row2 .transparentbox, .chamfer .row3 .transparentbox {
      background: yellow;
      height: 173px;}
    .chamfer .row3 .boxcontent, .chamfer .row4 .boxcontent {
      background: red;
      height: 173px;}
    body { 
      color: #3B3A37;
      background-color: olive;}

    Реальный пример шестиугольных блоков (в виде сот) на чистом CSS2.

    Страница в действии:
    https://output.jsbin.com/xewelufoda/

    CEHT9I6PbCKuu_nemyx, 01 Сентября 2021

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

    +1

    1. 1
    https://journal.tinkoff.ru/diary-it-zhena-ekb/

    Хорошо устроилась

    3_dar, 01 Сентября 2021

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

    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
    Хрюкни #12
                 ._     __,
                  |\,../'\
                ,'. .     `.
               .--         '`.
              ( `' ,          ;
              ,`--' _,       ,'\
             ,`.____            `.
            /              `,    |
           '                \,   '
           |                /   /`,
           `,  .           ,` ./  |
           ' `.  ,'        |;,'   ,@
     ______|     |      _________,_____jv______
            `.   `.   ,'
             ,'_,','_,
             `'   `'

    #1: (vanished) https://govnokod.xyz/_26863
    #2: (vanished) https://govnokod.xyz/_26868
    #3: https://govnokod.ru/26881 https://govnokod.xyz/_26881
    #4: https://govnokod.ru/26896 https://govnokod.xyz/_26896
    #5: https://govnokod.ru/26928 https://govnokod.xyz/_26928
    #6: (vanished) https://govnokod.xyz/_26952
    #7: https://govnokod.ru/26955 https://govnokod.xyz/_26955
    #8: https://govnokod.ru/27043 https://govnokod.xyz/_27043
    #9: https://govnokod.ru/27175 https://govnokod.xyz/_27175
    #10: https://govnokod.ru/27472 https://govnokod.xyz/_27472
    #11: https://govnokod.ru/27517 https://govnokod.xyz/_27517

    nepeKamHblu_nemyx, 01 Сентября 2021

    Комментарии (523)
  8. JavaScript / Говнокод #27635

    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
    // больше говнокодить не могу. сайт не дает мне писать коменты.
    // на последок говнокод
    
                    const adapter = await navigator.gpu.requestAdapter();
                    const device = this.device = await adapter.requestDevice();
                    if (!device) {
                        document.body.className = 'error';
    		            alert("No WebGPU");
                        return;
                    }
    
                    const computeShaderSource = document.getElementById("calculate").value;
    
                    const computePipeline = device.createComputePipeline({
                        compute: {
                            module: device.createShaderModule({
                                code: computeShaderSource,
                            }),
                            entryPoint: 'main',
                        },
                    });

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

    ASD_77, 01 Сентября 2021

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

    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
    switch ($group) {
            case 'Root':
                break;
            case 'Admin':
                break;
            case 'Accountant':
                break;
            case 'Manager':
                break;
            }
    
    return $group;

    Вот так можно проверить что ничего не надо делать

    zoorg, 01 Сентября 2021

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

    +2

    1. 001
    2. 002
    3. 003
    4. 004
    5. 005
    6. 006
    7. 007
    8. 008
    9. 009
    10. 010
    11. 011
    12. 012
    13. 013
    14. 014
    15. 015
    16. 016
    17. 017
    18. 018
    19. 019
    20. 020
    21. 021
    22. 022
    23. 023
    24. 024
    25. 025
    26. 026
    27. 027
    28. 028
    29. 029
    30. 030
    31. 031
    32. 032
    33. 033
    34. 034
    35. 035
    36. 036
    37. 037
    38. 038
    39. 039
    40. 040
    41. 041
    42. 042
    43. 043
    44. 044
    45. 045
    46. 046
    47. 047
    48. 048
    49. 049
    50. 050
    51. 051
    52. 052
    53. 053
    54. 054
    55. 055
    56. 056
    57. 057
    58. 058
    59. 059
    60. 060
    61. 061
    62. 062
    63. 063
    64. 064
    65. 065
    66. 066
    67. 067
    68. 068
    69. 069
    70. 070
    71. 071
    72. 072
    73. 073
    74. 074
    75. 075
    76. 076
    77. 077
    78. 078
    79. 079
    80. 080
    81. 081
    82. 082
    83. 083
    84. 084
    85. 085
    86. 086
    87. 087
    88. 088
    89. 089
    90. 090
    91. 091
    92. 092
    93. 093
    94. 094
    95. 095
    96. 096
    97. 097
    98. 098
    99. 099
    100. 100
    // https://wandbox.org/permlink/rAilQ54oYBNsHJ3W
    
    struct blob_p(T,alias t_xmalloc,alias t_free)
    {
      blob!(T)* bl_p;
    
      size_t
      getlen
      (
      ) @trusted
      in
      {
        assert(bl_p != null);
      }
      do
      {
        return bl_p.len;
      }
    
      T*
      getdata
      (
      ) @trusted
      in
      {
        assert(this.bl_p != null);
      }
      do
      {
        return cast(T*)bl_p.data;
      }
    
    
      static bool
      cmp
      (
        typeof(this) a,
        typeof(this) b
      ) @trusted
      in
      {
        assert(a.bl_p != null);
        assert(b.bl_p != null);
      }
      do
      {
        if (a.bl_p.len != b.bl_p.len)
        {
          return false;
        }
        if(memcmp(cast(void*)a.bl_p.data, cast(void*)b.bl_p.data, a.bl_p.len * T.sizeof) != 0)
        {
          return false;
        }
        return true;
      }
    
      bool
      cmp
      (
        typeof(this) a
      ) @trusted
      in
      {
        assert(a.bl_p != null);
        assert(this.bl_p != null);
      }
      do
      {
        if (a.bl_p.len != this.bl_p.len)
        {
          return false;
        }
        if(memcmp(cast(void*)a.bl_p.data, cast(void*)bl_p.data, a.bl_p.len * T.sizeof) != 0)
        {
          return false;
        }
        return true;
      }
    
      T opIndex(size_t i)
      in
      {
        assert(bl_p != null);
        assert(bl_p.len > i);
      }
      do
      {
        return getdata()[i];
      }
    
      ~this()
      /*in
      {
        assert (cast(void*)bl_p != null);
      }
      do*/
      {
        t_free(cast(void*)bl_p);
      }

    Попробовал написать на "D" своего рода "массив" с известно каким размером

    j123123, 31 Августа 2021

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