- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
var
WS1, WS2, WS3: TWSocket;
...
begin
...
WS1 := TWSocket.Create(Self);
WS2 := TWSocket.Create(Self);
WS3 := TWSocket.Create(Self);
...
end;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+146
var
WS1, WS2, WS3: TWSocket;
...
begin
...
WS1 := TWSocket.Create(Self);
WS2 := TWSocket.Create(Self);
WS3 := TWSocket.Create(Self);
...
end;
и это гавно код
+146
var
WS: array[1..3] of TWSocket;
...
var
I: Integer;
begin
...
for I := 1 to 3 do
WS := TWSocket.Create(Self);
...
end;
Гавно код так считают
+171
char *f(char *s1, ...)
{ char **cp = &s1; //--адрес первого указателя
int len = 0;
// цикл для определения общей длины сцепляемых строк
while (*cp) { len += strlen(*cp); cp++; }
char *s = new char[len+1]; //--память для строки
s[0]=0; //-- "очищаем" строку
// цикл для сцепления строк
cp=&s1; //-- опять установка на 1-й параметр
while (*cp)
{ strcat(s, *cp); //-- прицепляем первую (и следующие)
cp++; //-- перемещаемся на следующую
}
return s;
}
Сцепление строк (ноль в конце)
http://www.rsdn.ru/forum/cpp/418970.1.aspx
−179
def mac_search(*args):
db = MySQLdb.connect(host="localhost",user="test",passwd="test",db="test")
cursor = db.cursor()
cursor.execute('SELECT * FROM ip_groups WHERE mac="%s" AND is_deleted=0;' %args[0].split()[0])
for j in cursor.fetchall():
cursor.execute("SELECT * FROM iptraffic_service_links WHERE ip_group_id=%s and is_deleted=0;" %j[1])
for j1 in cursor.fetchall():
cursor.execute("SELECT * FROM service_links WHERE id=%s AND is_deleted=0;" %j1[0])
for j2 in cursor.fetchall():
cursor.execute("SELECT * FROM accounts WHERE is_deleted=0 AND id=%s AND is_blocked=0;" %j2[2])
for j3 in cursor.fetchall():
cursor.execute("SELECT * FROM service_links WHERE account_id=%s AND is_deleted=0;" %j2[2])
for j4 in cursor.fetchall():
if j4[3]==465 or j4[3]==641:
cursor.execute("SELECT * FROM s_multicast WHERE service_id=%s AND %s>=ip_start AND %s<=ip_end;" %(j4[3],args[0].split()[1],args[0].split()[1]))
for j5 in cursor.fetchall():
return j5
Я конечно понимаю, таким уже не удивить. Но все же.
http://www.python.su/forum/viewtopic.php?pid=76855
+171
/****************Попытка №1:**************/
<?php
if(date('d/m') == '13/09')
echo 'З Днем Програміста!'
?>
/****************Попытка №2:**************/
<?php
if((date('d/m') == '13/09') && (date('L') == 0)){
echo 'З Днем Програміста!';
}elseif((date('d/m') == '12/09') && (date('L') == 1)){
echo 'З Днем Програміста!!!';
}
?>
/****************Попытка №3:**************/
if (date('z') == 255) echo 'З Днем Програміста!';
мда... эволюция кода и кодера )
+168
<?php
function isValidCharacters($str)
{
$str2 = preg_replace("[^a-zA-Zа-яА-Я[email protected]]","",$str);
if ($str != $str2) return FALSE;
return TRUE;
}
$nik=preg_replace("[^a-zA-Zа-яА-Я[email protected]]","",$_POST['nik']);
$pass=preg_replace("[^a-zA-Zа-яА-Я[email protected]]","",$_POST['pass']);
if (!isValidCharacters($nik) || !isValidCharacters($pass))
{
$_SESSION['auth']="error";
$_SESSION['error_mes']="Неверный логин или пароль";
header('Location: ./index.php');
exit();
}
//дальше проверка на совпадение логина\пароля, ничего интересного.
?>
Строка 10, после 8-9, типа "А вдруг?!"
+160
function Hehe ($s) {
$str = $s;
$str = preg_replace ("/\\\/","", $str);
$str = preg_replace ("/'/","'", $str);
$str = preg_replace ("/\n/","<br>", $str);
$str = preg_replace ("/\r/","", $str);
return $str;
}
Название функции оригинальное. Лежала в модуле ~5k строк.
+161
$name = $data->fields["name"];
$name = str_replace("\n","",$name);
$name = str_replace("\r","",$name);
$name = str_replace("\\","\\\\",$name);
$name = preg_replace("/'/","'",str_replace("\n","",str_replace("\"",""",$name)));
2, 3 и 4 строчки похожи на серию ударов по мозгу, а последняя на кровавое комбо :)
+93
<%if(myaccount.getCountry().equals( "AF" )){%> <font color="grey"><label for="country">Afghanistan</label></font>
<%}else if(myaccount.getCountry().equals( "AL" )){%> <font color="grey"><label for="country">Albania</label></font>
<%}else if(myaccount.getCountry().equals( "DZ" )){%> <font color="grey"><label for="country">Algeria</label></font>
<%}else if(myaccount.getCountry().equals( "AS" )){%> <font color="grey"><label for="country">American Samoa</label></font>
<%}else if(myaccount.getCountry().equals( "AD" )){%> <font color="grey"><label for="country">Andorra</label></font>
<%}else if(myaccount.getCountry().equals( "AO" )){%> <font color="grey"><label for="country">Angola</label></font>
<%}else if(myaccount.getCountry().equals( "AI" )){%> <font color="grey"><label for="country">Anguilla</label></font>
<%}else if(myaccount.getCountry().equals( "AQ" )){%> <font color="grey"><label for="country">Antarctica</label></font>
<%}else if(myaccount.getCountry().equals( "AG" )){%> <font color="grey"><label for="country">Antigua and Barbuda</label></font>
<%}else if(myaccount.getCountry().equals( "AR" )){%> <font color="grey"><label for="country">Argentina</label></font>
<%}else if(myaccount.getCountry().equals( "AM" )){%> <font color="grey"><label for="country">Armenia</label></font>
<%}else if(myaccount.getCountry().equals( "AW" )){%> <font color="grey"><label for="country">Aruba</label></font>
<%}else if(myaccount.getCountry().equals( "AU" )){%> <font color="grey"><label for="country">Australia</label></font>
<%}else if(myaccount.getCountry().equals( "AT" )){%> <font color="grey"><label for="country">Austria</label></font>
<%}else if(myaccount.getCountry().equals( "AZ" )){%> <font color="grey"><label for="country">Azerbaijan</label></font>
<%}else if(myaccount.getCountry().equals( "BS" )){%> <font color="grey"><label for="country">Bahamas</label></font>
<%}else if ...
Индусская проверка принадлежности аккаунта к определённой стране...
P.S. Всё не влезло - стран у нас много =)
+40
function del_reiting_type($typeid){
global $typeid;
.....
}
как-то так...