1. C# / Говнокод #24760

    −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
    int[][] arr = new int[3][];
                arr[0] = new int[3];
                arr[1] = new int[2];
                arr[2] = new int[5];
                arr[0][2] = 16;
                arr[1][0] = 45;
                arr[2][4] = 99;
                foreach (int item in arr[0])
                    Console.Write(item + " ");
                Console.WriteLine();
                foreach (int item in arr[1])
                    Console.Write(item + " ");
                Console.WriteLine();
                foreach (int item in arr[2])
                    Console.Write(item + " ");
    
    Этот foreach просто божественен

    Auzergos, 14 Сентября 2018

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

    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
    override fun showThemeError() {
            Toast.makeText(activity, "Заполните тему", Toast.LENGTH_SHORT).show()
        }
    
        override fun showMessageError() {
            Toast.makeText(activity, "Напишите сообщение", Toast.LENGTH_SHORT).show()
        }
    
        override fun showRatingError() {
            Toast.makeText(activity, "Поставьте оценку", Toast.LENGTH_SHORT).show()
        }
    
        override fun showSendError() {
            Toast.makeText(activity, "Ошибка при отправке сообщения", Toast.LENGTH_SHORT).show()
        }

    Релизный проект который достался на доработку((((
    Android/kotlin

    MininN, 14 Сентября 2018

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

    0

    1. 1
    2. 2
    А когда исправят "1. CSRF VERIFICATION ERROR"?
    Или только у меня так?

    csrfverificatinho, 13 Сентября 2018

    Комментарии (61)
  4. C++ / Говнокод #24752

    +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
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    #include <bits/stdc++.h> 
    using namespace std; 
    int main(){
    int x1,y1,x2,y2; 
    string xy1,xy2;
    cin>>xy1>>xy2;
    if (xy1[0]=='A')x1=1;
    if (xy1[0]=='B')x1=2;
    if (xy1[0]=='C')x1=3;
    if (xy1[0]=='D')x1=4;
    if (xy1[0]=='E')x1=5;
    if (xy1[0]=='F')x1=6;
    if (xy1[0]=='G')x1=7;
    if (xy1[0]=='H')x1=8;
    
    if (xy1[1]=='1')y1=1;
    if (xy1[1]=='2')y1=2;
    if (xy1[1]=='3')y1=3;
    if (xy1[1]=='4')y1=4;
    if (xy1[1]=='5')y1=5;
    if (xy1[1]=='6')y1=6;
    if (xy1[1]=='7')y1=7;
    if (xy1[1]=='8')y1=8;
    
    if (xy2[0]=='A')x2=1;
    if (xy2[0]=='B')x2=2;
    if (xy2[0]=='C')x2=3;
    if (xy2[0]=='D')x2=4;
    if (xy2[0]=='E')x2=5;
    if (xy2[0]=='F')x2=6;
    if (xy2[0]=='G')x2=7;
    if (xy2[0]=='H')x2=8;
    
    if (xy2[1]=='1')y2=1;
    if (xy2[1]=='2')y2=2;
    if (xy2[1]=='3')y2=3;
    if (xy2[1]=='4')y2=4;
    if (xy2[1]=='5')y2=5;
    if (xy2[1]=='6')y2=6;
    if (xy2[1]=='7')y2=7;
    if (xy2[1]=='8')y2=8;
    if  ((abs(x1-x2)==1&&abs(y1-y2)==0)||
    (abs(x1-x2)==0&&abs(y1-y2)==1)||
    (abs(x1-x2)==1&&abs(y1-y2)==1)||
    (y1==y2||x1==x2||abs(x1-x2)==abs(y2-y1))||
    (y1==y2||x1==x2)||
    (abs(x1-x2)==abs(y2-y1))||
    (abs(x1-x2)==1&&abs(y1-y2)==2)|| 
    (abs(x1-x2)==2&&abs(y1-y2)==1)|| 
    (x1==x2&&((y1==2&&y2==y1+2)||(y1>=2&&y2==y1+1))))
    {
    //king
    if(abs(x1-x2)==1&&abs(y1-y2)==0)
    cout<<"King\n";
    else if(abs(x1-x2)==0&&abs(y1-y2)==1)
    cout<<"King\n";
    else if(abs(x1-x2)==1&&abs(y1-y2)==1)
    cout<<"King\n";
    //queen
    if(y1==y2||x1==x2||abs(x1-x2)==abs(y2-y1))
    cout<<"Queen\n";
    //rook
    if(y1==y2||x1==x2)
    cout<<"Rook\n";
    //bishop
    if (abs(x1-x2)==abs(y2-y1))
    cout<<"Bishop\n";
    //knight
     if(abs(x1-x2)==1&&abs(y1-y2)==2) 
    cout<<"Knight\n";
    else if(abs(x1-x2)==2&&abs(y1-y2)==1) 
    cout<<"Knight\n";
    //pawn
    if(x1==x2&&((y1==2&&y2==y1+2)||(y1>=2&&y2==y1+1)))
    cout<<"Pawn\n";
    }
    else cout<<"Nobody";
    }

    Нашел его в старом добром ACMP и он работает

    sulka, 13 Сентября 2018

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    https://r.mradx.net/img/02/039F10.png
    
    
    Даже такой гигант, как "Mail.Ru", использует "SQL". А вы продолжайте подтекать от "NoSQL"-говна.

    tuberkulez, 12 Сентября 2018

    Комментарии (20)
  6. SQL / Говнокод #24749

    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
    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
    95. 95
    96. 96
    97. 97
    SELECT *
    FROM
      (SELECT CASE
       WHEN (CASE
    		WHEN datediff(DAY,date,
    						(SELECT top (1) date
    						FROM Battles AS P2
    						WHERE P2.date > P1.date
    						ORDER BY P2.date))/365 = 0 THEN 'Y y.,'
    		ELSE cast((datediff(DAY,date,
    								(SELECT top (1) date
    								FROM Battles AS P2
    								WHERE P2.date > P1.date
    								ORDER BY P2.date))/365) AS varchar(20)) + ','
    	END + CASE
    				WHEN (datediff(DAY,date,
    								(SELECT top (1) date
    								FROM Battles AS P2
    								WHERE P2.date > P1.date
    								ORDER BY P2.date))/30 - (datediff(DAY,date,
    																	(SELECT top (1) date
    																	FROM Battles AS P2
    																	WHERE P2.date > P1.date
    																	ORDER BY P2.date))/365) * 12) = 0 THEN 'M m.'
    				ELSE cast((datediff(DAY,date,
    									(SELECT top (1) date
    									FROM Battles AS P2
    									WHERE P2.date > P1.date
    									ORDER BY P2.date))/30 - (datediff(DAY,date,
    																		(SELECT top (1) date
    																			FROM Battles AS P2
    																			WHERE P2.date > P1.date
    																			ORDER BY P2.date))/365) * 12) AS varchar(20))
    			END) = 'Y y.,M m.' THEN ''
          ELSE (CASE
            WHEN datediff(DAY,date,
                            (SELECT top (1) date
                             FROM Battles AS P2
                             WHERE P2.date > P1.date
                             ORDER BY P2.date))/365 = 0 THEN 'Y y.,'
            ELSE cast((datediff(DAY,date,
                                  (SELECT top (1) date
                                   FROM Battles AS P2
                                   WHERE P2.date > P1.date
                                   ORDER BY P2.date))/365) AS varchar(20)) + ','
        END + CASE
         WHEN (datediff(DAY,date,
                          (SELECT top (1) date
                           FROM Battles AS P2
                           WHERE P2.date > P1.date
                           ORDER BY P2.date))/30 - (datediff(DAY,date,
                                                               (SELECT top (1) date
                                                                FROM Battles AS P2
                                                                WHERE P2.date > P1.date
                                                                ORDER BY P2.date))/365) * 12) = 0 THEN 'M m.'
         ELSE cast((datediff(DAY,date,
                               (SELECT top (1) date
                                FROM Battles AS P2
                                WHERE P2.date > P1.date
                                ORDER BY P2.date))/30 - (datediff(DAY,date,
                                                                    (SELECT top (1) date
                                                                     FROM Battles AS P2
                                                                     WHERE P2.date > P1.date
                                                                     ORDER BY P2.date))/365) * 12) AS varchar(20))  END)
      END AS 'Возраст',
      date AS date1,
         (SELECT top (1) date
          FROM Battles AS P2
          WHERE P2.date > P1.date
          ORDER BY P2.date) AS date2
       FROM Battles AS P1
       WHERE
           (SELECT top (1) date
            FROM Battles AS P2
            WHERE P2.date > P1.date
            ORDER BY P2.date) IS NOT NULL) AS t
    UNION
      (SELECT CASE
       WHEN (CASE
                 WHEN datediff(DAY,date,CONVERT (date, GETDATE()))/365 = 0 THEN 'Y y.,'
                 ELSE cast((datediff(DAY,date,CONVERT (date, GETDATE()))/365) AS varchar(20)) + ','
             END + CASE
                       WHEN (datediff(DAY,date,CONVERT (date, GETDATE()))/30 - (datediff(DAY,date,CONVERT (date, GETDATE()))/365) * 12) = 0 THEN 'M m.'
                       ELSE cast((datediff(DAY,date,CONVERT (date, GETDATE()))/30 - (datediff(DAY,date,CONVERT (date, GETDATE()))/365) * 12) AS varchar(20))
                   END) = 'Y y.,M m.' THEN ''
       ELSE (CASE
                 WHEN datediff(DAY,date,CONVERT (date, GETDATE()))/365 = 0 THEN 'Y y.,'
                 ELSE cast((datediff(DAY,date,CONVERT (date, GETDATE()))/365) AS varchar(20)) + ','
             END + CASE
                       WHEN (datediff(DAY,date,CONVERT (date, GETDATE()))/30 - (datediff(DAY,date,CONVERT (date, GETDATE()))/365) * 12) = 0 THEN 'M m.'
                       ELSE cast((datediff(DAY,date,CONVERT (date, GETDATE()))/30 - (datediff(DAY,date,CONVERT (date, GETDATE()))/365) * 12) AS varchar(20))
                   END)
        END, date, CONVERT (date, GETDATE())
       FROM Battles AS T1
       WHERE
           (SELECT top (1) date    FROM Battles AS T2
            WHERE T2.date > T1.date ORDER BY T2.date) IS NULL );

    BDcorabli@ex5

    akimachan, 12 Сентября 2018

    Комментарии (3)
  7. SQL / Говнокод #24748

    +2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    select * from
    (
    select case when (case when datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365 = 0 then 'Y y.,' else cast((datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) as varchar(20)) + ',' end + case when (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/30 - (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) * 12) = 0 then 'M m.' else cast((datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/30 - (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) * 12) as varchar(20)) end) = 'Y y.,M m.' then '' else (case when datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365 = 0 then 'Y y.,' else cast((datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) as varchar(20)) + ',' end + case when (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/30 - (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) * 12) = 0 then 'M m.' else cast((datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/30 - (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) * 12) as varchar(20)) end) end as 'Возраст', date as date1, (select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date) as date2 from Battles as P1 where (select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date) is not null) as t
    union
    (select case when (case when datediff(day,date,CONVERT (date, GETDATE()))/365 = 0 then 'Y y.,' else cast((datediff(day,date,CONVERT (date, GETDATE()))/365) as varchar(20)) + ',' end + case when (datediff(day,date,CONVERT (date, GETDATE()))/30 - (datediff(day,date,CONVERT (date, GETDATE()))/365) * 12) = 0 then 'M m.' else cast((datediff(day,date,CONVERT (date, GETDATE()))/30 - (datediff(day,date,CONVERT (date, GETDATE()))/365) * 12) as varchar(20)) end) = 'Y y.,M m.' then '' else (case when datediff(day,date,CONVERT (date, GETDATE()))/365 = 0 then 'Y y.,' else cast((datediff(day,date,CONVERT (date, GETDATE()))/365) as varchar(20)) + ',' end + case when (datediff(day,date,CONVERT (date, GETDATE()))/30 - (datediff(day,date,CONVERT (date, GETDATE()))/365) * 12) = 0 then 'M m.' else cast((datediff(day,date,CONVERT (date, GETDATE()))/30 - (datediff(day,date,CONVERT (date, GETDATE()))/365) * 12) as varchar(20)) end) end, date, CONVERT (date, GETDATE()) from Battles as T1 where (select top (1) date from Battles as T2 where T2.date > T1.date order by T2.date) is null
    );

    BDcorabli@nomer5

    akimachan, 12 Сентября 2018

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

    +3

    1. 1
    https://ssr.vuejs.org/ru/

    Это победа! Столько лет героически переносить сайты на клиент (SPA! Мы разгрузим сервер! Сервер будет отдавать только JSON!) что бы в один момент пенести всё на сервер обратно из-за ёбанных сеошников.

    хуита, 12 Сентября 2018

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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    Раз уж пошли багрепорты и их начали исправлять,
    
    https://www.govnokod.ru/24743
    
    Mixed Content: The page at 'https://www.govnokod.ru/24743' was loaded over HTTPS, but requested an insecure script 'http://platform.twitter.com/widgets.js'. This request has been blocked; the content must be served over HTTPS.
    24743:127 Mixed Content: The page at 'https://www.govnokod.ru/24743' was loaded over HTTPS, but requested an insecure resource 'http://www.facebook.com/plugins/like.php?app_id=262270407124304&href=https://www.govnokod.ru/24743&send=false&layout=button_count&width=130&show_faces=true&action=like&colorscheme=light&font=arial&height=20'. This request has been blocked; the content must be served over HTTPS.

    SwiftGovno, 12 Сентября 2018

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

    +5

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    http://govnokod.ru/javascript/
    
    Forbidden
    
    You don't have permission to access /javascript/ on this server.
    Apache/2.4.18 (Ubuntu) Server at govnokod.ru Port 80

    dm_fomenok, 11 Сентября 2018

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