1. C++ / Говнокод #9518

    +991

    1. 1
    memmove(&*_Dest, &*_First, _Count * sizeof (*_First));

    в библиотеке memory, может я чего-то не понял, но выглядит как операция "подёргивание-2" (&*_Dest)

    Taru4, 23 Февраля 2012

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

    +157

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    $comment_msg=$row['comm'];
    $comment_msg=cuthtml($comment_msg);
    $comment_msg=cutbb($comment_msg);
    $comment_msg=wordwrap($comment_msg, 10, " ", 1);
    $comment_msg=viewworld($comment_msg,4).$massparam['lastend'];

    Один фрагмент из кучки говнокода, относительно популярного скрипта комментариев commentit

    dayw, 23 Февраля 2012

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

    +120

    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
    ' Program DISKRIMINANT
    CLS
    DO
        PRINT "Vvedite peremennye"
        INPUT "A"; A
        INPUT "B"; B
        INPUT "C"; C
        D = B ^ 2 - 4 * A * C
        CLS
        PRINT "A ="; A
        PRINT "B ="; B
        PRINT "C ="; C
        IF A = 0 THEN
            CLS
            WRITE "Urovnenie ne kvadratnoe"
            WRITE "Ekstrenaja ostanovka programmy"
            WRITE "Zavershenie raboty"
            SLEEP 3
            SYSTEM
            END
        END IF
        PRINT "DISKRIMINANT ="; D
        Dx = SQR(D)
        P$ = "Pechal"
        IF D > 0 THEN PRINT "x1 ="; ((0 - B) + Dx) / (2 * A), "x2="; ((0 - B) - Dx) / (2 * A)
        IF D = 0 THEN PRINT "x ="; (0 - B) / (2 * A)
        IF D < 0 THEN PRINT P$
        INPUT "Rerty(YES = 1; NO = 2)"; CLr
        IF CLr = 1 THEN CLS
    LOOP WHILE CLr = 1
    IF CLr = 2 THEN SYSTEM
    END

    Один из согруппников накодиль :D
    Ну я свиснул тихонька. Удивлению не была границ :D

    i3ookMAn, 23 Февраля 2012

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

    +172

    1. 1
    2. 2
    if ( is_int(intval($_GET['y'])) ) {
      //...

    Lowezar, 22 Февраля 2012

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

    +110

    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
    <!--
    			BEGIN RIDICULOUSLY LONG BATIK SECTION
    			
    			Do not touch. This is fragile stuff. Seriously.
    			
    			Batik just *wants* to pull xalan and xml-apis, *everywhere*,
    			even though we do not want this. And Ivy isn't clever enough
    			to ignore the dependencies everywhere.
    			
    			In an ideal world we would just explicitly depend on batik-swing
    			and batik-transcoder and be done with it. Instead we have to do
    			this atrocity. Apache, take a hint, would you kindly?
    		-->
    		<dependency org="org.apache.xmlgraphics" name="batik-xml" rev="[1.7,)">
    			<exclude org="xalan" module="xalan" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-ext" rev="[1.7,)">
    			<exclude org="xml-apis" module="xml-apis" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-css" rev="[1.7,)">
    			<exclude org="xml-apis" module="xml-apis" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-dom" rev="[1.7,)">
    			<exclude org="xml-apis" module="xml-apis" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-parser" rev="[1.7,)">
    			<exclude org="xml-apis" module="xml-apis" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-anim" rev="[1.7,)">
    			<exclude org="org.apache.xmlgraphics" module="batik-svg-dom" />
    			<exclude org="xml-apis" module="xml-apis" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-svg-dom" rev="[1.7,)">
    			<exclude org="xml-apis" module="xml-apis" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-bridge" rev="[1.7,)">
    			<exclude org="org.apache.xmlgraphics" module="batik-script" />
    			<exclude org="org.apache.xmlgraphics" module="batik-gvt" />
    			<exclude org="xml-apis" module="xml-apis" />
    			<exclude org="xalan" module="xalan" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-gvt" rev="[1.7,)">
    			<exclude org="org.apache.xmlgraphics" module="batik-script" />
    			<exclude org="xml-apis" module="xml-apis" />
    			<exclude org="xalan" module="xalan" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-gui-util" rev="[1.7,)">
    			<exclude org="xalan" module="xalan" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-script" rev="[1.7,)">
    			<exclude org="xalan" module="xalan" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-swing" rev="[1.7,)" />
    		<dependency org="org.apache.xmlgraphics" name="batik-transcoder" rev="[1.7,)" />
    		<!-- END BATIK SECTION -->

    Из ivy.xml.

    someone, 22 Февраля 2012

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

    +177

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    public static function textCorrections($text)
        {
            $text=str_replace("Ų", "Ø", $text);
            $text=str_replace("? фаски", "Ø фаски", $text);
            $text=str_replace("? отверстия", "Ø отверстия", $text);
            $text=str_replace("рем?нного", "ремённого", $text);
            return $text;
        }

    Вот такая заплатка для текстов в фомате UTF-8.

    Edd, 22 Февраля 2012

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

    +1009

    1. 1
    mExpanded = onExpandClick ? !mExpanded : mExpanded;

    lifemaker, 22 Февраля 2012

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

    +168

    1. 1
    2. 2
    3. 3
    $isHttp = $_tumbpath[0] == 'h' && $_tumbpath[1] == 't' && $_tumbpath[2] == 't' && $_tumbpath[3] == 'p';
    
    if ($isHttp){...}

    хорошо еще, что слово - http :)

    unVooDoo, 22 Февраля 2012

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

    +164

    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
    <script language="JavaScript">
                    <!--
                        document.write('<a href="#top" onclick="takeThis(\'<?php echo $PMA_Theme; ?>\'); return false;">');
                        document.write('<img src="<?php echo $screen_directory; ?>/screen.png" border="1" ');
                        if (document.getElementById) {
                            document.write('style="border: 1px solid #000000;" ');
                        }
                        document.write('alt="<?php echo htmlspecialchars(addslashes($theme_name)); ?>" ');
                        document.write('title="<?php echo htmlspecialchars(addslashes($theme_name)); ?>" />');
                        document.write('</a><br />');
                        document.write('[ <b><a href="#top" onclick="takeThis(\'<?php echo $PMA_Theme; ?>\'); return false;">');
                        document.write('<?php echo addslashes($strTakeIt); ?>');
                        document.write('</a></b> ]');
                    //-->
                    </script>

    Чужая самописная CMF. Файл themes в админке.

    zii, 22 Февраля 2012

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

    +155

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    public function get_included_js () 
     {
         if (count($this->included_js)) {
             return "\r\n".'<script type="text/javascript" src="'
             .implode('"></script>'."\r\n".'<script type="text/javascript" src="', $this->included_js)
             .'"></script>'."\r\n";
         } else {
             return '';
         }
     }

    Разгребаю чужой проект. Может быть чего-то не понимаю в этой жизни.

    zii, 22 Февраля 2012

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