- 1
- 2
declare @date datetime
set @date=convert(datetime, cast(day(getdate()) as varchar(2))+'.'+cast(month(getdate()) as varchar(2))+'.'+cast(year(getdate()) as char(4)), 105)
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−114
declare @date datetime
set @date=convert(datetime, cast(day(getdate()) as varchar(2))+'.'+cast(month(getdate()) as varchar(2))+'.'+cast(year(getdate()) as char(4)), 105)
MS SQL
Так и не удалось выяснить, почему автор не написал просто
set @date=getdate()
−117
SELECT *
FROM table1
WHERE
COALESCE(
field1,
field2,
field3,
field4,
field5,
fieldN,
"lol"
)!="lol"
+74
String.format("USR-БГПУ", new Object[] { new SimpleDateFormat("dd MMMM yyyy", new Locale("ru", "RU")) })
Нашёл в самолично написанной утильке (из серии блиц-[говно]кодинга). Думал.
+81
public void getApplicationContext(ApplicationContext applicationContext ) {
applicationContext.setUserId(currentUserService.getCurrentUser().getName());
applicationContext.setTransactionType(transactionType);
applicationContext.setApplication(applicationName);
applicationContext.setSubSystem(subSystemName);
applicationContext.setAddress(ipAddress);
applicationContext.setCorrelationId(correlationIDGenerator.getRandomGUID());
}
*facepalm*
+171
$date_day = date("d");
$date_month = date("m");
$date_year = date("Y");
$date_time = date("H:i");
$date_cont = " " . $date_day . "-" . $date_month . "-" . $date_year . " " . $date_time;
Вот так мы получаем дату строкой :)
Впоследствии используется только $date_cont.
+164
private function _arrayToString($array)
{
$count = count($array);
$str = '';
for ($i = 0; $i < $count; $i++) {
$str .= $array[$i] . ',';
}
$str = substr($str, 0, strlen($str) - 1);
return $str;
}
implode ?? не, не слышал!
+88
LinkedHashMap<Long, Map<String, Map<Long, List<Long>>>> propertyTemplates;
+163
$curdate=gmdate("Y.m.d H:i:s");
if(DateDayDiff($curdate,"2008.01.01")==0)$hny = true; else $hny = false;
if(DateDayDiff($curdate,"2008.04.01")==0)$fd = true; else $fd = false;
if((DateDayDiff($curdate,"2008.05.09")>=-1) && (DateDayDiff($curdate,"2008.05.09")<=1)) $nine_mai = true; else $nine_mai = false;
Оригинальная проверка "а-сегодня-ли-девятое-мая?" на форуме Elemental Games.
+163
d = d ? d.push({ajax: true}) : {ajax: true};
Похоже, что программист отметил весело новый год
+98
if RadioGroup1.ItemIndex=0 then cpr:=cpr+1;
if RadioGroup1.ItemIndex=1 then cth:=cth+1;
if RadioGroup2.ItemIndex=0 then cch:=cch+1;
if RadioGroup2.ItemIndex=1 then czs:=czs+1;
if RadioGroup3.ItemIndex=0 then chd:=chd+1;
if RadioGroup3.ItemIndex=1 then cpr:=cpr+1;
if RadioGroup4.ItemIndex=0 then cth:=cth+1;
if RadioGroup4.ItemIndex=1 then cch:=cch+1;
if RadioGroup5.ItemIndex=0 then czs:=czs+1;
if RadioGroup5.ItemIndex=1 then chd:=chd+1;
if RadioGroup6.ItemIndex=0 then cpr:=cpr+1;
if RadioGroup6.ItemIndex=1 then cch:=cch+1;
if RadioGroup7.ItemIndex=0 then chd:=chd+1;
if RadioGroup7.ItemIndex=1 then cth:=cth+1;
....// Это всё в 60 строк
if (cpr>cth) and (cpr>cch) and (cpr>czs) and (cpr>chd) then cpr1:=+1
else
if (cth>cpr) and (cth>cch) and (cth>czs) and (cth>chd) then cth1:=+1
else
if (cch>cpr) and (cch>cth) and (cch>czs) and (cch>chd) then cch1:=+1
else
if (czs>cpr) and (czs>cch) and (czs>cth) and (czs>chd) then czs1:=+1
else
if (chd>cpr) and (chd>cch) and (chd>czs) and (chd>cth) then chd1:=+1;
if cpr>chd or czs or cth or cch then
begin
ShowMessage('человек-природа – все профессии, связанные с растениеводством, животноводством и лесным хозяйством;') ;
Datamodule4.ADOTable1.Edit;
Datamodule4.ADOTable1.FieldValues['test2']:=('человек-природа – все профессии, связанные с растениеводством, животноводством и лесным хозяйством;');
Datamodule4.ADOTable1.Post;
end
else
if chd>cpr or cth or cch or czs then begin
ShowMessage('человек-техника – все технические профессии;') ;
Datamodule4.ADOTable1.Edit;
Datamodule4.ADOTable1.FieldValues['test2']:=('человек-техника – все технические профессии;');
Datamodule4.ADOTable1.Post;
...... И далее результаты в общем их 5
отдельная кнопка для вывода остальных 10 вопросов х)
procedure TForm1.Button1Click(Sender: TObject);
begin
Radiogroup11.Visible:=true;
Radiogroup12.Visible:=true;
Radiogroup13.Visible:=true;
Radiogroup14.Visible:=true;
Radiogroup15.Visible:=true;
Radiogroup16.Visible:=true;
Radiogroup17.Visible:=true;
Radiogroup18.Visible:=true;
Radiogroup19.Visible:=true;
Radiogroup20.Visible:=true;
Button2.Visible:=True;
end;
Программа тестирования на профориентацию
хД сколько он radiogroup создал)