- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
// seen in real project
class SomeClass extends AnotherClass {
protected $_AnotherClass = null;
public function __construct() {
$this->_AnotherClass = new AnotherClass();
}
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+167
// seen in real project
class SomeClass extends AnotherClass {
protected $_AnotherClass = null;
public function __construct() {
$this->_AnotherClass = new AnotherClass();
}
}
Сочная вырезка из структуры классов.
+152
$this->Справочники = null;
А вроде серьезная система...
+174
//коллаж картинок
$total = 7;
$i = 1;
while ($i <= $total)
{
echo '<div><img src="'.$path.'picture/collage/'.$i.'.jpg" alt="Промышленное оборудование: трубогибы, пресс механический" title="Промышленное оборудование: трубогибы, пресс механический" /></div>'."\n";
$i++;
if($i > $total) break;
}
по моему простенько, но со вкусом :)
+173
// app/code/Core/Mage/Catalog/Model/Resource/Eav/Attribute.php:68
Mage::throwException('0_o');
Из Magento 1.4.1.0.
Когда вылетело при дебаге, решил, что пора на дурку двигать...
+172
// подключение библиотек и конфига
require_once($_SERVER["DOCUMENT_ROOT"]."/config.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/content/lib/tree.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/content/lib/func.php");
extract($_GET);
if (isset($d1)&&(f_del_date($d1)!="")) {
$arr[0]=f_n_date($d1); // очистка первой переменной
if (isset($d2)&&(f_del_date($d2)!="")) {
$arr[1]=f_n_date($d2); // очистка второй переменной
if (isset($d3)&&(f_del_date($d3)!="")) {
$arr[2]=f_n_date($d3); // очистка третьей переменной
if (isset($d4)&&(f_del_date($d4)!="")) {
$arr[3]=f_n_date($d4); // очистка четвертой переменной
if (isset($d5)&&(f_del_date($d5)!="")) {
$arr[4]=f_n_date($d5); // очистка пятой переменной
if (isset($d6)&&(f_del_date($d6)!="")) {
$arr[5]=f_n_date($d6); // очистка шестой переменной
if (isset($d7)&&(f_del_date($d7)!="")) {
$arr[6]=f_n_date($d7); // очистка седьмой переменной
if (isset($d8)&&(f_del_date($d8)!="")) {
$arr[7]=f_n_date($d8); // очистка восьмой переменной
if (isset($d9)&&(f_del_date($d9)!="")) {
$arr[8]=f_n_date($d9); // очистка девятой переменной
if (isset($d10)&&(f_del_date($d10)!="")) {
$arr[9]=f_n_date($d10); // очистка десятой переменной
if (isset($d11)&&(f_del_date($d11)!="")) {
$arr[10]=f_n_date($d11); // очистка одинадцатой переменной
}
}
}
}
}
}
}
}
}
}
}
Это чудесная CMS Black Crystal (Кристалл-чернуха), админка у нее такая же, как и сам код.
+166
header('Location: adm.php?url=' . nl2br($_SERVER['PHP_SELF']));
+162
$db->query ( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" );
while ( $row = $db->get_row () ) {
$user_group[$row['id']] = array ();
foreach ( $row as $key => $value ) {
$user_group[$row['id']][$key] = $value;
}
}
До сих пор не могу понять смысл вложенного цикла..
+121
bool isManualExecute = (Request.QueryString["Manual"] != null && Request.QueryString["Manual"].ToLower() == "true")
|| (Request.QueryString["manual"] != null && Request.QueryString["manual"].ToLower() == "true");
Передаю Вовчику привет!
+191
// I am not responsible of this code.
// They made me write it, against my will.
double penetration;
http://community.livejournal.com/programmers_fun/65300.html
+161
void __fastcall ReverseStream(TMemoryStream* Stream)
{
TMemoryStream* buf = new TMemoryStream;
buf->LoadFromStream(Stream);
__int64 size = Stream->Size;
Stream->Clear();
for (__int64 i=size-1; i >= 0; i--) {
buf->Position = i;
Stream->CopyFrom(buf, 1);
}
}
Мне cpu+mem жалко, когда такие простые задачи творят через такие навороты...