- 1
- 2
- 3
typedef int IntHack;
const intHack operator+(const intHack, const intHack)
{
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+158
typedef int IntHack;
const intHack operator+(const intHack, const intHack)
{
Счастливой отладки. ^_^
−321
typedef double NSTimeInterval;//Убило
typedef signed char BOOL; //??????????????
#define YES (BOOL)1
#define NO (BOOL)0
typedef char *STR; //????
Кокоа - рекомендует использовать свои типы вместо стандартных, но то что я нашел в библиотеках - тут писал наверное Кэп!
+147
template <typename type>
class some
{
type val;
public:
some( const type &a ) : val(a)
{ }
template<typename t>
some( const some<t> &a )
{
val = static_cast<type>(a.val);
}
template <typename type>
friend class some; // иначе ошибка - нет доступа к приватному члену
};
Филосовский однако язык. Для того что бы все свои секреты нужно с самим собой подружиться...
Сбрил усы - дружись с усатым...
+169
// Конструктор
[...]
$this->Messages = array(
1 => 'Card succesfull edited !',
2 => 'Error, edited card !',
3 => 'Was change succesfull.', // Тут индекс = 3
4 => 'Was change succesfull.', // А тут = 4. Сечешь разницу?
5 => 'Change status...',
6 => 'Comment added succesful',
7 => 'Comment expediated !', // Коммент ушел в экспедицию
8 => 'The card was droped succesgul.', // succesGul
9 => 'Can\'t to delete this card.', // I don't to know php and to have no idea about english
10 => 'Can\'t do upload file.',
11 => 'File was uploaded successful.',
12 => 'The eacuation was succesfull.', // Успешная эякуляция :O
13 => 'Eacuation !' // Эякуляция !
);
[...]
// Сохранение в базу
// - Папа, папа, а SQL Injection существует? - Нет сынок..........
$this->SUA_DB->query("INSERT INTO cards SET type='{$_POST['selector_type']}',name='{$_POST['card']}',user = '{$this->user_id}', description='{$_POST['descr']}', project='{$_POST['selector_project']}', category='{$_POST['selector_category']}' ") &
$this->Msg->SetMsg (vsprintf($this->Messages[7],$_POST['card'])) :
$this->Msg->SetMsg ($this->Messages[6]) &
$this->Msg->SetError(true);
// Из область фантастики
Сказали чинить код парня которого недавно уволили... Пришлось переписать все заново.
Особенно понравившиеся строки прокомментировал
+143
public string IsLarge
{
get
{
return (txtValue.Style["width"] == "150px").ToString();
}
set
{
if (value == true.ToString())
{
txtValue.Style["width"] = "150px";
}
else
{
txtValue.Style["width"] = "65px";
}
}
}
Свойство из одного эпического веб-проекта
+147
datatypes.Float = function(inString)
{
var fBytes = [];
for (var i=0;i<4;i++)
{
var curByte = (inString.charCodeAt(i)&255).toString(2);
var byteLen = curByte.length;
if (byteLen<8)
{
for (var bit=0;bit<(8-byteLen);bit++)
curByte = '0'+curByte;
}
fBytes[i] = curByte;
}
var fBits = fBytes[3]+fBytes[2]+fBytes[1]+fBytes[0];
var fSign = parseInt(fBits[0]) ? -1 : 1;
var fExp = parseInt(fBits.substring(1,9),2)-127;
var fMan;
if (fExp == -127)
fMan = 0;
else
{
fMan = 1;
for (i=0;i<23;i++)
{
if (parseInt(fBits[9+i])==1)
fMan = fMan + 1/Math.pow(2,i+1);
}
fMan = fMan.toFixed(7);
}
return(parseFloat((fSign*Math.pow(2,fExp)*fMan).toFixed(3)));
}
Вчера накодил, оцените говнистость.
+102
org.quartz.jobStore.dontSetAutoCommitFalse=true
config boolshit
+150
function Point(){
this.x = 0;
this.y = 0;
if(arguments.length==2){ //if parameters are 2 points
this.x = arguments[0] || 0;
this.y = arguments[1] || 0;
}else
if(arguments.length==1){ //if parameter is a point object
this.x = arguments[0].x;
this.y = arguments[0].y;
}
};
+147
String classToType(Class cls) {
if (cls == Point.class) {
return "int2";
} else if ((cls == Integer.TYPE) || (cls == Integer.class)) {
return "int";
} else if ((cls == Double.TYPE) || (cls == Double.class)) {
return "double";
} else if (cls == String.class) {
return "String";
} else if ((cls == Boolean.TYPE) || (cls == Boolean.class)) {
return "boolean";
} else {
return null;
}
}
+164
define('htmlFORM_DOMAIN', '/\w*\.\w*\.*\w*\.*\w*\.*\w*\.*\w*\.*\w*\.*\w*\.*/'); // CRAzY ;)
тяжёлое утро, PHP лишился parse_url()