- 1
#define true 0
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+147
#define true 0
счастливой отладки, суки!
+104
procedure drawGird( var image1: TImage; needAxisLines: Boolean = True );
var
xP, yP: Integer;
xC, yC: Double;
h, w, tx, ty: Integer;
Text: String;
begin
image1.Canvas.FillRect( image1.ClientRect );
accuracy := 1 / cellSize;
image1.Canvas.Brush.Style := bsClear;
xC := p2cX( 0 );
while forC( xC, p2cX( image1.Width ), accuracy ) do
if floor( xC * cellSize ) mod cellSize = 0 then
begin
xP := c2pX( xC );
image1.Canvas.Pen.Color := clSilver;
image1.Canvas.MoveTo( xP, 0 );
image1.Canvas.LineTo( xP, image1.Height );
if ( needaxislines ) and ( abs( xC ) > 0.5 ) and
( xP > 30 ) and ( xP < image1.Width - 30 ) then
begin
image1.Canvas.Pen.Color := clBlack;
image1.Canvas.MoveTo( xP, c2pY( -0.5 ) );
image1.Canvas.LineTo( xP, c2pY( 0.5 ) );
end;
end;
yC := p2cY( 0 );
while forC( yC, p2cY( image1.Height ), accuracy ) do
if floor( yC * cellSize ) mod cellSize = 0 then
begin
yP := c2pY( yC );
image1.Canvas.Pen.Color := clSilver;
image1.Canvas.MoveTo( 0, yP );
image1.Canvas.LineTo( image1.Width, yP );
if ( needaxislines ) and ( abs( yC ) > 0.5 ) and
( yP > 30 ) and ( yP < image1.Height - 30 ) then
begin
image1.Canvas.Pen.Color := clBlack;
image1.Canvas.MoveTo( c2pX( -0.5 ), yP );
image1.Canvas.LineTo( c2pX( 0.5 ), yP );
end;
end;
xC := p2cX( 0 );
while forC( xC, p2cX( image1.Width ), accuracy ) do
if floor( xC * cellSize ) mod cellSize = 0 then
begin
xP := c2pX( xC );
if ( needaxislines ) and ( abs( xC ) > 1.5 ) and
( xP > 30 ) and ( xP < image1.Width - 30 ) then
begin
image1.Canvas.Pen.Color := clBlack;
Text := IntToStr( floor( xC ) );
h := image1.Canvas.TextHeight( Text ) div 2;
w := image1.Canvas.TextWidth( Text ) div 2;
image1.Canvas.TextOut( xP - w, c2pY( -0.5 ) + ( h + 3 ) *
( ( floor( abs( xC ) ) mod ( ( ( w * 2 + 8 ) div cellSize ) +
1 ) ) ), Text );
end;
end;
yC := p2cY( 0 );
while forC( yC, p2cY( image1.Height ), accuracy ) do
if floor( yC * cellSize ) mod cellSize = 0 then
begin
yP := c2pY( yC );
if ( needaxislines ) and ( abs( yC ) > 1.5 ) and
( yP > 30 ) and ( yP < image1.Height - 30 ) then
begin
image1.Canvas.Pen.Color := clBlack;
Text := IntToStr( floor( yC ) );
h := image1.Canvas.TextHeight( Text ) div 2;
w := image1.Canvas.TextWidth( Text ) div 2;
image1.Canvas.TextOut( c2pX( -0.5 ) - w * 2 - 2, yP - h, Text );
end;
end;
image1.Canvas.Brush.Style := bsSolid;
end;
Сотня строк кода, для того, чтобы нарисовать сетку.
+109
int rnd() {
srand( rand()*rand() );
int r = 0;
for (int i=0;i<=10;i++)
r=rand();
srand( ++r - time(NULL) );
return rand()/r;
}
NEED MOAR RANDOM NUMBERS!!!
+159
myInter_s5_dd_cart = window.setInterval("s5_getdropheight()",1);
Модуль корзины virtuemart от shape5. Аццки грузит проц.
+130
Ахтунг!
что за потоп на уютненьком говнокодике?
кто-то всеми виртуалами топит все говнокоды.
извиняюсь, что топик не с кодом, но, наверное, событие масштабное.
просьба высказаться.
−107
#!/usr/bin/env zsh
A=( q w e r t y u i o p a s d f g h j k l z x c v b n m )
B=( Q W E R T Y U I O P A S D F G H J K L Z X C V B N M )
C=( 0 1 2 3 4 5 6 7 8 9 A B C D E F ) #hex
F=( 1 2 4 )
D=40
E=10
Char::GetRandA(){
echo ${A[$(shuf -n 1 -i 1-${#A[@]})]}
}
Char::GetRandB(){
echo ${B[$(shuf -n 1 -i 1-${#B[@]})]}
}
Char::GetRandC(){
echo ${C[$(shuf -n 1 -i 1-${#C[@]})]}
}
Char::GetRandF(){
echo ${F[$(shuf -n 1 -i 1-${#F[@]})]}
}
Main::Matrix(){
for i in {1..$D}; do
for b in {A,B,C}; do
echo -n '\033[0;3'$(Char::GetRandF)"m$(Char::GetRand$b) "
done
done
}
#Run
for i in {1..$E}; do
Main::Matrix
done
дело было вечером...
+147
more: function()
{
redactorActive = this;
var mre = '<more>';
redactorActive.execCommand('inserthtml', mre, false);
this.modalClose();
}
WYSIWYG редактор ...
+147
urldecode($_POST['name'])
Нашел у себя в коде.
+147
// В деструкторе класса
if(this) this->Free(this);
фрагмент самоудаляемого объекта, который привязан к определенному классу, который реализует пул-памяти... впринципе не говнокод, но у многих подобные объекты в начале вызывают недоумение...
+147
if($response == false)
$response = true;
else
$response = false;
вот такая говно-конструкция изменяющая false на true и наоборот