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

    +4

    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
    public static bool isSupportedFrameworkVersion()
    	{
    		try
    		{
    			string s = null;
    			string m = s + "";
    		}
    		catch
    		{
    			return false;
    		}
    		return true;
    	}

    Нашел в нашем проекте. Не поверил. Проверил. Взлолировал.
    http://ideone.com/laV7up

    LispGovno, 12 Апреля 2016

    Комментарии (69)
  2. C++ / Говнокод #19804

    +1

    1. 1
    https://www.google.com/search?q=%D0%B2%D0%BE%D1%80%D0%B5%D1%86%D0%B8%D0%B8

    Насрали так, что все ссылки ведут на говнокод.
    Как эта херомантия называется в науке?
    3.14159265359, это ты придумал слово "вореции"?

    3_dar, 12 Апреля 2016

    Комментарии (52)
  3. PHP / Говнокод #19803

    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
    switch (true) {
    case $result['Type'] === 'date':
    	$column['type'] = 'date';
    	$column['format'] = 'date';
    	break;
    case preg_match('/^(datetime|timestamp)$/',                    $result['Type'], $matches):
    	$column['type'] = $result['Type'];
    	$column['format'] = 'datetime';
    	break;
    case preg_match('/^decimal\((\d+),(\d+)\)/',                   $result['Type'], $matches):
    	$column['type'] = 'decimal';
    	$column['format'] = 'number';
    	$column['precision'] = $matches[2];
    	break;
    	
    	...

    sikamikanico, 12 Апреля 2016

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

    +4

    1. 1
    A notice tag marks out-of-service equipment, such as a fire hydrant. Included is a guide member that has one or more guide channels and which is inserted into a connector body. The CNT array is patterned by using a patterned metallic seed layer on the substrate to form the CNT array by chemical vapor deposition. The pivot arm has a biasing mechanism with a force that results in less impact force between the pivot arm roller and drive roller when the trailing edge of each mail piece passes through the take-away nip, resulting in less vibration of the weighing platform as mail pieces exit the weighing platform. The process gas is exhausted from the chamber.

    Автоматическая генерация изобретений для общественного достояния
    https://geektimes.ru/post/274156/

    Вореции на страже от патентных троллей?

    kerman, 12 Апреля 2016

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

    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
    .container .additional-item{display: block;width:100%;}
    .container .additional-item thead{display: block;width:100%;}
    .container .additional-item thead tr td{font-weight: bold;}
    .container .additional-item tbody{display: block;width:100%;}
    .container .additional-item tr{display: block;width:100%;padding:10px 0px;}
    .container .additional-item tr td{display: inline-block;text-align: center;}
    .container .additional-item tr td:nth-child(1){width:3%;}
    .container .additional-item tr td:nth-child(2){width:3%;}
    .container .additional-item tr td:nth-child(3){width:3%;}
    .container .additional-item tr td:nth-child(4){width:15%;}
    .container .additional-item tr td:nth-child(5){width:5%;}
    .container .additional-item tr td:nth-child(6){width:5%;overflow: hidden;}
    .container .additional-item tr td:nth-child(7){width:20%;overflow: hidden;}
    .container .additional-item tr td:nth-child(8){width:3%;overflow: hidden;}
    .container .additional-item tr td:nth-child(9){width:3%;overflow: hidden;}
    .container .additional-item tr td:nth-child(10){width:5%;overflow: hidden;}
    
    .container .additional-item tbody tr td:nth-child(11){font-weight: bold;color:rgb(138, 43, 23);}
    .container .additional-item tr td:nth-child(11){width:10%;overflow: hidden;}
    .container .additional-item tr td:nth-child(12){width:7.5%;overflow: hidden;}
    .container .additional-item tr td:nth-child(12) input{width:50%;margin:auto;text-align: center;}
    .container .additional-item tr td:nth-child(13){width:12%;overflow: hidden;}
    .container .additional-item tr td:nth-child(13) a{display: block;width: 95%;margin-left: 5%;height: 30px;line-height: 15px;font-size: 100%;}

    lscin, 12 Апреля 2016

    Комментарии (2)
  6. C# / Говнокод #19799

    0

    1. 1
    if (html.Contains("The report you've designed is invalid. Please verify that everything is correct."))

    Как проверить нет ли ошибок в только что сгенерированном отчете?
    Теперь я знаю где работает Капитан Очевидность! ))))
    (Из исходников одной популярной генерилки отчетов Кстати, локализованной на штук 8 языков)

    RadChand, 12 Апреля 2016

    Комментарии (0)
  7. C# / Говнокод #19798

    +3

    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
    public class MyEnglishRadGridLocalizationProvider : RadGridLocalizationProvider
    {
        public override string GetLocalizedString(string id)
        {
            switch (id)
            {
                case RadGridStringId.ConditionalFormattingPleaseSelectValidCellValue: return "Please select valid cell value";
                case RadGridStringId.ConditionalFormattingPleaseSetValidCellValue: return "Please set a valid cell value";
                case RadGridStringId.ConditionalFormattingPleaseSetValidCellValues: return "Please set a valid cell values";
                case RadGridStringId.ConditionalFormattingPleaseSetValidExpression: return "Please set a valid expression";
                case RadGridStringId.ConditionalFormattingItem: return "Item";
                case RadGridStringId.ConditionalFormattingInvalidParameters: return "Invalid parameters";
                case RadGridStringId.FilterFunctionBetween: return "Between";
                case RadGridStringId.FilterFunctionContains: return "Contains";
                case RadGridStringId.FilterFunctionDoesNotContain: return "Does not contain";
                case RadGridStringId.FilterFunctionEndsWith: return "Ends with";
                case RadGridStringId.FilterFunctionEqualTo: return "Equals";
                case RadGridStringId.FilterFunctionGreaterThan: return "Greater than";
                case RadGridStringId.FilterFunctionGreaterThanOrEqualTo: return "Greater than or equal to";
                case RadGridStringId.FilterFunctionIsEmpty: return "Is empty";
                case RadGridStringId.FilterFunctionIsNull: return "Is null";

    Зачем мне ресурсы и конфиги локализации, у меня нет времени чтобы ебаться с ними!
    Лучше я захардкожу локализацию ещё раз!

    http://docs.telerik.com/devtools/winforms/gridview/localization/localization

    gost, 12 Апреля 2016

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

    +12

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    //Если кто-то пытается изменить стандартный отчет и не является Кириллом
    if (in_array($reportId, Default_Model_DbTable_SupplierReport::getInstance()->getStandardIds()) == true
    	&& $this->me->id != Default_Model_User::getKirill()->id
    ) {
    	return false;
    }

    jbot, 12 Апреля 2016

    Комментарии (5)
  9. C# / Говнокод #19796

    +3

    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
    98. 98
    namespace БиблиотекаКлассов
    {
         public class Картинки
         {
              public Vector2 Расположение_ЖивойКартинки;
              public Vector2 Расположение_НеЖивойКартинки;
              public Texture2D Объект_ЖиваяКартинка;
              public Texture2D Объект_НеЖиваяКартинка;
    
              public class ЖивыеКартинки : Картинки
              {
    
                   private Point Переменная_Номер_Текущего_Кадра;
    
                   private int Переменная_Скорость_ЖивыхКартинок;
                   private double Переменная_ВремяРаботыКадра;
                   private double Переменная_ВремяОтНачалаРаботыВсехКадров;
                   private Rectangle Объект_Кадр;
                   private float Переменная_Поворот_ЖивойКартинки;
                   private Vector2 Переменная_Центр_Поворота;
                   private int Переменная_Количество_Строк;
                   private int Переменная_Количество_Столбцов;
                   public int Переменная_Ширина_Кадра_ЖивыхКартинок;
                   public int Переменная_Высота_Кадра_ЖивыхКартинок;
    
                   
                 
                   // Метод создания живых картинок с параметрами
                   public ЖивыеКартинки(int ЗАДАТЬ_Количество_Строк, int ЗАДАТЬ_Количество_Столбцов, double ЗАДАТЬВремяРаботыКадраВСекунду, int ЗАДАТЬ_СкоростьКартинок)
                        {
                        Переменная_Количество_Строк = ЗАДАТЬ_Количество_Строк;
                        Переменная_Количество_Столбцов = ЗАДАТЬ_Количество_Столбцов;
                        Переменная_ВремяРаботыКадра = (float)1 / ЗАДАТЬВремяРаботыКадраВСекунду;
                        Переменная_ВремяОтНачалаРаботыВсехКадров = 0;
                        Переменная_Номер_Текущего_Кадра = new Point(0, 0);
                        Переменная_Скорость_ЖивыхКартинок = ЗАДАТЬ_СкоростьКартинок;
                        }
    
                   public void Метод_ПереходПоКадрам(double ПройденноеВремя)
                        {
    
                        Переменная_ВремяОтНачалаРаботыВсехКадров += ПройденноеВремя;
    
                        if (Переменная_ВремяОтНачалаРаботыВсехКадров > Переменная_ВремяРаботыКадра)
                        {
    
                                  ++Переменная_Номер_Текущего_Кадра.X;
                                  if (Переменная_Номер_Текущего_Кадра.X >= Переменная_Количество_Столбцов)
                                  {
                                  Переменная_Номер_Текущего_Кадра.X = 0;
                                  ++Переменная_Номер_Текущего_Кадра.Y;
    
                                  if (Переменная_Номер_Текущего_Кадра.Y >= Переменная_Количество_Строк)
                                       { 
                                            Переменная_Номер_Текущего_Кадра.Y = 0;
                                       }
                                  }
    
                             Переменная_ВремяОтНачалаРаботыВсехКадров -= Переменная_ВремяРаботыКадра;
                             }
                        }
    
    
                   public void Метод_КОМП_ДвижениеЖивыхКартинок()
                   {
                   }
    
    
                   public void Метод_ЗАГРУЗКА_ЖивойКартинки(ContentManager Переменная_ContentManager, String Переменная_ДляХраненияПутиКартинки)
                        {
                        Объект_ЖиваяКартинка = Переменная_ContentManager.Load<Texture2D>(Переменная_ДляХраненияПутиКартинки);
                        }
    
                   // Рисование Картинки
                   public void Метод_РИСОВАНИЕ_ЖивойКартинки(SpriteBatch Переменная_SpriteBatch, int x)   // x - Помогает задать центр поворота картинки
                        {
                             Переменная_Ширина_Кадра_ЖивыхКартинок = Объект_ЖиваяКартинка.Width / Переменная_Количество_Столбцов;
                             Переменная_Высота_Кадра_ЖивыхКартинок = Объект_ЖиваяКартинка.Height / Переменная_Количество_Строк;
                             if (x != 0)
                             {
                                  Переменная_Центр_Поворота = Vector2.Zero;
                             }
                             if (x == 0)
                             {
                                  Переменная_Центр_Поворота = new Vector2(Переменная_Ширина_Кадра_ЖивыхКартинок / 2, Переменная_Высота_Кадра_ЖивыхКартинок / 2);
                             }
    
                             Объект_Кадр = new Rectangle(Переменная_Номер_Текущего_Кадра.X * Переменная_Ширина_Кадра_ЖивыхКартинок, Переменная_Номер_Текущего_Кадра.Y * Переменная_Высота_Кадра_ЖивыхКартинок, Переменная_Ширина_Кадра_ЖивыхКартинок, Переменная_Высота_Кадра_ЖивыхКартинок);
                             Переменная_SpriteBatch.Draw(Объект_ЖиваяКартинка, Расположение_ЖивойКартинки, Объект_Кадр, Color.White, Переменная_Поворот_ЖивойКартинки, Переменная_Центр_Поворота, 1, SpriteEffects.None, 0);
                        }
              }
    
    
              public class НеЖивыеКартинки : Картинки
              {
                   private Vector2 Переменная_Центр_Поворота;
       //            private Rectangle Объект_Кадр;
                   public int Переменная_Ширина_НеЖивыхКартинок;

    http://www.gamedev.ru/code/forum/?id=208792

    Vasia, 11 Апреля 2016

    Комментарии (89)
  10. C# / Говнокод #19795

    +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
    Action doItWrong;
    var filename = "sdf";
    using (var fileStream = new FileStream(filename,FileMode.Create))
    {
    	doItWrong=()=>
    	{
    		for(int i = 0; i < 10; i++)
    		{
    			fileStream.WriteByte(255);
    		}
    	};
    }
    doItWrong();

    Интересно, почему такое вообще не запрещают компилировать?

    tucvbif, 11 Апреля 2016

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