- 1
flag = bool(int(flag) - 1);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−41
flag = bool(int(flag) - 1);
−186.9
for J1:=0 to Length(wArTypCoil[JJ])-1 do begin
with wArTypCoil[JJ][J1] do begin
with cTyp_coil do begin NRow:=J1+1;NTab:=II_Tabl+4; Itm5:=II;StrN:=2230;mEd:=true;Lev:=2;end;P5;ArP5[IJ5]:=@cTyp_coil;inc(IJ5);inc(II);
with cD_in do begin NRow:=J1+1;NTab:=II_Tabl+4; Itm1:=II; StrN:=2231;mEd:=true;NPos:=1;Lev:=2;end;P1;ArP1[IJ1]:=@cD_in;inc(IJ1);inc(II);
with cTyp_pr do begin NRow:=J1+1;NTab:=II_Tabl+4; Itm6:=II;NTypChs1:=1;StrN:=2232;mEd:=true;Lev:=2;end;P6;ArP6[IJ6]:=@cTyp_Pr;inc(IJ6);inc(II);
with cRad_str do begin NRow:=J1+1;NTab:=II_Tabl+4; Itm5:=II; StrN:=2233;mEd:=true;Lev:=2;end;P5;ArP5[IJ5]:=@cRad_str;inc(IJ5);inc(II);
with cPW_coil_rad do begin NRow:=J1+1;NTab:=II_Tabl+4; Itm2:=II; StrN:=2235;mEd:=true;Lev:=2;end;P2;ArP2[IJ2]:=@cPW_coil_rad;inc(IJ2);inc(II);
with cPW_coil_os do begin NRow:=J1+1;NTab:=II_Tabl+4; Itm2:=II; StrN:=2248;mEd:=true;Lev:=2;end;P2;ArP2[IJ2]:=@cPW_coil_os;inc(IJ2);inc(II);
with cRat_cur do begin NRow:=J1+1;NTab:=II_Tabl+4; Itm1:=II; StrN:=2236;mEd:=true;NPos:=2;Lev:=2;end;P1;ArP1[IJ1]:=@cRat_cur;inc(IJ1);inc(II);
with cTrn_coil do begin NRow:=J1+1;NTab:=II_Tabl+4; Itm1:=II; StrN:=2237;mEd:=true;NPos:=3;Lev:=2;end;P1;ArP1[IJ1]:=@cTrn_coil;inc(IJ1);inc(II);
with cRad_dim do begin NRow:=J1+1;NTab:=II_Tabl+4; Itm1:=II; StrN:=2271;mEd:=true;NPos:=3;Lev:=2;end;P1;ArP1[IJ1]:=@cRad_dim;inc(IJ1);inc(II);
//...
end;
end;
with wArNconcentr[JJ] do begin NRow:=1;NTab:=II_Tabl+1; Itm2:=II; StrN:=2279;mEd:=false;Lev:=1;end;P2;ArP2[IJ2]:=@wArNconcentr[JJ];inc(IJ2);inc(II);
with wArM_c[JJ] do begin NRow:=1;NTab:=II_Tabl+1; Itm3:=II; StrN:=2316;mEd:=true;NPos:=0;Lev:=1;end;P3;ArP3[IJ3]:=@wArM_c[JJ];inc(IJ3);inc(II);
// with wArNumZoneOtvod_c[JJ] do begin NTab:=II_Tabl+1; Itm3:=II; StrN:=2317;mEd:=true;NPos:=0;Lev:=1;end;P3;ArP3[IJ3]:=@wArNumZoneOtvod_c[JJ];inc(IJ3);inc(II);
// with wArNumZoneVdod_c[JJ] do begin NTab:=II_Tabl+1; Itm3:=II; StrN:=2318;mEd:=true;NPos:=0;Lev:=1;end;P3;ArP3[IJ3]:=@wArNumZoneVdod_c[JJ];inc(IJ3);inc(II);
// with wArNxod_c[JJ] do begin NTab:=II_Tabl+1; Itm3:=II; StrN:=2319;mEd:=true;NPos:=0;Lev:=1;end;P3;ArP3[IJ3]:=@wArNxod_c[JJ];inc(IJ3);inc(II);
// with wArNcur_c[JJ] do begin NTab:=II_Tabl+1; Itm3:=II; StrN:=2320;mEd:=true;NPos:=0;Lev:=1;end;P3;ArP3[IJ3]:=@wArNcur_c[JJ];inc(IJ3);inc(II);
// with wArParam_c[JJ] do begin NTab:=II_Tabl+1; Itm3:=II; StrN:=2321;mEd:=true;NPos:=0;Lev:=1;end;P3;ArP3[IJ3]:=@wArParam_c[JJ];inc(IJ3);inc(II);
// with wArSw_c[JJ] do begin NTab:=II_Tabl+1; Itm3:=II; StrN:=2322;mEd:=true;NPos:=1;Lev:=1;end;P3;ArP3[IJ3]:=@wArSw_c[JJ];inc(IJ3);inc(II);
with wArNumKolc_top_c[JJ] do begin NRow:=1;NTab:=II_Tabl+1; ; Itm3:=II; StrN:=2328;mEd:=true;NPos:=0;Lev:=1;end;P3;ArP3[IJ3]:=@wArNumKolc_top_c[JJ];inc(IJ3);inc(II);
with wArNumKolc_bot_c[JJ] do begin NRow:=1;NTab:=II_Tabl+1; Itm3:=II; StrN:=2329;mEd:=true;NPos:=0;Lev:=1;end;P3;ArP3[IJ3]:=@wArNumKolc_bot_c[JJ];inc(IJ3);inc(II);
with wArNreek_ar[JJ] do begin NRow:=1;NTab:=II_Tabl+3; Itm3:=II; StrN:=2313;mEd:=true;NPos:=0;Lev:=1;end;P3;ArP3[IJ3]:=@wArNreek_ar[JJ];inc(IJ3);inc(II);
with wArGshreik_ar[JJ] do begin NRow:=1;NTab:=II_Tabl+3; Itm3:=II; StrN:=2314;mEd:=true;NPos:=2;Lev:=1;end;P3;ArP3[IJ3]:=@wArGshreik_ar[JJ];inc(IJ3);inc(II);
with wArGtreik_ar[JJ] do begin NRow:=1;NTab:=II_Tabl+3; Itm3:=II; StrN:=2315;mEd:=true;NPos:=2;Lev:=1;end;P3;ArP3[IJ3]:=@wArGtreik_ar[JJ];inc(IJ3);inc(II);
with wArShreik_ar[JJ] do begin NRow:=1;NTab:=II_Tabl+3; Itm3:=II; StrN:=2404;mEd:=true;NPos:=2;Lev:=1;end;P3;ArP3[IJ3]:=@wArShreik_ar[JJ];inc(IJ3);inc(II);
with wArNpr[JJ] do begin NRow:=1;NTab:=II_Tabl+3; Itm2:=II; StrN:=2369;mEd:=true;Lev:=1;end;P2;ArP2[IJ2]:=@wArNpr[JJ];inc(IJ2);inc(II);
with wArShpr[JJ] do begin NRow:=1;NTab:=II_Tabl+3; Itm1:=II; StrN:=2245;mEd:=true;NPos:=2;Lev:=1;end;P1;ArP1[IJ1]:=@wArShpr[JJ];inc(IJ1);inc(II);
with wArRadZaz_w[JJ] do begin NRow:=1;NTab:=II_Tabl+1; Itm3:=II; StrN:=2323;mEd:=true;NPos:=2;Lev:=1;end;P3;ArP3[IJ3]:=@wArRadZaz_w[JJ];inc(IJ3);inc(II);
with wArStr_os_w[JJ] do begin NRow:=1;NTab:=II_Tabl+1; Itm1:=II; StrN:=2324;mEd:=true;NPos:=2;Lev:=1;end;P1;ArP1[IJ1]:=@wArStr_os_w[JJ];inc(IJ1);inc(II);
with wArPrizn_radop_w[JJ] do begin NRow:=1;NTab:=II_Tabl+1; Itm4:=II;NTypChs:=0;StrN:=2325;mEd:=true;Lev:=1;end;P4;ArP4[IJ4]:=@wArPrizn_radop_w[JJ];inc(IJ4);inc(II);
with wArAxStr[JJ].awAxialStr do begin NRow:=1;NTab:=II_Tabl+5; Itm5:=II; StrN:=2243;mEd:=true;Lev:=1;end;P5;ArP5[IJ5]:=@wArAxStr[JJ].awAxialStr;inc(IJ5);inc(II);
with wArYokeRast_bot_w[JJ] do begin NRow:=1;NTab:=II_Tabl+2; Itm1:=II; StrN:=2265;mEd:=true;NPos:=2;Lev:=1;end;P1;ArP1[IJ1]:=@wArYokeRast_bot_w[JJ];inc(IJ1);inc(II);
with wArElectrH_w[JJ] do begin NRow:=1;NTab:=II_Tabl+2; Itm1:=II; StrN:=2266;mEd:=true;NPos:=2;Lev:=1;end;P1;ArP1[IJ1]:=@wArElectrH_w[JJ];inc(IJ1);inc(II);
with wArElectr_centre[JJ] do begin NRow:=1;NTab:=II_Tabl+2; Itm1:=II; StrN:=2395;mEd:=false;NPos:=1;Lev:=1;end;P1;ArP1[IJ1]:=@wArElectr_centre[JJ];inc(IJ1);inc(II);
with wArKanBottom[JJ] do begin NRow:=1;NTab:=II_Tabl+2; Itm3:=II; StrN:=2341;mEd:=true;NPos:=2;Lev:=1;end;P3;ArP3[IJ3]:=@wArKanBottom[JJ];inc(IJ3);inc(II);
with wArKanTop[JJ] do begin NRow:=1;NTab:=II_Tabl+2; Itm3:=II; StrN:=2342;mEd:=true;NPos:=2;Lev:=1;end;P3;ArP3[IJ3]:=@wArKanTop[JJ];inc(IJ3);inc(II);
with wArComIsZone[JJ] do begin NRow:=1;NTab:=II_Tabl+6; Itm1:=II; StrN:=2339;mEd:=true;NPos:=2;Lev:=1;end;P1;ArP1[IJ1]:=@wArComIsZone[JJ];inc(IJ1);inc(II);
with wArMprIsZone[JJ] do begin NRow:=1;NTab:=II_Tabl+6; Itm1:=II; StrN:=2340;mEd:=true;NPos:=2;Lev:=1;end;P1;ArP1[IJ1]:=@wArMprIsZone[JJ];inc(IJ1);inc(II);
with wArKus_pr[JJ] do begin NRow:=1;NTab:=II_Tabl+7; Itm1:=II; StrN:=2249;mEd:=true;NPos:=3;Lev:=1;end;P1;ArP1[IJ1]:=@wArKus_pr[JJ];inc(IJ1);inc(II);
with wArKus_bm_is[JJ] do begin NRow:=1;NTab:=II_Tabl+7; Itm1:=II; StrN:=2250;mEd:=true;NPos:=3;Lev:=1;end;P1;ArP1[IJ1]:=@wArKus_bm_is[JJ];inc(IJ1);inc(II);
with wArKus_ob_is[JJ] do begin NRow:=1;NTab:=II_Tabl+7; Itm1:=II; StrN:=2251;mEd:=true;NPos:=3;Lev:=1;end;P1;ArP1[IJ1]:=@wArKus_ob_is[JJ];inc(IJ1);inc(II);
with wArKus_mpr_is[JJ] do begin NRow:=1;NTab:=II_Tabl+7; Itm1:=II; StrN:=2252;mEd:=true;NPos:=3;Lev:=1;end;P1;ArP1[IJ1]:=@wArKus_mpr_is[JJ];inc(IJ1);inc(II);
// with wArKus_msl_is[JJ] do begin NRow:=1;NTab:=II_Tabl+7; Itm1:=II; StrN:=2253;mEd:=true;NPos:=3;Lev:=1;end;P1;ArP1[IJ1]:=@wArKus_msl_is[JJ];inc(IJ1);inc(II);
with wArTypIsol[JJ] do begin NRow:=1;NTab:=II_Tabl+6; Itm6:=II;NTypChs1:=2;StrN:=2254;mEd:=true;Lev:=1;end;P6;ArP6[IJ6]:=@wArTypIsol[JJ];inc(IJ6);inc(II);
with wArEndIsol_bot[JJ] do begin NRow:=1;NTab:=II_Tabl+6; Itm3:=II; StrN:=2258;mEd:=true;NPos:=1;Lev:=1;end;P3;ArP3[IJ3]:=@wArEndIsol_bot[JJ];inc(IJ3);inc(II);
with wArEndIsol_top[JJ] do begin NRow:=1;NTab:=II_Tabl+6; Itm3:=II; StrN:=2259;mEd:=true;NPos:=1;Lev:=1;end;P3;ArP3[IJ3]:=@wArEndIsol_top[JJ];inc(IJ3);inc(II);
with wArTypMat_end_top_w[JJ] do begin NRow:=1;NTab:=II_Tabl+6; Itm6:=II;NTypChs1:=3;StrN:=2326;mEd:=true;Lev:=1;end;P6;ArP6[IJ6]:=@wArTypMat_end_top_w[JJ];inc(IJ6);inc(II);
with wArTypMat_end_bot_w[JJ] do begin NRow:=1;NTab:=II_Tabl+6; Itm6:=II;NTypChs1:=3;StrN:=2327;mEd:=true;Lev:=1;end;P6;ArP6[IJ6]:=@wArTypMat_end_bot_w[JJ];inc(IJ6);inc(II);
with wArNst_top_isol[JJ] do begin NRow:=1;NTab:=II_Tabl+6; Itm3:=II; StrN:=2332;mEd:=true;NPos:=0;Lev:=1;end;P3;ArP3[IJ3]:=@wArNst_top_isol[JJ];inc(IJ3);inc(II);
with wArNst_bot_isol[JJ] do begin NRow:=1;NTab:=II_Tabl+6; Itm3:=II; StrN:=2333;mEd:=true;NPos:=0;Lev:=1;end;P3;ArP3[IJ3]:=@wArNst_bot_isol[JJ];inc(IJ3);inc(II);
with wArSh_top_isol[JJ] do begin NRow:=1;NTab:=II_Tabl+6; Itm3:=II; StrN:=2334;mEd:=true;NPos:=2;Lev:=1;end;P3;ArP3[IJ3]:=@wArSh_top_isol[JJ];inc(IJ3);inc(II);
with wArSh_bot_isol[JJ] do begin NRow:=1;NTab:=II_Tabl+6; Itm3:=II; StrN:=2335;mEd:=true;NPos:=2;Lev:=1;end;P3;ArP3[IJ3]:=@wArSh_bot_isol[JJ];inc(IJ3);inc(II);
with wArRad_top_isol[JJ] do begin NRow:=1;NTab:=II_Tabl+6; Itm3:=II; StrN:=2336;mEd:=true;NPos:=2;Lev:=1;end;P3;ArP3[IJ3]:=@wArRad_top_isol[JJ];inc(IJ3);inc(II);
with wArRad_bot_isol[JJ] do begin NRow:=1;NTab:=II_Tabl+6; Itm3:=II; StrN:=2337;mEd:=true;NPos:=2;Lev:=1;end;P3;ArP3[IJ3]:=@wArRad_bot_isol[JJ];inc(IJ3);inc(II);
// with wArPriznZakr[JJ] do begin NRow:=1;NTab:=II_Tabl+6; Itm3:=II; StrN:=2338;mEd:=true;NPos:=0;Lev:=1;end;P3;ArP3[IJ3]:=@wArPriznZakr[JJ];inc(IJ3);inc(II);
//....
end;
Просто говно. Кусок одного из вложенных циклов
+49.5
if (gettype($x/2) == 'int') {
$rowspan = $x - $i;
} else {
$rowspan = ($x - $i) + 1;
}
Проверка на остаток от деления на 2 одним начинающим знакомым ПХП программистом
+25
elseif( $manufacturer_id) {
$db->query( "SELECT manufacturer_id, mf_name FROM #__{vm}_manufacturer WHERE manufacturer_id='$manufacturer_id'");
$db->next_record();
$mainframe->setPageTitle( $db->f("mf_name") );
echo "Izdeliya ot";
}
−48
private static final String PROMPT = " >";
private static final int BUFFER_SIZE = 255;
private static final int NEW_LINE_CHAR = 13;
private static final int CARRIAGE_RETURN_CHAR = 10;
...
System.out.print( prompt + PROMPT );
StringBuffer sb = new StringBuffer();
byte[] buf = new byte[BUFFER_SIZE];
int read = System.in.read( buf );
if ( read != 0 && buf[0] != CARRIAGE_RETURN_CHAR && buf[0] != NEW_LINE_CHAR )
{
sb.append( new String( buf, 0, read ).trim() );
}
return sb.toString();
Вам нужно вывести приглашение и прочитать введенную строку? Что может быть проще?
−53.2
private void setTims( String project )
{
int endIndex = project.indexOf( "-" );
boolean isNumber = false;
if ( endIndex != -1 )
{
try
{
Integer.parseInt( project.substring( 0, endIndex ) );
isNumber = true;
}
catch ( NumberFormatException e )
{
//ignore
}
}
if ( isNumber )
{
runtimeContext.put( RuntimeContext.TIMS_NUMBER, project.substring( 0, endIndex ) );
}
else
{
runtimeContext.put( RuntimeContext.TIMS_NUMBER, project );
}
}
+20.5
b:=(1-(n+1))/2
Ничего не трогать, пусть работает, как есть!
+20
source code: C++
enum e_acomany {
Audi,
BMW,
Cadillac,
Ford,
Jaguar,
Lexus
Maybach,
RollsRoyce,
Saab
};
?>
Маны бывают разные. Этот, например, по C++
−74.2
CString temp;
temp.Preallocate(5000);
GetName(temp.GetBuffer());
name_.Format(L"%s", temp);
На самом деле после GetBuffer нужен ReleaseBuffer и Preallocate резервирует место, но не устанавливает длину.
Эти ошибки приводят к тому что использование name_ в GetName не работает и name_ = temp тоже не работает.
Хитрый "индокодер" выкрутился через Format.
+24
while (!bFound && j < enmMessages)
{
if (!strcmp(str.operator const char * (), strPacketName[j]))
{
iPacketType = j;
bFound = true;
TRACE(" of type %s\n",strPacketName[j]);
strcat(strOut," of type ");
strcat(strOut, strPacketName[j]);
break;
}
j++;
}