- 1
- 2
- 3
Property Documentation
antennaConnected : int
This property is true if there is an antenna connected. Otherwise it will be false.
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+131
Property Documentation
antennaConnected : int
This property is true if there is an antenna connected. Otherwise it will be false.
Выдержка из Qt Multimedia
+167
function validateBoolean($bool) {
if ($bool == 'true') {
return '1';
} else if ($bool == 'false') {
return '0';
}
if ($bool == '1') {
return "true";
} else if ($bool == '0'){
return "false";
}
exit("Invalid Boolean Data");
}
вот такое чудо нам передали на поддержку
−123
ALTER TRIGGER [dbo].[ObjectTrade]
ON [dbo].[packets]
AFTER INSERT
AS
BEGIN
SET NOCOUNT ON;
DECLARE
@id_key int,
@id_th int,
@date_end datetime,
@date_beg datetime
SET @id_key = (SELECT id_key FROM inserted)
SET @id_th = (SELECT id_th FROM inserted WHERE id_key = @id_key)
SET @date_end = (SELECT date_end FROM inserted WHERE id_key = @id_key)
SET @date_beg = (SELECT date_beg FROM inserted WHERE id_key = @id_key)
IF @id_th = 183
UPDATE packets
SET packets.date_end = CAST('12-05-2014' AS DATE)
WHERE id_key =@id_key
IF (CAST(@date_end AS DATE) BETWEEN '08-03-2014' and '10-03-2014') SET @date_end = '07-03-2014'
IF (CAST(@date_end AS DATE) BETWEEN '01-05-2014' and '04-05-2014') SET @date_end = '30-04-2014'
IF (CAST(@date_end AS DATE) BETWEEN '09-05-2014' and '11-05-2014') SET @date_end = '08-05-2014'
IF (CAST(@date_end AS DATE) BETWEEN '12-06-2014' and '15-06-2014') SET @date_end = '11-06-2014'
IF (CAST(@date_end AS DATE) BETWEEN '02-11-2014' and '04-11-2014') SET @date_end = '01-11-2014'
IF (CAST(@date_end AS DATE) BETWEEN '01-01-2015' and '08-01-2015') SET @date_end = '31-12-2014'
IF DATEPART(WEEKDAY, @date_end) = 7 SET @date_end = DATEADD(DAY, -1, @date_end)
UPDATE packets SET packets.date_end = @date_end WHERE id_key =@id_key
END
+22
/* macro is a way faster than inline */
#define Compare(offsetx, offsety) \
do { \
int add; \
Point other = Get(g, x + offsetx, y + offsety); \
if(offsety == 0) { \
add = 2 * other.dx + 1; \
} \
else if(offsetx == 0) { \
add = 2 * other.dy + 1; \
} \
else { \
add = 2 * (other.dy + other.dx + 1); \
} \
other.f += add; \
if (other.f < p.f) \
{ \
p.f = other.f; \
if(offsety == 0) { \
p.dx = other.dx + 1; \
p.dy = other.dy; \
} \
else if(offsetx == 0) { \
p.dy = other.dy + 1; \
p.dx = other.dx; \
} \
else { \
p.dy = other.dy + 1; \
p.dx = other.dx + 1; \
} \
} \
} while(0)
Нужно делать макросы ЕЩЕ больше!
http://habrahabr.ru/post/215905/
+77
// Решил узнать, что лучше C или C++.
int C;
if(C == C++)
cout << "То же самое.";
else
cout << "Разные.";
C++ то же самое что и С.
Как было сказано в одной книге компьютер очень глупый(Хоть он тут и не причём, компилятор подставил).
+155
if(rradiocheck.test(elem.type)&&!jQuery.support.checkOn){return elem.getAttribute("value")===null?"on":elem.value;}
return(elem.value||"").replace(rreturn,"");}
http://govnokod.ru/media/ddd20ce56acf1d9ebadd126322495087.js
Говно так и льется.
+24
((x<0) && (y < 0)) ? ({x =-x; y=-y;}) : (((x < 0) || (y < 0)) ? ({x+=0.5; y+=0.5;}) : ( (!(((x > 2.0) || (x < 0.5)) && ( (y > 2.0) || (y < 0.5) ))) ? : ({x/=10;y/=10;}) ) );
простейшее задание на условия...
+140
Я не понял - какого хуя удалили все мои посты?
+127
#define SOME_MACRO_NAME 4 /* 1 */
−122
protected override function getCurrentSkinState():String
{
if (!this._currentState) this._currentState = "edit";
else this._currentState = super.getCurrentSkinState() || "edit";
return this._currentState;
}
Еще грабли от Адоба.