- 1
WasSaved = false || WasSaved;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+108
WasSaved = false || WasSaved;
проекту уже лет 7 или 9
+26
private:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGenerator);
Корпорация добра.
+80
private HttpClient httpServer = new DefaultHttpClient();
У нас в приложении есть свой сервер!!1
−195
// optimization. Should only be used to read it. Never to write it.
extern CGFloat __ccContentScaleFactor;
Может быть, я бунтарь!
__ccContentScaleFactor = -666;
+92
type
TForm1 = class(TForm)
Button1: TButton;
Button3: TButton;
ListBox1: TListBox;
Button2: TButton;
Button4: TButton;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
TListThread = class(TThread)
protected
procedure Execute; override;
end;
TMyThread = class(TThread)
protected
procedure Execute; override;
end;
TYouThread = class(TThread)
protected
procedure Execute; override;
end;
var
Form1: TForm1;
threadList1: TThreadList;
mythreadRunning, youthreadRunning, listThreadRunning: Boolean;
globalCount: Integer;
listProcess: TListThread; { TListThread is a custom descendant of TThread. }
secondProcess: TMyThread; { TMyThread is a custom descendant of TThread. }
otherSecondProcess: TYouThread; { TMyThread is a custom descendant of TThread. }
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if (mythreadRunning = FALSE) then
begin
mythreadRunning:= TRUE;
secondProcess := TMyThread.Create(True); { Create suspended--secondProcess does not run yet. }
secondProcess.FreeOnTerminate := True; { You do not need to clean up after termination. }
secondProcess.Priority := tpLower; // Set the priority to lower than normal.
secondProcess.Resume; { Now run the thread. }
end
else
MessageDlg('This thread is still running. You are going to hurt yourself!',
mtInformation, [mbOk], 0);
end;
procedure TMyThread.Execute;
var
I: Integer;
myRadio: TRadioButton;
begin
for I := 0 to 20 do
begin
if (Terminated) then
begin
mythreadRunning:= FALSE;
exit;
end;
myRadio:= TRadioButton.Create(Form1);
globalCount:= globalCount + 1;
myRadio.Name:= 'RadioButton' + IntToStr(globalCount);
threadList1.Add(myRadio);
Sleep(1000);
end;
mythreadRunning:= FALSE;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if (listthreadRunning = FALSE) then
begin
listThreadRunning:= TRUE;
listProcess := TListThread.Create(True); { Create suspended--secondProcess does not run yet. }
listProcess.FreeOnTerminate := True; { You do not need to clean up after termination. }
listProcess.Priority := tpLower; // Set the priority to lower than normal.
listProcess.Resume; { Now run the thread. }
end;
end;
procedure TListThread.Execute;
var
I: Integer;
Temp: TControl;
myList: TList;
begin
while(True) do
begin
http://docwiki.embarcadero.com/CodeExamples/XE5/en/TThreadList_%28Delphi%29
Беда, когда примеры пишут психически неполноценные люди. Самое ужасное то, что этот "пример" висит на сайте embarcadero.
+174
/*Caused by: java.lang.StackOverflowError
at com.sun.org.apache.xalan.internal.xsltc.dom.SimpleResultTreeImpl.characters(SimpleResultTreeImpl.java)
at com.sun.org.apache.xalan.internal.xsltc.dom.SimpleResultTreeImpl.copy(SimpleResultTreeImpl.java:438)
at com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary.copy(BasisLibrary.java:1317)
at GregorSamsa.replace()
at GregorSamsa.replace()
at GregorSamsa.replace()
at GregorSamsa.replace()
at GregorSamsa.replace()
начали разбираться
*/
/**
* As Gregor Samsa awoke one morning from uneasy dreams he found himself
* transformed in his bed into a gigantic insect. He was lying on his hard,
* as it were armour plated, back, and if he lifted his head a little he
* could see his big, brown belly divided into stiff, arched segments, on
* top of which the bed quilt could hardly keep in position and was about
* to slide off completely. His numerous legs, which were pitifully thin
* compared to the rest of his bulk, waved helplessly before his eyes.
* "What has happened to me?", he thought. It was no dream....
*/
protected final static String DEFAULT_TRANSLET_NAME = "GregorSamsa";
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
transofm, factory, bug - какие начитанные разработчки, а.
+150
<?php
$subjects = array (
0 =>
array (
'title' => 'ОС Unix',
'teacher' => 'Вася',
'mark' => '3'),
1 =>
array (
'title' => 'Компьютерные сети',
'teacher' => 'Петя',
'mark' =>'4'),
2 =>
array (
'title' => 'Алгоритмы',
'teacher' => 'Коля',
'mark' => '4'),
);?>
<table>
<? foreach ($subjects as $key=>$subject) :
$number = $key+1;
?>
<tr>
<td><?echo $number;?></td>
<td><?echo $subject['title'];?></td>
<td><?echo $subject['teacher'];?></td>
<td><?echo $subject['mark'];?></td>
</tr>
<? endforeach; ?>
</table>
<? var_dump($subject)?>
+3
#define BOOST_INTRUSIVE_INTERNAL_STATIC_BOOL_IS_TRUE(TRAITS_PREFIX, TYPEDEF_TO_FIND) \
template <class T>\
struct TRAITS_PREFIX##_bool\
{\
template<bool Add>\
struct two_or_three {one _[2 + Add];};\
template <class U> static one test(...);\
template <class U> static two_or_three<U::TYPEDEF_TO_FIND> test (int);\
static const std::size_t value = sizeof(test<T>(0));\
};\
\
template <class T>\
struct TRAITS_PREFIX##_bool_is_true\
{\
static const bool value = TRAITS_PREFIX##_bool<T>::value > sizeof(one)*2;\
};\
//
Ну тут как бы все просто и понятно. Но зачем заканчивают макрос кодом
\
//
?
+133
panel1.Visible = checkBoxCCF.Checked;
panel2.Visible = checkBoxReliabilty.Checked;
panel3.Visible = checkBoxRisk.Checked;
panel4.Visible = checkBoxSaftey.Checked;
panel5.Visible = checkBoxSensitivity.Checked;
panel6.Visible = checkBoxThroughput.Checked;
panel7.Visible = checkBoxUncertainity.Checked;
Почему половина переменных нормальные, половина нет? Логика некоторых погромистов зашкаливает...
−85
c1 = true
c2 = true
c3 = true
c4 = true
c5 = true
c6 = true
c7 = true
c8 = true
c9 = true
c10 = true
c11 = true
c12 = true
c13 = true
next = true
function goForward()
c1 = c2
c2 = c3
c3 = c4
c4 = c5
c5 = c6
c6 = c7
c7 = c8
c8 = c9
c9 = c10
c10 = c11
c11 = c12
c12 = c13
c13 = next
end
Немножко Lua-кода от геймдизайнера.