-
Лучший говнокод
- В номинации:
-
- За время:
-
-
+166
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
<?php
switch(func_num_args())
{
case 1:
$$class = new $class(func_get_arg(0));
break;
# ....
case 7:
$$class = new $class(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6));
break;
default:
$$class = new $class();
break;
}
?>
Боюсь подумать о 10 и более передаваемых переменных в конструктор класса
MoLe-X,
23 Декабря 2010
-
+104
- 001
- 002
- 003
- 004
- 005
- 006
- 007
- 008
- 009
- 010
- 011
- 012
- 013
- 014
- 015
- 016
- 017
- 018
- 019
- 020
- 021
- 022
- 023
- 024
- 025
- 026
- 027
- 028
- 029
- 030
- 031
- 032
- 033
- 034
- 035
- 036
- 037
- 038
- 039
- 040
- 041
- 042
- 043
- 044
- 045
- 046
- 047
- 048
- 049
- 050
- 051
- 052
- 053
- 054
- 055
- 056
- 057
- 058
- 059
- 060
- 061
- 062
- 063
- 064
- 065
- 066
- 067
- 068
- 069
- 070
- 071
- 072
- 073
- 074
- 075
- 076
- 077
- 078
- 079
- 080
- 081
- 082
- 083
- 084
- 085
- 086
- 087
- 088
- 089
- 090
- 091
- 092
- 093
- 094
- 095
- 096
- 097
- 098
- 099
- 100
procedure TForm1.FormCreate(Sender: TObject);
begin
RS[0]:='а'; PRS[0]:='@';
RS[1]:='б'; PRS[1]:='6';
RS[2]:='в'; PRS[2]:='B';
RS[3]:='г'; PRS[3]:='r';
RS[4]:='д'; PRS[4]:='g';
RS[5]:='е'; PRS[5]:='e';
RS[6]:='ё'; PRS[6]:='e';
RS[7]:='ж'; PRS[7]:='}|{';
RS[8]:='з'; PRS[8]:='3';
RS[9]:='и'; PRS[9]:='u';
RS[10]:='й'; PRS[10]:='u';
RS[11]:='к'; PRS[11]:='k';
RS[12]:='л'; PRS[12]:='JI';
RS[13]:='м'; PRS[13]:='M';
RS[14]:='н'; PRS[14]:='H';
RS[15]:='о'; PRS[15]:='o';
RS[16]:='п'; PRS[16]:='n';
RS[17]:='р'; PRS[17]:='p';
RS[18]:='с'; PRS[18]:='c';
RS[19]:='т'; PRS[19]:='T';
RS[20]:='у'; PRS[20]:='y';
RS[21]:='ф'; PRS[21]:='%';
RS[22]:='х'; PRS[22]:='x';
RS[23]:='ц'; PRS[23]:='?';
RS[24]:='ч'; PRS[24]:='4';
RS[25]:='ш'; PRS[25]:='III';
RS[26]:='щ'; PRS[26]:='III,';
RS[27]:='ъ'; PRS[27]:='b';
RS[28]:='ы'; PRS[28]:='bI';
RS[29]:='ь'; PRS[29]:='b';
RS[30]:='э'; PRS[30]:='&';
RS[31]:='ю'; PRS[31]:='I-o';
RS[32]:='я'; PRS[32]:='9I';
RS[33]:='А'; PRS[33]:='A';
RS[34]:='Б'; PRS[34]:='6';
RS[35]:='В'; PRS[35]:='B';
RS[36]:='Г'; PRS[36]:='r';
RS[37]:='Д'; PRS[37]:='g';
RS[38]:='Е'; PRS[38]:='E';
RS[39]:='Ё'; PRS[39]:='E';
RS[40]:='Ж'; PRS[40]:='}|{';
RS[41]:='З'; PRS[41]:='3';
RS[42]:='И'; PRS[42]:='U';
RS[43]:='Й'; PRS[43]:='U';
RS[44]:='К'; PRS[44]:='K';
RS[45]:='Л'; PRS[45]:='JL';
RS[46]:='М'; PRS[46]:='M';
RS[47]:='Н'; PRS[47]:='H';
RS[48]:='О'; PRS[48]:='O';
RS[49]:='П'; PRS[49]:='n';
RS[50]:='Р'; PRS[50]:='p';
RS[51]:='С'; PRS[51]:='c';
RS[52]:='Т'; PRS[52]:='T';
RS[53]:='У'; PRS[53]:='Y';
RS[54]:='Ф'; PRS[54]:='%';
RS[55]:='Х'; PRS[55]:='X';
RS[56]:='Ц'; PRS[56]:='?';
RS[57]:='Ч'; PRS[57]:='4';
RS[58]:='Ш'; PRS[58]:='III';
RS[59]:='Щ'; PRS[59]:='III,';
RS[60]:='Ъ'; PRS[60]:='b';
RS[61]:='Ы'; PRS[61]:='bI';
RS[62]:='Ь'; PRS[62]:='b';
RS[63]:='Э'; PRS[63]:='&';
RS[64]:='Ю'; PRS[64]:='I-O';
RS[65]:='Я'; PRS[65]:='9I';
ES[0]:='a'; PPS[0]:='@';
ES[1]:='b'; PPS[1]:='6';
ES[2]:='c'; PPS[2]:='|_|,';
ES[3]:='d'; PPS[3]:=',^,';
ES[4]:='e'; PPS[4]:='e';
ES[5]:='f'; PPS[5]:='%';
ES[6]:='g'; PPS[6]:='|"';
ES[7]:='h'; PPS[7]:='][';
ES[8]:='i'; PPS[8]:='|/|';
ES[9]:='j'; PPS[9]:='>|<';
ES[10]:='k'; PPS[10]:='K';
ES[11]:='l'; PPS[11]:='/\';
ES[12]:='m'; PPS[12]:='M';
ES[13]:='n'; PPS[13]:='|-|';
ES[14]:='o'; PPS[14]:='0';
ES[15]:='p'; PPS[15]:='n';
ES[16]:='q'; PPS[16]:='k|3';
ES[17]:='r'; PPS[17]:='P';
ES[18]:='s'; PPS[18]:='$';
ES[19]:='t'; PPS[19]:='T';
ES[20]:='u'; PPS[20]:='Y';
ES[21]:='v'; PPS[21]:='\/';
ES[22]:='w'; PPS[22]:='|3';
ES[23]:='x'; PPS[23]:='kc';
ES[24]:='y'; PPS[24]:='9';
ES[25]:='z'; PPS[25]:='3';
ES[26]:='A'; PPS[26]:='@';
ES[27]:='B'; PPS[27]:='6';
ES[28]:='C'; PPS[28]:='|_|,';
ES[29]:='D'; PPS[29]:=',^,';
ES[30]:='E'; PPS[30]:='E';
ES[31]:='F'; PPS[31]:='%';
Найдено в DRKB. Double F@$EР@LM.
Govnocoder#0xFF,
13 Декабря 2010
-
+163
- 1
- 2
- 3
- 4
- 5
$('div').each(function (i) {
if(i==0)$(this).css('display', 'none');
else
for(j=0;j<=1;j++)break;
});
Вместо $("div:first").hide();
fuckyounoob,
08 Декабря 2010
-
−141
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
public function getToBrick(brick:Point):void
{
function f():void {
scale_sliderbar.position = scale_sliderbar.position;
view_wall.x = (brick.x * -300) * view_wall.scaleX + 150;
view_wall.y = (brick.y * -178) * view_wall.scaleY + 258;
testWallPosition();
}
f();
f();
f();
}
Бог любит троицу! =)
Самое смешное, если убрать троекратный вызов f(); - то все работает как-то коряво..
Функция testWallPosition(); проверяет min&&max координаты у стены, там также нет никаких математических просчетов.
Хоть убейте - не пойму - но аффору +100500 за потрясный кусок кода:)
KirAmp,
08 Декабря 2010
-
+145
- 1
поставьте пожалуйста +1 к этому говнотексту на этом говносайте. )))
плиззз )))
Maxim546,
07 Декабря 2010
-
+75
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
...
<target name="killServer">
<exec executable="pkill">
<arg line=" java"/>
</exec>
<sleep seconds="1"/>
</target>
<target name="zipBuild">
<zip destfile="${home}/zipContent_${current.time}.zip"
basedir="${home}/${dir}"
update="true"
/>
</target>
<target name="all" depends="killServer, zipBuild" />
...
it's ant but... no ant in drop down (killing java with ant itself)
shchavla,
06 Декабря 2010
-
+157
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
<?if (is_array($GLOBALS['cart_content'])):?>
<?foreach ($GLOBALS['cart_content'] as $item_id=>$odin):?>
<?if (isset($arResult['ITEMS'][$item_id])):?>
$('#product-order-<?=$item_id?>').html('<a href="/personal/cart/" class="buy" style="padding-left:20px">В корзине</a>').parent().addClass('bought');
<?endif;?>
<?endforeach;?>
<?endif;?>
<?if (is_array($GLOBALS['wishlist_content'])):?>
<?foreach ($GLOBALS['wishlist_content'] as $item_id=>$odin):?>
<?if (isset($arResult['ITEMS'][$item_id])):?>
$('#product-wishlist-<?=$item_id?>').html('<a href="/personal/wishlist/" class="reserve">Отложено</a>');
<?endif;?>
<?endforeach;?>
<?endif;?>
Довелось переделывать шаблон магазина на злополучном битриксе. Нашёл в старом шаблоне такую красоту, этот кусок вставляется в основной шаблон внутри тега <script>, предназначение его — на товарах которые в корзине отображать вместо ссылки купить надпись в корзине.
sickuenser,
03 Декабря 2010
-
−145
- 1
- 2
$ if [ "0" != "0" ]; then make i8086gui;else echo "GTK GUI is disabled - may be you lack of gtk!";fi;
GTK GUI is disabled - may be you lack of gtk!
Странная какая-то проверка наличия GTK в мєйкфайле...
Anderson,
01 Декабря 2010
-
+156
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
function uname($v)
{
return $v;
}
function name($v)
{
return $v;
}
function url($v)
{
return $v;
}
function icq($v)
{
return $v;
}
function from($v)
{
return $v;
}
function intrest($v)
{
return $v;
}
foreach( $s_data AS $k=>$v )
{
$v = $k($v);
$parser -> set_var($this -> tmpl_id,$k,$v);
}
Клинический случай. Убрал «$v = $k($v);» и, как и следовало ожидать, ничего не изменилось.
Oonitaz,
24 Ноября 2010
-
+157
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
move_uploaded_file($_FILES['Filedata']['tmp_name'], 'gallery/' . $_FILES['Filedata']['name']);
chmod('gallery/' . $_FILES['Filedata']['name'], 0777);
$return['src'] = 'uploads/' . $_FILES['Filedata']['name'];
/*
* or
*
* $return['link'] = YourImageLibrary::createThumbnail($_FILES['Filedata']['tmp_name']);
*
*/
if ($error) {
$return = array(
'status' => '0',
'error' => $error
);
} else {
$return = array(
'status' => '1',
'name' => $_FILES['Filedata']['name']
);
// Our processing, we get a hash value from the file
$return['hash'] = md5_file($_FILES['Filedata']['tmp_name']);
// ... and if available, we get image data
$info = @getimagesize($_FILES['Filedata']['tmp_name']);
if ($info) {
$return['width'] = $info[0];
$return['height'] = $info[1];
$return['mime'] = $info['mime'];
}
}
ZekMan,
23 Ноября 2010