- 1
- 2
- 3
- 4
- 5
- 6
/**
* Появилась из-за опечатки. См. getCurrentEnterpriseIds()
*/
public function getCurrnetEnterpriseIds($user_id) {
return $this->getCurrentEnterpriseIds($user_id);
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+157
/**
* Появилась из-за опечатки. См. getCurrentEnterpriseIds()
*/
public function getCurrnetEnterpriseIds($user_id) {
return $this->getCurrentEnterpriseIds($user_id);
}
рефакторинг? не, не слышал
+149
$data = "";
if (isset($_POST["json"]))
$data = $_POST["json"];
$send_str = "";
$jsonObj=json_decode($data);
if(json_last_error() == JSON_ERROR_NONE)
{
if ($jsonObj)
{
if (strlen($jsonObj->pass) != 32 || strlen($jsonObj->login)==0 || strlen($jsonObj->userName)==0)
{
$send_str = '{"RegistrationActionError":{"type":"2"}}';
}
else
{
// проверка на совпадение логина
if ($db->userExists($jsonObj->login))
$send_str = '{"RegistrationActionError":{"type":"1"}}';
else
{
$user = $db->createUser($jsonObj->login, $jsonObj->pass, $jsonObj->userName, $jsonObj->mail);
$send_str = '{"RegistrationActionComplete"}';
}
}
}
else
$send_str = '{"RegistrationActionError":{"type":"2"}}';
}
else
$send_str = '{"RegistrationActionError":{"type":"2"}}';
echo $send_str;
Регистрация пользователя написанная человеком который себя позиционирует как пхпе миддл )
+145
class beer
{public: beer(){beer::in();}
private: void in();void chek(int);void out(int);};
main(){beer yeeah;}
void beer::in()
{int N;std::cout << "Input N: ";std::cin>>N;int mValue[N];
for(int i=0;i<N;i++){std::cout << "Input ["<<i+1<<"] = ";std::cin>>mValue[i];}
for(int i=0;i<N;i++){beer::chek(mValue[i]);};}
void beer::chek(int Value){for(int i=2;i<Value;i++){if(Value%i==0){return;};};beer::out(Value);}
void beer::out(int Value){std::cout<<Value<<std::endl;}
Задачка на 45-50 баллов(по 50 бальной шкале), 2 курс технического ВУЗа
+141
// строка добавлена, чтобы сраный парсер говнокода не сжирал пробелы, этого в коде не было
end;
end;
end;
end;
end;
end;
Увидел в своём коде.
Очень сложный алгоритм.
+150
if (!isset($pmas_table[0][3])) $pmas_table[0][3]='';
if (!isset($pmas_table[0][5])) $pmas_table[0][5]='';
if (!isset($pmas_table[0][6])) $pmas_table[0][6]='';
if (!isset($pmas_table[0][7])) $pmas_table[0][7]='';
UserSide v2.48 again. Так как там каждая строчка имеет право быть на этом сайте, выкладываю The best of the best =)
+161
while (!$db->query("INSERT INTO lots (lot_num) VALUES (".($unicnum=rand(1,99999)).")"));
Проверка и создание уникального рандомного идентификатора
+156
string Delimiter(string Text, int Index, const char* Delimiter) {
int n = 0, find = 0;
for (int i = 0; i <= Index; i++) {
find = Text.find(Delimiter, n);
if (i == Index) {
return Text.substr(n, find - n);
}
n = find + 1;
}
return "";
}
+993
void inline WriteXY(int X, int Y, byte szText, WORD fColor = 0x01F) {
DWORD cWritten;
COORD ptCoord = {X - 1, Y - 1};
gotoxy(X, Y);
cout << char(szText);
cout.flush();
FillConsoleOutputAttribute(hStdOut, fColor, 1, ptCoord, &cWritten);
return;
}
void inline WriteXY(int X, int Y, string szText, WORD fColor = 0x01F) {
DWORD cWritten;
COORD ptCoord = {X - 1, Y - 1};
gotoxy(X, Y);
cout << szText.c_str();
cout.flush();
FillConsoleOutputAttribute(hStdOut, fColor, strlen(szText.c_str()), ptCoord, &cWritten);
return;
}
Функция и её прототип
+150
public function run() {
$stime = microtime(TRUE);
$this->header('Content-Type: text/html');
$this->setcookie('testcookie', '1');
$this->registerShutdownFunction(function() {
?></html><?php
});
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>It works!</title>
</head>
<body>
<h1>It works! Be happy! ;-)</h1>
............
............
............
phpDaemon Example.php line 63
+173
/*
if($_REQUEST["act_id"]==8){
а нет. маньяки так не пишут...
*/
define("Э", $_REQUEST["act_id"]);
if( 8===Э ){
...
}
оператор члена :)