- 1
- 2
- 3
...
$ORDER_ID = urldecode(urldecode($_REQUEST["ORDER_ID"]));
...
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+159
...
$ORDER_ID = urldecode(urldecode($_REQUEST["ORDER_ID"]));
...
битрикс :)
−134
private function onButtonModeClick(e:MouseEvent):void
{
if (_mode == 0)
{
myButtonMode.setTxtLabel("дизайнеры");
_mode++;
}
else if (_mode == 1)
{
myButtonMode.setTxtLabel("стажеры");
_mode++;
}
else if (_mode == 2)
{
myButtonMode.setTxtLabel("программисты");
_mode = 0;
}
}
−91
var l:uint = 0;
var product:Vector.<IProduct> = new Vector.<IProduct>;
if (programmers.length > designers.length)
{
l = designers.length;
}
else if (programmers.length < designers.length)
{
l = programmers.length;
}
else
{
l = programmers.length;
}
+62
struct ErrorCodes
{
#define ERROR_ISNT_TEMPLATE_FILE -1
#define ERROR_ISNT_VALID_TEMPLATE_FILE -2
};
+209
http://tinypic.com/r/30afj3o/8
первоапрельская монетизация уютненького?
+49
(*items)[item] += 1;
указатель на map + operator[]
такое
+78
public void initializeMap() {
for(Point p: getPoints()) {
{
Address address = p.getAddress();
LatLng position = new LatLng(address.getLatitude(), address.getLongitude());
//...
} // (2)
for (Item item : items) {
Address address = item.getAddress();
LatLng position = new LatLng(address.getLatitude(), address.getLongitude());
//...
}
}
}
автору лень придумывать вменяемые имена переменных, для кода ниже. по сему, он просто оборачивает верний код в новый блок и вуаля - можно реюзать те самые имена.
не совсем уверен говнокод ли это, но как минимум это - глупо.
+157
foreach($arDataToCsv[$i] as $key => $value)
{
if ($key == 'birth_date' && $value != 'Логин' && $value != '0000-00-00')
{
$date = new DateTime($value);
$value = $date->format('d.m.Y');
}
if ($key == 'birth_date' && $value != 'Логин' && $value == '0000-00-00')
$value = '01.01.0001';
if ($key == 'firstname' && $value == '')
$value = 'Undefined';
if ($key == 'lastname' && $value == '')
$value = 'Undefined';
$arDataToCsv[$i][$key] = iconv(mb_detect_encoding($value), "CP1251", $value);
}
Чувак обрабатывает данные перед записью в csv.
+159
var existingDates=new Array();
existingDates[11]=new Array();
existingDates[11][3]=[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28];
existingDates[11][4]=[3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,28,29,30,31];
existingDates[11][5]=[1,2,4,5,6,7,8,9,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30];
existingDates[11][6]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
existingDates[11][7]=[1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
existingDates[11][8]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30];
existingDates[11][9]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
existingDates[11][10]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30];
existingDates[11][11]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
/*... */
existingDates[24][1]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28];
existingDates[24][2]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
existingDates[24][3]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30];
existingDates[24][4]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
existingDates[24][5]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30];
existingDates[24][6]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
existingDates[24][7]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
existingDates[24][8]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30];
existingDates[24][9]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
existingDates[24][10]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30];
existingDates[24][11]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
existingDates[25]=new Array();
existingDates[25][0]=[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
existingDates[25][1]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28];
existingDates[25][2]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
existingDates[25][3]=[1];
/* ... */
Src: http://www.kommersant.ru/archive/news/77/2015-04-01
+139
...
// GRAY SCALE:
#define ER_COLOR_BLACK_DEEP3 ccc3(0, 0, 0)
#define ER_COLOR_BLACK_DEEP4 ccc4(0, 0, 0, 255)
#define ER_COLOR_BLACK3 ccc3(38, 38, 38)
#define ER_COLOR_BLACK4 ccc4(38, 38, 38, 255)
#define ER_COLOR_SIDEMENU_SELECTED3 ccc3(47, 47, 47)
#define ER_COLOR_LETTER_VIEW3 ccc3(51, 51, 51)
#define ER_COLOR_SIDEBAR_BG3 ccc3(58, 58, 58)
#define ER_COLOR_SIDEBAR_BG4 ccc4(58, 58, 58, 255)
#define ER_COLOR_BAR_BG_GRAY3 ccc3(82, 82, 82)
#define ER_COLOR_AUTHOR_NAME3 ccc3(103, 103, 103)
#define ER_COLOR_SIDE_WIDGET3 ccc3(255, 255, 255)
#define ER_COLOR_SIDE_WIDGET4 ccc4(255, 255, 255, 255)
#define ER_COLOR_GRAY_TUT3 ccc3(115, 115, 115)
#define ER_COLOR_GRAY3 ccc3(130, 130, 130)
#define ER_COLOR_PULL_LABEL3 ccc3(142, 142, 142)
#define ER_COLOR_SEND_BG4 ccc4(158, 158, 158, 255)
#define ER_COLOR_SEND_BG3 ccc3(158, 158, 158)
#define ER_COLOR_BADGE_GRAY3 ccc3(149, 149, 149)
#define ER_COLOR_BADGE_GRAY4 ccc4(149, 149, 149, 255)
#define ER_COLOR_SEPARATOR3 ccc3(195, 195, 195)
#define ER_COLOR_LABELS_GRAY3 ccc3(170, 170, 170)
#define ER_COLOR_AUTHOR_CAPTION3 ccc3(173, 173, 173)
#define ER_COLOR_SAFE_EXIT_BG4 ccc4(189, 189, 189, 255)
#define ER_COLOR_SAFE_EXIT_BG3 ccc3(189, 189, 189)
#define ER_COLOR_MENU_GRAY_ONE3 ccc3(204, 204, 204)
#define ER_COLOR_PUSHED_ELEMENT3 ccc3(205, 205, 205)
#define ER_COLOR_GRAY_208_3 ccc3(208, 208, 208)
#define ER_COLOR_GRAY_208_4 ccc4(208, 208, 208, 255)
#define ER_COLOR_MENU_GRAY_TWO3 ccc3(216, 216, 216)
#define ER_COLOR_NEW_GAME_BACK3 ccc3(216, 216, 216)
#define ER_COLOR_NEW_GAME_BACK4 ccc4(216, 216, 216, 255)
#define ER_COLOR_WHITE_222_3 ccc3(222, 222, 222)
#define ER_COLOR_WHITE_232_3 ccc3(232, 232, 232)
#define ER_COLOR_WHITE_MY_PLATE3 ccc3(243, 243, 243)
#define ER_COLOR_WHITE_INTRO4 ccc4(232, 232, 232, 255)
#define ER_COLOR_WHITE3 ccc3(255, 255, 255)
#define ER_COLOR_WHITE4 ccc4(255, 255, 255, 255)
50 оттенков серого в нашем приложении.