1. C# / Говнокод #8511

    +131

    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
    string[] strArray1 = new string[6];
              string[] strArray2 = strArray1;
              int index1 = 0;
              DateTime now = DateTime.Now;
              string str1 = now.Month.ToString();
              strArray2[index1] = str1;
              string[] strArray3 = strArray1;
              int index2 = 1;
              now = DateTime.Now;
              string str2 = now.Day.ToString();
              strArray3[index2] = str2;
              string[] strArray4 = strArray1;
              int index3 = 2;
              now = DateTime.Now;
              string str3 = now.Year.ToString();
              strArray4[index3] = str3;
              string[] strArray5 = strArray1;
              int index4 = 3;
              now = DateTime.Now;
              string str4 = now.Hour.ToString();
              strArray5[index4] = str4;
              string[] strArray6 = strArray1;
              int index5 = 4;
              now = DateTime.Now;
              string str5 = now.Minute.ToString();
              strArray6[index5] = str5;
              string[] strArray7 = strArray1;
              int index6 = 5;
              now = DateTime.Now;
              string str6 = now.Second.ToString();
              strArray7[index6] = str6;
              Program.zipName = string.Concat(strArray1);

    jabacrack, 13 Ноября 2011

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

    +133

    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
    public static string FristChar(this string input)
        {
            if (!string.IsNullOrEmpty(input))
            {
                if (input.Length >= 1)
                {
                    return input.Substring(0, 1);
                }
                else
                {
                    return input;
                }
            }
            else
            {
                return null;
            }
        }

    http://www.extensionmethod.net/Details.aspx?ID=170

    Author: Mehrdad Ghasemi

    Killster, 13 Ноября 2011

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

    +1000

    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
    int *element_iskomoi_posledovatelnosti;
     int tempNum = 1;
    element_iskomoi_posledovatelnosti = new int [maxim];
       
        int k=index_pervogo_elementa_posledovatelnosti;
        element_iskomoi_posledovatelnosti[0]=arr[k];
        printf(" element_iskomoi_posledovatelnosti[%i]=%i\n ",1, element_iskomoi_posledovatelnosti[0]);
     
        for (int j=index_pervogo_elementa_posledovatelnosti; j< n ; j++ )
        if (arr[k]<arr[j]) 
        {
           element_iskomoi_posledovatelnosti[tempNum]=arr[j];
           printf(" element_iskomoi_posledovatelnosti[%i]=%i\n ",tempNum+1, element_iskomoi_posledovatelnosti[tempNum++]);
           k=j;
         }
    }

    Crazy_penguin, 13 Ноября 2011

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

    +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
    41. 41
    42. 42
    43. 43
    44. 44
    <?php
    class sql extends sleshs{
    	//Выборка из баззы
    	//Напоминалочка
    	//$select =Што ищим \\//$from= Где ищим\\//$where=Где именно\\//$param = Допалнительные параметры
    	function select($select,$from,$where=NULL,$param=NULL){
    		$myrow = mysql_query("SELECT ".$select." FROM ".$from." ".$where." ".$param."");
    		if(!(mysql_error())){
    			if(mysql_num_rows($myrow)){
    				return $myrow;
    				}else{return FALSE;}}else{return FALSE;}
    		}
    		
    		
    	//Запись в базу
    	function update($from,$array,$where,$param=NULL){
    		//Формируем запрос и слэшируем
    		for($i=0,$col=count($array)-1;$i<=$col;$i++){
    			$zap .=",`".key($array[$i])."`='".$this->slesh($array[$i][key($array[$i])],$array[$i]['slesh'])."'";
    			}
    		//Удоляем лишнию запятую
    		$zap{0}=' ';
    		//Отпровляем запрос
    		if(mysql_query("UPDATE `".$from."` SET ".$zap." ".$where." ".$param."")){return true;}else{return false;}
    		}
    		
    		
    	//Добавление записи в бд	
    	function insert($from,$array){
    		//Формируем запрос
    		for($i=0,$col=count($array)-1;$i<=$col;$i++){
    			$into .=",`".key($array[$i])."`";
    			$value .=",'".$this->slesh($array[$i][key($array[$i])],$array[$i]['slesh'])."'";
    			
    		}
    		$into{0}=' ';
    		$value{0}=' ';
    		if(mysql_query("INSERT INTO `".$from."` (".$into.") VALUE (".$value.")")){echo'good';}else{echo mysql_query();}
    		}
    	
    	//Удаление
    	function delete($from,$where){return mysql_query("DELETE FROM `".$from."` ".$where."");}
    	}
    ?>

    oop mysql

    lans8097, 13 Ноября 2011

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

    +152

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    $time=12843;
     
    echo $hours = floor($time/3600);
    echo '<br />';
    echo floor($minutes = ($time/3600 - $hours)*60);
    echo '<br />';
    echo $seconds = ceil(($minutes - floor($minutes))*60);

    Пых даты ...

    Sulik78, 13 Ноября 2011

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

    +163

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    if ($row['num']) $rating = round(($row['rating'] /  $row['num']), 0); else $rating = 0;
     $rating = $rating;
    
     $rated = <<<HTML
    {$rating}
    HTML;
    
     return $rated;

    Увидел это чудо программистской мысли, когда приступал к выполнению заказа.

    blide, 13 Ноября 2011

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

    +146

    1. 1
    http://macton.smugmug.com/gallery/8936708_T6zQX#593426709_ZX4pZ

    AnimeGovno-_-, 13 Ноября 2011

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

    +152

    1. 1
    <form action="/orders/saveorder/?act=update&order=<?php echo $this->order['id'];?>&plan_id=<?php echo $this->treatment_plan['id'];?>&plan=<?php echo $this->treatment_plan['treatment_plan_number'];?>" method="post" name="formas" class="order_form">

    Говнокод "среднего программиста" - как он сам себя назвал

    SuperChel, 12 Ноября 2011

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

    +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
    $er = array();
    
    $file1=$config['tpl_dir'].$config['general']['site_template'].'/style/catalog.css';
    $file2=$config['tpl_dir'].$config['general']['site_template'].'/module/catalog.html';
    $file3=$config['tpl_dir'].$config['general']['site_template'].'/module/catalog_read.html';
    $file4='modules/catalog/setup_catalog/table_catalog.MYD';
    $file5='modules/catalog/setup_catalog/table_catalog_cats.MYD';
    $file6='modules/catalog/setup_catalog/table_catalog_comments.MYD';
    $file7='modules/catalog/setup_catalog/table_catalog_rating.MYD';
    
    
    if(file_exists($file1)==True) {}else{$er[]="нет файла стилей <b>\"catalog.css\"</b> <br> он должен находиться в<b> $file1</b>"; }
    if(file_exists($file2)==True) {}else{$er[]="нет файла дизайна <b>\"catalog.html\"</b> <br> он должен находиться в<b> $file2</b>"; }
    if(file_exists($file3)==True) {}else{$er[]="нет файла дизайна <b>\"catalog_read.html\"</b> <br> он должен находиться в<b> $file3</b>"; }
    if(file_exists($file4)==True) {}else{$er[]="нет файла таблицы <b>\"table_catalog.MYD\"</b> <br> он должен находиться в<b> $file4</b>"; }
    if(file_exists($file5)==True) {}else{$er[]="нет файла таблицы <b>\"table_catalog_cats.MYD\"</b> <br> он должен находиться в<b> $file5</b>"; }
    if(file_exists($file6)==True) {}else{$er[]="нет файла таблицы <b>\"table_catalog_comments.MYD\"</b> <br> он должен находиться в<b> $file6</b>"; }
    if(file_exists($file7)==True) {}else{$er[]="нет файла таблицы <b>\"table_catalog_rating.MYD\"</b> <br> он должен находиться в<b> $file7</b>"; }

    Установщик модуля. Условия проверки доставляют: бул сравнимаем с булом (и получаем бул), вместо отрицания держим еще одну ветку условия.

    Мартин, 12 Ноября 2011

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

    +150

    1. 1
    http://www.gamedev.ru/users/?id=45914

    AnimeGovno-_-, 12 Ноября 2011

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