- 1
Var panelTile1:PanelTile = PanelTile(target.parent.parent.parent.parent.parent.parent);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−616.9
Var panelTile1:PanelTile = PanelTile(target.parent.parent.parent.parent.parent.parent);
обращение к одному из элементов
+242.5
CNode* CBSTree::AddNode(CNode *&pTree, CNode *pNode)
{
...
return !NULL;
}
...
if(AddNode(pTree->left ,pNode)!=NULL)
{
...
}
...
Надо не нулл - дадим не нулл!
+138.9
1000:
nume:=0;
for i:=1 to mmes do work^[i]{^}:=work^[i]{^}+hde;
iter:=iter+1;
for j:=1 to 2 do
begin
if j=1 then w:=work^[1]{^};
if j=2 then w:=work^[mmes]{^} ;
ab:=2*sqrt(3.*abs(1.-w));
w1:=ab;
for i:=1 to 10 do
begin
w2:=ab * sqrt(1.+w1);
if abs(w2-w1)<1.e-6 then goto 18;
w1:=w2
end;
18:
wkb:=(1.+w2)/w;
if j=1 then rpsi[1]^:=work^[2]{^}*wkb;
if j=2 then rpsi[mmes]^:=work^[m1]{^}*wkb
end;
b:=rpsi[mmes]^;
for i:=1 to m1 do
begin
npsi:=mmes-i;
a:=(12./work^[npsi]{^}-10.0)-1./b;
rpsi[npsi]^:=a;
b:=a;
if a<=1. then goto 30
end;
30:
mcross:=npsi;
rmcros:=a;
b:=rpsi[1]^;
for i:=2 to mcross do
begin
a:=(12./work^[i]{^}-10.0)-1./b;
rpsi[i]^:=a;
b:=a;
if a<0. then nume:=nume+1
end;
if (iter=1) and (nume<num) then writeln('error in initial Eh');
if nume=num then goto 50;
if (not bisec) then writeln('give left energy El');
if (succes) then goto 60;
if nume>num then eh:=enew;
if nume<num then el:=enew;
goto 80;
50:
m3:=mcross+1;
m4:=mcross-1;
a:=1.-0.5/work^[m3]{^};
a1:=a*(1./rpsi[m3]^-rpsi[mcross]^);
b:=1.-0.5/work^[m4]{^};
b1:=b*(rmcros-1./rpsi[m4]^);
de:=(a1-b1)*work^[mcross]{^};
if de>0. then eh:=enew;
if de<0. then el:=enew;
it:=it+1;
goto 70;
60:
it:=0;
70:
if it>=maxit then goto 100;
80:
eold:=enew;
delta:=(el-eh)*0.5;
enew:=eh+delta;
hde:=hsq12*(enew-eold);
succes:=false;
{writeln ('delta=',delta); }
if abs(delta)>1.e-10 then goto 1000;
{writeln('enew=',enew); }
if nume=num then goto 90;
writeln ('degeneration : num-state=nume-state ');
halt;
90:
{ lip:=true; }
100:
succes:=true;
1 из 3-х модулей, которые мне нужно оснастить ГУИ, оптимизировать и привнести абстракцию...
+39.1
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define N 50
#define K 6
main()
{int i,j,n,error,max,imax,min=0,imin=0;
int a[N][K],b[N][K];
long c[N],r;
do
{error=0;
printf("Vvedite kol-vo raznih dat: ");
scanf("%d",&n);
if(n<1 || n>N)
{printf("\nVi vveli kol-vo elementov massiva men'she 2 ili bol'she 50!\nPovtorite vvod!\n\n");
error=1;
}
}
while (error);
printf("\nDati v formate GG MM DD cc mm ss:\n");
for(i=0;i<n;i++)
{do a[i][0]=rand()%2008; while(a[i][0]<1970);
do a[i][1]=rand()%13; while(a[i][1]<1);
do a[i][2]=rand()%32; while(a[i][2]<1);
a[i][3]=rand()%24;
a[i][4]=rand()%60;
a[i][5]=rand()%60;
printf("\nData %d:",i+1);
for (j=0;j<K;j++)
printf(" %.2d",a[i][j]);
}
max=0;
for(i=0;i<n;i++)
if (a[i][0]>max)
{
max=a[i][0];
imax=i;
}
min=a[0][0];
for(i=0;i<n;i++)
if (a[i][0]<min)
{
min=a[i][0];
imin=i;
}
for(i=0;i<2;i++)
{
for(j=0;j<K;j++)
{
b[i][j]=a[imax][j];
}
imax=imin;
}
for(i=0;i<2;i++)
{
printf("\n");
for(j=0;j<K;j++)
printf(" b[%d,%d]=%d",i,j,b[i][j]);
}
for(i=0;i<2;++i)
{
c[i]=(b[i][0]-1971)*31536000;
c[i]+=b[i][2]*86400;
c[i]+=b[i][3]*3600;
c[i]+=b[i][4]*60;
c[i]+=b[i][5]-86400;
c[i]+=((b[i][0]-69)/4)*86400;
if(b[i][1]>12)
c[i]+=31*86400;
if(b[i][1]>11)
c[i]+=30*86400;
if(b[i][1]>10)
c[i]+=31*86400;
if(b[i][1]>9)
c[i]+=30*86400;
if(b[i][1]>8)
c[i]+=31*86400;
if(b[i][1]>7)
c[i]+=31*86400;
if(b[i][1]>6)
c[i]+=30*86400;
if(b[i][1]>5)
c[i]+=31*86400;
if(b[i][1]>4)
c[i]+=30*86400;
if(b[i][1]>3)
c[i]+=31*86400;
if(b[i][1]>2)
c[i]+=28*86400;
if(b[i][1]>1)
c[i]+=31*86400;
if(((b[i][1]==2 && b[i][2]==29) || b[i][1]>2) && b[i][1]>1 && b[i][0]%4==0 && b[i][0]%100!=0 || b[i][0]%400==0)
c[i]+=151936;
}
printf("\n\nDati v formate vremennoi metki UNIX:\n\n");
for(i=0;i<2;i++)
{printf("Data %d: %ld\n",i+1,c[i]);
}
r=c[0]-c[1];
Нетленное твАрение участницы Truegirl с vingrad.ru
Глядя на ЭТО, начинаешь понимать: женщин в программинг пускать нельзя.
НЕ РЕКОМЕНДУЕТСЯ смотреть код после плотного приёма пищи :lol:
+40.1
$database->setQuery("SELECT DATE_FORMAT('{$date}', '%m/%d/%Y %H:%i')");
$date = $database->loadResult();
Джедайский подход для форматирования даты
+18.3
MyObject a;
switch(id)
{
case id_1:
....
break;
case id_2:
break;
case id_3:
MyObject a;
a = value;
break;
}
res = a;
псевдо код моей ошибки(((
−29.2
for i:=1 to n do
begin
j:=i;
a:=b*exp((j-1)*ln(r));
end;
Задание геометрической прогрессии. Из решения школьной задачки.
+71
<?
if ($_SESSION['UsersPermission'] != 'admin') {?>
<script type = "text/javascript">
location.href = "index.php";
</script>
<?}
Мега безопасная проверка на права админа
−452.5
z=1;
b1.onRelease = function() {
if(xo1._alpha!=100){
z+=1;
if(z>2){z=1}
xo1._alpha=100;
xo1.gotoAndStop(z);}
};
b2.onRelease = function() {
if(xo2._alpha!=100){
z+=1;
if(z>2){z=1}
xo2._alpha=100;
xo2.gotoAndStop(z);}
};
b3.onRelease = function() {
if(xo3._alpha!=100){
z+=1;
if(z>2){z=1}
xo3._alpha=100;
xo3.gotoAndStop(z);}
};
b4.onRelease = function() {
if(xo4._alpha!=100){
z+=1;
if(z>2){z=1}
xo4._alpha=100;
xo4.gotoAndStop(z);}
};
b5.onRelease = function() {
if(xo5._alpha!=100){
z+=1;
if(z>2){z=1}
xo5._alpha=100;
xo5.gotoAndStop(z);}
};
b6.onRelease = function() {
if(xo6._alpha!=100){
z+=1;
if(z>2){z=1}
xo6._alpha=100;
xo6.gotoAndStop(z);}
};
b7.onRelease = function() {
if(xo7._alpha!=100){
z+=1;
if(z>2){z=1}
xo7._alpha=100;
xo7.gotoAndStop(z);}
};
b8.onRelease = function() {
if(xo8._alpha!=100){
z+=1;
if(z>2){z=1}
xo8._alpha=100;
xo8.gotoAndStop(z);}
};
b9.onRelease = function() {
if(xo9._alpha!=100){
z+=1;
if(z>2){z=1}
xo9._alpha=100;
xo9.gotoAndStop(z);}
};
Интерфейс крестиков-ноликов на флеше, AS.
−593.8
Dim cr
Private Function click()
If cr = 0 Then
cr = 1
click = "X"
Else
cr = 0
click = "O"
End If
End Function
Private Sub CommandButton1_Click()
If CommandButton1.Caption = "" Then CommandButton1.Caption = click()
End Sub
Private Sub CommandButton10_Click()
cr = 0
CommandButton1.Caption = ""
CommandButton2.Caption = ""
CommandButton3.Caption = ""
CommandButton4.Caption = ""
CommandButton5.Caption = ""
CommandButton6.Caption = ""
CommandButton7.Caption = ""
CommandButton8.Caption = ""
CommandButton9.Caption = ""
End Sub
Private Sub CommandButton2_Click()
If CommandButton2.Caption = "" Then CommandButton2.Caption = click()
End Sub
Private Sub CommandButton3_Click()
If CommandButton3.Caption = "" Then CommandButton3.Caption = click()
End Sub
Private Sub CommandButton4_Click()
If CommandButton4.Caption = "" Then CommandButton4.Caption = click()
End Sub
Private Sub CommandButton5_Click()
If CommandButton5.Caption = "" Then CommandButton5.Caption = click()
End Sub
Private Sub CommandButton6_Click()
If CommandButton6.Caption = "" Then CommandButton6.Caption = click()
End Sub
Private Sub CommandButton7_Click()
If CommandButton7.Caption = "" Then CommandButton7.Caption = click()
End Sub
Private Sub CommandButton8_Click()
If CommandButton8.Caption = "" Then CommandButton8.Caption = click()
End Sub
Private Sub CommandButton9_Click()
If CommandButton9.Caption = "" Then CommandButton9.Caption = click()
End Sub
Крестики-нолики на Power Point за 2 минуты.