-
Лучший говнокод
- В номинации:
-
- За время:
-
-
+161
- 1
- 2
- 3
- 4
if(upass==uname || upass=='1234' || upass=='12345' || upass=='123456' || upass=='654321' || upass=='pikabu' || upass=='password' || upass=='qwerty' || upass=='qazwsx') {
$('#'+upass2_id+'_err').html('Пароль не должен быть слишком простым или совпадать с логином');
errCnt++;
}
смотрел исходный код по правой кнопки - сайт pikabu.ru
marik_v,
15 Декабря 2014
-
−165
- 1
- 2
- 3
- 4
- 5
- 6
- 7
update #tmpTours1 set pricelink = ('<a target="_blank" title="Прайс-лист на ближайшие заезды" href="../pricelist/Complex.aspx?country=' + ltrim(str(cnkey)) + '&tour=' + ltrim(str(tourkey)) + '&dateFrom=' + dbo.mwFirstTourDate(tlkey) + '">' + ltrim(str(tourprice)) + ' ' + tourrate + '</a>')
set @sql = N'select * from #tmpTours1 where tourprice is not null and quota <> case ' + ltrim(str(@quotaYes)) + ' when -1 then -10 else 0 end '
if len(@sort) > 0
set @sql = @sql + ' order by ' + @sort
print @sql
exec sp_executesql @sql
Хранимочки по 1000 строк подобного кода.
tablecell,
15 Декабря 2014
-
+58
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
if(is_ai_on && !white_move)
{
int tries;
start:
srand (time(NULL));
select_figure:
int figure = rand() % (game_field.figures.size() - 1) + 0;
if(game_field.figures[figure]->IsWhiteFigure()) goto select_figure;
int pos_x;
int pos_y;
tries = 0;
try_move:
try
{
switch(game_field.figures[figure]->GetType())
{
case PawnType:
{
pos_x = rand() % (game_field.figures[figure]->GetPositionX() + 2) + (game_field.figures[figure]->GetPositionX() - 2);
if(pos_x < 0) pos_x = 0;
if(pos_x >= game_field.size) pos_x = game_field.size - 1;
pos_y = game_field.figures[figure]->GetPositionY() + 1;
if(pos_x == game_field.figures[figure]->GetPositionX() &&
pos_y == game_field.figures[figure]->GetPositionY())
{
if(tries < 6)
{
tries++;
goto try_move;
}
else
{
goto select_figure;
}
}
}break;
default:
{
pos_x = rand() % (game_field.figures[figure]->GetPositionX() + 5) + (game_field.figures[figure]->GetPositionX() - 5);
pos_y = rand() % (game_field.figures[figure]->GetPositionY() + 5) + (game_field.figures[figure]->GetPositionY() - 5);
if(pos_x < 0) pos_x = 0;
if(pos_x >= game_field.size) pos_x = game_field.size - 1;
if(pos_y < 0) pos_y = 0;
if(pos_y >= game_field.size) pos_y= game_field.size - 1;
if(pos_x == game_field.figures[figure]->GetPositionX() &&
pos_y == game_field.figures[figure]->GetPositionY())
{
if(tries < 6)
{
tries++;
goto try_move;
}
else
{
goto select_figure;
}
}
}break;
}
game_field.DoMove(figure, pos_x, pos_y, this->white_move);
}
catch(...)
{
if(tries < 6)
{
tries++;
goto try_move;
}
else
{
goto select_figure;
}
}
this->white_move = true;
}
Скайнет - версия 0.0000000000000000000000000000000001
GreatMASTERcpp,
12 Декабря 2014
-
+73
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
@Override
public void run()
{
_tracks = parseTracks();
double inc = 100 / _tracks.size();
for(Track track : _tracks)
{
track.save(_savePath);
_progress += inc;
}
_progress = 100;
}
Категория "чтоб наверняка".
pushistayapodmyshka,
11 Декабря 2014
-
+135
- 1
<html class=" js flexbox flexboxlegacy hashchange history rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity flash no-touch no-opera cssanimations csscolumns cssgradients no-cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage applicationcache performance mediaqueries" lang="ru-RU" xml:lang="ru-RU" style="">
kyzi007,
03 Декабря 2014
-
+157
- 1
- 2
- 3
- 4
formatDate: function (oSignDate) {
"use strict";
return oSignDate.getFullYear().toString() + (1 + oSignDate.getMonth()).toString() + oSignDate.getDate().toString() + "T" + oSignDate.getHours().toString() + oSignDate.getMinutes().toString() + oSignDate.getSeconds().toString() + (oSignDate.getTimezoneOffset() > 0 ? "-" : "+") + ("0000" + (-1 * oSignDate.getTimezoneOffset() / 60) * 100).toString().substr(-4, 4);
}
Представление даты в формате YYYYMMDDThhmmss±hhmm
Yaruson,
24 Ноября 2014
-
+86
- 1
- 2
- 3
- 4
- 5
public interface ArchitectureUnit<T> {
public T release(Object... params);
}
максимальная гибкость
_a_o_O,
12 Ноября 2014
-
+145
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
Connection::Connection(const Options& opts): impl_(new Impl)
{
impl_->isInitialized = false;
impl_->options = std::move(*opts.impl_);
if (!options().lazyInit)
conn();
}
Вся соль в строке 4: из объекта opts, переданного по константной ссылке, подло выжимают содержимое. Видимо, никто не пробовал создать два коннекта из одного объекта опций.
roman-kashitsyn,
28 Октября 2014
-
+88
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
with dm.Query do
begin
if Active then Close;
//вот так оно работало до ввода параметров
//dm.QStat.SQL.Text := 'select * from T_ORDER where (date between ''' + IntToStr(ys) + '-' + IntToStr(ms) + '-' + IntToStr(ds) + ''' and ''' + IntToStr(yf) + '-' + IntToStr(mf) + '-' + IntToStr(df) + ''')' ;
SQL.Text := 'select * from T_ORDER where (date between :StartDate and :FinishDate)';
Parameters.ParamByName('StartDate').Value := IntToStr(ys) + '-' + IntToStr(ms) + '-' + IntToStr(ds);
Parameters.ParamByName('FinishDate').Value := IntToStr(yf) + '-' + IntToStr(mf) + '-' + IntToStr(df);
в комменте - код, ниже - его вменяемая замена
knowy,
27 Октября 2014
-
+131
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
Dictionary<string, string> Users = new Dictionary<string, string>();
//somecode
foreach (string key in Users.Keys)
{
string str = Users[key];
m_LookUpProjectSupervisorFilter.Text = str;
m_LookUpProjectSupervisorFilter.Value = key;
break;
}
Такое часто в рабочем проекте.
r1nk,
26 Октября 2014