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

    +123

    1. 1
    2. 2
    (format t "~{~[~:R~; ~S~:;none~] chance~^, ~}" '(0 1 0 2 0 3))
    ;; first chance, second chance, third chance

    Любителям ДСЛ (а так же древесно-стружечных плит, и других керамических изделий):
    Объясните почему так работает? Наверное не говнокод, просто нихрена не понятно.

    wvxvw, 18 Октября 2012

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

    +127

    1. 1
    2. 2
    <COUNTRY>Испания</COUNTRY>
     <REGION><![CDATA[Краснодарский Край]]></REGION>

    "Максим не знал, смеяться или плакать, Максим не знал, зачем учился в школе..."(с)
    xml-выгрузка данных с одного сайта агентства недвижимости.

    twsdwf, 17 Октября 2012

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

    +129

    1. 1
    arr <- return $ map (2*) lst

    Я тут читал раздел на одном форуме по решению задач для школьников и наткнулся на такое говно.
    - let?
    - Не, не слышал.
    Подозреваю, что автор не понял, что let нужно писать без in в монадах, чтобы скомпилировалось.

    HaskellGovno, 17 Октября 2012

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

    +126

    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
    PHP (66%, 152 голосов)
    C++ (8%, 18 голосов)
    Java (5%, 12 голосов)
    Delphi (5%, 11 голосов)
    Ни одного не знаю ( (4%, 10 голосов)
    C# (4%, 9 голосов)
    JavaScript (3%, 8 голосов)
    Ни одного не знаю (2%, 5 голосов)
    C (1%, 3 голосов)
    Perl (0%, 1 голосов)
    Ассемблер (0%, 1 голосов)
    Python (0%, 0 голосов)
    Ruby (2%, 0 голосов)
    Всего голосов: 230

    Нормальная такая статистика. Прогеры явно подигрывают ruby

    Vasiliy, 16 Октября 2012

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

    +123

    1. 1
    2. 2
    fixed login dabl validation;
    dabl ajax zaproses;

    комментарий к коммиту

    crook, 03 Октября 2012

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

    +130

    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
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Centering div content in 2012 using CSS</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <style>
    
    /* align horizontally */
    .fu { width: 100%; text-align: center; }
    
    /* align vertically */
    @media all and (min-height:0px) { .fu { margin-top: 0px; }}
    @media all and (min-height:2px) { .fu { margin-top: 1px; }}
    @media all and (min-height:4px) { .fu { margin-top: 2px; }}
    @media all and (min-height:6px) { .fu { margin-top: 3px; }}
    @media all and (min-height:8px) { .fu { margin-top: 4px; }}
    @media all and (min-height:10px) { .fu { margin-top: 5px; }}
    @media all and (min-height:12px) { .fu { margin-top: 6px; }}
    @media all and (min-height:14px) { .fu { margin-top: 7px; }}
    @media all and (min-height:16px) { .fu { margin-top: 8px; }}
    @media all and (min-height:18px) { .fu { margin-top: 9px; }}
    @media all and (min-height:20px) { .fu { margin-top: 10px; }}
    @media all and (min-height:22px) { .fu { margin-top: 11px; }}
    .....
    .....
    .....
    @media all and (min-height:1994px) { .fu { margin-top: 997px; }}
    @media all and (min-height:1996px) { .fu { margin-top: 998px; }}
    @media all and (min-height:1998px) { .fu { margin-top: 999px; }}
    
    
    </style>
    </head>
    <body>
    <div class="fu">horizontally and vertically centered</div>
    </body>
    </html>​

    Центрируем содержимое дива по горизонтали и вертикали :) http://jsfiddle.net/ykrBh/

    makc3d, 02 Октября 2012

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

    +134

    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
    .events-bx-calendar .calendar-wrapper .calendar .days #day_1,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_2,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_3,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_4,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_5,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_6,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_7,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_8,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_9,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_10,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_11,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_12,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_13,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_14,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_15,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_16,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_17,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_18,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_19,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_20,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_21,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_22,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_23,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_24,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_25,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_26,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_27,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_28,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_29,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_30,
    .events-bx-calendar .calendar-wrapper .calendar .days #day_31 { padding: 5px 3px; }

    Un1oR, 27 Сентября 2012

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

    +139

    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
    // Эволюция программы
    
    foo = true;
    
    function foo(){ 
    	return true;
    }
    function foo( param ){
    	return int;
    }
    function foo( param1, param2, param3, param4, param5 ){
    	return result;
    }
    function foo( object ){
    	return {result1, result2};
    }
    class foo {
    	function bar( object1 ){
    		return result1;
    	}
    	function biz( object2 ){
    		return result2;
    	}
    }
    class factory {
    	foo = new foo();
    	bar = new bar();
    }
    
    
    server1 = new factory1();
    server2 = new factory2();
    
    // прошло миллион лет...
    ...а потом программа встала и пошла.

    просто так

    bot-minurast, 27 Сентября 2012

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

    +138

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    # it makes sense to use it only for
    # numbers up to 100
    fun StringToInteger (str) {
        int = -1;
        for (i=0; i<=100; i++) {
            if (i+"" == str) {
                int = i;
                break;
            }
        }
        return int;
    }

    Функция преобразования строк в целые числа из кода бутскрина Ubuntu на неизвестном науке кастомном скриптовом языке.
    Пруфлинк: http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/plymouth/precise/view/head:/themes/ubuntu-logo/ubuntu-logo.script#L149

    Shnatsel, 22 Сентября 2012

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

    +127

    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
    /**
       * Determines equality based upon the contents of this Box instead of the box itself.
       * As a result, it is not symmetric. Which means that for
       *
       * <pre name="code" class="scala">
       *     val foo = "foo"
       *     val boxedFoo = Full(foo)
       *     foo == boxedFoo //is false
       *     boxedFoo == foo //is true
       * </pre>
       *
       * For Full and Empty, this has the expected behavior. Equality in terms of Failure
       * checks for equivalence of failure causes.
       */
      override def equals(other: Any): Boolean = (this, other) match {
        case (Full(x), Full(y)) => x == y
        case (Full(x), y) => x == y
        case (x, y: AnyRef) => x eq y
        case _ => false
      }

    https://github.com/lift/framework/blob/master/core/common/src/main/scala/net/liftweb/common/Box.scala

    rat4, 20 Сентября 2012

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