- 1
- 2
- 3
- 4
-(BOOL) isShuffleOn {
return iPodPlayer? iPodPlayer.shuffleMode != MPMusicShuffleModeOff
: NO;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−121
-(BOOL) isShuffleOn {
return iPodPlayer? iPodPlayer.shuffleMode != MPMusicShuffleModeOff
: NO;
}
СУКА, САМЫЙ УМНЫЙ ДА, а я думаю чо оно нет даже если оно ДА.
+1008
QPainter painter(this);
int a1;
int a2;
int a3;
int a4;
//.......
int a999;
int a1000;
a1 = 1;
a2 = 1;
a3 = 1;
a4 = 1;
//.......
a999 = 1;
a1000 = 1;
while (a1 != 500)
{ painter.drawLine(a1, a1, a1, a1); a1 ++;
}
while (a2 != 500)
{ painter.drawLine(a2, a2, a2, a2); a2 ++;
}
while (a3 != 500)
{ painter.drawLine(a3, a3, a3, a3); a3 ++;
}
while (a4 != 500)
{ painter.drawLine(a4, a4, a4, a4); a1 ++;
}
//........
while (a999 != 500)
{ painter.drawLine(a999, a999, a999, a999); a999 ++; }
}
while (a1000 != 500)
{ painter.drawLine(a1000, a1000, a1000, a1000); a1000 ++; }
}
ПРИКИНЬТЕ такое в paintevente!!!!!!! Qt
+89
unit DllUnit; interface
uses windows, sysutils;
Procedure GuPrcA(var p:PAnsiChar;const l:integer); StdCall;
Procedure GuPrcW(var p:PWideChar;const l:integer); StdCall;
Exports GuPrcA,GuPrcW;
implementation
procedure GuMes(s:string);
begin
MessageBox(0,pchar(s),'From dll',mb_iconinformation);
end;
Procedure GuPrcW(var p:PWideChar;const l:integer); // wide
var s:widestring;
begin
if (p=nil)or(l<1) then begin p:=nil;exit;end;
SetLength(s,trunc(l/sizeof(widechar)));Move(p^,Pointer(s)^,l);
gumes('l: '+inttostr(l)+', nl: '+inttostr(length(s))+#10+'-'+s+'-');
s:=widestring(Uppercase(s));Move(Pointer(s)^,p^,l);
end;
Procedure GuPrcA(var p:Pansichar;const l:integer); // ansi
var s:ansistring;
begin
if (p=nil)or(l<1) then begin p:=nil;exit;end;
SetLength(s,l);Move(p^,Pointer(s)^,l);
gumes('l: '+inttostr(l)+', nl: '+inttostr(length(s))+#10+'-'+s+'-');
s:=ansistring(AnsiUppercase(s));Move(Pointer(s)^,p^,l);
end;
Initialization
ReportMemoryLeaksOnShutdown:=true;
end.
(* выше - DLL, ниже импорт из неё *)
...
implementation
{$R *.dfm}
Procedure GuPrcA(var p:PansiChar;const l:cardinal); StdCall; external 'mydll.dll' name 'GuPrcA';
Procedure GuPrcW(var p:PwideChar;const l:cardinal); StdCall; external 'mydll.dll' name 'GuPrcW';
procedure TForm1.Button6Click(Sender: TObject);
var p:pwidechar;c:cardinal;s:widestring;
begin
s:=widestring(memo1.Text);
c:=length(s)*sizeof(widechar);
p:=allocmem(c);
Move(Pointer(s)^,p^,c);
GuPrcW(p,c);
s:='';setlength(s,trunc(c/sizeof(widechar)));
Move(p^,Pointer(s)^,c);
Freemem(p,c);
memo1.Text:='='+s+'= l:'+inttostr(c);
end;
procedure TForm1.Button7Click(Sender: TObject);
var p:pansichar;c:cardinal;s:ansistring;
begin
s:=ansistring(memo1.text);
c:=length(s);
p:=allocmem(c);
Move(Pointer(s)^,p^,c);
GuPrcA(p,c);
s:='';setlength(s,c);
Move(p^,Pointer(s)^,c);
Freemem(p,c);
memo1.Text:='='+s+'= l:'+inttostr(c);
end;
Initialization
ReportMemoryLeaksOnShutdown:=true;
end.
На стековерфловочке завелся некий GuSoft (sic!), который регулярно постит свои высеры через гоогле транслате. Сегодня вот таким шедевром разродился, хочет бесплатных консультаций чтобы в этой херне ему поискали ошибки и «оптимизировали».
+155
<?
if ($id != "") {
$id--;
$file=file("file.txt");
for($i=0;$i<sizeof($file);$i++)
if($i==$id) unset($file[$i]);
$fp=fopen("file.txt","w");
fputs($fp,implode("",$file));
fclose($fp);
}
?>
http://www.codenet.ru/webmast/php/delstr.php вот нарыл говнокод.
OMG!WTF?!
Неужели,люди забыли про file_put_contents ?
+78
while (entityIterator.hasNext()) {
Object[] results = entityIterator.next();
Long policyId = ((PolicyEntity) results[0]).getId();
PolicyEntity policy = (PolicyEntity) policyDao.findById(policyId);
processPolicy(policy);
}
Спецально не рефакторил этот шедевр, ждал, пока ГК поднимется.
+98
if RadioGroup1.ItemIndex=0 then cpr:=cpr+1;
if RadioGroup1.ItemIndex=1 then cth:=cth+1;
if RadioGroup2.ItemIndex=0 then cch:=cch+1;
if RadioGroup2.ItemIndex=1 then czs:=czs+1;
if RadioGroup3.ItemIndex=0 then chd:=chd+1;
if RadioGroup3.ItemIndex=1 then cpr:=cpr+1;
if RadioGroup4.ItemIndex=0 then cth:=cth+1;
if RadioGroup4.ItemIndex=1 then cch:=cch+1;
if RadioGroup5.ItemIndex=0 then czs:=czs+1;
if RadioGroup5.ItemIndex=1 then chd:=chd+1;
if RadioGroup6.ItemIndex=0 then cpr:=cpr+1;
if RadioGroup6.ItemIndex=1 then cch:=cch+1;
if RadioGroup7.ItemIndex=0 then chd:=chd+1;
if RadioGroup7.ItemIndex=1 then cth:=cth+1;
....// Это всё в 60 строк
if (cpr>cth) and (cpr>cch) and (cpr>czs) and (cpr>chd) then cpr1:=+1
else
if (cth>cpr) and (cth>cch) and (cth>czs) and (cth>chd) then cth1:=+1
else
if (cch>cpr) and (cch>cth) and (cch>czs) and (cch>chd) then cch1:=+1
else
if (czs>cpr) and (czs>cch) and (czs>cth) and (czs>chd) then czs1:=+1
else
if (chd>cpr) and (chd>cch) and (chd>czs) and (chd>cth) then chd1:=+1;
if cpr>chd or czs or cth or cch then
begin
ShowMessage('человек-природа – все профессии, связанные с растениеводством, животноводством и лесным хозяйством;') ;
Datamodule4.ADOTable1.Edit;
Datamodule4.ADOTable1.FieldValues['test2']:=('человек-природа – все профессии, связанные с растениеводством, животноводством и лесным хозяйством;');
Datamodule4.ADOTable1.Post;
end
else
if chd>cpr or cth or cch or czs then begin
ShowMessage('человек-техника – все технические профессии;') ;
Datamodule4.ADOTable1.Edit;
Datamodule4.ADOTable1.FieldValues['test2']:=('человек-техника – все технические профессии;');
Datamodule4.ADOTable1.Post;
...... И далее результаты в общем их 5
отдельная кнопка для вывода остальных 10 вопросов х)
procedure TForm1.Button1Click(Sender: TObject);
begin
Radiogroup11.Visible:=true;
Radiogroup12.Visible:=true;
Radiogroup13.Visible:=true;
Radiogroup14.Visible:=true;
Radiogroup15.Visible:=true;
Radiogroup16.Visible:=true;
Radiogroup17.Visible:=true;
Radiogroup18.Visible:=true;
Radiogroup19.Visible:=true;
Radiogroup20.Visible:=true;
Button2.Visible:=True;
end;
Программа тестирования на профориентацию
хД сколько он radiogroup создал)
+151
001 // Определяем наборы изображений
002 var images = {
003 'Набор 1' : [
004 'pic1.jpg',
005 'pic2.jpg',
006 'pic3.jpg',
007 'pic4.jpg',
008 'pic5.jpg',
009 'pic6.jpg',
010 'pic7.jpg',
011 'pic8.jpg',
012 'pic9.jpg',
013 'pic10.jpg'
014 ],
015 'Набор 2' : [
016 'pic2.jpg',
017 'pic3.jpg',
018 'pic4.jpg',
019 'pic5.jpg',
020 'pic6.jpg',
021 'pic7.jpg',
022 'pic8.jpg',
023 'pic9.jpg',
024 'pic10.jpg',
025 'pic11.jpg',
026 'pic12.jpg',
027 'pic5.jpg',
028 'pic6.jpg',
029 'pic7.jpg',
030 'pic8.jpg'
031 ],
032 'Набор 3' : [
033 'pic1.jpg',
034 'pic2.jpg',
035 'pic3.jpg',
036 'pic4.jpg',
037 'pic5.jpg',
038 'pic6.jpg',
039 'pic7.jpg',
040 'pic8.jpg',
041 'pic9.jpg',
042 'pic10.jpg',
043 'pic11.jpg',
044 'pic12.jpg',
045 'pic4.jpg',
046 'pic5.jpg',
047 'pic6.jpg'
...
О_О Шок...
+166
if ($_POST['login']!="" && $_POST['pas']!="" && $_GET['con']=='auth')
{
$login=$_POST['login'];
$pas=$_POST['pas'];
$fulld = mysql_query ("SELECT * FROM users WHERE login='$login' AND pas='$pas'",$link);
....
Местных гурманов этим конечно не удивить. Но все же...
−138
вайп
−137
вайп