- 1
(ð“¹ð“»ð“²ð“·ð“½ "ð“—ð“®ð“µð“µð“¸, ð“¦ð“¸ð“»ð“µð“!")
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+140
(ð“¹ð“»ð“²ð“·ð“½ "ð“—ð“®ð“µð“µð“¸, ð“¦ð“¸ð“»ð“µð“!")
В продолжение темы юникода. К сожалению, крестокомпилятор не захотел кушать эти символы, а в других языках нет препроцессора. Поэтому пришлось на лиспе.
http://ideone.com/14yidz
−165
our @hilight_critical_files = ( 'celebrities.txt', 'obscene.txt', 'lekarstva.txt' );
Глобальная переменная, неверно написанное английское слово, захардкоженные значения, транслит, транслит вперемешку с английскими словами<s>, и вообще perl</s>.
И всё это в одной короткой строке.
+83
TextView v = (TextView)
((RelativeLayout)
((AbsoluteLayout)
((LinearLayout)
((RelativeLayout)(
(LinearLayout)activty.findViewById(R.id.container)).getChildAt(1))
.getChildAt(0))
.getChildAt(element))
.getChildAt(0))
.getChildAt(0);
(Android)
когда нет idшников...
−405
float scaleFactor = param1/172;
if (scaleFactor < -1)
{
scaleFactor = -1;
}
_releaseTheKraken.transform = CGAffineTransformMakeScale(-scaleFactor,-scaleFactor);
float krakenPosition = param1/2.4571;
if (param1<-172)
{
krakenPosition = -70 + 172 + param1;
_activityIndicator.center = CGPointMake(25, param1+15);
}
_releaseTheKraken.center = CGPointMake(147.5, krakenPosition);
if (param1<-100)
{
float param2 = (-param1 - 100)/7.5;
int param3 = floor(param2);
if (param3<10)
{...
+136
DIR_STRUCT * fill_dir_struct(DIR_STRUCT * dir_stc, _ptr_by_val_(char *) base_dir_path, _ptr_by_val_(char *) offset_dir)
{
DIR_STRUCT * sub_dir;
DIR * srcdir;
struct stat st;
char full_sub_dir_path[MAX_PATH_SIZE];
struct dirent * dent;
sprintf(full_sub_dir_path, "%s/%s", base_dir_path, offset_dir);
dbgprintln("Directory %s", full_sub_dir_path);
if(NULL != (dir_stc = malloc(sizeof(DIR_STRUCT))))
{
memset(dir_stc, 0x00, sizeof(DIR_STRUCT));
if (NULL != (srcdir = opendir(full_sub_dir_path)))
{
if(NULL != (dir_stc->dir_path = malloc(strlen(offset_dir) + 1)))
{
strcpy(dir_stc->dir_path, offset_dir);
for( ;(NULL != (dent = readdir(srcdir))); )
{
if((0 != strcmp(dent->d_name, ".")) &&
(0 != strcmp(dent->d_name, "..")) &&
(0 <= fstatat(dirfd(srcdir), dent->d_name, &st, 0)))
{
if (S_ISDIR(st.st_mode)) //Directory
{
if(NULL != (sub_dir = fill_dir_struct(sub_dir, full_sub_dir_path, dent->d_name)))
{
dir_stc->sub_dirs = list_append_node(dir_stc->sub_dirs, sub_dir);
dir_stc->dir_files_size += sub_dir->dir_files_size;
dir_stc->sub_dir_files_count += sub_dir->sub_dir_files_count;
}
else
{
dir_stc = destroy_dir_struct(dir_stc);
break;
}
}
else //File
{
dbgprintln("File %s, size %lu bytes", dent->d_name, st.st_size);
dir_stc->dir_files = list_append_node(dir_stc->dir_files, allocate_and_copy_char_buffer(dent->d_name, strlen(dent->d_name) + 1));
dir_stc->dir_files_size += st.st_size;
dir_stc->sub_dir_files_count++;
}
}
}//End of for(;NULL != (dent = readdir(srcdir)); )
closedir(srcdir);
}
else//End of if(NULL != (dir_stc->dir_path = malloc(strlen(offset_dir) + 1)))
{
dir_stc = destroy_dir_struct(dir_stc);
}
}//End of if (NULL != (srcdir = opendir(full_sub_dir_path)))
else
{
dir_stc = destroy_dir_struct(dir_stc);
}
}//End of if(NULL != (dir_stc = malloc(sizeof(DIR_STRUCT))))
return dir_stc;
}
Восьмикратный индент, Йода нотейшн, const *(x) const в аргументах. Есть подозрение, что велосипедисты не знали о scandir.
Это кладезь говна.
+138
if ((NULL != (string_array = (0 == *length) ? malloc((*length + 1) * REG_SIZE) : realloc(string_array, (*length + 1) * REG_SIZE))))
А кому-то это говно меинтейнить надо будет...
−93
function SAEController:GetPointVariableValue(WayNet,CurPoint)
local waypointVars = {};
for i = 0, WayNet:GetPointsCount() - 1 do
local Link = WayNet:GetPoint(i);
local PlaySound1 = Link:GetVariableValue("PlaySound1");
local PlaySound2 = Link:GetVariableValue("PlaySound2");
local PlaySound3 = Link:GetVariableValue("PlaySound3");
local Effect1 = Link:GetVariableValue("Effect1");
local Effect2 = Link:GetVariableValue("Effect2");
local Effect3 = Link:GetVariableValue("Effect3");
if PlaySound1 and CurPoint == Link then
waypointVars.PlaySound1 = PlaySound1;
end;
if PlaySound2 and CurPoint == Link then
waypointVars.PlaySound2 = PlaySound2;
end;
if PlaySound3 and CurPoint == Link then
waypointVars.PlaySound3 = PlaySound3;
end;
if Effect1 and CurPoint == Link then
waypointVars.Effect1 = Effect1;
end;
if Effect2 and CurPoint == Link then
waypointVars.Effect2 = Effect2;
end;
if Effect3 and CurPoint == Link then
waypointVars.Effect3 = Effect3;
end;
end;
return waypointVars;
end;
Кусок игровой логики на Lua. Функция проверяет значение переменных в текущей точке пути моба.
Мы перебираем все точки пути и сравниваем с текущей точкой моба, но это не нужно, так как именно текущая точка в функцию и передаётся!
−120
CREATE TABLE `numbers` (
`number` BIGINT(20) DEFAULT NULL
) ENGINE=InnoDB;
CREATE TABLE `numbers_small` (
`number` INT(11) DEFAULT NULL
) ENGINE=InnoDB;
-- numbers
INSERT INTO `numbers` (`number`) VALUES('0');
INSERT INTO `numbers` (`number`) VALUES('1000');
INSERT INTO `numbers` (`number`) VALUES('2000');
INSERT INTO `numbers` (`number`) VALUES('3000');
INSERT INTO `numbers` (`number`) VALUES('4000');
INSERT INTO `numbers` (`number`) VALUES('5000');
-- 10 000 lines of inserting numbers into table numbers
-- ...
INSERT INTO `numbers` (`number`) VALUES('5999');
INSERT INTO `numbers` (`number`) VALUES('6999');
INSERT INTO `numbers` (`number`) VALUES('7999');
INSERT INTO `numbers` (`number`) VALUES('8999');
INSERT INTO `numbers` (`number`) VALUES('9999');
-- numbers small
INSERT INTO `numbers_small` (`number`) VALUES('0');
INSERT INTO `numbers_small` (`number`) VALUES('1');
INSERT INTO `numbers_small` (`number`) VALUES('2');
INSERT INTO `numbers_small` (`number`) VALUES('3');
INSERT INTO `numbers_small` (`number`) VALUES('4');
INSERT INTO `numbers_small` (`number`) VALUES('5');
INSERT INTO `numbers_small` (`number`) VALUES('6');
INSERT INTO `numbers_small` (`number`) VALUES('7');
INSERT INTO `numbers_small` (`number`) VALUES('8');
INSERT INTO `numbers_small` (`number`) VALUES('9');
Сделали нам программу на java. Прислали скрипт для обновления базы данных DatabaseUpdateScript.sql на 874 KB.
+58
#include "internationalization.h"
namespace internationalization
{
QString numToString(int num, CASE padezh)
{
switch ( padezh )
{
case NOMINATIVE:
switch ( num )
{
case 0: return "ноль";
case 1: return "один";
case 2: return "два";
case 3: return "три";
case 4: return "четыре";
case 5: return "пять";
case 6: return "шесть";
case 7: return "семь";
case 8: return "восемь";
case 9: return "девять";
case 10: return "десять";
case 11: return "одиннадцать";
case 12: return "двенадцать";
case 13: return "тринадцать";
case 14: return "четырнадцать";
case 15: return "пятнадцать";
case 16: return "шестнадцать";
case 17: return "семьнадцать";
case 18: return "восемьнадцать";
case 19: return "девятнадцать";
case 20: return "двадцать";
case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: return numToString( num / 10 * 10 ) + " " + numToString( num % 10 );
case 30: return "традцать";
case 31: case 32: case 33: case 34: case 35: case 36: case 37: case 38: case 39: return numToString( num / 10 * 10 ) + " " + numToString( num % 10 );
case 40: return "сорок";
case 41: case 42: case 43: case 44: case 45: case 46: case 47: case 48: case 49: return numToString( num / 10 * 10 ) + " " + numToString( num % 10 );
case 50: return "пятьдесят";
case 51: case 52: case 53: case 54: case 55: case 56: case 57: case 58: case 59: return numToString( num / 10 * 10 ) + " " + numToString( num % 10 );
case 60: return "шестьдесят";
case 61: case 62: case 63: case 64: case 65: case 66: case 67: case 68: case 69: return numToString( num / 10 * 10 ) + " " + numToString( num % 10 );
case 70: return "семьдесят";
case 71: case 72: case 73: case 74: case 75: case 76: case 77: case 78: case 79: return numToString( num / 10 * 10 ) + " " + numToString( num % 10 );
case 80: return "восемьдесят";
case 81: case 82: case 83: case 84: case 85: case 86: case 87: case 88: case 89: return numToString( num / 10 * 10 ) + " " + numToString( num % 10 );
case 90: return "девяносто";
case 91: case 92: case 93: case 94: case 95: case 96: case 97: case 98: case 99: return numToString( num / 10 * 10 ) + " " + numToString( num % 10 );
case 100: return "сто";
case 101: case 102: case 103: case 104: case 105: case 106: case 107: case 108: case 109: return numToString( (num / 100 % 10 ) * 100 ) + " " + numToString( num % 10 );
case 110: case 111: case 112: case 113: case 114: case 115: case 116: case 117: case 118: case 119: case 120: case 121: case 122: case 123: case 124: case 125: case 126: case 127: case 128: case 129: case 130: case 131: case 132: case 133: case 134: case 135: case 136: case 137: case 138: case 139: case 140: case 141: case 142: case 143: case 144: case 145: case 146: case 147: case 148: case 149: case 150: case 151: case 152: case 153: case 154: case 155: case 156: case 157: case 158: case 159: case 160: case 161: case 162: case 163: case 164: case 165: case 166: case 167: case 168: case 169: case 170: case 171: case 172: case 173: case 174: case 175: case 176: case 177: case 178: case 179: case 180: case 181: case 182: case 183: case 184: case 185: case 186: case 187: case 188: case 189: case 190: case 191: case 192: case 193: case 194: case 195: case 196: case 197: case 198: case 199: return numToString( (num / 100 % 10 ) * 100 ) + " " + numToString( (num / 10 % 10 ) * 10 ) + " " + numToString( num % 10 );
Такой код мне встретился в моем старом проекте... Мне кажется, или из меня вышел бы неплохой программист в Китае или Индии?
И там не конец, весь файл сего перла здесь: http://pastebin.com/tpAd95fd
+66
if(version.StartsWith("Windows 9")) { /* 95 and 98 */ } else {
по слухам, именно из-за этого говна следующая windows будет 10ой
https://issues.jenkins-ci.org/secure/attachment/18777/PlatformDetailsTask.java