- 1
- 2
- 3
- 4
- 5
if(false || DEBUG)
{
System.out.print("analysis: "+Integer.toBinaryString(analysis));
System.out.println(", "+WalkerFactory.getAnalysisString(analysis));
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+75
if(false || DEBUG)
{
System.out.print("analysis: "+Integer.toBinaryString(analysis));
System.out.println(", "+WalkerFactory.getAnalysisString(analysis));
}
Вычурный способ делать комментарии. Пример может и боян, но зато где: в исходниках API Android 2.2 Froyo.
+159
$t2 = db_query("SELECT
COUNT(*)
FROM
order_delivery_offers AS odf,
uc_orders AS uo
WHERE
odf.order_id = uo.order_id AND
uo.uid = $uid AND
uo.order_status = 'accepted' AND
odf.status = 'accepted' AND
odf.visible = 1 AND
odf.active = 1
GROUP BY odf.order_id");
$count_rows2 = 0;
while ($r2 = db_fetch_array($t2)){
$count_rows2++;
}
Подсчет количества записей в запросе.
+168
case IDC_LED1_ZERO:
if (::IsDlgButtonChecked (hWnd,IDC_LED1_ZERO) )
{
if (::IsDlgButtonChecked (hWnd,IDC_LED2_ANYSPEED) ||
::IsDlgButtonChecked (hWnd,IDC_LED3_ANYSPEED) ||
::IsDlgButtonChecked (hWnd,IDC_LED4_ANYSPEED) )
::CheckDlgButton(hWnd,IDC_LED1_ANYSPEED,0);
if (::IsDlgButtonChecked (hWnd,IDC_LED2_POSITION) ||
::IsDlgButtonChecked (hWnd,IDC_LED3_POSITION) ||
::IsDlgButtonChecked (hWnd,IDC_LED4_POSITION) )
::CheckDlgButton(hWnd,IDC_LED1_POSITION,0);
if (::IsDlgButtonChecked (hWnd,IDC_LED2_DIGITAL_INPUT) ||
::IsDlgButtonChecked (hWnd,IDC_LED3_DIGITAL_INPUT) ||
::IsDlgButtonChecked (hWnd,IDC_LED4_DIGITAL_INPUT) )
::CheckDlgButton(hWnd,IDC_LED1_DIGITAL_INPUT,0);
::CheckDlgButton(hWnd,IDC_LED1_TURN_UNDER,0);
::CheckDlgButton(hWnd,IDC_LED2_ZERO,0);
::CheckDlgButton(hWnd,IDC_LED3_ZERO,0);
::CheckDlgButton(hWnd,IDC_LED4_ZERO,0);
}
break;
case IDC_LED1_ANYSPEED:
if (::IsDlgButtonChecked (hWnd,IDC_LED1_ANYSPEED) )
{
if (::IsDlgButtonChecked (hWnd,IDC_LED2_ZERO) ||
::IsDlgButtonChecked (hWnd,IDC_LED3_ZERO) ||
::IsDlgButtonChecked (hWnd,IDC_LED4_ZERO) )
::CheckDlgButton(hWnd,IDC_LED1_ZERO,0);
if (::IsDlgButtonChecked (hWnd,IDC_LED2_POSITION) ||
::IsDlgButtonChecked (hWnd,IDC_LED3_POSITION) ||
::IsDlgButtonChecked (hWnd,IDC_LED4_POSITION) )
::CheckDlgButton(hWnd,IDC_LED1_POSITION,0);
if (::IsDlgButtonChecked (hWnd,IDC_LED2_DIGITAL_INPUT) ||
::IsDlgButtonChecked (hWnd,IDC_LED3_DIGITAL_INPUT) ||
::IsDlgButtonChecked (hWnd,IDC_LED4_DIGITAL_INPUT) )
::CheckDlgButton(hWnd,IDC_LED1_DIGITAL_INPUT,0);
::CheckDlgButton(hWnd,IDC_LED1_TURN_UNDER,0);
::CheckDlgButton(hWnd,IDC_LED2_ANYSPEED,0);
::CheckDlgButton(hWnd,IDC_LED3_ANYSPEED,0);
::CheckDlgButton(hWnd,IDC_LED4_ANYSPEED,0);
}
break;
case IDC_LED1_POSITION:
if (::IsDlgButtonChecked (hWnd,IDC_LED1_POSITION) )
{
if (::IsDlgButtonChecked (hWnd,IDC_LED2_ZERO) ||
::IsDlgButtonChecked (hWnd,IDC_LED3_ZERO) ||
::IsDlgButtonChecked (hWnd,IDC_LED4_ZERO) )
::CheckDlgButton(hWnd,IDC_LED1_ZERO,0);
if (::IsDlgButtonChecked (hWnd,IDC_LED2_ANYSPEED) ||
::IsDlgButtonChecked (hWnd,IDC_LED3_ANYSPEED) ||
::IsDlgButtonChecked (hWnd,IDC_LED4_ANYSPEED) )
::CheckDlgButton(hWnd,IDC_LED1_ANYSPEED,0);
if (::IsDlgButtonChecked (hWnd,IDC_LED2_DIGITAL_INPUT) ||
::IsDlgButtonChecked (hWnd,IDC_LED3_DIGITAL_INPUT) ||
::IsDlgButtonChecked (hWnd,IDC_LED4_DIGITAL_INPUT) )
::CheckDlgButton(hWnd,IDC_LED1_DIGITAL_INPUT,0);
::CheckDlgButton(hWnd,IDC_LED1_TURN_UNDER,0);
::CheckDlgButton(hWnd,IDC_LED2_POSITION,0);
::CheckDlgButton(hWnd,IDC_LED3_POSITION,0);
::CheckDlgButton(hWnd,IDC_LED4_POSITION,0);
}
break;
case IDC_LED1_TURN_UNDER:
if (::IsDlgButtonChecked (hWnd,IDC_LED1_TURN_UNDER) )
{
if (::IsDlgButtonChecked (hWnd,IDC_LED2_ZERO) ||
::IsDlgButtonChecked (hWnd,IDC_LED3_ZERO) ||
::IsDlgButtonChecked (hWnd,IDC_LED4_ZERO) )
::CheckDlgButton(hWnd,IDC_LED1_ZERO,0);
if (::IsDlgButtonChecked (hWnd,IDC_LED2_ANYSPEED) ||
::IsDlgButtonChecked (hWnd,IDC_LED3_ANYSPEED) ||
::IsDlgButtonChecked (hWnd,IDC_LED4_ANYSPEED) )
::CheckDlgButton(hWnd,IDC_LED1_ANYSPEED,0);
if (::IsDlgButtonChecked (hWnd,IDC_LED2_DIGITAL_INPUT) ||
::IsDlgButtonChecked (hWnd,IDC_LED3_DIGITAL_INPUT) ||
::IsDlgButtonChecked (hWnd,IDC_LED4_DIGITAL_INPUT) )
::CheckDlgButton(hWnd,IDC_LED1_DIGITAL_INPUT,0);
::CheckDlgButton(hWnd,IDC_LED1_POSITION,0);
::CheckDlgButton(hWnd,IDC_LED2_TURN_UNDER,0);
::CheckDlgButton(hWnd,IDC_LED3_TURN_UNDER,0);
::CheckDlgButton(hWnd,IDC_LED4_TURN_UNDER,0);
}
Понадобилось добавить ещё один чек бокс. Зашёл в обработчик - а там такое. И это только начало, всё не поместилось. Чтобы представить масштабы скажу, что чекбоксов 16..., я должен добавить ещё 4.
+112
{...}
type
a=(
january,
february,
march,
{--------------}
april,
may,
june,
{--------------}
jule,
august,
september,
{--------------}
october,
november,
december
);
b=(
seаson1,
seаson2,
seаson3,
seаson4
);
c=(
winter,
spring,
summer,
autumn
);
{...}
function d(e:a):b;
begin
case e of
january,
february,
march
:d:=seаson1;
april,
may,
june
:d:=seаson2;
jule,
august,
september
:d:=seаson3;
october,
november,
december
:d:=seаson4
end
end;
function f(g:a):c;
begin
case g of
december,
january,
february
:f:=winter;
march,
may,
april
:f:=spring;
june,
jule,
august
:f:=summer;
september,
october,
november
:f:=autumn
end
end;
begin
{...}
end.
Сделал на этой неделе в первом часу ночи.
+1000
bool __fastcall TItsString::operator == (const char* sVal) const
{
bool Empty1 = ((FStringValue == NULL) || (FStringValue[0] == 0));
bool Empty2 = ((sVal == NULL) || (sVal[0] == 0));
if (Empty1 && Empty2) return true;
if (Empty1 || Empty2) return false;
int i,j,k;
for(i=0; FStringValue[i] && (GET_LOWER_CHAR(FStringValue[i]) == GET_LOWER_CHAR(sVal[i])); i++);
if ((FStringValue[i] == 0) && (sVal[i] == 0)) return true;
j=i; k=i;
if (sVal[k] == 0) for(; FStringValue[i] == 0x20; i++);
if (FStringValue[k] == 0) for(; sVal[j] == 0x20; j++);
if ((FStringValue[i] == 0) && (sVal[j] == 0)) return true;
return false;
}
+160
const ORDER_FUNC_ARGS = '$a, $b';
const ORDER_FUNC_LOGIC = '$a=strlen($a);$b=strlen($b);return$a==$b?0:($a<$b?1:-1);';
// а дальше в одном из методов
$this->_userAgents = array_keys($browsers);
usort(
$this->_userAgents,
create_function(self::ORDER_FUNC_ARGS, self::ORDER_FUNC_LOGIC)
);
Для меня это странно выглядит
−111
public class MonstrGrafic extends ModulINT {
var data:XML;
var colors:Array = new Array(
'0x008080',
'0x800080',
'0xccffcc',
'0x00ffff',
'0x800000',
'0x0000ff',
'0x00ccff',
'0xccffff',
'0xffff00',
'0xffff99',
'0x000080',
'0xff00ff'
);
var ListTime:Array = new Array(
"08:00:00 - 08:15:00",
"08:15:00 - 08:30:00",
"08:30:00 - 08:45:00",
"08:45:00 - 09:00:00",
"09:00:00 - 09:15:00",
"09:15:00 - 09:30:00",
"09:30:00 - 09:45:00",
"09:45:00 - 10:00:00",
"10:00:00 - 10:15:00",
"10:15:00 - 10:30:00",
"10:30:00 - 10:45:00",
"10:45:00 - 11:00:00",
"11:00:00 - 11:15:00",
"11:15:00 - 11:30:00",
"11:30:00 - 11:45:00",
"11:45:00 - 12:00:00",
"12:00:00 - 12:15:00",
"12:15:00 - 12:30:00",
"12:30:00 - 12:45:00",
"12:45:00 - 13:00:00",
"13:00:00 - 13:15:00",
"13:15:00 - 13:30:00",
"13:30:00 - 13:45:00",
"13:45:00 - 14:00:00",
"14:00:00 - 14:15:00",
"14:15:00 - 14:30:00",
"14:30:00 - 14:45:00",
"14:45:00 - 15:00:00",
"15:00:00 - 15:15:00",
"15:15:00 - 15:30:00",
"15:30:00 - 15:45:00",
"15:45:00 - 16:00:00",
"16:00:00 - 16:15:00",
"16:15:00 - 16:30:00",
"16:30:00 - 16:45:00",
"16:45:00 - 17:00:00",
"17:00:00 - 17:15:00",
"17:15:00 - 17:30:00",
"17:30:00 - 17:45:00",
"17:45:00 - 18:00:00",
"18:00:00 - 18:15:00",
"18:15:00 - 18:30:00",
"18:30:00 - 18:45:00",
"18:45:00 - 19:00:00",
"19:00:00 - 19:15:00",
"19:15:00 - 19:30:00",
"19:30:00 - 19:45:00",
"19:45:00 - 20:00:00",
"20:00:00 - 20:15:00",
"20:15:00 - 20:30:00",
"20:30:00 - 20:45:00",
"20:45:00 - 21:00:00",
"21:00:00 - 21:15:00",
"21:15:00 - 21:30:00",
"21:30:00 - 21:45:00",
"21:45:00 - 22:00:00",
"22:00:00 - 22:15:00",
"22:15:00 - 22:30:00",
"22:30:00 - 22:45:00",
"22:45:00 - 23:00:00",
"23:00:00 - 23:15:00",
"23:15:00 - 23:30:00",
"23:30:00 - 23:45:00",
"23:45:00 - 24:00:00"
);
+159
protected $_never_allowed_regex = array(
"javascript\s*:" => '[removed]',
"expression\s*(\(|&\#40;)" => '[removed]', // CSS and IE
"vbscript\s*:" => '[removed]', // IE, surprise!
"Redirect\s+302" => '[removed]'
);
Это не разу не ковнокод, но строкой с // IE, surprise! не поделится, не смог)
ЗЫ. это CodeIgniter 2.0.3 класс Security, строка 52
−111
try{
characterParser.parse(_daeXML);
}catch(e:ScriptTimeoutError){
characterParser.parse(_daeXML);
}
чувак решил проблему пятнадцати секунд
+159
private function isBonusAddOK($code,$ffStr)
{
switch($code)
{
case 1:if(
($this->isBFFOK($ffStr,40) || $this->isBFFOK($ffStr,38) || $this->isBFFOK($ffStr,37)) &&
$this->isBFFOK($ffStr,24) && $this->isBFFOK($ffStr,19) &&
($this->isBFFOK($ffStr,42) || $this->isBFFOK($ffStr,43) || $this->isBFFOK($ffStr,44))
)return true;return false;
case 6:if(
($this->isBFFOK($ffStr,40) || $this->isBFFOK($ffStr,38) || $this->isBFFOK($ffStr,37)) &&
$this->isBFFOK($ffStr,24) && $this->isBFFOK($ffStr,20) &&
($this->isBFFOK($ffStr,42) || $this->isBFFOK($ffStr,43) || $this->isBFFOK($ffStr,44))
)return true;return false;
case 11:if(
$this->isBFFOK($ffStr,24) &&
($this->isBFFOK($ffStr,16) || $this->isBFFOK($ffStr,358) || $this->isBFFOK($ffStr,360) || $this->isBFFOK($ffStr,361)) &&
$this->isBFFOK($ffStr,62) &&
($this->isBFFOK($ffStr,64) || $this->isBFFOK($ffStr,352) || $this->isBFFOK($ffStr,356) || $this->isBFFOK($ffStr,363)) &&
($this->isBFFOK($ffStr,3) || $this->isBFFOK($ffStr,4) || $this->isBFFOK($ffStr,5))
)return true;return false;
case 14:if(
$this->isBFFOK($ffStr,24) &&
($this->isBFFOK($ffStr,16) || $this->isBFFOK($ffStr,358) || $this->isBFFOK($ffStr,360) || $this->isBFFOK($ffStr,361)) &&
$this->isBFFOK($ffStr,61) &&
($this->isBFFOK($ffStr,64) || $this->isBFFOK($ffStr,352) || $this->isBFFOK($ffStr,356) || $this->isBFFOK($ffStr,363)) &&
($this->isBFFOK($ffStr,3) || $this->isBFFOK($ffStr,4) || $this->isBFFOK($ffStr,5))
)return true;return false;
case 17:if(
($this->isBFFOK($ffStr,16) || $this->isBFFOK($ffStr,358) || $this->isBFFOK($ffStr,360) || $this->isBFFOK($ffStr,361)) &&
($this->isBFFOK($ffStr,64) || $this->isBFFOK($ffStr,352) || $this->isBFFOK($ffStr,356) || $this->isBFFOK($ffStr,363)) &&
($this->isBFFOK($ffStr,3) || $this->isBFFOK($ffStr,4) || $this->isBFFOK($ffStr,5)) &&
$this->isBFFOK($ffStr,17)
)return true;return false;
case 20:if(
($this->isBFFOK($ffStr,16) || $this->isBFFOK($ffStr,358) || $this->isBFFOK($ffStr,360) || $this->isBFFOK($ffStr,361)) &&
($this->isBFFOK($ffStr,64) || $this->isBFFOK($ffStr,352) || $this->isBFFOK($ffStr,356) || $this->isBFFOK($ffStr,363)) &&
($this->isBFFOK($ffStr,3) || $this->isBFFOK($ffStr,4) || $this->isBFFOK($ffStr,5)) &&
$this->isBFFOK($ffStr,25) && $this->isBFFOK($ffStr,21)
)return true;return false;
case 23:if(
($this->isBFFOK($ffStr,16) || $this->isBFFOK($ffStr,358) || $this->isBFFOK($ffStr,360) || $this->isBFFOK($ffStr,361)) &&
($this->isBFFOK($ffStr,64) || $this->isBFFOK($ffStr,352) || $this->isBFFOK($ffStr,356) || $this->isBFFOK($ffStr,363)) &&
($this->isBFFOK($ffStr,3) || $this->isBFFOK($ffStr,4) || $this->isBFFOK($ffStr,5)) &&
$this->isBFFOK($ffStr,21)
)return true;return false;
.... еще куча строк до значения 88
default: return true;
}
}
private function isBFFOK($ffStr,$pos)
{
$val = substr($ffStr,$pos,1);//echo $pos.':'.$val;var_dump(($val != '0'));echo ' ';
return ($val != '0');
/*if($val == 0)return false;
ИфЗебок