- 1
- 2
- 3
<?php
// Silence is golden.
?>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 1419
+143
<?php
// Silence is golden.
?>
Wordpress wp-content/themes/index.php
+142
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1251">
<title>гЮОХЯМЮЪ ЙМХФЙЮ</title>
</HEAD>
<BODY bgcolor="#FFFFE0">
<font face="Verdana" size=-1>
<h3 align=center>Записная книжка</h3>
<table align=center width=200>
<p>Введите текст</p>
<form method=post name="notebook" action="notebook.php">
<textarea cols="30" rows="7" name="message"></textarea><br><br>
<input type="submit" value="Написать">
</form>
<?php
if (isset($_POST['message']) && !empty($_POST['message']))
{
$date = date("Y-m-d H:i:s");
$s = $date ."<br>" .$_POST['message'] ."<hr>\r\n" ;
$f = @fopen("notes.txt","a+") ;
fwrite($f,$s) ;
fclose($f) ;
}
include("notes.txt");
?>
</table>
</font>
</BODY>
Писка пишет
+25.1
for(i=0;i<n;i++){
vector[i]=(a[i]+0.0)/(c[i]+0.0);
}
result=(extremum(vector,n));
cout<<"Input data was:"<<endl<<endl;
for (i=0; i < n; i++) {
cout<<a[i]<<" / "<<c[i]<<" | "<<vector[i];
cout<<endl;
}
+153
function B2R(Bytes: Int64): string;
const
k: int64 = 1024;
begin
if Bytes < k then result := IntToStr(Bytes) + 'B' else
if Bytes < k*k then result := FloatToStr(Round(Bytes*10/k)/10) + 'K' else
if Bytes < k*k*k then result := FloatToStr(Round(Bytes*10/(k*k))/10) + 'M' else
if Bytes < k*k*k*k then result := FloatToStr(Round(Bytes*10/(k*k*k))/10) + 'G' else
if Bytes < k*k*k*k*k then result := FloatToStr(Round(Bytes*10/(k*k*k*k))/10) + 'T' else
result := IntToStr(Bytes);
end;
Функция из плагина для JAJC особенно "понравилось" созерцание деления и умножения на 10 ;)
+153
PROCEDURE changeValue ( KeyStore:IN OUT Keys'Class; value: IN INTEGER )
IS
BEGIN
IF value = 1024 THEN
Message ( "NOT IN RANGE" );
ELSIF value = 2048 THEN
Message ( "OUT OF RANGE" );
ELSIF value = KeyStore.def THEN
KeyStore.val = value;
ELSE
Message ( "IN RANGE");
END IF;
END changeValue;
Какой-то наркоманский код.
Трезвый такого не напишет.
Почему приходится дорабатывать такое... будто за кем-то ж.. подтираешь:)
+38
void PduBuffer::putLen_BER(size_t len)
{
if(len <= 0x00ffff)
{
if(len <= 0x007f)
{
check_room(1);
*position++ = (uint1)len;
}
else if(len <= 0x00ff)
{
check_room(2);
*position++ = 0x81;
*position++ = (uint1)len;
}
else // 0x00ff < len <= 0x00ffff
{
check_room(3);
*position++ = 0x82;
*position++ = (uint1)(len >> 8);
*position++ = (uint1)len;
}
}
else //len > 0x00ffff
{
if(len <= 0x00ffffff)
{
check_room(4);
*position++ = 0x83;
*position++ = (uint1)(len >> 16);
*position++ = (uint1)(len >> 8);
*position++ = (uint1)len;
}
else if(len <= 0xffffffff)
{
check_room(5);
*position++ = 0x84;
*position++ = (uint1)(len >> 24);
*position++ = (uint1)(len >> 16);
*position++ = (uint1)(len >> 8);
*position++ = (uint1)len;
}
else
THROW_INTERNAL("BER length out of range [0, 2^32)");
}
frame_start = NULL;
}
Добавление байтов длины TLV-объекта в буфер.
+143.7
/*Hide deleted button*/
if (((UF.FileTypeID == FP.FileType1) && (FP.FileType1Edit == 1))
|| ((UF.FileTypeID == FP.FileType2) && (FP.FileType2Edit == 1))
|| ((UF.FileTypeID == FP.FileType3) && (FP.FileType3Edit == 1))
|| ((UF.FileTypeID == FP.FileType4) && (FP.FileType4Edit == 1))
|| ((UF.FileTypeID == FP.FileType5) && (FP.FileType5Edit == 1))
|| ((UF.FileTypeID == FP.FileType6) && (FP.FileType6Edit == 1))
|| ((UF.FileTypeID == FP.FileType7) && (FP.FileType7Edit == 1))
|| ((UF.FileTypeID == FP.FileType8) && (FP.FileType8Edit == 1))
|| ((UF.FileTypeID == FP.FileType9) && (FP.FileType9Edit == 1))
|| ((UF.FileTypeID == FP.FileType10) && (FP.FileType10Edit == 1))
|| ((UF.FileTypeID == FP.FileType11) && (FP.FileType11Edit == 1)))
{
if (CBL.GetListOfButtons(CPF.ID, 1) == true)
{
bool ButtonVisible = true;
String BText = "";
foreach (ConfirmButtons CB in CBL.Items)
{
BText = "";
if ((CB.ActionID > 0)&&(aAction.GetActionInfo(CB.ActionID) == true))
{
if (DTS.isStepAllowed(CB.ActionID, sysUser.GetID(), UserRoleID, aRequest.ID) == true)
{
ButtonVisible = true;
#region Exeptions
if (CB.TypeName == "Confirm")
{
/*----------Check parallel process status--------------*/
if (aRequest.IsParent == 1)
{
if (CheckBP.CheckParallelBP(aRequest.ID, aRequest.aReqStatus.ID) == true)
{
if ((CheckBP.IsNecessary == 1) || ((CheckBP.ChildID > 0) && (CheckBP.ChildCurState > 0)))
{
if (((CheckBP.IsNecessary == 1) && ((CheckBP.ChildID == 0))) || ((CheckBP.PositiveEndState != CheckBP.ChildCurState) && (CheckBP.NegativeEndState != CheckBP.ChildCurState)))
{
ButtonVisible = false;
CFTitleText.Text = "В данный момент вы не можете cогласовать заявку. Незавершен параллельный процесс: '" + CheckBP.Name.ToString() + "'!";
}
}
}
}
Кусок, начиная со строки 881(из 1307) метода Page_Load. Мастурбация мозга..
+144.9
function custom_print ($custom_category, $custom_template, $aviable, $custom_from, $custom_limit, $custom_cache, $do){
global $db, $is_logged, $member_id, $xf_inited, $cat_info, $config, $user_group, $category_id, $_TIME, $lang;
$do = $do ? $do : "main";
$aviable = explode ('|', $aviable);
if(!(in_array($do, $aviable)) AND ($aviable[0] != "global")) return "";
$custom_category = $db->safesql(str_replace(',', '|', $custom_category));
$custom_from = intval($custom_from);
$custom_limit = intval($custom_limit);
$thisdate = date ("Y-m-d H:i:s", (time()+ $config['date_adjust']*60));
if (intval($config['no_date'])) $where_date = " AND date < '".$thisdate."'"; else $where_date = "";
$tpl = new dle_template;
$tpl->dir = TEMPLATE_DIR;
//if ($custom_cache == "yes") $config['allow_cache'] = "yes"; else $config['allow_cache'] = false;
if ($is_logged AND ($user_group[$member_id['user_group']]['allow_edit'] AND !$user_group[$member_id['user_group']]['allow_all_edit'])) $config['allow_cache'] = false;
$content = dle_cache("custom", "cat_".$custom_category."template_".$custom_template."from_".$custom_from."limit_".$custom_limit, true);
if ($content) { return $content; }
else {
$allow_list = explode (',', $user_group[$member_id['user_group']]['allow_cats']);
if ($allow_list[0] != "all") {
if ($config['allow_multi_category']) {
$stop_list = "category regexp '[[:<:]](".implode ('|', $allow_list).")[[:>:]]' AND ";
} else {
$stop_list = "category IN ('".implode ("','", $allow_list)."') AND ";
}
} else $stop_list = "";
if ($user_group[$member_id['user_group']]['allow_short']) $stop_list = "";
if ($cat_info[$custom_category]['news_sort'] != "") $config['news_sort'] = $cat_info[$custom_category]['news_sort'];
if ($cat_info[$custom_category]['news_msort'] != "") $config['news_msort'] = $cat_info[$custom_category]['news_msort'];
if ($config['allow_multi_category']) {
$where_category = "category regexp '[[:<:]](".$custom_category.")[[:>:]]'";
} else {
$custom_category = str_replace ("|", "','", $custom_category);
$where_category = "category IN ('".$custom_category."')";
}
$sql_select = "SELECT " . PREFIX . "_post.id, gallery, autor, date," . PREFIX . "_post.image," . PREFIX . "_post.imgtype, short_story, full_story, " . PREFIX . "_post.xfields, title, category, alt_name, " . PREFIX . "_post.comm_num, " . PREFIX . "_post.allow_comm, allow_rate, " . PREFIX . "_post.rating, " . PREFIX . "_post.vote_num, news_read, " . PREFIX . "_post.flag, " . PREFIX . "_users.fullname FROM " . PREFIX . "_post , " . PREFIX . "_users WHERE " . PREFIX . "_post.autor=" . PREFIX . "_users.name and ".$stop_list.$where_category." AND approve = '1'".$where_date." ORDER BY ".$config['news_sort']." ".$config['news_msort']." LIMIT ".$custom_from.",".$custom_limit;
//echo $sql_select;
include (ENGINE_DIR.'/modules/show.custom.php');
if ($config['files_allow'] == "yes")
if ( strpos( $tpl->result['content'], "[attachment=" ) !== false)
{
$tpl->result['content'] = show_attach($tpl->result['content'], $attachments);
}
create_cache("custom", $tpl->result['content'], "cat_".$custom_category."template_".$custom_template."from_".$custom_from."limit_".$custom_limit, true);
}
return $tpl->result['content'];
}
Проект, который поддерживаю по работе просто пестрит такими вещими. Время убивает просто жуть. :((
Мораль: Не экономьте на программистах. Не давайте студентам и дешевым фрилансерам писать проекты. Поддержка говна обойдется втридорого.
+82.8
<?
$n=0;
$result = mysql_query("SELECT email FROM accounts ");
$myrow = mysql_fetch_array($result);
do
{
$n=$n+1;
}
while ($myrow = mysql_fetch_array ($result));
echo $n;
?>
+85.1
private static String CHECK_ACTIVE_ASSIGNMENTS =
new StringBuffer("select assignment_id from gp_rep_assignment where assignment_id in (?.) and is_active=0").toString();
Индусский код, бессмысленный и беспощадный.