- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
<?php
while($menu = mysql_fetch_assoc($q))
{
?>
<option value="<?=$menu['id']?>"<?=($id === $menu['id']) ? ' selected="selected"' : ''?>><?=$menu['title']?></option>
<?php
}
?>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+149
<?php
while($menu = mysql_fetch_assoc($q))
{
?>
<option value="<?=$menu['id']?>"<?=($id === $menu['id']) ? ' selected="selected"' : ''?>><?=$menu['title']?></option>
<?php
}
?>
Адовейший пиздец наговнокодил сегодня. Ну не люблю я HTML-теги в PHP писать, о шаблонизаторах никогда не слышал
+3
#include "stdafx.h"
int otv;
int main()
{
int l[10]={1,1,1,1,1,1,1,1,1,1};
start://старт
std::cout<<"Enter the number of variables < 10\n";
int g;
std::cin>>g;
if(g>=10||g<=0) goto start;
std::cout<<"please enter "<<g<<" your numbers\n";
for(int y=0;y<g;y++){int z;std::cin>>z;l[y]=z;}
for(int y=0;y<g;y++){std::cout<<l[y]<<", ";}
otv=l[0]*l[1]*l[2]*l[3]*l[4]*l[5]*l[6]*l[7]*l[8]*l[9];
std::cout<<"answer is "<< otv <<'\n';
return 0;}
Кальцо еще то.
+130
* g o a t s e x * g o a t s e x * g o a t s e x *
g g
o / \ \ / \ o
a| | \ | | a
t| `. | | : t
s` | | \| | s
e \ | / / \\\ --__ \\ : e
x \ \/ _--~~ ~--__| \ | x
* \ \_-~ ~-_\ | *
g \_ \ _.--------.______\| | g
o \ \______// _ ___ _ (_(__> \ | o
a \ . C ___) ______ (_(____> | / a
t /\ | C ____)/ \ (_____> |_/ t
s / /\| C_____) | (___> / \ s
e | ( _C_____)\______/ // _/ / \ e
x | \ |__ \\_________// (__/ | x
* | \ \____) `---- --' | *
g | \_ ___\ /_ _/ | g
o | / | | \ | o
a | | / \ \ | a
t | / / | | \ |t
s | / / \__/\___/ | |s
e | / | | | |e
x | | | | | |x
* g o a t s e x * g o a t s e x * g o a t s e x *
+129
Что за питух мои г-коды удаляет?
+147
А не использовать ли нам пиписюнчик?
+142
Язык Богов
+8
int wordLen(const char* word)
{
int i=-1;
while(word[++i]!='\0'&&word[i]!='\n');
return i;
}
Типичная лаба, но как же смешно это увидеть спустя некоторое время
+145
public function parse_url($url)
{
return parse_url($url);
}
Модель из моего диплома... Всё по фен-шуй!
+29
//thirteen
Cluster cl;
Cluster empty;
I--;
if(distances.size()){
for (int i = 0; i < (Lmax < distances.size() ? Lmax : distances.size()); ++i){
cl.X(( clusters.at(distances.at(i).first.first).X()*clusters.at(distances.at(i).first.first).Points().size() + clusters.at(distances.at(i).first.second).X()*clusters.at(distances.at(i).first.second).Points().size())/(clusters.at(distances.at(i).first.first).Points().size() + clusters.at(distances.at(i).first.second).Points().size()));
cl.Y(( clusters.at(distances.at(i).first.first).Y()*clusters.at(distances.at(i).first.first).Points().size() + clusters.at(distances.at(i).first.second).Y()*clusters.at(distances.at(i).first.second).Points().size())/(clusters.at(distances.at(i).first.first).Points().size() + clusters.at(distances.at(i).first.second).Points().size()));
if(clusters.at(distances.at(i).first.second).Number() != -1 && clusters.at(distances.at(i).first.first).Number() != -2){
cl.Points() = clusters.at(distances.at(i).first.second).Points();
clusters.at(distances.at(i).first.second) = cl;
clusters.at(distances.at(i).first.second).Number(-1);
for (std::vector<Point>::iterator j = clusters.at(distances.at(i).first.first).Points().begin(); j != clusters.at(distances.at(i).first.first).Points().end(); ++j)
{
clusters.at(distances.at(i).first.second).Points().push_back(*j);
}
clusters.at(distances.at(i).first.first) = empty;
n_c--;
}
}
for (std::vector<Cluster>::iterator i = clusters.begin(); i != clusters.end(); ++i){
if(i->Number() == -2){
i = clusters.erase(i);
}
i->Number(i - clusters.begin());
if(I)i->Points().clear();
if(i == clusters.end())break;
}
}
//fourteen
Кусок алгоритма isodata
+151
class geo extends db {
public function ip2Country($ip, $id=false)
{
$result=$this->doQuery("SELECT `eng`, `ID_parent`, `type`, `id` FROM cngeo_geo WHERE id=(
SELECT ID_geo FROM cngeo_ip WHERE IP_bi <= INET_ATON(?) ORDER BY IP_bi DESC LIMIT 1)", array('0' => array('s' => $ip)), array(0 => 'ID_parent', 1 => 'type', 2 => 'nac', 3 => 'id'));
if($result!=NULL)
{
while($result[0][2]!='c')
{
$result=$this->doQuery("SELECT `eng`, `ID_parent`, `type`, `id` FROM cngeo_geo WHERE `id`=?", array('0' => array('i' => $result[0][1])), array(0 => 'ID_parent', 1 => 'type', 2 => 'nac', 3 => 'id'));
if($result==NULL) break;
}
//echo $result[0][0];
if( $id )
return $result[0][3];
return $result[0][0];
}
}
}