- 1
- 2
- 3
function GetUsersStatus($n){
return "Авторизованный пользователь";
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+166
function GetUsersStatus($n){
return "Авторизованный пользователь";
}
просто и без лишних слов
+126
[img]http://www.cosplayisland.co.uk/files/costumes/3606/48808/9131%20-%20animated_gif%20haters_gonna_hate%20my_little_pony_friendship_is_magic%20rainbow_dash%20tagme.gif[/img]
+166
$params['BannerIDS'] = null;
$params['BannerIDS'] = $banners;
$t_banners = null;
unset($t_banners);
Ну так чтоб наверняка
+131
ThreadStarter stru
this dd ?
...
ends
ThreadStarter::MoveToArmy near proc
in ax, 0x40 // initial time
xor cx, cx
mov dx, ax
__repeat:
in ax, 0x40
lea cx, [ax - dx]
mov dx, ax
cmp cx, 60 * 60 * 24 * 365
jl short __repeat
pop ax
ret
endp
start:
sub sp, sizeof ThreadStarter
assume [sp]: stru ThreadStarter
mov ax, sp
invoke Thread_Starter::MoveToArmy, ax
...
http://www.gamedev.ru/flame/forum/?id=152390#m6+75
Entity entity1 = null;
Entity entity2 = null;
//..............
Entity entityN = null;
try{
entity1 = provider.getEntity("key1").getValue();
entity2 = provider.getEntity("key2").getValue();
//..................
entityN = provider.getEntity("key3").getValue();
}catch (NullPointerException e){
log.error("error", e);
}
//later
smth.call(entity1.getSMTH())
Главное - сообщить в лог!
Почти такое же г-но ушло на продакшн систему по причине "не успел поревьюить".
+146
<?php
error_reporting(E_ALL);
require_once '../app/config.php';
require_once systemConfig::$pathToSystem . '/index.php';
require_once '../app/application.php';
$application = new application();
$application->run();
?>
http://code.google.com/p/govnokod/source/browse/trunk/govnoquoter/www/index.php
Шел 2011-й год...
+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, типа "А вдруг?!"
+40
function del_reiting_type($typeid){
global $typeid;
.....
}
как-то так...
−110
$sql_info = "SELECT * FROM accessories";
$query_info = mysql_query($sql_info);
while($row_info=mysql_fetch_array($query_info)) {
$found_something=1;
}
Проверка наличия записей в БД
+162
/*
Содержимое news.xml
<?xml version="1.0" encoding="utf-8"?>
<news>
<item>
<title>Новые поступления</title>
<text>
This program is free software;
</text>
<date>13:30 - 12.08.2004</date>
</item>
<item>
<title>ERERER поступления</title>
<text>
p pppppppppppppppp p p pp p pppppppppppppppppp pppppppppppppppppppppp
</text>
<date>18:30 - 12.08.2004</date>
</item>
</news>
*/
$file = fopen("news.xml","r");
fseek($file, 47, SEEK_SET);
$other = fread($file, 900000);
fseek($file, 0, SEEK_SET);
$prev = fread($file, 47);
fclose($file);
$file = fopen("news.xml","w");
//...
$text1 = "$text";
$title = "$h1";
$date = "$dates";
echo $other;
$all = $prev.'<item><title>'.$title.'</title><text>'.$text1.'</text><date>'.$date.'</date></item>'.$other;
$buff = fputs ($file, $all);
print $buff;
Оригинальный способ дописывать новую новость в xml файл.
Данный способ уже не кошерный:
$doc = new DOMDocument();
$doc->load($xml);
$item = $doc->createElement('item');
$news = $doc>getElementsByTagName('news')->item(0);
$news->appendChild($item);
$doc->save($xml);