- 1
- 2
- 3
- 4
- 5
- 6
if (s.length() < 2)
return false;
if (s.charAt(1) == ':') {
return true;
}
return false;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+65
if (s.length() < 2)
return false;
if (s.charAt(1) == ':') {
return true;
}
return false;
+155.4
function strtolowerex($str)
{
$str = strtr($str, "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ", "абвгдеёжзийклмнопрстуфхцчшщъыьэюя");
return strtolower($str);
}
я может чего-то не понимаю? 0_о
+158.8
$fStr = fgets($fp);
if ($k==0 && $IsFirst)
continue;
$arLine = explode(";", $fStr);
$type = intval($arLine[0]);
$articul = trim($arLine[1]);
$section_id = intval($arLine[2]);
$model = trim($arLine[3]);
$name = trim($arLine[4]);
$brand = trim($arLine[5]);
$width = trim($arLine[6]);
$radius = trim($arLine[7]);
$pcd = trim($arLine[8]);
$et = trim($arLine[9]);
$dia = trim($arLine[10]);
$dop = trim($arLine[11]);
$color = trim($arLine[12]);
//и чуть позже
$query = "INSERT INTO ".$dbCatalogElProp." VALUES (null, ".$element_id.", 38, 'S', '".$articul."', null, '')";
$res = SQLResult($query);
$query = "INSERT INTO ".$dbCatalogElProp." VALUES (null, ".$element_id.", 25, 'L', '', ".$type.", '')";
$res = SQLResult($query);
$query = "INSERT INTO ".$dbCatalogElProp." VALUES (null, ".$element_id.", 17, 'S', '".$width."', null, '')";
$res = SQLResult($query);
$query = "INSERT INTO ".$dbCatalogElProp." VALUES (null, ".$element_id.", 18, 'S', '".$radius."', null, '')";
$res = SQLResult($query);
$query = "INSERT INTO ".$dbCatalogElProp." VALUES (null, ".$element_id.", 19, 'S', '".$pcd."', null, '')";
$res = SQLResult($query);
$query = "INSERT INTO ".$dbCatalogElProp." VALUES (null, ".$element_id.", 20, 'S', '".$et."', null, '')";
$res = SQLResult($query);
$query = "INSERT INTO ".$dbCatalogElProp." VALUES (null, ".$element_id.", 45, 'S', '".$dia."', null, '')";
$res = SQLResult($query);
$query = "INSERT INTO ".$dbCatalogElProp." VALUES (null, ".$element_id.", 21, 'S', '".$color."', null, '')";
$res = SQLResult($query);
$query = "INSERT INTO ".$dbCatalogElProp." VALUES (null, ".$element_id.", 22, 'S', '0', null, '')";
$res = SQLResult($query);
$query = "INSERT INTO ".$dbCatalogElProp." VALUES (null, ".$element_id.", 23, 'S', '', null, '')";
$res = SQLResult($query);
+60.3
void AcquireSomething(..., boost::shared_ptr<Something> out)
{
...
out.reset(new Something());
}
жесть
+73.7
public Object save(Object entity) {
final EntityManager em = getEntityManager();
try {
final EntityTransaction et = em.getTransaction();
try {
et.begin();
em.persist(entity);
et.commit();
} finally {
if (et != null && et.isActive()) {
entity = null;
et.rollback();
}
}
} finally {
if (em != null && em.isOpen()) {
em.close();
}
}
return entity;
}
Простое и понятное управление транзакциями придумали трусы!
А rollback в секции finally, и вложенные try-catch секции -- вообще модная сейчас фишка.
+159.1
paramsObj.templateName = templateNewWindow.items.items[0].items.items[0].items.items[0].items.items[0].getValue();
Получение значения ExtJS'ного контрола, который спрятан глубоко в дереве.
−179
Выборка=Запрос.Выполнить().Выбрать();
Пока Выборка.Следующий() Цикл
ФизЛицо=Выборка.Физлицо;
Состояние("Обробатывается - "+ФизЛицо.Ссылка);
...
КонецЦикла;
Если новичок порой может забыть указать реквизит ".Ссылка", где это требуется. То тут всё наоборот. Видать, чел настолько поднаторел, что только он знает, нахера тут ссылка. (про грамматику молчу)
−122
my $title=$self->{ditems}->get_field_value({SET=>'City', itemid=>$cityid, field=>'genitive_case', notitle=>1});
$title='в '.$self->{ditems}->get_field_value({SET=>'City', itemid=>$cityid, field=>'prepositional_case', notitle=>1}) unless length($title);
return '' if $title eq 'в ';
+128.3
List<estExecPeriod> lst = TEDManager.getExecPeriodByIDExecWork(budget.IdBudget);
+91.1
s := TStringList.Create;
LocalIniFile.ReadSection(sPad, s);
for x := 0 to ActionListMenu.ActionCount - 1 do
begin
for y := 0 to 9 do
begin
for z := 0 to s.Count - 1 do
begin
if (Length(s[z]) <> Length('Tag0')) and (s[z] = 'Tag' + IntToStr(ActionListMenu[x].Tag + y)) then
begin
try
ActionListMenu[x].Execute;
except
end;
end;
end;
end;
end;
s.Free;
Эм, ну комментарии излишни?