- 1
- 2
- 3
- 4
- 5
{% if not has_previous %}
<a class="prev" style="visibility:hidden" href=?page={{ previous }} title="">prev</a>
{% else %}
<a class="prev" href=?page={{ previous }} title="">prev</a>
{% endif %}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−100.4
{% if not has_previous %}
<a class="prev" style="visibility:hidden" href=?page={{ previous }} title="">prev</a>
{% else %}
<a class="prev" href=?page={{ previous }} title="">prev</a>
{% endif %}
Django template. Написал один знакомый.
+157
/**/ if ($page+1 <= $sch-1)
/**/ {echo "<a href='in_mes.php?page=".($page+1)."' class='nav_lnk'><strong>".($page+2)."</strong></a>";
/**/
/**/ echo " ";}
/**/
/**/ if ($page+2 <= $sch-1)
/**/ {echo "<a href='in_mes.php?page=".($page+2)."' class='nav_lnk'><strong>".($page+3)."</strong></a>";
/**/
/**/ echo " ";}
/**/
/**/ if ($page+3 <= $sch-1)
/**/ {echo "<a href='in_mes.php?page=".($page+3)."' class='nav_lnk'><strong>".($page+4)."</strong></a>";
/**/
/**/ echo " ";}
/**/
/**/ if ($page+4 <= $sch-1)
/**/ {echo "<a href='in_mes.php?page=".($page+4)."' class='nav_lnk'><strong>".($page+5)."</strong></a>";
/**/
/**/ echo " ";}
/**/
/**/ if ($page+5 <= $sch-1)
/**/ {echo "<a href='in_mes.php?page=".($page+5)."' class='nav_lnk'><strong>".($page+6)."</strong></a>";
/**/
/**/ echo " ";}
оригинальное форматирование сохранено. Что человек этим пытался сказать - не понятно
+158.2
var TIWRECTANGLE14IWCL;
var TIWRECTANGLE17IWCL;
var TIWRECTANGLE18IWCL;
var TIWRECTANGLE19IWCL;
var TIWRECTANGLE16IWCL;
var TIWRECTANGLE15IWCL;
var TIWRECTANGLE10IWCL;
var TIWRECTANGLE12IWCL;
var TIWRECTANGLE13IWCL;
var TIWRECTANGLE11IWCL;
var TIWRECTANGLE9IWCL;
var TIWRECTANGLE7IWCL;
var TIWRECTANGLE8IWCL;
var TIWRECTANGLE1IWCL;
var TIWRECTANGLE4IWCL;
var TIWRECTANGLE6IWCL;
var TIWRECTANGLE5IWCL;
var TIWRECTANGLE3IWCL;
var TIWRECTANGLE2IWCL;
var IWEDIT1IWCL;
function IWEDIT2_OnKeyPress(ASender) {
return CheckReturnKey(event.keyCode, 'IWEDIT2', true);
}
Массивы - исчадие прих.больниц для неполноценных программистов!
Тру говнокодер пишет так!
Код веб-страницы на Делфи. Продолжение - http://govnokod.ru/1709
+161
var IWIMAGEFILE2IWCL;
var IWRECTANGLE11IWCL;
var IWIMAGEFILE3IWCL;
var IWIMAGEFILE5IWCL;
var IWIMAGEFILE6IWCL;
var IWIMAGEFILE7IWCL;
var IWTEXT1IWCL;
var IWTEXT2IWCL;
var IWTEXT3IWCL;
var IWTEXT4IWCL;
var IWIMAGEFILE8IWCL;
var IWIMAGEFILE9IWCL;
var IWIMAGEFILE10IWCL;
var IWIMAGEFILE11IWCL;
var IWTEXT5IWCL;
var IWTEXT6IWCL;
var IWTEXT7IWCL;
var IWTEXT8IWCL;
var IWRECTANGLE5IWCL;
var IWRECTANGLE2IWCL;
var IWLABEL8IWCL;
var IWLABEL9IWCL;
var IWLABEL7IWCL;
var IWRECTANGLE3IWCL;
var IWRECTANGLE1IWCL;
var IWLABEL5IWCL;
var IWLABEL6IWCL;
var IWIMAGEFILE4IWCL;
var IWLABEL10IWCL;
var IWLABEL11IWCL;
var IWRECTANGLE4IWCL;
var IWLABEL3IWCL;
var IWLABEL2IWCL;
var IWIMAGEFILE1IWCL;
var IWRECTANGLE6IWCL;
var IWRECTANGLE7IWCL;
var IWRECTANGLE8IWCL;
var IWRECTANGLE9IWCL;
var IWRECTANGLE10IWCL;
var IWURL2IWCL;
var IWURL3IWCL;
var IWURL4IWCL;
var IWURL5IWCL;
function IWURL1_OnMouseOver(ASender) {
return Status('Написать письмо разработчику');
}
function IWURL1_OnMouseOut(ASender) {
return Status('');
}
var IWURL1IWCL;
var IWTEXT9IWCL;
var IWLABEL1IWCL;
var IWIMAGEFILE12IWCL;
function IWLINK1_OnClick(ASender) {
return SubmitClickConfirm('IWLINK1','', false, '');
}
var IWLINK1IWCL;
function InitIWCLObjects() {
TIWRECTANGLE14IWCL = new CreateIWCLObject(IWCLForm, "TIWRECTANGLE14", "TIWRECTANGLE14IWCL");
if (TIWRECTANGLE14IWCL.Item != null) {
TIWRECTANGLE14IWCL.SetAlign(alTop);
TIWRECTANGLE14IWCL.SetAnchors(new CreateAnchors(true, true, true, false));
}
TIWRECTANGLE17IWCL = new CreateIWCLObject(TIWRECTANGLE14IWCL, "TIWRECTANGLE17", "TIWRECTANGLE17IWCL");
if (TIWRECTANGLE17IWCL.Item != null) {
TIWRECTANGLE17IWCL.SetAlign(alClient);
TIWRECTANGLE17IWCL.SetAnchors(new CreateAnchors(true, true, true, true));
}
TIWRECTANGLE18IWCL = new CreateIWCLObject(TIWRECTANGLE17IWCL, "TIWRECTANGLE18", "TIWRECTANGLE18IWCL");
if (TIWRECTANGLE18IWCL.Item != null) {
TIWRECTANGLE18IWCL.SetAlign(alBottom);
TIWRECTANGLE18IWCL.SetAnchors(new CreateAnchors(true, true, false, true));
}
TIWRECTANGLE19IWCL = new CreateIWCLObject(TIWRECTANGLE18IWCL, "TIWRECTANGLE19", "TIWRECTANGLE19IWCL");
if (TIWRECTANGLE19IWCL.Item != null) {
TIWRECTANGLE19IWCL.SetAlign(alRight);
TIWRECTANGLE19IWCL.SetAnchors(new CreateAnchors(false, true, true, true));
}
TIWRECTANGLE16IWCL = new CreateIWCLObject(TIWRECTANGLE14IWCL, "TIWRECTANGLE16", "TIWRECTANGLE16IWCL");
if (TIWRECTANGLE16IWCL.Item != null) {
TIWRECTANGLE16IWCL.SetAlign(alRight);
TIWRECTANGLE16IWCL.SetAnchors(new CreateAnchors(false, true, true, true));
}
TIWRECTANGLE15IWCL = new CreateIWCLObject(TIWRECTANGLE14IWCL, "TIWRECTANGLE15", "TIWRECTANGLE15IWCL");
if (TIWRECTANGLE15IWCL.Item != null) {
TIWRECTANGLE15IWCL.SetAlign(alLeft);
TIWRECTANGLE15IWCL.SetAnchors(new CreateAnchors(true, false, true, true));
}
TIWRECTANGLE10IWCL = new CreateIWCLObject(IWCLForm, "TIWRECTANGLE10", "TIWRECTANGLE10IWCL");
if (TIWRECTANGLE10IWCL.Item != null) {
TIWRECTANGLE10IWCL.SetAlign(alTop);
TIWRECTANGLE10IWCL.SetAnchors(new CreateAnchors(true, true, true, false));
}
TIWRECTANGLE12IWCL = new CreateIWCLObject(TIWRECTANGLE10IWCL, "TIWRECTANGLE12", "TIWRECTANGLE12IWCL");
if (TIWRECTANGLE12IWCL.Item != null) {
TIWRECTANGLE12IWCL.SetAlign(alRight);
TIWRECTANGLE12IWCL.SetAnchors(new CreateAnchors(false, true, true, true));
}
TIWRECTANGLE13IWCL = new CreateIWCLObject(TIWRECTANGLE12IWCL, "TIWRECTANGLE13", "TIWRECTANGLE13IWCL");
И так далее, еще много много раз.....
Код веб-страницы, написанной на ДЕлфи :)
"Это кто сказал, что на делфи страницы не пишуцца? пишуцца!!"
Авторы - программисты гос.структуры
+51.9
CSocket* CServer::GetSocket (const int& fd) { // Find socket by FD
if (m_mapSocket[fd]) return m_mapSocket[fd];
else return NULL;
}
// another one piece of crap...
void CServer::CloseSocket(const int& fd) { // Close Socket.
delete m_mapSocket[fd];
if (m_mapSocket[fd]) m_mapSocket.erase(fd);
FD_CLR(fd,&FFd_set);
if (fd == FMax_fd) FMax_fd--;
}
+181.7
function schitaem_ves_fajla($file) {
return strlen(file_get_contents($file));
}
[email protected] - 05:00 MSK
+141.9
<table>
<tr>
<td bgcolor=green><br/></td>
<td bgcolor=red><br/></td>
<td bgcolor=blue><br/></td>
</tr>
<tr>
<td><input name="check1" type="checkbox" /></td>
<td><input name="check2" type="checkbox" /></td>
<td><input name="check3" type="checkbox" /></td>
</tr>
</table>
форма для выбора цветов)
−866.9
CREATE TABLE [Battles] (
[name] [varchar] (20) NOT NULL ,
[date] [datetime] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [Classes] (
[class] [varchar] (50) NOT NULL ,
[type] [varchar] (2) NOT NULL ,
[country] [varchar] (20) NOT NULL ,
[numGuns] [tinyint] NULL ,
[bore] [real] NULL ,
[displacement] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Ships] (
[name] [varchar] (50) NOT NULL ,
[class] [varchar] (50) NOT NULL ,
[launched] [smallint] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Outcomes] (
[ship] [varchar] (50) NOT NULL ,
[battle] [varchar] (20) NOT NULL ,
[result] [varchar] (10) NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Battles] ADD
CONSTRAINT [PK_Battles] PRIMARY KEY CLUSTERED
(
[name]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Classes] ADD
CONSTRAINT [PK_Classes] PRIMARY KEY CLUSTERED
(
[class]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Ships] ADD
CONSTRAINT [PK_Ships] PRIMARY KEY CLUSTERED
(
[name]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Outcomes] ADD
CONSTRAINT [PK_Outcomes] PRIMARY KEY CLUSTERED
(
[ship],
[battle]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Ships] ADD
CONSTRAINT [FK_Ships_Classes] FOREIGN KEY
(
[class]
) REFERENCES [dbo].[Classes] (
[class]
) NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[Outcomes] ADD
CONSTRAINT [FK_Outcomes_Battles] FOREIGN KEY
(
[battle]
) REFERENCES [dbo].[Battles] (
[name]
)
GO
Это с sql-ex.ru , база "корабли"
Может, упражнения там интересные,
но сама база истинный говнокод. Почему?
Строчка
"В отношение Outcomes могут входить корабли, отсутствующие в отношении Ships."
делает её говнокодом.
+67.9
#!/bin/bash
ln -s /tomcat/tc1/logs/CR.log /tomcat/logs/tc1.log
ln -s /tomcat/tc2/logs/CR.log /tomcat/logs/tc2.log
ln -s /tomcat/tc3/logs/CR.log /tomcat/logs/tc3.log
ln -s /tomcat/tc4/logs/CR.log /tomcat/logs/tc4.log
ln -s /tomcat/tc5/logs/CR.log /tomcat/logs/tc5.log
ln -s /tomcat/tc6/logs/CR.log /tomcat/logs/tc6.log
ln -s /tomcat/tc7/logs/CR.log /tomcat/logs/tc7.log
ln -s /tomcat/tc8/logs/CR.log /tomcat/logs/tc8.log
rm -fR /tomcat/webapps
mv /tomcat/tc1/webapps /tomcat/webapps
rm -fR /tomcat/tc1/webapps
rm -fR /tomcat/tc2/webapps
rm -fR /tomcat/tc3/webapps
rm -fR /tomcat/tc4/webapps
rm -fR /tomcat/tc5/webapps
rm -fR /tomcat/tc6/webapps
rm -fR /tomcat/tc7/webapps
rm -fR /tomcat/tc8/webapps
ln -s /tomcat/webapps /tomcat/tc1/webapps
ln -s /tomcat/webapps /tomcat/tc2/webapps
ln -s /tomcat/webapps /tomcat/tc3/webapps
ln -s /tomcat/webapps /tomcat/tc4/webapps
ln -s /tomcat/webapps /tomcat/tc5/webapps
ln -s /tomcat/webapps /tomcat/tc6/webapps
ln -s /tomcat/webapps /tomcat/tc7/webapps
ln -s /tomcat/webapps /tomcat/tc8/webapps
rm -fR /tomcat/tc2/conf/Catalina/localhost
rm -fR /tomcat/tc3/conf/Catalina/localhost
rm -fR /tomcat/tc4/conf/Catalina/localhost
rm -fR /tomcat/tc5/conf/Catalina/localhost
rm -fR /tomcat/tc6/conf/Catalina/localhost
rm -fR /tomcat/tc7/conf/Catalina/localhost
rm -fR /tomcat/tc8/conf/Catalina/localhost
ln -s /tomcat/tc1/conf/Catalina/localhost /tomcat/tc2/conf/Catalina/localhost
ln -s /tomcat/tc1/conf/Catalina/localhost /tomcat/tc3/conf/Catalina/localhost
ln -s /tomcat/tc1/conf/Catalina/localhost /tomcat/tc4/conf/Catalina/localhost
ln -s /tomcat/tc1/conf/Catalina/localhost /tomcat/tc5/conf/Catalina/localhost
ln -s /tomcat/tc1/conf/Catalina/localhost /tomcat/tc6/conf/Catalina/localhost
ln -s /tomcat/tc1/conf/Catalina/localhost /tomcat/tc7/conf/Catalina/localhost
ln -s /tomcat/tc1/conf/Catalina/localhost /tomcat/tc8/conf/Catalina/localhost
rm -fR /tomcat/tc2/lib
rm -fR /tomcat/tc3/lib
rm -fR /tomcat/tc4/lib
rm -fR /tomcat/tc5/lib
rm -fR /tomcat/tc6/lib
rm -fR /tomcat/tc7/lib
rm -fR /tomcat/tc8/lib
ln -s /tomcat/tc1/lib /tomcat/tc2/lib
ln -s /tomcat/tc1/lib /tomcat/tc3/lib
ln -s /tomcat/tc1/lib /tomcat/tc4/lib
ln -s /tomcat/tc1/lib /tomcat/tc5/lib
ln -s /tomcat/tc1/lib /tomcat/tc6/lib
ln -s /tomcat/tc1/lib /tomcat/tc7/lib
ln -s /tomcat/tc1/lib /tomcat/tc8/lib
rm -fR /tomcat/tc2/common
rm -fR /tomcat/tc3/common
rm -fR /tomcat/tc4/common
rm -fR /tomcat/tc5/common
rm -fR /tomcat/tc6/common
rm -fR /tomcat/tc7/common
rm -fR /tomcat/tc8/common
ln -s /tomcat/tc1/common /tomcat/tc2/common
ln -s /tomcat/tc1/common /tomcat/tc3/common
ln -s /tomcat/tc1/common /tomcat/tc4/common
ln -s /tomcat/tc1/common /tomcat/tc5/common
ln -s /tomcat/tc1/common /tomcat/tc6/common
ln -s /tomcat/tc1/common /tomcat/tc7/common
ln -s /tomcat/tc1/common /tomcat/tc8/common
+156
$sql = "SELECT MAX(user_id) AS total
FROM " . USERS_TABLE;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain next user_id information', '', __LINE__, __FILE__, $sql);
}
if ( !($row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_ERROR, 'Could not obtain next user_id information', '', __LINE__, __FILE__, $sql);
}
$user_id = $row['total'] + 1;
Найдено в phpBB-wap. Перед регистрацией пользователя. $user_id - id регистрирующегося юзера. Похоже, автор не знает про auto_increment