1. Лучший говнокод

    В номинации:
    За время:
  2. Си / Говнокод #18770

    −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
    #include<stdio.h>
    	main(void){
    	#define   SIZE 10
    	int workers[SIZE] = {0,0,0,0,0,0,0,0,0};
           int frequency[SIZE] = {0,0,0,0,0,0,0,0,0};          		
    	int freq[SIZE]  = {0,0,0,0,0,0,0,0,0};
    	int salary = 200;	
    	int  m = 0, k = 0 ,n = 0, x = 0;
    
    for( k = 1 ; 	k <= SIZE - 1  ; ++k){
       printf("inter summary cash = ");
           scanf("\n%d", &m);
    	  workers[k] = m;
    	  freq[k ]	= (int) salary +  ( workers[k] * 0.01 ) * 9;
    		printf("number index%4d  up salary $%d\n", k  , freq[k]);
    		puts("");
    	}
    
    for(n = 1;n <= SIZE  - 1; n++){
      freq[x]	=  salary +  (workers[n] * 0.01 ) * 9   ;
        if(freq[n] >= 200 && freq[n] < 1000 ){
           ++frequency[(int)  freq[n] / 100  ]  ;
    	 }
    else if ( freq[n] > 1000 ){
    	++frequency[10];
    		 }
    	}		
    		
          for(x = 2;  x <=  SIZE ; x++ ){							
    	printf("$%4d = $%4d 	%d\n",salary, salary + 99,	frequency[x]  );						
                  salary += 100;		
    		}	
    return 0;
    	}

    Задачу по Дейтелам решал.

    tyrin, 27 Сентября 2015

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

    +8

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    // большой кусок кода 
    $where = '';
    if (strlen($data["name"])) {
        $where = $where . " AND name = '" . $data["name"] . "'";
    }
    if (strlen($data["company"])) {
        $where = $where . " AND company = '" . $data["company"] . "'";
    }
    if (strlen($data["status"])) {
        $where = $where . " AND status = '" . $data["status"] . "'";
    }
    // большой кусок кода

    Проверка переменных на пустоту...

    koftikes, 23 Сентября 2015

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

    +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
    -webkit-text-fill-color: white;
    -webkit-text-stroke-width: 1px;
    -webkit-text-stroke-color: #333;
    -moz-text-fill-color: white;
    -moz-text-stroke-width: 1px;
    -moz-text-stroke-color: #;
    text-shadow:
       1px 1px 0 #333,
     -1px -1px 0 #333,  
      1px -1px 0 #333,
      -1px 1px 0 #333,
       1px 1px 0 #333;

    Сколько нужно строчек CSS, чтобы сделать бордер у букв? (все-равно с разрывами...)

    keitoaino, 13 Сентября 2015

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

    +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
    ...
            <tr>
              <td class=ArtelAdminTableTdCaption>Заголовок&nbsp;&nbsp;&nbsp;
              <td><input type=text name=f[caption] value="<?=$row['sct_caption']?>" size=50 style=width:340>
            </tr>
    		</table>
        </tr>
    
      <tr>
        <td><input type=submit name=save_Goods_supcatalog3s value="Сохранить">
      </tr>
     </form>
    </table>
    
    ...

    WOW! WOW! WOW!

    tutov2013, 03 Сентября 2015

    Комментарии (1)
  6. PHP / Говнокод #18662

    +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
    // чето у меня совсем хуёво с сортировками
            if ($a['TYPE_CODE'] == static::STORAGE_TYPE_MAIN && $b['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS) {
                return -1;
            }
    
            if ($a['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS  && $b['TYPE_CODE'] == static::STORAGE_TYPE_MAIN) {
                return 1;
            }
            if (($a['TYPE_CODE'] == static::STORAGE_TYPE_MAIN  && $b['TYPE_CODE'] != static::STORAGE_TYPE_MAIN)
                || ($a['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS && $b['TYPE_CODE'] != static::STORAGE_TYPE_5DAYS)
            ) {
                return -1;
            }
    
            if (($a['TYPE_CODE'] != static::STORAGE_TYPE_MAIN && $b['TYPE_CODE'] == static::STORAGE_TYPE_MAIN)
                || ($a['TYPE_CODE'] != static::STORAGE_TYPE_5DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS)
            ) {
                return 1;
            }
    
            if (($a['TYPE_CODE'] == static::STORAGE_TYPE_MAIN && $b['TYPE_CODE'] == static::STORAGE_TYPE_MAIN)
                || ($a['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS)
            ) {
                return $a['ID'] < $b['ID'] ? -1 : 1;
            }
    
            if ($a['TYPE_CODE'] == static::STORAGE_TYPE_MAIN && $b['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS) {
                return -1;
            }
    
            if ($a['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS  && $b['TYPE_CODE'] == static::STORAGE_TYPE_MAIN) {
                return 1;
            }
            if (($a['TYPE_CODE'] == static::STORAGE_TYPE_MAIN  && $b['TYPE_CODE'] != static::STORAGE_TYPE_MAIN)
                || ($a['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS && $b['TYPE_CODE'] != static::STORAGE_TYPE_7DAYS)
            ) {
                return -1;
            }
    
            if (($a['TYPE_CODE'] != static::STORAGE_TYPE_MAIN && $b['TYPE_CODE'] == static::STORAGE_TYPE_MAIN)
                || ($a['TYPE_CODE'] != static::STORAGE_TYPE_7DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS)
            ) {
                return 1;
            }
    
            if (($a['TYPE_CODE'] == static::STORAGE_TYPE_MAIN && $b['TYPE_CODE'] == static::STORAGE_TYPE_MAIN)
                || ($a['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS)
            ) {
                return $a['ID'] < $b['ID'] ? -1 : 1;
            }
    
            if ($a['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS) {
                return -1;
            }
    
            if ($a['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS  && $b['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS) {
                return 1;
            }
            if (($a['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS  && $b['TYPE_CODE'] != static::STORAGE_TYPE_5DAYS)
                || ($a['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS && $b['TYPE_CODE'] != static::STORAGE_TYPE_7DAYS)
            ) {
                return -1;
            }
    
            if (($a['TYPE_CODE'] != static::STORAGE_TYPE_5DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS)
                || ($a['TYPE_CODE'] != static::STORAGE_TYPE_7DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS)
            ) {
                return 1;
            }
    
            if (($a['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS)
                || ($a['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS)
            ) {
                return $a['ID'] < $b['ID'] ? -1 : 1;
            }
    
            if ($a['TYPE_CODE'] == static::STORAGE_TYPE_COMING && $b['TYPE_CODE'] == static::STORAGE_TYPE_COMING) {
                $aTs = MakeTimeStamp($a['UF_ARRIVAL_DATE']);
                $bTs = MakeTimeStamp($b['UF_ARRIVAL_DATE']);
                return $aTs < $bTs ? -1 : ($aTs > $bTs ? 1 : 0);
            }
    
            return 1;

    n1ce22rus, 03 Сентября 2015

    Комментарии (1)
  7. JavaScript / Говнокод #18645

    +8

    1. 1
    2. 2
    3. 3
    4. 4
    // Init function
    function init() {
      ...
    }

    Не говнокод, но инвормативные и полезные комментарии - это хорошо.

    keitoaino, 28 Августа 2015

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

    +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
    function getUserLocalTime() {
        var date = new Date(), h = date.getHours(), m = date.getMinutes(), offset = date.getTimezoneOffset();
        offset = -offset / 60;
        if (offset < 10) {
            offset = '0' + Math.abs(offset);
        }
        offset = (sign(offset) ? '+' : '-') + offset;
        if (m < 10) {
            m = '0' + m;
        }
        return offset;
    }
    function sign(x) {
        x = +x;
        if (x === 0 || isNaN(x))
            return x
        return x > 0 ? 1 : -1
    }

    Ещё одно гениальное определение, временной зоны.

    doggeddiesel, 27 Августа 2015

    Комментарии (1)
  9. JavaScript / Говнокод #18635

    +4

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    # CoffeeScript
    
    @allowLoadContentFromHistory = ->
      @loadContentFromHistory = true
    
    @denyLoadContentFromHistory = ->
      @loadContentFromHistory = false

    Нам нужны глобальные функции чтобы сменить глобальные переменные...

    monstrodev, 26 Августа 2015

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

    −98

    1. 1
    Если ЗапретНаСозданиеРаходныхПоФирме(Фирма, Родитель) И ЭтоТакиНовый Тогда

    таки да, таки новый

    alexinzaz, 06 Августа 2015

    Комментарии (1)
  11. C# / Говнокод #18554

    +5

    1. 1
    _members[member.Member.MemberExpression.Member] = member.Member;

    В исходниках Linq2db

    vik-borisov, 31 Июля 2015

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