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

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

    +123.7

    1. 1
    7. MyColorStops[0].Color = System.Drawing.Color.FromArgb(((int)(((byte)(161)))), ((int)(((byte)(255)))), ((int)(((byte)(67)))));

    Лишние касты

    guest, 09 Апреля 2009

    Комментарии (5)
  3. Ruby / Говнокод #836

    −146.2

    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
    m = 0
    loop do 
      Dir.foreach(".") do |file|
        if file =~ /Снимок экрана \d+\.png/
          Dir.foreach("docs") do |file2|
            if file2 =~ /(\d+).png/
              m = $1.to_i if $1.to_i > m
            end
          end
          puts "moving#{file} to docs/#{m+1}.png"
          File.rename(file,"docs/#{m+1}.png")
        end
      end
      sleep 5
    end~

    Язык: ruby

    guest, 09 Апреля 2009

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

    +140.9

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    function pr($a){
    	ob_start();
    	print_r($a);
    	return str_replace("\n", "\r\n", ob_get_clean());
    }
    
    function vd($a){
    	ob_start();
    	var_dump($a);
    	return str_replace("\n", "\r\n", ob_get_clean());
    }

    guest, 07 Апреля 2009

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

    +144

    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
    $file=array();
    $cols=3;
    
    extract($_GET);
    extract($_POST);
    
    if(!@$cardfile){
    $dir=opendir("cards");
    while($files=readdir($dir)){
    if($files!="." && $files!=".."){
    $file[]=$files;
    }
    }
    closedir($dir);
    
    
    print "<table width=615 border=0 align=center>\n";
    for($c=0;$c<ceil(count($file)/$cols);$c++){
    print "<tr>";
    
    for($d=0;$d<$cols;$d++){
    $cur=$c*$cols+$d+1;
    if(@$file[$cur]){
    print "<td align=center style='border: 1px solid #d0d0d0;background: #ffffff; padding: 3;'>
    <a href=cards.php?cardfile=".$file[$cur]."><img src=thumbnail.php?file=".$file[$cur]." border=0 alt=Открытки@Kupid.uz\"></a></td>";
    }else{
    print "<td></td>";
    }
    }
    
    print "</tr>\n";
    }
    print "</table><br>\n";

    Помогите кто может!
    Мне нужно сделать цикл ячеек из таблицы и чтобы в каждую ячейку заносились данные из базы данных
    Снизу пример с моего сайта www.kupid.uz
    скрипт я готовый брал, а разобраться не могу
    Заранее спасибо!

    guest, 04 Апреля 2009

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

    +146.3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    if(isset($_POST["a"]))
        {
         $x=print_r($_POST["a"],true);
         $x=str_replace("    [","",$x);
         $x=str_replace("] => ","",$x);
         $x=str_replace("Array","",$x);
         $body="\n\n";
         $body.=$x;
         ...

    Отправка письма с содержимым формы.
    $_POST["a"] - массив передаваемый из формы

    guest, 31 Марта 2009

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

    +157.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
    <script type="text/javascript">
    stat['asian']=0;
    pics['asian']=new Array('/thumbs/0000003/0003347/0003347_005.jpg','/thumbs/0000000/0000340/0000340_005.jpg','/thumbs/0000003/0003286/0003286_005.jpg','/thumbs/0000002/0002807/0002807_005.jpg','/thumbs/0000000/0000736/0000736_005.jpg');
    stat['anal']=0;
    pics['anal']=new Array('/thumbs/0000000/0000110/0000110_005.jpg','/thumbs/0000011/0011314/0011314_005.jpg','/thumbs/0000000/0000110/0000110_005.jpg','/thumbs/0000008/0008106/0008106_005.jpg','/thumbs/0000015/0015500/0015500_005.jpg');
    stat['gay']=0;
    pics['gay']=new Array('/thumbs/0000001/0001937/0001937_005.jpg','/thumbs/0000000/0000591/0000591_005.jpg','/thumbs/0000001/0001562/0001562_005.jpg','/thumbs/0000000/0000559/0000559_005.jpg','/thumbs/0000001/0001051/0001051_005.jpg');
    stat['mature']=0;
    pics['mature']=new Array('/thumbs/0000009/0009785/0009785_005.jpg','/thumbs/0000000/0000476/0000476_005.jpg','/thumbs/0000011/0011280/0011280_005.jpg','/thumbs/0000009/0009822/0009822_005.jpg','/thumbs/0000003/0003238/0003238_005.jpg');
    stat['lesbian']=0;
    pics['lesbian']=new Array('/thumbs/0000010/0010760/0010760_005.jpg','/thumbs/0000012/0012678/0012678_005.jpg','/thumbs/0000009/0009686/0009686_005.jpg','/thumbs/0000010/0010389/0010389_005.jpg','/thumbs/0000000/0000519/0000519_005.jpg');
    stat['blowjob']=0;
    pics['blowjob']=new Array('/thumbs/0000011/0011320/0011320_005.jpg','/thumbs/0000006/0006367/0006367_005.jpg','/thumbs/0000011/0011487/0011487_005.jpg','/thumbs/0000012/0012655/0012655_005.jpg','/thumbs/0000009/0009602/0009602_005.jpg');
    stat['teens']=0;
    pics['teens']=new Array('/thumbs/0000003/0003770/0003770_005.jpg','/thumbs/0000004/0004427/0004427_005.jpg','/thumbs/0000010/0010795/0010795_005.jpg','/thumbs/0000010/0010079/0010079_005.jpg','/thumbs/0000008/0008470/0008470_005.jpg');
    stat['public']=0;
    pics['public']=new Array('/thumbs/0000011/0011009/0011009_005.jpg','/thumbs/0000002/0002821/0002821_005.jpg','/thumbs/0000010/0010545/0010545_005.jpg','/thumbs/0000004/0004747/0004747_005.jpg','/thumbs/0000012/0012624/0012624_005.jpg');
    stat['group']=0;
    pics['group']=new Array('/thumbs/0000009/0009736/0009736_005.jpg','/thumbs/0000019/0019419/0019419_005.jpg','/thumbs/0000020/0020848/0020848_005.jpg','/thumbs/0000005/0005308/0005308_005.jpg','/thumbs/0000000/0000410/0000410_005.jpg');
    stat['bigtits']=0;
    pics['bigtits']=new Array('/thumbs/0000013/0013906/0013906_005.jpg','/thumbs/0000012/0012874/0012874_005.jpg','/thumbs/0000008/0008778/0008778_005.jpg','/thumbs/0000010/0010558/0010558_005.jpg','/thumbs/0000006/0006816/0006816_005.jpg');
    stat['cumshot']=0;
    pics['cumshot']=new Array('/thumbs/0000009/0009602/0009602_005.jpg','/thumbs/0000002/0002602/0002602_015.jpg','/thumbs/0000006/0006421/0006421_015.jpg','/thumbs/0000001/0001352/0001352_005.jpg','/thumbs/0000006/0006530/0006530_015.jpg');
    stat['ebony']=0;
    pics['ebony']=new Array('/thumbs/0000013/0013923/0013923_005.jpg','/thumbs/0000002/0002836/0002836_005.jpg','/thumbs/0000008/0008727/0008727_005.jpg','/thumbs/0000015/0015677/0015677_005.jpg','/thumbs/0000008/0008510/0008510_005.jpg');
    stat['fetish']=0;
    pics['fetish']=new Array('/thumbs/0000011/0011028/0011028_005.jpg','/thumbs/0000010/0010212/0010212_005.jpg','/thumbs/0000010/0010187/0010187_005.jpg','/thumbs/0000000/0000314/0000314_005.jpg','/thumbs/0000016/0016852/0016852_005.jpg');
    stat['hentai']=0;
    pics['hentai']=new Array('/thumbs/0000006/0006147/0006147_005.jpg','/thumbs/0000015/0015705/0015705_005.jpg','/thumbs/0000015/0015711/0015711_005.jpg','/thumbs/0000010/0010197/0010197_005.jpg','/thumbs/0000014/0014874/0014874_005.jpg');
    stat['amateur']=0;
    pics['amateur']=new Array('/thumbs/0000010/0010511/0010511_005.jpg','/thumbs/0000009/0009992/0009992_005.jpg','/thumbs/0000010/0010601/0010601_005.jpg','/thumbs/0000010/0010704/0010704_005.jpg','/thumbs/0000011/0011465/0011465_005.jpg');
    stat['wildcrazy']=0;
    pics['wildcrazy']=new Array('/thumbs/0000000/0000726/0000726_005.jpg','/thumbs/0000006/0006540/0006540_005.jpg','/thumbs/0000001/0001227/0001227_005.jpg','/thumbs/0000006/0006540/0006540_005.jpg','/thumbs/0000011/0011672/0011672_005.jpg');

    guest, 24 Марта 2009

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

    +135.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
    String[] days = new String[7];
    for( int i = 0; i < 7; i++ ) {
      switch(i) {
        default:
        case 0:
          days[i] = "Monday";
          break;
        case 1:
          days[i] = "Tuesday";
          break;
        case 2:
          days[i] = "Wednesday";
          break;
        case 3:
          days[i] = "Thursday";
          break;
        case 4:
          days[i] = "Friday";
          break;
        case 5:
          days[i] = "Saturday";
          break;
        case 6:
          days[i] = "Sunday";
          break;
      }
    }

    Боян, наверное, но все-таки...

    guest, 24 Марта 2009

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

    +155.9

    1. 1
    2. 2
    $names = explode('_', $className);
    $fileName = join('/', $names) . '.php';

    Супер замена символов в строчке :)
    Это из куска нынче модной функции __autoload() :)

    guest, 18 Марта 2009

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

    +150

    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
    [Serializable]
        public class Key
        {
            public Key(long id, string code)
            {
                m_Id = id;
                m_Code = code;
            }
    
            public Key(long id) : this(id, null)
            {
            }
    
            public Key(string code) : this(0, code)
            {
            }
    
            public Key() : this(0, null)
            {
            }
    
            public long getId()
            {
                return (m_Id);
            }
    
            public long m_Id;
    
            public string getCode()
            {
                return (m_Code);
            }
    
            public string m_Code;
    
            public static string ToString(Key k)
            {
                return ((k == null) ? "(null)" : k.ToString());
            }
        }

    guest, 18 Марта 2009

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

    +154

    1. 1
    2. 2
    3. 3
    strlen($searchNumber) > 0 && strpos($row['to'], $searchNumber) === false && strpos($row['from'], $searchNumber) === false
    
    //strlen($searchNumber) && $row['to'] != $searchNumber && $row['from'] != $searchNumber

    проверка на равенство в ифе

    guest, 18 Марта 2009

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