- 1
- 2
- 3
public function run() {
$this->_stop();
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+162.5
public function run() {
$this->_stop();
}
К концу рабочего дня у себя такое обнаружил = ) Заработался.
+148
<? if (!$isLogged) {
echo '
<table class="br-table" align="center" cellspacing="0" cellpadding="0">
<tr>
<td class="corner-lt"></td>
<td class="left-br-top"></td>
<td class="corner-rt"></td>
</tr>
<tr>
<td colspan="3" class="box">
<h1 class="h1-title" ><img src="img/star.png">';
блаблабла
Да, и <? if(): ?> <?endif;?> их тоже не учили :(
+160.4
$('input').each(function () {
if ($(this).attr('type') == 'text') {
this.className = 'textInput';
}
if ($(this).attr('type') == 'password') {
this.className = 'passwordInput';
}
});
$('textarea').each(function () {
this.className = 'textarea';
});
это чудо было найдено здесь http://uweb.ws/publ/javascript/dobavljaem_vsem_ehlementam_input_i_texta rea_klassy/1-1-0-8
+122.4
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<!--
POSTER PHOTO
-->
<div id="poster-photo-container">
<img src="images/photo-poster.jpg" alt="" class="poster-photo-image" />
<div id="feature-area-home">
<div id="login" class="boxed">
<h2 class="title">Аккаунт пользователя</h2>
<div class="content">
<fieldset>
<legend>Войти</legend>
<label for="inputtext1">Аккаунт :</label>
<input id="inputtext1" type="text" name="inputtext1" value="" />
<label for="inputtext2">Пароль :</label>
<input id="inputtext2" type="password" name="inputtext2" value="" />
<asp:Button ID="Button1" runat="server" Text="Войти" onclick="Button1_Click" />
<p><a href="#">Забыли пароль ?</p>
</a>
</fieldset>
</div>
</div>
</div>
</div>
<!--
CONTENT CONTAINER
-->
<div id="content-container-two-column">
<!--
CONTENT MAIN COLUMN
-->
<div id="content-main-two-column">
<h1>
<span lang="ru">Контроль измерительных приборов.</span> </h1>
<p>
Consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet
dolore magna aliquam erat volutpat.</p>
<div id="three-column-container">
<div id="three-column-side1">
<a href="Items.aspx">
<img src="images/home-photo-1.jpg" class="photo-border" alt="Enter Alt Text Here" /></a>
<h2>
<span lang="ru">Хромотографы ?</span></h2>
<p>
<span lang="ru">11111111</span></p>
<span lang="ru">
<a href="Items.aspx">Подробнее</a></span><img class="arrow" src="images/arrow.gif" alt="" /></div>
</div>
</div>
<!--
CONTENT SIDE COLUMN
-->
<div class="clear">
</div>
</div>
</asp:Content>
Найти DIV
+144.5
<?php if (!$mode || true) { ?>
<div class="yiiForm">
<?php } else { ?>
<div class="yiiForm">
<?php } ?>
последствия удаления ненужных частей кода
−126.7
<li class="list_item primary_card_<%= index+1 %> <%= primary_card.patient.sex == 'male' ? 'boy' : 'girl' %> critical">
А можно было изменить имя класса в CSS
+106.6
if WordCount>GetWord(i) then else if WordCount>GetWord(i) then
begin
// ...
// ...
end;
при каких условиях выполнится код между begin-end?..
−352.1
#!/usr/bin/perl
while ($colresults = $rez->fetchrow_hashref()) {
$hour = $colresults->{'TIME'};
if ($hour == '00') {$value0 = $colresults->{'VALUE_NUM'}};
if ($hour == '01') {$value1 = $colresults->{'VALUE_NUM'}};
if ($hour == '02') {$value2 = $colresults->{'VALUE_NUM'}};
if ($hour == '03') {$value3 = $colresults->{'VALUE_NUM'}};
if ($hour == '04') {$value4 = $colresults->{'VALUE_NUM'}};
if ($hour == '05') {$value5 = $colresults->{'VALUE_NUM'}};
if ($hour == '06') {$value6 = $colresults->{'VALUE_NUM'}};
if ($hour == '07') {$value7 = $colresults->{'VALUE_NUM'}};
if ($hour == '08') {$value8 = $colresults->{'VALUE_NUM'}};
if ($hour == '09') {$value9 = $colresults->{'VALUE_NUM'}};
if ($hour == '10') {$value10 = $colresults->{'VALUE_NUM'}};
if ($hour == '11') {$value11 = $colresults->{'VALUE_NUM'}};
if ($hour == '12') {$value12 = $colresults->{'VALUE_NUM'}};
if ($hour == '13') {$value13 = $colresults->{'VALUE_NUM'}};
if ($hour == '14') {$value14 = $colresults->{'VALUE_NUM'}};
if ($hour == '15') {$value15 = $colresults->{'VALUE_NUM'}};
if ($hour == '16') {$value16 = $colresults->{'VALUE_NUM'}};
if ($hour == '17') {$value17 = $colresults->{'VALUE_NUM'}};
if ($hour == '18') {$value18 = $colresults->{'VALUE_NUM'}};
if ($hour == '19') {$value19 = $colresults->{'VALUE_NUM'}};
if ($hour == '20') {$value20 = $colresults->{'VALUE_NUM'}};
if ($hour == '21') {$value21 = $colresults->{'VALUE_NUM'}};
if ($hour == '22') {$value22 = $colresults->{'VALUE_NUM'}};
if ($hour == '23') {$value23 = $colresults->{'VALUE_NUM'}};
if ($d_name ne $colresults->{'DNAME'}) {
unless ($first) {
push @result, {
N => $n_name,
C => $c_name,
D => $d_name,
TIME0 => get_temp($value0),
TIME1 => get_temp($value1),
TIME2 => get_temp($value2),
TIME3 => get_temp($value3),
TIME4 => get_temp($value4),
TIME5 => get_temp($value5),
TIME6 => get_temp($value6),
TIME7 => get_temp($value7),
TIME8 => get_temp($value8),
TIME9 => get_temp($value9),
TIME10 => get_temp($value10),
TIME11 => get_temp($value11),
TIME12 => get_temp($value12),
TIME13 => get_temp($value13),
TIME14 => get_temp($value14),
TIME15 => get_temp($value15),
TIME16 => get_temp($value16),
TIME17 => get_temp($value17),
TIME18 => get_temp($value18),
TIME19 => get_temp($value19),
TIME20 => get_temp($value20),
TIME21 => get_temp($value21),
TIME22 => get_temp($value22),
TIME23 => get_temp($value23),
};
$value0 = undef;
$value1 = undef;
$value2 = undef;
$value3 = undef;
$value4 = undef;
$value5 = undef;
$value6 = undef;
$value7 = undef;
$value8 = undef;
$value9 = undef;
$value10 = undef;
$value11 = undef;
$value12 = undef;
$value13 = undef;
$value14 = undef;
$value15 = undef;
$value16 = undef;
$value17 = undef;
$value18 = undef;
$value19 = undef;
$value20 = undef;
$value21 = undef;
$value22 = undef;
$value23 = undef;
}
...
}
}
.... # продолжение не менее захватывающее
Феерический код из одной не малоизвестной организации :)
+171.6
if ( !empty( $page ) )
{
if ( $page == "login" )
{
$spage = "Login.inc";
}
else if ( $page == "rules" )
{
$spage = "rules.inc";
}
else if ( $page == "help" )
{
$spage = "help.inc";
}
else if ( $page == "wm" )
{
$spage = "wm.inc";
}
else if ( $page == "game"
{
$spage = "game.inc";
}
else if ( $page == "webmoney" )
{
$spage = "webmoney.inc";
}
else if ( $page == "egold" )
{
$spage = "egold.inc";
}
else if ( $page == "cashin" )
{
$spage = "cashin.inc";
}
else if ( $page == "ballans" )
{
$spage = "ballans.inc";
}
else if ( $page == "remind" )
{
$spage = "remind.inc";
}
else if ( $page == "contact" )
{
$spage = "contact.inc";
}
else if ( $page == "reg" )
{
$spage = "reg.inc";
}
:(((
+131.2
static void module3_exit(void){
cdev_del(mydev);
printk(KERN_INFO"Device"DEV_NAME"was deleted");
};
int mydev_open(struct inode *in,struct file *filp){
printk(KERN_INFO DEV_NAME "open");
struct dev_state *dev_stat;
dev_stat=&STATE[MINOR(in->i_rdev)];
if(dev_stat->dev_open)
{
printk("Kernel: device "DEV_NAME" is exist");
return -EBUSY;
};
dev_stat->dev_open++;
dev_stat->dev_read=0;
dev_stat->dev_write=0;
int num= NUM(in->i_rdev);
int type=TYPE(in->i_rdev);
return 0;
};
int mydev_ioctl(struct inode *in,struct file *filp,unsigned int ioctl,unsigned long param)
{
printk(KERN_INFO DEV_NAME "ioctl");
return 0;
};
ssize_t mydev_read(struct file *filp,char *buff,ssize_t len,loff_t pos)
{
printk(KERN_INFO DEV_NAME "read");
struct inode *in;
int count=len;
struct dev_state *devst;
printk("Kernel: try to read %d bytes \n",len);
in=filp->f_dentry->d_inode;
printk("Kernel: minor number is %d",MINOR(in->i_rdev));
devst=&STATE[MINOR(in->i_rdev)];
while(count--)
{
put_user(inb_p(PORT_START+10*MINOR(in->i_rdev)),buff);
buff++;
};
devst->dev_read+=len;
printk(KERN_INFO"Kernel: read "DEV_NAME" %d bytes",len);
return len;
};
ssize_t mydev_write(struct file *filp, const char *buff, ssize_t len,loff_t pos)
{
printk(KERN_INFO DEV_NAME "write");
struct inode *in;
int count=len;
unsigned char byte;
struct dev_state *devst;
printk(KERN_INFO"Kernel: try to write %d bytes\n",len);
in=filp->f_dentry->d_inode;
printk(KERN_INFO"Kernel: minor number %d\n",MINOR(in->i_rdev));
devst=&STATE[MINOR(in->i_rdev)];
while(count--)
{
get_user(byte, buff);
outb_p(byte, PORT_START+10*MINOR(in->i_rdev));
buff++;
};
devst->dev_write +=len;
printk(KERN_INFO"Kernel: "DEV_NAME " written %d bytes\n",len);
return len;
};
Модуль ядра