- 1
- 2
boolean direct = !Boolean.FALSE.equals(directParam);
boolean demoAgency = !direct;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+79
boolean direct = !Boolean.FALSE.equals(directParam);
boolean demoAgency = !direct;
+150
function rustrtolower($s)
{
$from = array("А","Б","В","Г","Д","Е","Ё","Ж","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ч","Ш","Щ","Ъ","Ы","Ь","Э","Ю","Я","A","B","C","D","E","F","G","H","I","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","J");
$to = array("а","б","в","г","д","е","ё","ж","з","и","й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ч","ш","щ","ъ","ы","ь","э","ю","я","a","b","c","d","e","f","g","h","i","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","j");
return str_replace($from, $to, $s);
}
+151
var GetUrl = /\[(.*)\]/g.exec("$SECTION_NAME$")[1].replace(/\-/i, '~').replace(/\-/i, '~');
фу ;(
+155
if($inc == true){
$counter_val = $cat[$this->FileCounterKey] + 1;
}else{
$counter_val = $cat[$this->FileCounterKey] - 1;
}
Класс деревьев в одной русской CMS. Метод пересчитывает кол-во файлов в категории после добавления/удаления.
+75
<% ServicePackage servicePackage = null; %>
<% char fi [] = {'g', 'v', 'p'}; %>
<% int ni [] = {3, 7, 11}; %>
<% for(int i = 0; i < fi.length; i++)
for(int j = 1; j <= ni[i]; j++)
{
String id = "", name = null, brief = null, price = null;
id += (char)fi[i];
if (j >= 10)
id += (char)('0' + j / 10);
id += (char)('0' + j % 10);
servicePackage = AllServicePackages.map.get(id);
if (servicePackage != null)
{
name = servicePackage.getName();
brief = servicePackage.getBrief();
price = servicePackage.getPrise();
}
%>
<% } %>
Автору хотелось перебрать все эл-ты map'а.
−120
if( (ori == UIInterfaceOrientationLandscapeLeft) || (ori == UIInterfaceOrientationLandscapeRight))
{
// Some code
}
else if(ori==UIInterfaceOrientationPortrait || ori==UIInterfaceOrientationPortraitUpsideDown)
{
// Some other code
}
else {
// God mode on!
}
Реальный проект после индусов... Что движет этими людьми я не понимаю...
+166
// say this is some existing structure. And we want to use
// a list. We can tell it that the next pointer
// is apple::next.
struct apple {
int data;
apple * next;
};
// simple example of a minimal intrusive list. Could specify the
// member pointer as template argument too, if we wanted:
// template<typename E, E *E::*next_ptr>
template<typename E>
struct List {
List(E *E::*next_ptr):head(0), next_ptr(next_ptr) { }
void add(E &e) {
// access its next pointer by the member pointer
e.*next_ptr = head;
head = &e;
}
E * head;
E *E::*next_ptr;
};
int main() {
List<apple> lst(&apple::next);
apple a;
lst.add(a);
}
c++ страшный язык :) (часть вторая)
C++: Pointer to class data member: http://stackoverflow.com/questions/670734/c-pointer-to-class-data-member
Такие конструкции "E *E::*next_ptr;" без подготовки не осилить.
+165
// Обработка запроса
for ($i = 1; $i<=300000; $i++)
{
$marat=$marat+10;
}
Эмуляция паузы при генерировании РНР-скриптом ответа для Flash-ки (сайт - онлайн казино)
−116
sub _check_sms_hash {
my $self = shift;
my $q = shift;
my $qs = $q->param('id').$q->param('phone').$q->param('trigger').$q->param('text').$q->param('date').$q->param('check').$self->_sicretsms();
my $hash = $self->{DB}->selectrow_array("SELECT MD5(?)", undef, $qs);
return 1 if $hash eq $q->param('sign');
return 0;
}
Православное вычисление контрольной суммы.
+151
$currN = 0;
$countN = count($news);
$currW = 0;
$countW = count($wall);
$time = time();
$date = date('Y-m-d H:i:s');
// Жестянка в сферическом ваккуме куба
foreach($lenta as $k => &$v)
{
while (($v['DZ'] <= $news[$currN]['DZ']))
{
while (($news[$currN]['DZ'] <= $wall[$currW]['DZ']) && ($currW < $countW))
{
$this->create_time($wall[$currW]['DZ'], $time, $date);
$this->display_wall($wall[$currW]);
++$currW;
}
$this->create_time($news[$currN]['DZ'], $time, $date);
$this->display_news($news[$currN]);
++$currN;
}
$this->create_time($v['DZ'], $time, $date);
$this->display_lenta($v, $usr);
}
while ($currN < $countN)
{
while (($news[$currN]['DZ'] <= $wall[$currW]['DZ']) && ($currW < $countW))
{
$this->create_time($wall[$currW]['DZ'], $time, $date);
$this->display_wall($wall[$currW]);
++$currW;
}
$this->create_time($news[$currN]['DZ'], $time, $date);
$this->display_news($news[$currN]);
++$currN;
}
while ($currW < $countW)
{
$this->create_time($wall[$currW]['DZ'], $time, $date);
$this->display_wall($wall[$currW]);
++$currW;
}
Просто и со вкусом.