- 1
val=(chb.checked?val|VAR_ID:val&~VAR_ID);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+16.3
val=(chb.checked?val|VAR_ID:val&~VAR_ID);
позволяет сохранить в число 32 числа
−42.8
procedure TForm1.fritb(ie:longint;var fr0:extended);
begin
v1:=0;
for nsf:=1 to 5 do
begin
kl11:=0;kl12:=0;kl22:=0;
for k:=1 to km[nsf] do
begin
if (cm^[ie]=cm^[nm^[(ie-1)*kms[ksf+1]+kms[nsf]+k]])and (cm^[ie]=1)
then kl11:=kl11+1;
if (cm^[ie]=cm^[nm^[(ie-1)*kms[ksf+1]+kms[nsf]+k]])and (cm^[ie]=2)
then kl22:=kl22+1;
if (cm^[ie]<>cm^[nm^[(ie-1)*kms[ksf+1]+kms[nsf]+k]])and(cm^[nm^[(ie-1)*kms[ksf+1]+kms[nsf]+k]]<>0)and (cm^[ie]<>0)
then kl12:=kl12+1;
end;
fr0:=fr0+kl11*(p11[1,nsf])+kl22*p11[2,nsf]+kl12*p11[3,nsf];
v1:=v1+kl11*(f11[1,nsf])+kl22*f11[2,nsf]+kl12*f11[3,nsf];
end;
fr0:=fr0-sqrt(abs(v1));
end;
процеДуро
−12.7
for i:=sk[(npl-1)*5+1] to sk[(npl-1)*5+2]-1 do
begin
l1:=0;l2:=0;l3:=0;l4:=0;l5:=0;l6:=0;l7:=0;l8:=0;l9:=0;l10:=0;
for j:=1 to 100 do g1[j]:=0;
for k:=sk[(npl-1)*5+1] to sk[(npl-1)*5+2] do
if (k<>i )and
(((abs(xyz^[pxyz^[i]].x-xyz^[pxyz^[k]].x)< dd) or ((lx-abs(xyz^[pxyz^[i]].x-xyz^[pxyz^[k]].x))<dd))
and ((abs(xyz^[pxyz^[i]].y-xyz^[pxyz^[k]].y)<dd) or ((ly-abs(xyz^[pxyz^[i]].y-xyz^[pxyz^[k]].y))<dd))
and ((abs(xyz^[pxyz^[i]].z-xyz^[pxyz^[k]].z)<dd) or ((lz-abs(xyz^[pxyz^[i]].z-xyz^[pxyz^[k]].z))<dd)))
then
это только заголовок цикла ..
−50
contents = contents.replaceAll("\\<(\\w+)\\>", "<CT_$1>\n");
contents = contents.replaceAll("\\<(\\w+)(\\s\\w+)=\\"(\\w+)\\"\\>", "<CT_$1$2=\"$3\">\n");
contents = contents.replaceAll("\\<(\\w+)(\\s\\w+)=\\'(\\w+)\\'\\>", "<CT_$1$2='$3'>\n");
contents = contents.replaceAll("\\</(\\w+)\\>", "\n</CT_$1>\n");
преобразуем эскейпнутые тэги в обычные
−276.5
text=string.replace(text,"<br>","\n")
text=string.replace(text,"<BR>","\n")
text=string.replace(text,"<Br>","\n")
text=string.replace(text,"<bR>","\n")
Twisted Words, протокол Oscar.
Кусок функции dehtml()
−187.2
respons+="""<span class="gray">коэффициент:</span> %s<br />""" % str(koeff[0][5])
respons+="""<br />"""
Формирование "аяксового" ответа
+14.4
<?
/////////////////////////////// GAME START TASOVKA //////////////////////////////////////////////////
if($page == "game_start")
{
if( isset($_SESSION["game"]) && !empty($_SESSION["game"]) )
{
session_unregister("game");
}
if( isset($_SESSION["total_price"]) && !empty($_SESSION["total_price"]) )
{
session_unregister("total_price");
}
if( isset($_SESSION["game_num"]) && !empty($_SESSION["game_num"]))
{
session_unregister("game_num");
}
if( isset($_SESSION["ticket_num"]) && !empty($_SESSION["ticket_num"]) )
{
session_unregister("ticket_num");
}
if( isset($_SESSION["for_fl"]) && !empty($_SESSION["for_fl"]) )
{
session_unregister("for_fl");
}
//---------------------------------------------------//
if( isset($_SESSION["order_res_query3"]) && !empty($_SESSION["order_res_query3"]) )
{
session_unregister("order_res_query3");
}
if( isset($_SESSION["order_res_query2"]) && !empty($_SESSION["order_res_query2"]) )
{
session_unregister("order_res_query2");
}
if( isset($_SESSION["order_res2"]) && !empty($_SESSION["order_res2"]) )
{
session_unregister("order_res2");
}
if( isset($_SESSION["order_res"]) && !empty($_SESSION["order_res"]) )
{
session_unregister("order_res");
}
if( isset($_SESSION["user_not_reg"]) && !empty($_SESSION["user_not_reg"]) )
{
session_unregister("user_not_reg");
}
if( isset($_SESSION["order_id"]) && !empty($_SESSION["order_id"]) )
{
session_unregister("order_id");
}
if( isset($_SESSION["user_edit_type"]) && !empty($_SESSION["user_edit_type"]) )
{
session_unregister("user_edit_type");
}
//---------------------------------------------------//
if( isset($_SESSION["order_date"]) && !empty($_SESSION["order_date"]) )
{
session_unregister("order_date");
}
if( isset($_SESSION["drawing_num"]) && !empty($_SESSION["drawing_num"]) )
{
session_unregister("drawing_num");
}
}
/////////////////////////////// GAME START TASOVKA //////////////////////////////////////////////////
?>
<?
/////////////////////////////// CHOSE TASOVKA //////////////////////////////////////////////////
if($page == "chose")
{
if( isset($_SESSION["order_res_query3"]) && !empty($_SESSION["order_res_query3"]) )
{
session_unregister("order_res_query3");
}
if( isset($_SESSION["order_res_query2"]) && !empty($_SESSION["order_res_query2"]) )
{
session_unregister("order_res_query2");
}
if( isset($_SESSION["order_res2"]) && !empty($_SESSION["order_res2"]) )
{
session_unregister("order_res2");
}
if( isset($_SESSION["order_res"]) && !empty($_SESSION["order_res"]) )
{
session_unregister("order_res");
+32.9
foreach(explode(' ',str_replace($symbols,'',htmlspecialchars_decode(html_entity_decode(implode(' ',$keywords))))) as $i=>$val) if(mb_strlen($val)>2) echo ', '.$val;
Массив keywords собирается в строку через запятую :)
+40.6
Application was halted by an exception.
Debug-mode is off.
Ошибка на govnokod.ru при добавлении комментариев
+52.3
//разметка матрицы
while ((founded==1)&&(mat[nx][ny]<=0)) {
founded=0;
iii=y-i;
while (((i==0)&&(iii==y))||((iii<=y+i))){
ii=x-i;
while ((ii<=x+i)){
if ((mat[ii][iii]==i)&&((ii<70)&&(ii>=0))&&((iii<70)&&(iii>=0))) {
bii=ii;
biii=iii;
if ((mat[bii+1][biii]==-1)&&(bii+1<70)&&(bii+1>=0)) {
mat[bii+1][biii]=i+1;
founded=1;
}
if ((mat[bii-1][biii]==-1)&&(bii-1<70)&&(bii-1>=0)) {
mat[bii-1][biii]=i+1;
founded=1;
}
if ((mat[bii][biii+1]==-1)&&(biii+1<70)&&(biii+1>=0)) {
mat[bii][biii+1]=i+1;
founded=1;
}
if ((mat[bii][biii-1]==-1)&&(biii-1<70)&&(biii-1>=0)) {
mat[bii][biii-1]=i+1;
founded=1;
}
}
ii++;
}
iii++;
}
i++;
}
if (mat[nx][ny]>=0) {
if ((nx==40)&&(ny==57)) {
nx=nx;
}
ik=i;
ii=nx;
iii=ny;
//поиск пути
while (ik>1) {
if ((mat[ii-1][iii]==ik-1)&&(ii-1<70)&&(ii-1>=0)) {
ii--;
mat[ii][iii]=-3;
}
if ((mat[ii][iii-1]==ik-1)&&(iii-1<70)&&(iii-1>=0)) {
iii--;
mat[ii][iii]=-3;
}
if ((mat[ii+1][iii]==ik-1)&&(ii+1<70)&&(ii+1>=0)) {
ii++;
mat[ii][iii]=-3;
}
if ((mat[ii][iii+1]==ik-1)&&(iii+1<70)&&(iii+1>=0)) {
iii++;
mat[ii][iii]=-3;
}
ik--;
}
ax=ii*10+5;
ay=iii*10+5;
//out_to_file(mat,"d:\\out.txt");
i++;
ii=0;
iii=0;
while ((iii>-1)&&(iii<70)){
ii=0;
while ((ii>-1)&&(ii<70)){
if ((mat[ii][iii]>-1)||(mat[ii][iii]==-3)) {
mat[ii][iii]=-1;
}
ii++;
}
iii++;
}
nx=ax;
ny=ay;
} else ...
}
Разметка матрицы, Поиск Пути.