- 1
- 2
- 3
- 4
- 5
- 6
- 7
void someMethod(Object obj)
{
if(!obj.Equals(null))
{
...
}
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+110
void someMethod(Object obj)
{
if(!obj.Equals(null))
{
...
}
}
а это я сам когда-то очень-очень давно наклал :))))
до их пор с теплотой вспоминаю, как сам потом ржал, когда заметил :)
+110
<asp:EntityDataSource ID="targert" runat="server" ConnectionString="name=portalEntities1"
DefaultContainerName="portalEntities1" EnableFlattening="False"
CommandText="SELECT first_table.id FROM first_table
WHERE ANYELEMENT(select second_table.field_2 from first_table.second_table where second_table.field_2 = @var1).field_2 = @var1
" EntityTypeFilter="">
<CommandParameters>
<asp:QueryStringParameter Name="var1" QueryStringField="var1" DbType="String" />
</CommandParameters>
</asp:EntityDataSource>
Вот такой странный код с двойной проверкой...
таблицы second_table и first_table имеют связь многие ко многим...
+110
// At the maximum, no match found
if (j >= cmax)
return false;
// Okay, must try one more atom
if (!atom.match(matcher, i, seq))
return false;
// If we haven't moved forward then must break out
if (i == matcher.last)
return false;
if (type == GREEDY)
return match0(matcher, i, j, seq);
else if (type == LAZY)
return match1(matcher, i, j, seq);
else
return match2(matcher, i, j, seq);
to be continued....
+110
void BubbleSort(dynamic arr)
{
for (int i = arr.Length - 1; i > 0; i--)
{
for (int j = 0; j < i; j++)
{
if (arr[j] > arr[j + 1])
{
int t = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = t;
}
}
}
}
Обобщенное программирование (:
Видел на одно форуме в теме operator constraint
+110
Function IsBigLet(Let: String): Boolean;
var r: bool;
begin
r:=false;
if pos('Й',Let)>0 then r:=true;
if pos('Ц',Let)>0 then r:=true;
if pos('У',Let)>0 then r:=true;
if pos('К',Let)>0 then r:=true;
if pos('Е',Let)>0 then r:=true;
if pos('Н',Let)>0 then r:=true;
if pos('Г',Let)>0 then r:=true;
if pos('Ш',Let)>0 then r:=true;
if pos('Щ',Let)>0 then r:=true;
if pos('З',Let)>0 then r:=true;
if pos('Х',Let)>0 then r:=true;
if pos('Ф',Let)>0 then r:=true;
if pos('Ы',Let)>0 then r:=true;
if pos('В',Let)>0 then r:=true;
if pos('А',Let)>0 then r:=true;
if pos('П',Let)>0 then r:=true;
if pos('Р',Let)>0 then r:=true;
if pos('О',Let)>0 then r:=true;
if pos('Л',Let)>0 then r:=true;
if pos('Д',Let)>0 then r:=true;
if pos('Ж',Let)>0 then r:=true;
if pos('Э',Let)>0 then r:=true;
if pos('Я',Let)>0 then r:=true;
if pos('Ч',Let)>0 then r:=true;
if pos('С',Let)>0 then r:=true;
if pos('М',Let)>0 then r:=true;
if pos('И',Let)>0 then r:=true;
if pos('Т',Let)>0 then r:=true;
if pos('Б',Let)>0 then r:=true;
if pos('Ю',Let)>0 then r:=true;
Result:=r;
end;
Немножко индусского кода!
+109.8
for i := 1 to X do begin
tblitem.FindKey([tbltranitemno.text]);
tblitem.GotoKey;
button3.Click;
edit3.Text := floattostr(org-i);
x := 1-1;
end;
(c) India
хочется взять и уеб...
+109.6
decimal d = DomainObject.AssignedPercent;
if (d.Equals(0) == false) {
...
}
+109.4
//Dictionary used to check if eventValues are unique
Dictionary<string, string> uniqueEventValues = new Dictionary<string, string>();
//... заполняем коллекцию
try {
uniqueEventValues.Add(eventValue, "X");
}
catch (Exception ex) {
if (ex.Message.Equals("An item with the same key has already been added.")) {
msgAddEventParams.Text = "EventValues must be unique. " + eventValue + " is duplicate.";
msgAddEventParams.Visible = true;
return;
}
}
мы не ищем легких путей!
+109.3
<script type="text/javascript">
<!--
if (window.screen)
{
if (screen.width < 1024)
{
document.write('<td height="35" width="11"><img src="img0800/indx/indx_0_0.png" title="" alt="" style="width: 11px; height: 35px;"></td>\n');
document.write('<td height="35" width="43"><a href="en/index.html"><img src="img0800/indx/indx_1_0.png" title="" alt="" style="width: 43px; height: 35px;"></a></td>\n');
document.write('<td height="35" width="76"><img src="img0800/indx/indx_2_0.png" title="" alt="" style="width: 76px; height: 35px;"></td>\n');
document.write('<td height="35" width="32"><img src="img0800/indx/indx_3_0.png" title="" alt="" style="width: 32px; height: 35px;"></td>\n');
document.write('<td height="35" width="27"><img src="img0800/indx/indx_4_0.png" title="" alt="" style="width: 27px; height: 35px;"></td>\n');
document.write('<td height="35" width="39"><img src="img0800/indx/indx_5_0.png" title="" alt="" style="width: 39px; height: 35px;"></td>\n');
document.write('<td height="35" width="103"><img src="img0800/indx/indx_6_0.png" title="" alt="" style="width: 103px; height: ................
document.write('<td height="31" width="21"><img src="img1024/indx/indx_15_19.png" title="" alt="" style="width: 21px; height: 31px;"></td>\n');
}
else if (screen.width < 1600)
{
document.write('<td height="59" width="18"><img src="img1280/indx/indx_0_0.png" title="" alt="" style="width: 18px; height: 59px;"></td>\n');
document.write('<td height="59" width="72"><a href="en/index.html"><img src="img1280/indx/indx_1_0.png" title="" alt="" style="width: 72px; height: 59px;"></a></td>\n');
document.write('<td height="59" width="127"><img src="img1280/indx/indx_2_0.png" title="" alt="" style="width: 127px; height: 59px;"></td>\n');
document.write('<td height="59" width="53"><img src="img1280/indx/indx_3_0.png" title="" alt="" style="width: 53px; height: 59px;"></td>\n');
document.write('<td height="59" width="46"><img src="img1280/indx/indx_4_0.png" title="" alt="" style="width: 46px; height: 59px;"></td>\n');
document.write('<td height="59" width="64"><img src="img1280/indx/indx_5_0.png" title="" alt="" style="width: 64px; height: 59px;"></td>\n');
.......
Сайт с фоном из таблицы с картинками. Картинки нарезаны на мелкие кусочки и, внимание, сайт подстраивается под разные разрешения мониторов! Есть наборы картинок для ширины 800, 1024, 1280 и 1600. Посмотреть можно на http://old.abvi.redsolution.ru/
+109
memcpy (stderr, stdout, sizeof (FILE));