- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
/**
* return angle of otrezok near the center, with circle point as a second part of the otrezok
*
* @param center
* @param circlePoint
* @param len
* @return
*/
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+133
/**
* return angle of otrezok near the center, with circle point as a second part of the otrezok
*
* @param center
* @param circlePoint
* @param len
* @return
*/
+132
@font-face {
font-family: 'MyWebFont';
src: url('webfont.eot#') format('eot'),
url('webfont.woff') format('woff');
}
Если в «src» поместить больше одного формата шрифта, то IE не сможет загрузить его и сообщит об ошибке 404. Причина в том, что IE пытается использовать как адрес файла всё, что записано после первой открывающей скобки и до самой последней закрывающей скобки.
IE как всегда в своём стиле...
+158
function country_code_to_country( $code ){
$country = '';
if( $code == 'AF' ) $country = 'Afghanistan';
if( $code == 'AX' ) $country = 'Aland Islands';
if( $code == 'AL' ) $country = 'Albania';
if( $code == 'DZ' ) $country = 'Algeria';
if( $code == 'AS' ) $country = 'American Samoa';
if( $code == 'AD' ) $country = 'Andorra';
if( $code == 'AO' ) $country = 'Angola';
if( $code == 'AI' ) $country = 'Anguilla';
if( $code == 'AQ' ) $country = 'Antarctica';
if( $code == 'AG' ) $country = 'Antigua and Barbuda';
if( $code == 'AR' ) $country = 'Argentina';
if( $code == 'AM' ) $country = 'Armenia';
if( $code == 'AW' ) $country = 'Aruba';
if( $code == 'AU' ) $country = 'Australia';
if( $code == 'AT' ) $country = 'Austria';
if( $code == 'AZ' ) $country = 'Azerbaijan';
if( $code == 'BS' ) $country = 'Bahamas the';
if( $code == 'BH' ) $country = 'Bahrain';
if( $code == 'BD' ) $country = 'Bangladesh';
if( $code == 'BB' ) $country = 'Barbados';
if( $code == 'BY' ) $country = 'Belarus';
if( $code == 'BE' ) $country = 'Belgium';
if( $code == 'BZ' ) $country = 'Belize';
if( $code == 'BJ' ) $country = 'Benin';
if( $code == 'BM' ) $country = 'Bermuda';
if( $code == 'BT' ) $country = 'Bhutan';
if( $code == 'BO' ) $country = 'Bolivia';
if( $code == 'BA' ) $country = 'Bosnia and Herzegovina';
if( $code == 'BW' ) $country = 'Botswana';
if( $code == 'BV' ) $country = 'Bouvet Island (Bouvetoya)';
if( $code == 'BR' ) $country = 'Brazil';
if( $code == 'IO' ) $country = 'British Indian Ocean Territory (Chagos Archipelago)';
if( $code == 'VG' ) $country = 'British Virgin Islands';
if( $code == 'BN' ) $country = 'Brunei Darussalam';
if( $code == 'BG' ) $country = 'Bulgaria';
if( $code == 'BF' ) $country = 'Burkina Faso';
if( $code == 'BI' ) $country = 'Burundi';
if( $code == 'KH' ) $country = 'Cambodia';
if( $code == 'CM' ) $country = 'Cameroon';
if( $code == 'CA' ) $country = 'Canada';
if( $code == 'CV' ) $country = 'Cape Verde';
if( $code == 'KY' ) $country = 'Cayman Islands';
if( $code == 'CF' ) $country = 'Central African Republic';
if( $code == 'TD' ) $country = 'Chad';
if( $code == 'CL' ) $country = 'Chile';
if( $code == 'CN' ) $country = 'China';
if( $code == 'CX' ) $country = 'Christmas Island';
if( $code == 'CC' ) $country = 'Cocos (Keeling) Islands';
if( $code == 'CO' ) $country = 'Colombia';
if( $code == 'KM' ) $country = 'Comoros the';
if( $code == 'CD' ) $country = 'Congo';
if( $code == 'CG' ) $country = 'Congo the';
if( $code == 'CK' ) $country = 'Cook Islands';
if( $code == 'CR' ) $country = 'Costa Rica';
if( $code == 'CI' ) $country = 'Cote d\'Ivoire';
if( $code == 'HR' ) $country = 'Croatia';
if( $code == 'CU' ) $country = 'Cuba';
if( $code == 'CY' ) $country = 'Cyprus';
if( $code == 'CZ' ) $country = 'Czech Republic';
if( $code == 'DK' ) $country = 'Denmark';
if( $code == 'DJ' ) $country = 'Djibouti';
if( $code == 'DM' ) $country = 'Dominica';
if( $code == 'DO' ) $country = 'Dominican Republic';
if( $code == 'EC' ) $country = 'Ecuador';
if( $code == 'EG' ) $country = 'Egypt';
if( $code == 'SV' ) $country = 'El Salvador';
if( $code == 'GQ' ) $country = 'Equatorial Guinea';
if( $code == 'ER' ) $country = 'Eritrea';
if( $code == 'EE' ) $country = 'Estonia';
if( $code == 'ET' ) $country = 'Ethiopia';
if( $code == 'FO' ) $country = 'Faroe Islands';
if( $code == 'FK' ) $country = 'Falkland Islands (Malvinas)';
if( $code == 'FJ' ) $country = 'Fiji the Fiji Islands';
if( $code == 'FI' ) $country = 'Finland';
if( $code == 'FR' ) $country = 'France, French Republic';
if( $code == 'GF' ) $country = 'French Guiana';
if( $code == 'PF' ) $country = 'French Polynesia';
----------------------------------------------------------------
if( $code == 'VE' ) $country = 'Venezuela';
if( $code == 'VN' ) $country = 'Vietnam';
if( $code == 'WF' ) $country = 'Wallis and Futuna';
if( $code == 'EH' ) $country = 'Western Sahara';
if( $code == 'YE' ) $country = 'Yemen';
if( $code == 'ZM' ) $country = 'Zambia';
if( $code == 'ZW' ) $country = 'Zimbabwe';
if( $country == '') $country = $code;
return $country;
}
Кто-то очень много старался
+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. Функция проверяет значение переменных в текущей точке пути моба.
Мы перебираем все точки пути и сравниваем с текущей точкой моба, но это не нужно, так как именно текущая точка в функцию и передаётся!