- 1
- 2
- 3
- 4
- 5
public string ValidationTitle
{
get { return this.Title; }
set { }
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+139
public string ValidationTitle
{
get { return this.Title; }
set { }
}
+155
<?php
class WidgetSidebarUser extends Portlet
{
public function renderContent(){
if(Yii::app()->user->isGuest)
Yii::app()->controller->redirect('/logout');
$model = User::model()->findByPk(Yii::app()->user->id);
$this->render('sidebar/user', array('user'=>$model));
}
}
?>
// sidebar/user
<aside id="sidebar1" class="span3 sidebar">
<div class="content left ">
<?php if(!Yii::app()->user->isGuest) if(Yii::app()->user->id === $user->id): ?>
...
<?php else: ?>
<?php
$this->widget('application.widgets.ProfileSidebarOther', array(
'user' => $user,
'profile' => $user->profile,
));
?>
<?php endif; ?>
</div>
</aside>
Дорабатываю проект и код немного радует своими проверками. Получается мы выбираем данные пользователя, а потом проверяем "А точно это тот самый пользователь".
+88
#include <cstdlib>
#include <ctime>
main(){
srand((unsigned)time(NULL));
int x = 1^~0-(((1+&x?2||0:(~1))-(1 & 2)*.1-(1+-1?5:3)%1)==0?10:-rand()%5+1);
return 0;
}
perl'овцы развлекаются.
+134
http://www.freepascal.ru/forum/viewtopic.php?t=9463&p=77107
ебаный пиздец.
ебаный пиздец.
+130
static void npcMove(string npcid, string posX, string posZ, string posY, int localsid)
{
byte[] opcode = { 0x4d, 0x00, 0x16, 0x23, 0x00 };
byte[] npcid_in_bytes = new byte[4];
npcid_in_bytes = Enumerable.Range(0, npcid.Length).Where(x => x % 2 == 0).Select(x => Convert.ToByte(npcid.Substring(x, 2), 16)).ToArray();
Array.Reverse(npcid_in_bytes);
byte[] posX_in_bytes = PackFloatStringArrayOfBytes(posX);
byte[] posZ_in_bytes = PackFloatStringArrayOfBytes(posZ);
byte[] posY_in_bytes = PackFloatStringArrayOfBytes(posY);
byte[] unknown = { 0x00, 0x0f, 0x5c, 0x01, 0x01 };
byte[] roleid_in_bytes = packint(16);
byte[] localdsid_in_bytes = packint(localsid);
byte[] buffer = opcode.Concat<byte>(npcid_in_bytes)
.Concat<byte>(posX_in_bytes).Concat<byte>(posZ_in_bytes).Concat<byte>(posY_in_bytes)
.Concat<byte>(unknown).Concat<byte>(roleid_in_bytes).Concat<byte>(localdsid_in_bytes).ToArray<byte>();
buffer[1] = Convert.ToByte(buffer.Length - 2);
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Connect(localhost, GProviderPort);
socket.Send(buffer);
socket.Close();
}
+139
#include <stdio.h>
#include <stdlib.h>
#define value_i int
#define gen_program main()
#define begin {
#define end }
#define sep ;
#define back_val return
#define vis(a) printf ("%d", a)
#define ln printf ("\n")
#define ln3 printf ("\n\n\n")
#define cycle_count for
#define rand rand()
#define gen_rand srand((unsigned)time(NULL))
#define value_c char
#define vis_c(a) printf("%c", a)
#define eq =
#define uneq !=
#define check ==
#define inc(a) a++
#define res %
#define add +
#define sub -
#define blank void
#define small <
#define big >
blank line(blank) sep
value_i gen_program
begin
value_i x, i sep
gen_rand sep
value_c c eq ' ' sep
cycle_count(i eq 1 sep i small 10 sep inc(i))
begin
x eq rand res 10 add 1 sep
if (x uneq 10)
begin
vis(x) sep
vis_c(c) sep
end
end
ln3 sep
line() sep
ln sep
back_val 0 sep
end
blank line(blank)
begin
value_i i sep
cycle_count (i eq 0 sep i small 10 sep inc(i) )
begin
printf("-/*\\") sep
end
printf("-") sep
end
Можно рефакторить.
+124
http://www.youtube.com/watch?v=swAEcc9JX4Q
(автор пишет троян на дельфях, и комментирует)
убила фраза:
"...реестр[...]. Так как в линуксе все по-другому, Вы должны быть уверены, что ваша программа запускается на Windows"
убила фраза:
"...реестр[...]. Так как в линуксе все по-другому, Вы должны быть уверены, что ваша программа запускается на Windows"
+143
МЕНЯ ДОЛБЯТ В АЧКО ВСЕ КОМУ НЕПОПОДЯ
−98
ResetList( Chars( ) )
While NextElement( Chars( ) )
Define Address.l = @Chars( )
Define Reference.s = Chars( )
While NextElement( Chars( ) )
If Chars( ) = Reference
DeleteElement( Chars( ) )
EndIf
Wend
ChangeCurrentElement( Chars( ), Address )
Wend
+36
#include <iostream>
class StaticClassData {
int *pointer, value;
public:
StaticClassData(): pointer(&value) {}
void add(int i) {
std::cout << "Hello, this is " << this << std::endl;
value = i;
std::cout << "I'm fine" << std::endl;
*pointer = i;
std::cout << "You never read this text" << std::endl;
}
};
class SomeClass {
struct StaticConstructor {
StaticConstructor(){ storage.add(1); }
};
static StaticConstructor constructor;
static StaticClassData storage;
};
SomeClass::StaticConstructor SomeClass::constructor;
StaticClassData SomeClass::storage;
int main(){}
Долго думал, с какого хрена программа падает на заполнении static поля в "статическом конструкторе". Поле вроде бы есть, но толку от этого мало.
http://ideone.com/Ux14ep - из раздела ub.govnokod.ru или как выстрелить себе в ногу до выполнения main.