- 1
@property (nonatomic, retain) NSString *totalCount;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−1065
@property (nonatomic, retain) NSString *totalCount;
Чуть глаза от такого не лопнули
−19
TElement* get(void)
{
TElement* result = this->allocateBuffer();
if (result!=NULL)
{
try
{
::new(result) TElement; //Вызов конструктора.
}catch(...)//Получили исключение в конструкторе конструироваемого объекта.
{
this->deallocateBuffer(result);
throw;
};
};
return result;
};
template<class TArg1>
TElement* get(TArg1 arg1)
{
TElement* result = this->allocateBuffer();
if (result!=NULL)
{
try
{
::new(result) TElement(arg1); //Вызов конструктора.
}catch(...)//Получили исключение в конструкторе конструироваемого объекта.
{
this->deallocateBuffer(result);
throw;
};
};
return result;
};
//...
template<class TArg1, class TArg2, class TArg3, class TArg4, class TArg5, class TArg6>
TElement* get(TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
{
TElement* result = this->AllocateBuffer();
if (result!=NULL)
{
try
{
::new(result) TElement(arg1, arg2, arg3, arg4, arg5, arg6); //Вызов конструктора.
}catch(...)//Получили исключение в конструкторе конструироваемого объекта.
{
this->DeallocateBuffer(result);
throw;
};
};
return result;
};
Хотя этот баян мы уже видели на Action Script.
+91
private void changeTabItem(object parameter)
{
if (SelectedTabIndex == SelectedTabIndexOld) return;
if (SelectedTabIndex != 0)
{
if ([надо сохранить])
{
if ([попытка сохранить удалась]) SelectedTabIndexOld = SelectedTabIndex;
else SelectedTabIndex = 0;
}
else SelectedTabIndexOld = SelectedTabIndex;
if (SelectedTabIndex == 1)
[обновить древо]
}
else if (SelectedTabIndex != 1)
{
if ([надо сохранить])
{
if ([попытка сохранить удалась]) SelectedTabIndexOld = SelectedTabIndex;
else SelectedTabIndex = 1;
}
else SelectedTabIndexOld = SelectedTabIndex;
if (SelectedTabIndex == 0)
[обновить древо]
}
}
Раскопки продолжаются. Теперь Вашему вниманию предлагается "женское" переключение вкладок, работающее "от противного". В данном случае две вкладки, а теперь представим что надо добавить ещё пару. =)
−22
class TFunctorMap
{
public:
typedef bool (*TFunctor)(const TSentenceList&, unsigned short &);
private:
std::map<char, TFunctor> _functorMap;
public:
TFunctorMap(void)
{
_functorMap.insert(std::make_pair('g', &RZC));
_functorMap.insert(std::make_pair('t', &STN));
_functorMap.insert(std::make_pair('d', &RTC));
}
TFunctor GetFunctor(const char Key)
{
if (_functorMap.find(Key) == _functorMap.end())
return NULL;
return _functorMap[Key];
}
};
−24
template <bool ValueToLock>
class TBoolLocker
{
private:
bool _lockedValue;
public:
TBoolLocker(void) : _lockedValue(!ValueToLock) {}
TBoolLocker(const TBoolLocker & Copy) : _lockedValue(Copy._lockedValue) {}
const TBoolLocker & operator=(const TBoolLocker & Copy)
{
_lockedValue = Copy._lockedValue;
return *this;
}
bool update(const bool NewValue)
{
if (_lockedValue != ValueToLock)
_lockedValue = NewValue;
return _lockedValue;
}
};
+72
/* Данные пользователя*/
$fio=$_POST['fio'];
$sex=$_POST['sex'];
$sdate=$_POST['sdate'];
$city=$_POST['city'];
$age=$_POST['age'];
$hage=$_POST['hage'];
$cage=$_POST['cage'];
$page=$_POST['page'];
$stime=$_POST['stime'];
$ip=$_POST['ip'];
/* Вопросы*/
$a1=$_POST['a1'];
$a1b1=$_POST['1a1'];
$a1b2=$_POST['1a2'];
$a1b3=$_POST['1a3'];
$a1b4=$_POST['1a4'];
$com1=$_POST['com1'];
$a2=$_POST['a2'];
$a2b1=$_POST['2a1'];
$a2b2=$_POST['2a2'];
$com2=$_POST['com2'];
$a3=$_POST['a3'];
$b1a1=$_POST['b1a1'];
$b1a2=$_POST['b1a2'];
$b1a3=$_POST['b1a3'];
$a4=$_POST['a4'];
$a3b1=$_POST['3a1'];
$a3b2=$_POST['3a2'];
$a3b3=$_POST['3a3'];
$a3b4=$_POST['3a4'];
$a3b5=$_POST['3a5'];
$a3b6=$_POST['3a6'];
$a3b7=$_POST['3a7'];
$a3b8=$_POST['3a8'];
$a3b9=$_POST['3a9'];
$a3b10=$_POST['3a10'];
$com3=$_POST['com3'];
$a5=$_POST['a5'];
$b2a1=$_POST['b2a1'];
$b2a2=$_POST['b2a2'];
$b2a3=$_POST['b2a3'];
$a6=$_POST['a6'];
$a4b1=$_POST['4a1'];
$a4b2=$_POST['4a2'];
$a4b3=$_POST['4a3'];
$a4b4=$_POST['4a4'];
$a4b5=$_POST['4a5'];
$a4b6=$_POST['4a6'];
$a4b7=$_POST['4a7'];
$com4=$_POST['com4'];
$a7=$_POST['a7'];
$b3a1=$_POST['b3a1'];
$b3a2=$_POST['b3a2'];
$b3a3=$_POST['b3a3'];
$a8=$_POST['a8'];
$a5b1=$_POST['5a1'];
$a5b2=$_POST['5a2'];
$a5b3=$_POST['5a3'];
$a5b4=$_POST['5a4'];
$a5b5=$_POST['5a5'];
$a5b6=$_POST['5a6'];
$a5b7=$_POST['5a7'];
$a5b8=$_POST['5a8'];
$a5b9=$_POST['5a9'];
$a5b10=$_POST['5a10'];
$a5b11=$_POST['5a11'];
$com5=$_POST['com5'];
$a9=$_POST['a9'];
$a6b1=$_POST['6a1'];
$a6b2=$_POST['6a2'];
$a6b3=$_POST['6a3'];
$a6b4=$_POST['6a4'];
$a6b5=$_POST['6a5'];
$a6b6=$_POST['6a6'];
$a6b7=$_POST['6a7'];
$a6b8=$_POST['6a8'];
$com6=$_POST['com6'];
echo "<CENTER>";
echo "Привет, ".$_POST['fio'];
echo "<BR><BR>";
echo "Спасибо за ваш интерес.<BR><BR>";
....
нашли в прокте вот такое извращение :)
+66
catch (com.google.gwt.event.shared.UmbrellaException ex) {
Iterator<Throwable> it = ex.getCauses().iterator();
while (it.hasNext()) {
Throwable msg = it.next();
System.out.println(msg.getStackTrace());
}
обрабатываем exception......
+70
if(rightTable.isCellPresent(0, 0))
for(int i = 0; i < rightTable.getRowCount(); i++)
if(((CheckBox)((HorizontalPanel)rightTable.getWidget(i, 0)).getWidget(0)).getValue())
{ isChanged = true;
leftTableList.add(currentTemplate.getColumns().get(i));
for(int j = 0; j < resultTable.getCellCount(0); j++)
if(((Label)((HorizontalPanel)resultTable.getWidget(0, j)).getWidget(1)).getText().compareTo(new Integer(currentTemplate.getColumns().get(i).getOrder()).toString()) == 0)
resultTable.removeCell(0, j);
System.out.println(resultTable.getCellCount(0));
rightTable.removeRow(i);
currentTemplate.getColumns().remove(i);
i--;
}
+78
private function isRussianCar($car){
# Определялка российских машин.
if ($car['make_id'] == '107') return true;
if ($car['make_id'] == '108') return true;
if ($car['make_id'] == '109') return true;
if ($car['make_id'] == '110') return true;
if ($car['make_id'] == '111') return true;
if ($car['make_id'] == '112') return true;
if ($car['make_id'] == '113') return true;
if ($car['make_id'] == '114') return true;
if ($car['make_id'] == '115') return true;
if ($car['make_id'] == '116') return true;
if ($car['make_id'] == '117') return true;
return false;
}
Нашёл в одном из проектов
+71
$template_archive_footer = stripslashes(get_option('poll_template_pollarchivefooter'));
$template_archive_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_archive_footer);
$template_archive_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_archive_footer);
$template_archive_footer = str_replace("%POLL_TOTALVOTES%", number_format_i18n($polls_question['totalvotes']), $template_archive_footer);
$template_archive_footer = str_replace("%POLL_TOTALVOTERS%", number_format_i18n($polls_question['totalvoters']), $template_archive_footer);
$template_archive_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_archive_footer);
$template_archive_footer = str_replace("%POLL_MOST_VOTES%", number_format_i18n($poll_most_votes), $template_archive_footer);
$template_archive_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_archive_footer);
$template_archive_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_archive_footer);
$template_archive_footer = str_replace("%POLL_LEAST_VOTES%", number_format_i18n($poll_least_votes), $template_archive_footer);
$template_archive_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_archive_footer);
wp-polls. пиздец.