- 1
- 2
- 3
- 4
- 5
- 6
- 7
if (Name = PictSection) then
begin
if frVariables['SECTION'] <> null then
if frVariables['SEC_FIRM_ID'] <> null then
;
exit;
end;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+29
if (Name = PictSection) then
begin
if frVariables['SECTION'] <> null then
if frVariables['SEC_FIRM_ID'] <> null then
;
exit;
end;
Нах вообще проверка...
+15.3
/**
* Validate the word
*
* @see Zend_Validate_Interface::isValid()
* @param mixed $value
* @return boolean
*/
public function isValid($value, $context = null)
{
$name = $this->getName();
if (!isset($context[$name]['input'])) {
$this->_error(self::MISSING_VALUE);
return false;
}
$value = strtolower($context[$name]['input']);
$this->_setValue($value);
if (!isset($context[$name]['id'])) {
$this->_error(self::MISSING_ID);
return false;
}
$this->_id = $context[$name]['id'];
if ($value !== $this->getWord()) {
$this->_error(self::BAD_CAPTCHA);
return false;
}
return true;
}
не ожидал даже от Zend Framework-а
+7.5
public function rsort($flag = SORT_REGULAR)
{
rsort($this->var, SORT_REGULAR);
return $this;
}
Пример сортировки массива =)
+17
if(True==true && True==false)
return True;
нереальное условие
+31.7
if($show[10]=='1' || substr($quest[$key]['QShowC'],1,1)=='1')
Двоичная арифметика на стрингах... логическое И (&)...
+17.4
for (i = 0; i<sizeof(n)*4; i++)
{
if ((((n>>(2*i))&1==1)&&((n>>(2*i+1))&1==0)))
{
n|=(1<<(2*i));
n&=~(1<<(2*i+1));
}
else if ((((n>>(2*i))&1==0)&&((n>>(2*i+1))&1==1)))
{
n|=(1<<(2*i+1));
n&=~(1<<(2*i));
}
Нечто вроде циклического сдвига вправо на Си.
+15
<?php
define('true',false);
?>
-
+20.9
$dayofmonth = date('t');
$day_count = 1;
$num = 0;
for($i = 0; $i < 7; $i++)
{
$dayofweek = date('w', mktime(0, 0, 0, date('m'), $day_count, date('Y')));
$dayofweek = $dayofweek - 1;
if($dayofweek == -1) $dayofweek = 6;
if($dayofweek == $i)
{
$week[$num][$i] = $day_count;
$day_count++;
}
else $week[$num][$i] = "";
}
while(true)
{
$num++;
for($i = 0; $i < 7; $i++)
{
$week[$num][$i] = $day_count;
$day_count++;
if($day_count > $dayofmonth) break;
}
if($day_count > $dayofmonth) break;
}
взято с softtime.ru, PHP5 самоучитель
+25
private string RemoveNonAlphaChars(string txt)
{
string returnText = txt;
returnText = returnText.Replace("~", "");
returnText = returnText.Replace("`", "");
returnText = returnText.Replace("!", "");
returnText = returnText.Replace("@", "");
returnText = returnText.Replace("#", "");
returnText = returnText.Replace("$", "");
returnText = returnText.Replace("%", "");
returnText = returnText.Replace("^", "");
returnText = returnText.Replace("&", "");
returnText = returnText.Replace("*", "");
returnText = returnText.Replace("(", "");
returnText = returnText.Replace(")", "");
returnText = returnText.Replace("-", "");
returnText = returnText.Replace("_", "");
returnText = returnText.Replace("+", "");
returnText = returnText.Replace("=", "");
returnText = returnText.Replace("{", "");
returnText = returnText.Replace("}", "");
returnText = returnText.Replace("[", "");
returnText = returnText.Replace("]", "");
returnText = returnText.Replace("|", "");
returnText = returnText.Replace("\\", "");
returnText = returnText.Replace("\"", "");
returnText = returnText.Replace("'", "");
returnText = returnText.Replace(";", "");
returnText = returnText.Replace("<", "");
returnText = returnText.Replace(",", "");
returnText = returnText.Replace(">", "");
returnText = returnText.Replace(".", "");
returnText = returnText.Replace("/", "");
returnText = returnText.Replace("?", "");
returnText = returnText.Replace(" ", "");
return returnText.ToUpper();
}
Убирает разделители. ;)
+16
--------CSS----------
.window {
position:fixed;
height:300px;
width:300px;
background: #FCFDCC;
}
.window .wlt {
float: left;
height:15px;
width:11px;
background: url("design/wlt.gif");
}
.window .wrt {
float: right;
height:15px;
width:11px;
background: url("design/wrt.gif");
}
.window .wct {
height:15px;
width: 100%;
background: url("design/wct.gif");
}
.window .content {
float: left;
}
--------HTML--------------------
<div class="window">
<div class="wlt"></div>
<div class="wrt"></div>
<div class="wct"></div>
</div>
Как заставить этот код работать в ИЕ7?