-
Лучший говнокод
- В номинации:
-
- За время:
-
-
+126
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
2.2.14 Empty text box Why there is an option to add an empty text box
3.2.14 Presentation on the left side The paper that the narrow on him (that playing right now), should be enlarge (like magnifying glass).
3.2.14 Player- time scale Should be an option to move the narrow on the scale and "jump" forward\backwards
3.2.14 Slide- changing pages Should be an option to move between pages while the presentation is playing\the caption appearing
3.2.14 Slide's tooltips invisible Slide's tooltips invisible because the arror is hide them
3.2.14 Delete a slide - Are you sure message When a user deleting a slide, should be a message: "Are you sure?"
5.2.14 Slide- "Play presentation" button, should call "Full screen" It's not clear enough that this button is Full screen
5.2.14 Slide- Minimize button- should have tooltip It's not clear enough that this button is Minimize button
5.2.14 Picture Editing Its not clear enough that the small button in corner is the "Edit button", when clicking on the picture to
edit, its go back to the library
English as she is spoke.
Сегодня получил списог багов обнаруженый нашим КуЭй. Это только малая толика (всего их там около сотни).
wvxvw,
20 Мая 2014
-
+162
- 1
var errorIsShown = false; // если уже показана ошибка, то зачем опять показывать сообщение об ошибке (ведь если чего то не так.. то логично, что ошибки ещё будут...)
|Mesi
И еще больше замечательных комментариев: http://study.mesi.ru/_layouts/elrportal/assessment/JScript/Other.js
alyxbit,
19 Мая 2014
-
+156
- 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
$this->_html .= '<script type="text/javascript">id_language = ' . intval($this->defaultLanguage) . ';</script>';
if ($ObjAdvancedTopMenuClass)
$haveDepend = AdvancedTopMenuClass::menuHaveDepend($ObjAdvancedTopMenuClass->id);
$this->_html .= '<form action="' . $this->base_config_url . '" method="post" id="menuform_' . $this->name . '" name="menuform_' . $this->name . '" method="post" enctype="multipart/form-data" class="width3">
<div id="blocMenuForm">
' . ($ObjAdvancedTopMenuClass ? '<input type="hidden" name="id_menu" value="' . intval($ObjAdvancedTopMenuClass->id) . '" /><br /><a href="' . $this->base_config_url . '"><img src="../img/admin/arrow2.gif" />' . $this->l('Back') . '</a><br class="clear" /><br />' : '');
$this->_html .= '<label>' . $this->l('Tab type') . '</label>
<div class="margin-form"><select name="type" id="type_menu">
<option value="">' . $this->l('Choose') . '</option>
<option value="1" ' . ($ObjAdvancedTopMenuClass && $ObjAdvancedTopMenuClass->type == 1 ? 'selected="selected"' : '') . '>' . $this->l('CMS') . '</option>
<option value="2" ' . ($ObjAdvancedTopMenuClass && $ObjAdvancedTopMenuClass->type == 2 ? 'selected="selected"' : '') . '>' . $this->l('Link') . '</option>
<option value="3" ' . ($ObjAdvancedTopMenuClass && $ObjAdvancedTopMenuClass->type == 3 ? 'selected="selected"' : '') . '>' . $this->l('Category') . '</option>
<option value="4" ' . ($ObjAdvancedTopMenuClass && $ObjAdvancedTopMenuClass->type == 4 ? 'selected="selected"' : '') . '>' . $this->l('Manufacturer') . '</option>
<option value="5" ' . ($ObjAdvancedTopMenuClass && $ObjAdvancedTopMenuClass->type == 5 ? 'selected="selected"' : '') . '>' . $this->l('Supplier') . '</option>
<option value="6" ' . ($ObjAdvancedTopMenuClass && $ObjAdvancedTopMenuClass->type == 6 ? 'selected="selected"' : '') . '>' . $this->l('Search') . '</option>
<option value="7" ' . ($ObjAdvancedTopMenuClass && $ObjAdvancedTopMenuClass->type == 7 ? 'selected="selected"' : '') . '>' . $this->l('Only image or icon') . '</option>
</select></div>';
$this->_html .= '<script type="text/javascript">$("#type_menu").change(function() {showMenuType($(this),"menu");});</script>';
$this->_html .= '<label>' . $this->l('Menu link not clickable') . '</label>
<div class="margin-form">
<input type="checkbox" name="clickable" id="menu_clickable" value="1" ' . ($ObjAdvancedTopMenuClass && $ObjAdvancedTopMenuClass->link [$this->defaultLanguage] == '#' ? ' checked=checked' : '') . ' />
<small>' . $this->l('Add a # in the link field. Do not remove.') . '</small>
</div>';
$this->_html .= '<script type="text/javascript">$("#menu_clickable").click(function() {setUnclickable($(this));});</script>';
if ($ObjAdvancedTopMenuClass && in_array($ObjAdvancedTopMenuClass->type, $this->rebuildable_type)) {
$this->_html .= '<label>' . $this->l('Rebuild tree') . '</label>
<div class="margin-form"><label class="t" for="rebuild_on"><img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" /></label>
<input type="radio" name="rebuild" id="rebuild_on" value="1" />
<label class="t" for="rebuild_on"> ' . $this->l('Yes') . '</label>
<label class="t" for="rebuild_off"><img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" style="margin-left: 10px;" /></label>
<input type="radio" name="rebuild" id="rebuild_off" value="0" checked=checked />
<label class="t" for="rebuild_off"> ' . $this->l('No') . '</label><br />' . $this->l('Caution, this may change the appearance of your menu !') . '</div>';
}
А Smarty стоит рядышком и тихо плачет вместе с программистом.
Модуль для PrestaShop стоимостью 50 евро.
in8finity,
19 Мая 2014
-
+133
- 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
public void ExtIdGen()
{
try
{
Random rnd = new Random();
string uin = "";
for (int i = 0; i < 20; i++)
{
uin += rnd.Next(10).ToString();
}
this.ExtId = uin;
GetError("0");
}
catch
{
GetError("-6");
}
}
private void GetError(string error_code)
{
switch (error_code)
{
case "0":
this.LastErrorCode = 0;
this.LastErrorDescription = "Нет ошибок";
break;
// -1 .. -5
case "-6":
this.LastErrorCode = -6;
this.LastErrorDescription = "Ошибка при получении идентификатора запроса";
break;
}
}
LastErrorCode, LastErrorDescription, ExtId - public поля.
Там весь класс написан в таком стиле, с вызовами GetError, принимающими номер ошибки в виде строки, молчаливым catch-ем всех исключений и т.п.
yamamoto,
17 Мая 2014
-
+155
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
{php}
$this->_tpl_vars['image_set'] = array();
$this->_tpl_vars['json_string'] = "";
{/php}
{if $pcollection}
{foreach name=pcollection key=picture_id item=picture from=$pcollection}
{php}
array_push($this->_tpl_vars['image_set'], "{$this->_tpl_vars['urlprefix']}/thumb.php?file=" . str_replace("thumbs","original","media/pictures/{$this->_tpl_vars['album']->getPath()}/{$this->_tpl_vars['picture']->getPath()}")."&size=245x143");
{/php}
{/foreach}
{/if}
{php}
$this->_tpl_vars['json_string'] = json_encode($this->_tpl_vars['image_set']);
{/php}
{$json_string}
получение объекта в smarty, потом пара фокусов, и вуаля, выплевываем json строку
expert,
15 Мая 2014
-
+152
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
function code_generator(){
$chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
$code_name='';
for ($i=0;$i<5;$i++){
$code_name.=substr($chars, rand(1, strlen($chars))-1,1);
}
return $code_name;
}
function generate (){
$code_name=code_generator().'-'.code_generator().'-'.code_generator().'-'.code_generator().'-'.code_generator();
return $code_name;
}
Шедевральное решение задачи по генерированию ключа:)
PHPed,
09 Мая 2014
-
+156
- 1
- 2
- 3
- 4
- 5
- 6
function onFuncIsSome()
{
someFunc();
if( !state )
return;
}
я понимаю что после этого условия что-то когда то было, но выглядит прикольно )
Dart_Sergius,
06 Мая 2014
-
+151
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
if (!empty($_POST["favoriteColor"])) {
switch($_POST["favoriteColor"]) {
case "Lightred":
$strBackgroundColor = "#FFDAB9";
break;
case "Lightgreen":
$strBackgroundColor = "Lightgreen";
break;
case "Lightblue":
$strBackgroundColor = "Lightblue";
break;
case "Lightgray":
$strBackgroundColor = "Lightgray";
break;
default:
$strBackgroundColor = "Gray";
break;
}
} else {
$strBackgroundColor = "Gray";
}
arif,
05 Мая 2014
-
+126
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
private static void LoadSendMethodFromConfig()
{
if (!sendMethod.HasValue)
{
sendMethod = SendMethodTypes.Default;
try
{
// read SendKeys value from config file, not case sensitive
string value = System.Configuration.ConfigurationManager.AppSettings.Get("SendKeys");
if (string.IsNullOrEmpty(value))
return;
if (value.Equals("JournalHook", StringComparison.OrdinalIgnoreCase))
sendMethod = SendMethodTypes.JournalHook;
else if (value.Equals("SendInput", StringComparison.OrdinalIgnoreCase))
sendMethod = SendMethodTypes.SendInput;
}
catch { } // ignore any exceptions to keep existing SendKeys behavior
}
}
Сорцы дотнета. Игнорируем любые исключения. Возмущение компилятора отключаем атрибутом. Как мило!
Пруф: http://referencesource.microsoft.com/#System.Windows.Forms/ndp/fx/src/winforms/Managed/System/WinForms/SendKeys.cs#323f3884113aa0ae#references
Цимес ещё и в том, что раньше в коде не было строк:
if (string.IsNullOrEmpty(value))
return;
То есть NullReferenceException тоже глушилось.
ЗЫ: пришлось пароль вспоминать, чтобы запостить. А то лень было логиниться, из под геста изредка комментил.
koodeer,
28 Апреля 2014
-
+154
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
trait TPerson {
public $fname;
public $lname;
public $mname;
// ...
}
class BUser extends EMongoDocument {
public $first_name;
public $last_name;
public $middle_name;
// ...
}
class User extends BUser {
public $firstname;
public $lastname;
// ...
}
Попалось такое наследие на одном рабочем месте. Было два типа юзеров, каждый из них наследовал BUser, в одном из них были firstname и lastname, в другом не были. В монге документы юзера, у которого свои firstname и lastname были вида:
{
_id: ObjectId("..."),
...
first_name: '',
last_name: '',
middle_name: '',
fname: '',
lname: '',
mname: '',
firstname: '',
lastname: ''
}
LubarVV,
26 Апреля 2014