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

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

    +28

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    if (0) {
    ?>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
            <tr class="infoBoxContents">
              <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr> .... . ...

    Фрагментик из крелоада(CRELoaded).
    Жёсткая дискретная логика!

    guest, 16 Января 2009

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

    +20

    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
    while ($row = mysql_fetch_assoc($res))
    
          {
    
          echo "<td valign=top align=center>
    
    		<table width=90%><tr>
    
    		<td valign=top align=center>
    
    		<a href=# title=\"".$row['date_act']."\" onclick=\"window.open('".$_ENV['PHP_SELF']."?main=".$row['id']."','article','width=600,height=600,resizable=1,scrollbars=12');\">
    
    		<img  src=\"../../../images/yarlik/".$row['id'].".jpg\" border=0 alt=\"подробнее\"><br>".
    
    		$row['name_ru']."</a>
    
    		</td></tr></table></td>";
    
    	if ($i==3) {echo '</tr><tr>';$i=0;}
    
    	$i++;
    
          }

    Цикл выводит инфу...

    guest, 11 Января 2009

    Комментарии (16)
  4. JavaScript / Говнокод #111

    +133.2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    if (a.length > 0){
        if (a.length <> 0){
            if (a.length == 7){
                if (a.length === 7){
                    return a;
                }
            }
        }
    }

    7 раз отмерь 1 отрежь

    guest, 11 Декабря 2008

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

    +24.7

    1. 1
    str_replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $file_new);

    4страйко)

    guest, 04 Декабря 2008

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

    +29

    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
    global $page_parent; //Целочисленный массив с айдями родителя страницы
    global $page_title;  //Строковый массив с названиями страниц
    global $page_dir;    //Целочисленный массив массивов списка страниц в странице (o_O)
    global $page_dirs;   //Количество страниц в странице, если 0 то страница не содержит
    
    
    ... some code ...
    
    
    function TreeBuild($ina)
    {
    	foreach($page_dir[$ina] as $ina)
    	{
    		echo $ina.'=>'.$page_dirs[$ina].'<br>';
    		if($page_dirs[$ina] != 0)
    		{
    			TreeBuild($ina);
    		}
    	}
    	return 0;
    }
    
    TreeBuild($i);

    Нихрена не пойме с этой рекурсией

    guest, 28 Ноября 2008

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

    +1

    1. 1
    if ($text[2] == 'www.' or $text[2] == 'Www.' or $text[2] == 'wWw.' or $text[2] == 'wwW.' or $text[2] == 'WwW.' or $text[2] == 'WWw.' or $text[2] == 'wWW.' or $text[2] == 'WWW.')

    Можно было так: if(strtolower($text[2]) == 'www.')

    ququnta, 25 Марта 2024

    Комментарии (15)
  8. Python / Говнокод #28879

    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
    # Теперь нам нужны несколько изображений для выполнения
    # логического вывода. Давайте загрузим их с помощью wget.
    
    urls = [
        "https://mir-s3-cdn-cf.behance.net/project_modules/max_3840/2712bd29493563.55f6ec5e98924.jpg",
        "https://i.pinimg.com/736x/5a/8a/5c/5a8a5c4cd658580ae4719e5c96043541.jpg",
        "https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/4d222729493563.55f6420cd3768.jpg"
    ]
    downloaded_files = []
     
    for index, url in enumerate(urls, start=1):
      os.system(f"wget {url} -O pose-{index}.jpg")
      downloaded_files.append(f"pose-{index}.jpg")

    Датасаентист — не программист, и сегодня ему предстояла трудная ночь...

    https://habr.com/ru/articles/772558/

    ISO, 08 Ноября 2023

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

    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
    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
    Events.on(EventType.ClientLoadEvent, () => {
        
        const oneDialog = new BaseDialog(" ");
        oneDialog.cont.add(" ").row();
        oneDialog.cont.button("OK", () => {
            oneDialog.hide();
          
            const twoDialog = new BaseDialog(" ");
            twoDialog.cont.add(" ").row();
            twoDialog.cont.button("OK", () => {
                twoDialog.hide();
              
                const threeDialog = new BaseDialog(" ");
                threeDialog.cont.add(" ").row();
                threeDialog.cont.button("OK", () => {
                    threeDialog.hide();
                  
                    const fourDialog = new BaseDialog(" ");
                    fourDialog.cont.add(" ").row();
                    fourDialog.cont.button("OK", () => {
                        fourDialog.hide();
                      
                        const fiveDialog = new BaseDialog(" ");
                        fiveDialog.cont.add(" ").row();
                        fiveDialog.cont.button("OK", () => {
                            fiveDialog.hide();
                          
                            const sixDialog = new BaseDialog(" ");
                            sixDialog.cont.add(" ").row();
                            sixDialog.cont.button("OK", () => {
                                sixDialog.hide();
                              
                                const sevenDialog = new BaseDialog(" ");
                                sevenDialog.cont.add(" ").row();
                                sevenDialog.cont.button("OK", () => {
                                    sevenDialog.hide();
                                  
                                    const eightDialog = new BaseDialog(" ");
                                    eightDialog.cont.add(" ").row();
                                    eightDialog.cont.button("OK", () => {
                                        eightDialog.hide();
                                      
                                        const nineDialog = new BaseDialog(" ");
                                        nineDialog.cont.add(" ").row();
                                        nineDialog.cont.button("OK", () => {
                                            nineDialog.hide();
                                          
                                            const tenDialog = new BaseDialog(" ");
                                            tenDialog.cont.add(" ").row();
                                            tenDialog.cont.button("OK", () => {
                                                tenDialog.hide();
                                              
                                                const elevenDialog = new BaseDialog(" ");
                                                elevenDialog.cont.add(" ").row();
                                                elevenDialog.cont.button("OK", () => {
                                                elevenDialog.hide();
                                              
                                                    const twelveDialog = new BaseDialog(" ");
                                                    twelveDialog.cont.add(" ").row();
                                                    twelveDialog.cont.button("OK", () => {
                                                    twelveDialog.hide();
                                                    
                                                        const thirteenDialog = new BaseDialog(" ");
                                                        thirteenDialog.cont.add(" ").row();
                                                        thirteenDialog.cont.button("OK", () => {
                                                        thirteenDialog.hide();
                                                        
                                                            const fourteenDialog = new BaseDialog(" ");
                                                            fourteenDialog.cont.add(" ").row();
                                                            fourteenDialog.cont.button("OK", () => {
                                                            fourteenDialog.hide();
                                                              
                                                                const fifteenDialog = new BaseDialog(" ");
                                                                fifteenDialog.cont.add(" ").row();
                                                                fifteenDialog.cont.button("OK", () => {fifteenDialog.hide();if(Core.settings.get("wentdowntherabbithole",false)){
                                                                 const again = new BaseDialog(" ");
    // ...

    https://github.com/camelStyleUser/popup-unforked/blob/main/scripts/main.js

    girixok149, 03 Августа 2023

    Комментарии (15)
  10. Java / Говнокод #28600

    −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
    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
    import java.lang.Math;
    import java.util.Random;
    
    public class MyVector {
    
        public static MyVector[] generateVectors(int N) {
            MyVector[] generated_vectors = new MyVector[N];
            for (int i = 0; i < N; i++) {
                MyVector vec = new MyVector();
                generated_vectors[i] = vec;
            }
            return generated_vectors;
        }
    
        public MyVector(double x, double y, double z) {
            this.x = x;
            this.y = y;
            this.z = z;
        }
    
        public MyVector() {
            final Random random = new Random();
            this.x = random.nextInt();
            this.y = random.nextInt();
            this.z = random.nextInt();
        }
    
        public double getX() { return this.x; }
        public void setX(double newX) { this.x = newX; }
    
        public double getY() { return this.y; }
        public void setY(double newY) { this.y = newY; }
    
        public double getZ() { return this.z; }
        public void setZ(double newZ) { this.z = newZ; }
    
        public double getLength() {
            return Math.sqrt(Math.pow(this.x, 2) +
                             Math.pow(this.y, 2) +
                             Math.pow(this.z, 2));
        }
    
        public String toString() {
            StringBuilder representation = new StringBuilder();
            representation.
                append(" { ").
                append(this.x).
                append(" ; ").
                append(this.y).
                append(" ; ").
                append(this.z).
                append(" } ");
            return representation.toString();
        }
    
        public double scalarProduct(MyVector vec) {
            return (this.getX() * vec.getX() +
                    this.getY() * vec.getY() +
                    this.getZ() * vec.getZ());
        }
    
        public MyVector vectorProduct(MyVector vec) {
            MyVector result = new MyVector();
            result.setX(this.getY() * vec.getZ() -
                        this.getZ() * vec.getY());
            result.setY(this.getZ() * vec.getX() -
                        this.getX() * vec.getZ());
            result.setZ(this.getX() * vec.getY() -
                        this.getY() * vec.getX());
            return result;
        }
    
        public MyVector substract(MyVector vec) {
            MyVector result = new MyVector();
            result.setX(this.getX() - vec.getX());
            result.setY(this.getY() - vec.getY());
            result.setZ(this.getZ() - vec.getZ());
            return result;
        }
    
        public MyVector add(MyVector vec) {
            MyVector result = new MyVector();
            result.setX(this.getX() + vec.getX());
            result.setY(this.getY() + vec.getY());
            result.setZ(this.getZ() + vec.getZ());
            return result;
        }
    
        private double x;
        private double y;
        private double z;
    }

    Что здесь не так?

    JloJle4Ka, 13 Февраля 2023

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

    +1

    1. 1
    СТРЗАМЕНИТЬ(СОКРЛ(СТРЗАМЕНИТЬ(уатПутевойЛист.Номер, "0", " ")), " ", "0") КАК НомерПЛ,

    Удаляет нули в номере документа для вывода на печатную форму

    serving12, 18 Августа 2022

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