- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
format MS COFF
public fuckHighLevel as '_fuckHighLevel@4'
fuckHighLevel:
pop ebx
pop eax
add eax, 1
jmp ebx
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+126
format MS COFF
public fuckHighLevel as '_fuckHighLevel@4'
fuckHighLevel:
pop ebx
pop eax
add eax, 1
jmp ebx
Вызываем ассемблерную процедуру из Си.
Вместо retn используем безусловыный переход на адрес возврата.
Но работает же!
+120
if (clr1 != Color.Black && clr2 != Color.Black)
{
int R1 = clr1.R > clr2.R ? clr1.R - 1 : clr1.R + 1;
int R2 = clr1.R < clr2.R ? clr1.R - 1 : clr1.R + 1;
int G1 = clr1.G > clr2.G ? clr1.G - 1 : clr1.G + 1;
int G2 = clr1.G < clr2.G ? clr1.G - 1 : clr1.G + 1;
int B1 = clr1.B > clr2.B ? clr1.B - 1 : clr1.B + 1;
int B2 = clr1.B < clr2.B ? clr1.B - 1 : clr1.B + 1;
if (R1 > 255) R1 = 255; if (R1 < 0) R1 = 0;
if (R2 > 255) R2 = 255; if (R2 < 0) R2 = 0;
if (G1 > 255) G1 = 255; if (G1 < 0) G1 = 0;
if (G2 > 255) G2 = 255; if (G2 < 0) G2 = 0;
if (B1 > 255) B1 = 255; if (B1 < 0) B1 = 0;
if (B2 > 255) B2 = 255; if (B2 < 0) B2 = 0;
outp.b = Color.FromArgb(R1, G1, B1); outp.a = Color.FromArgb(R2, G2, B2);
}
Нашёл у себя такого красавца годичной давности - суровое "плавное" целочисленное интерполирование двух цветов для Compact Framework.
+99
var
i,c,b,f:integer;
str:string;
procedure TForm1.codir;
begin
b:=1;
f:=1;
c:=length(edit1.Text);
str:=edit1.Text;
repeat
i:=ord(str[f]);
case i of
0:inc(i);
1:inc(i);
2:inc(i);
3:inc(i);
4:inc(i);
5:inc(i);
6:inc(i);
7:inc(i);
8:inc(i);
9:i:=0;
end;
Delete(str, b, 1);
Insert(inttostr(i),str,b);
inc(b);
inc(f);
until b=c;
edit2.Text:=str;
end;
+168
#include <iostream>
using namespace std;
void main()
{
char U='#';
int K;
_asm
{
mov eax, 0
mov al, U
mov K,eax
}
cout<<K<<endl;
}
"Получение десятичного представления числа". C wasm.ru
+167
PopupWindow* GameLocations::getCurrentPopup()
{
if(m_curPopup != nullptr && m_curPopup->needsClose())
{
m_curPopup->onClose();
m_curPopup = nullptr;
m_walker->BeginWalk(m_graph->getClosestNode(m_currentLocationId));
}
return m_curPopup;
}
+114
if (defaultOrderType == OrderType.NoCharge || defaultOrderType == OrderType.Claims)
{
noChargeItemEntry.Style.Add(HtmlTextWriterStyle.Display, "block");
itemEntryPanel.Style.Add(HtmlTextWriterStyle.Display, "none");
items.Style.Add(HtmlTextWriterStyle.Display, "none");
}
else
{
noChargeItemEntry.Style.Add(HtmlTextWriterStyle.Display, "none");
itemEntryPanel.Style.Add(HtmlTextWriterStyle.Display, "block");
items.Style.Add(HtmlTextWriterStyle.Display, "block");
}
+116
// Method that returns anonymous type as object
object ReturnAnonymous() {
return new { City="Prague", Name="Tomas" };
}
void Main() {
// Get instance of anonymous type with 'City' and 'Name' properties
object o = ReturnAnonymous();
// This call to 'Cast' method converts first parameter (object) to the
// same type as the type of second parameter - which is in this case
// anonymous type with 'City' and 'Name' properties
var typed = Cast(o, new { City="", Name="" });
Console.WriteLine("{0}, {1}", typed.City, typed.Name)
}
// Cast method - thanks to type inference when calling methods it
// is possible to cast object to type without knowing the type name
T Cast<T>(object obj, T type) {
return (T)obj;
}
via http://social.msdn.microsoft.com/forums/en-US/linqprojectgeneral/thread/c1c179bb-ea88-4633-970a-947f0dd1e71f/
+119
http://rabota.1777.ru/one_rezume.php?job_rezume_id=33838&job_cat_id2=1&doljnost2=&pol2=&vozrast_ot2=21&vozrast_do2=21&obrazovanie2=&opit2=&plata2=&pajina=&new=&doljnost3=
Супер человек, всего 21 год, умеет все и деньги ему не нужны.
+165
/*
* Корректировка даты.
* если дата в будущем - то показываем сегодня.
*/
$row['created'] = ( strtotime( date("Y-m-d", strtotime($row['created'])) ) > strtotime( date("Y-m-d") ) )?
date("r")
: date("r", strtotime($row['created']));
4x4 off-road racing...
+161
<?
function save($author,$title,$pubyear,$price) {
$sql = "INSERT INTO catalog(author,title,pubyear,price)
VALUES('$author','$title',$pubyear,$price)";
mysql_query($sql) or die (mysql_error());
}
function selectAll() {
$sql = "SELECT * FROM catalog";
$result = mysql_query($sql) or die(mysql_error());
return $result;
}