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

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

    +165

    1. 1
    if ($k == 'changed' && ($v == '' || $v=='0000-00-00 00:00:00')) $v = 'Не изменялся';

    skad0, 06 Июня 2011

    Комментарии (24)
  3. Си / Говнокод #6819

    +145

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    unsigned int userID;
    ...
    userID = -1;
    ...
    if( userID < 0 )

    bred, 02 Июня 2011

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

    +135

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    <div id="pointer_div">jQuery16104518015997745993=Object { events={...}}
    <div style="display: block; background: url("http://localhost/first/coord_mouse_on_pic/3/cr.gif") repeat scroll 0% 0% transparent; position: relative; padding: 0px; width: 615px; height: 417px;">
    <map id="htmlmap_com_4" name="htmlmap_com_4">jQuery16104518015997745993=Object { events={...}}
    <div id="myCanvas" style="position: relative; margin: 0px; padding: 0px;"></div>
    <div style="position: absolute; left: 424px; top: 195px; width: 2px; height: 2px; clip: rect(0pt, 2px, 2px, 0pt); padding: 0px; margin: 0px; background-color: red; overflow: hidden; opacity: 0.8;"></div>
    <div style="position: absolute; left: 426px; top: 195px; width: 2px; height: 2px; clip: rect(0pt, 2px, 2px, 0pt); padding: 0px; margin: 0px; background-color: red; overflow: hidden; opacity: 0.8;"></div>
    <div style="position: absolute; left: 424px; top: 197px; width: 4px; height: 2px; clip: rect(0pt, 4px, 2px, 0pt); padding: 0px; margin: 0px; background-color: red; overflow: hidden; opacity: 0.8;"></div>
    <div style="position: absolute; left: 424px; top: 197px; width: 2px; height: 0px; clip: rect(0pt, 2px, 0px, 0pt); padding: 0px; margin: 0px; background-color: red; overflow: hidden; opacity: 0.8;"></div>
    </div>

    -

    vulkan, 29 Мая 2011

    Комментарии (24)
  5. C# / Говнокод #6773

    +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
    using System;
    
    class C
    {
        static void Main()
        {
            क्ष(0);
        }
    
        static void क्‍ष(int x) { Console.WriteLine(1); }
        static void क्ष(object x) { Console.WriteLine(2); }
    }

    Что будет напечатано ?


    Оч понравилось, нашел на простора интырнета (пардон если повтор)

    glilya, 28 Мая 2011

    Комментарии (24)
  6. JavaScript / Говнокод #6598

    +161

    1. 1
    var ptzReq = auction.responseText.slice(auction.responseText.indexOf('id="ptzReq'+id+'"')+18+id.toString().length, auction.responseText.indexOf('id="ptzReq'+id+'"')+51+id.toString().length);

    Зато здесь хотя-бы нет jQuery.

    popoffka, 08 Мая 2011

    Комментарии (24)
  7. JavaScript / Говнокод #6555

    +162

    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
    function Turn(id, mode) {
     if(document.layers || document.all) {
      if(mode)
       eval("setTimeout(\"On(" + id + ");\",100)");
      else
       eval("setTimeout(\"Off(" + id + ");\",100)");
     }
    }
    
    function On(id){
     if(occupied_header[id]) {
      if(document.all) {
        eval("menu" + id).style.visibility = 'visible';
        eval("menu" + id).style.left = mmm.offsetLeft+9;
    
      }
      else
      if(document.layers) {
       eval("document.layers['menu" + id + "']").visibility = "show";
      }
     }
    }
    
     function Off(id){
      if(!occupied_menu[id] && !occupied_header[id]) {
       name = 'i' + id;
       if(document.all) {
        eval("menu" + id).style.visibility = 'hidden';
       }
       else if(document.layers) {
        eval("document.layers['menu" + id + "']").visibility = "hide";
       }
      }
     }

    moonie, 05 Мая 2011

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

    +68

    1. 1
    2. 2
    3. 3
    #KPACHblu {COLOR:#FF0000 !IMPORTANT;}
    #KPACHblu .CuHuu {COLOR:BLUE;COLOR:BLUE;COLOR:BLUE;COLOR:BLUE;COLOR:BLUE;}
    #KPACHblu .3EJlEHblu {COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;}

    stuffort, 04 Мая 2011

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

    +156

    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
    //было:
    	function query($sque){
    		$sque = mysql_real_escape_string($sque,$this->hdb);
    		$res = mysql_query($sque,$this->hdb);
    		if(!$res){
    			echo 'Invalid query: '.mysql_error().'; ';
    			return 0;
    		}
    		return $res;
    	}
    //добавил:
    //так как предыдущая функция иногда косячила запрос
    	function sensiblequery($sque,$arr){
    		for($i = 0; $i<count($arr); ++$i){
    			$arr[$i] = mysql_real_escape_string($arr[$i],$this->hdb);
    			$pattern = "/{var$i}/";
    			$sque = preg_replace($pattern, $arr[$i], $sque);	
    		}
    		$res = mysql_query($sque,$this->hdb);
    		if(!$res){
    			echo 'Invalid query: '.mysql_error().'; ';
    			return 0;
    		}
    		return $res;
    	}

    Такое ощущение что написал говно. Если это так подскажите как адекватней сделать...

    greshnik, 23 Апреля 2011

    Комментарии (24)
  10. bash / Говнокод #6457

    −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
    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
    #!/bin/bash
    
    export cpx=0
    export cpy=0
    cf=0
    export xf=0
    export yf=0
    while :
    do
      tput reset
      xp=`cat /tmp/X.txt`
      yp=`cat /tmp/Y.txt` 
    echo "xp $xp yp $yp"
    clear
    if [ $cpx -eq $xp ]
    then
      echo "x coincided"
      xf=1
    elif [ $cpx -gt $xp ]
    then
      let cpx--
    else
      let cpx++
    fi
    
    if [ $cpy -eq $yp ]
    then
      echo "y coincided"
      yf=1
    elif [ $cpy -gt $yp ]
    then
      let cpy--
    else
      let cpy++
    fi
    tput cup 45 130
    echo px $xp py $yp
    tput cup 46 130
    echo x $cpx y $cpy
    tput cup $cpx $cpy
    sleep 0.5s
    if [ $xf -eq 1 ]
    then
      if [ $yf -eq 1 ]
      then
        echo "Point coincide"
        exit
      fi
    fi
    done

    Move cursor in right place.

    AliceGoth, 22 Апреля 2011

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

    +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
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    '8, :.
                                                  `""`oooob."T,.
                                                ,-`".)O;8:doob.'-.
                                         ,..`'.'' -dP()d8O8Yo8:,..`,
                                       -o8b-     ,..)doOO8:':o; `Y8.`,
                                      ,..bo.,.....)OOO888o' :oO.  ".  `-.
                                    , "`"d....88OOOOO8O88o  :O8o;.    ;;,b
                                   ,dOOOOO""""""""O88888o:  :O88Oo.;:o888d
                                   ""888Ob...,-- :o88O88o:. :o'"""""""Y8OP
                                   d8888.....,.. :o8OO888:: ::
                                     ,dd8".  ,-)do8O8o:"""; :::
                                     -"",`(;O"KdOo::        :::
                                        .doo:::"""::  :.    'o:
            ,..            .;ooooooo..o:"""""     ::;. ::;.  'o.
       ,, "'    ` ..   .d;o:"""'                  ::o:;::o::  :;
       d,         , ..ooo::;                      ::oo:;::o"'.:o
      ,d'.       :OOOOO8Oo::" '.. .               ::o8Ooo:;  ;o:
      ,8:   o::oO` 88888OOo:::  o8O8Oo:::;;     ,;:oO88OOo;  '
     ,YP  , :;:O:  *888o::::  :8888Ooo::::::::::oo888888o;. ,
     dPY:  :o8O     (|)888O:O:;  O8888888888OOOO888"" Y8o:O88o; ,
    ,' O:  'ob`      "8888888Oo;;o8888888888888'"'     `8OO:.`OOb .
    '  Y:  ,:o:       `8O88888OOoo"""""""""""'           `OOob`Y8b`
       ::  ';o:        `8O88o:oOoP                       `8Oo `YO.
       `:   Oo:         `888O::oP                         88O  :OY
        :o; 8oP         :888o::P                          do:  8O:
       ,ooO:8O'       ,d8888o:O'                         dOo   ;:.
       ;O8odo'        88888O:o'                          do::  oo.:
     ''-'`"            d:O8oK  -hrr-                   dOOo'  :o":
                       `8O:;7b,.                       `"8'     Y:
                         `Oo; 8:.
                            Y8bod.

    Ву-гу-гу! Поне! Не забыли ещё?

    Govnocoder#0xFF, 12 Апреля 2011

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