1. PHP / Говнокод #9206

    +150

    1. 1
    2. 2
    3. 3
    http://php.net/include/layout.inc
    http://php.net/include/site.inc
    http://php.net/include/languages.inc

    без комментариев :)

    Beat, 24 Января 2012

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

    +125

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    .middleWrapper .countryPreviewWrapper .countryPreviewContainer {}
    .middleWrapper .countryPreviewWrapper .countryPreviewContainer .item {}
    .middleWrapper .countryPreviewWrapper .countryPreviewContainer .item h2 {}
    .middleWrapper .countryPreviewWrapper .countryPreviewContainer .item hr {}
    .middleWrapper .countryPreviewWrapper .countryPreviewContainer .item span {}

    адовые цепочки

    alex_ok, 23 Января 2012

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

    +132

    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
    <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="1M"/>
          <xs:enumeration value="2M"/>
          <xs:enumeration value="3M"/>
          <xs:enumeration value="4M"/>
          <xs:enumeration value="5M"/>
          <xs:enumeration value="6M"/>
          <xs:enumeration value="7M"/>
          <xs:enumeration value="8M"/>
          <xs:enumeration value="9M"/>
          <xs:enumeration value="10M"/>
          <xs:enumeration value="11M"/>
          <xs:enumeration value="12M"/>
          <xs:enumeration value="13M"/>
          <xs:enumeration value="14M"/>
          <xs:enumeration value="15M"/>
          <xs:enumeration value="16M"/>
          <xs:enumeration value="17M"/>
          <xs:enumeration value="18M"/>
          <xs:enumeration value="19M"/>
          <xs:enumeration value="20M"/>
          <xs:enumeration value="21M"/>
          <xs:enumeration value="22M"/>
          <xs:enumeration value="23M"/>
          <xs:enumeration value="24M"/>
          <xs:enumeration value="25M"/>
          <xs:enumeration value="26M"/>
          <xs:enumeration value="27M"/>
          <xs:enumeration value="28M"/>
          <xs:enumeration value="29M"/>
          <xs:enumeration value="30M"/>
          <xs:enumeration value="31M"/>
          <xs:enumeration value="32M"/>
        </xs:restriction>
      </xs:simpleType>

    миллион, миллион алых роз

    Lure Of Chaos, 23 Января 2012

    Комментарии (7)
  4. Java / Говнокод #9203

    +77

    1. 1
    if (!employees.equals("") && employees != null) {

    gorsash, 23 Января 2012

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

    −113

    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
    with mycte as
    (
    
    select dateadd(dd, 1,@dato1)as  Dato
    
    union all
    select Dato + 1
    from    mycte    
    where   Dato + 1 <= @dato2
    )
    select count(Dato) as antall
    from    mycte
    where Dato <=@dato2
    OPTION (MAXRECURSION 0)

    Суровые нордические ребята пытаются найти разницу в днях между двумя датами с помощью рекурсии.
    И ведь dateadd они знают, а про datediff нет.
    Так же веселит OPTION (MAXRECURSION 0), который обычно устанавливают с параметром отличным от 0 в тех случаях, когда рекурсия убегает в бесконечность, чтобы хоть как-то ограничить ее. Видимо, эхо дебаггинга сего замечательного кода.

    DBdev, 23 Января 2012

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

    +121

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    private List<string> _items
    
    ...				
    
    if (_items.Count <= 0)
        return;

    Alx, 23 Января 2012

    Комментарии (94)
  7. VisualBasic / Говнокод #9200

    −107

    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
    GraphicsWindow.Width = 640
    GraphicsWindow.Height = 480
    
    GraphicsWindow.PenColor = "Yellow" 
    For i = 0 To 250
      GraphicsWindow.DrawLine(0 + i, 480 - i, 640 - i, 480 - i )
    EndFor
    
    GraphicsWindow.PenColor = "Orange"
    For i = 0 To 250 Step 10
      GraphicsWindow.DrawLine(0 + i, 480 - i, 640 - i, 480 - i)
    EndFor
    
    GraphicsWindow.BrushColor = "SteelBlue"
    GraphicsWindow.FillRectangle (0,0, 640 , 230)
    GraphicsWindow.BrushColor = "lightGreen"
    GraphicsWindow.FillTriangle(0, 480, 0, 230, 250, 230)
    GraphicsWindow.FillTriangle(640, 480, 640, 230, 390, 230)
    
    GraphicsWindow.BrushColor = "Orange"
    GraphicsWindow.FillEllipse (10, 30, 50, 50)  
    
    GraphicsWindow.PenColor = "Yellow"
    Turtle.Show()
    y = 0
    For i = 0 To 360 Step 30
    Turtle.X =35
    Turtle.Y = 55
    Turtle.Angle = i
    Turtle.PenUp()
    Turtle.Move(25)
    Turtle.PenDown()
    If y = 1 Then
      Turtle.Move(10)
      y = 0
    else  
      Turtle.Move(20)
      y = 1
    endif
    endfor

    KotoFey1ch, 23 Января 2012

    Комментарии (4)
  8. VisualBasic / Говнокод #9199

    −106

    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
    Turtle.Show()
    Turtle.Move (200)
    Turtle.TurnRight()
    Turtle.TurnRight()
    Turtle.Move(100)
    Turtle.TurnLeft()
    Turtle.Move(100)
    Turtle.TurnRight()
    Turtle.Move(100)
    Turtle.TurnRight()
    Turtle.TurnRight()
    Turtle.Move(200)
    
    Turtle.PenUp()
    Turtle.MoveTo(500, 0)
    Turtle.MoveTo(500, 250)
    Turtle.PenDown()
    Turtle.Angle = 0
    Turtle.Move(180)
    Turtle.PenUp()
    Turtle.Move(10)
    Turtle.PenDown()
    Turtle.Move(3)

    KotoFey1ch, 23 Января 2012

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

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    if($element_id===false)
            {
            	//этот  код не должен работать
                $sql = 'SELECT `countmessage` FROM `mes_topic` WHERE `id`='.(int)$board_id;
            }else{
                ....
            }

    А зачем его писать?!

    admincheg, 23 Января 2012

    Комментарии (4)
  10. PHP / Говнокод #9197

    +154

    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
    public function invokeMethod($method, $params = array()) {
                    switch (count($params)) {
                            case 0:
                                    return $this->{$method}();
                            case 1:
                                    return $this->{$method}($params[0]);
                            case 2:
                                    return $this->{$method}($params[0], $params[1]);
                            case 3:
                                    return $this->{$method}($params[0], $params[1], $params[2]);
                            case 4:
                                    return $this->{$method}($params[0], $params[1], $params[2], $params[3]);
                            case 5:
                                    return $this->{$method}($params[0], $params[1], $params[2], $params[3], $params[4]);
                            default:
                                    return call_user_func_array(array(&$this, $method), $params);
                    }
            }

    Из сорцов Lithium

    asfalanaft, 23 Января 2012

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