- 1
++[>+++++[>++++++<-]<-]++[>+++++<-]>>+++<<+[[,----------]>>.<.<+]
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+125
++[>+++++[>++++++<-]<-]++[>+++++<-]>>+++<<+[[,----------]>>.<.<+]
ed на brainfuck'е
+131
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);
+133
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
+1000
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;
}
}
+150
<?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
+152
$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);
Пых даты ...
+163
if ($row['num']) $rating = round(($row['rating'] / $row['num']), 0); else $rating = 0;
$rating = $rating;
$rated = <<<HTML
{$rating}
HTML;
return $rated;
Увидел это чудо программистской мысли, когда приступал к выполнению заказа.
+146
http://macton.smugmug.com/gallery/8936708_T6zQX#593426709_ZX4pZ
+152
<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">
Говнокод "среднего программиста" - как он сам себя назвал
+162
$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>"; }
Установщик модуля. Условия проверки доставляют: бул сравнимаем с булом (и получаем бул), вместо отрицания держим еще одну ветку условия.