- 1
public static final String TimeoutInMilliseconds = "timeoutInSeconds";
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+78
public static final String TimeoutInMilliseconds = "timeoutInSeconds";
Нашел в константах нашего проекта. Существовало и ежедневно использовалось в течение 8 месяцев. Глянул историю - создано и редактировалось только мной. Фейспалм.
+127
// Step 2
inline CreateCharacterDialogStep2(playerid, dialogid, response, listitem, string:inputtext[]) {
#pragma unused dialogid, listitem, inputtext
if(!response) return CreateCharacter(playerid);
if(strlen(inputtext) < MIN_PLAYER_CHARACTER_NAME || strlen(inputtext) > MAX_PLAYER_NAME) return CreateCharacter(playerid);
- if(!IsRolePlayNickname(inputtext)) return CreateCharacter(playerid);
- SetPVarString(playerid, "name", inputtext);
+ if(!IsRolePlayNickname(str_replace(" ", "_", inputtext))) return CreateCharacter(playerid);
+ SetPVarString(playerid, "name", str_replace(" ", "_", inputtext));
format(title, sizeof(title), "Character creating - Step 3: Sex");
format(content, sizeof(content), "\
Skip\r\n\%s\r\n\%s\
", Group_GetName(gMale), Group_GetName(gFemale));
Dialog_ShowCallback(playerid, using inline CreateCharacterDialogStep3, DIALOG_STYLE_LIST, title, content, "Next", "Back");
return false;
}
Отличное изменение.
+80
public class CookieHelper {
public static Cookie getCookie(String name, Http.Request request) {
Cookie cookie = null;
if (request.cookies != null) {
for (Entry<String, Cookie> entry : request.cookies.entrySet()) {
if (name.equals(entry.getKey())){
cookie = entry.getValue();
}
}
}
return cookie;
}
}
request.cookies - это конечно же Map<String, Cookie>
+156
if (count($vCard) == 1) {
print_r($vCard -> n);
print_r($vCard -> tel);
} else {
foreach ($vCard as $vCardPart)
{
print_r($vCardPart -> n);
print_r($vCardPart -> tel);
}
}
https://github.com/nuovo/vCard-parser
Ну за каким хуем обрабатывать один элемент как отдельный случай?!
−166
CREATE OR REPLACE FUNCTION "GET_SOTR_FULL_NAME" (sotr_id in number)
RETURN varchar2 IS
cursor surname (sotr_id number)
is
select fc_fam from tsotr
where tsotr.fk_id=sotr_id;
cursor name (sotr_id number)
is
select fc_name from tsotr
where tsotr.fk_id=sotr_id;
cursor patronym (sotr_id number)
is
select fc_otch from tsotr
where tsotr.fk_id=sotr_id;
fio varchar2(90);
fam varchar2(30);
im varchar2(30);
otch varchar2(30);
BEGIN
open surname (sotr_id);
fetch surname into fam;
close surname;
open name (sotr_id);
fetch name into im;
close name;
open patronym (sotr_id);
fetch patronym into otch;
close patronym;
fio:=fam||' '||im||' '||otch;
return fio;
END;
По ИД сотрудника получаем его ФИО
+152
if( $options[ 'header_show' ] != 'disable-both' && $options[ 'header_show' ] == 'header-text' ) {
?>
...
<?php
}
elseif( $options[ 'header_show' ] != 'disable-both' && $options[ 'header_show' ] == 'header-logo' ) {
Одна там блестящая тема для вордпресса.
+143
return string.Format(templateStr, "",
_p1_Tb.Text,
_p2_Tb1.Text + ", " + _p2_Tb2.Text,
_p3_Tb.Text,
"",//_p4_Tb.Text,
_p5_Tb1.Text + " / " + _p5_Tb2.Text,
_p6_Tb.Text,
RblTxt(_p7_Rbl) + " " + _p7_Tb.Text,
b("Построен в ") + _p8_Tb1.Text + " году, в " + _p8_Tb2.Text + " году произведен "
+ _p8_Tb3.Text + " ремонт. " + _p8_Tb4.Text + ", Количество корпусов " + _p8_Tb4.Text + ", Количество этажей в каждом корпусе " + _p8_Tb5.Text
+ (_p8_Ch1.Checked ? (", " + _p8_Ch1.Text) : "")
+ (_p8_Ch2.Checked ? (", " + _p8_Ch2.Text) : "")
+ (_p8_Ch3.Checked ? (", " + _p8_Ch3.Text) : "") ,
FillTbl9() ,
b("Уровень средства размещения: ") + _p10_Tb.Text,
b("Объект находится рядом с ") + _p11_Tb.Text,
"принимаются с " + _p12_Tb1.Text + " лет, " + _p12_Tb2.Text,
_p13_Tb.Text,
b("Период работы: ") + (_p14_Rb1.Checked ? ("С " + _p14_Tb1.Text + " По " + _p14_Tb2.Text) : "Круглогодично"),
"к " + _p15_Tb1.Text + " до " + _p15_Tb2.Text,
_p16_Tb.Text
+ (_p16_Ch1.Checked ? ("<br/> От аэропорта " + _p16_Tb1.Text + " автобусом № " + _p16_Tb2.Text + " до остановки" + _p16_Tb3.Text) : "")
+ (_p16_Ch2.Checked ? ("<br/> От жд вокзала " + _p16_Tb4.Text + " автобусом № " + _p16_Tb5.Text + " до остановки" + _p16_Tb6.Text) : "")
+ (_p16_Ch3.Checked ? ("<br/> Другое " + _p16_Tb7.Text) : "")
,
b("Типы номеров: ") + _p17_Tb.Text,
b("В номере: ")
((_p23_Ch1.Checked ? (" " + _p23_Ch1.Text + ",") : "")
+ (_p23_Ch2.Checked ? (" " + _p23_Ch2.Text + ",") : "")
+ (_p23_Ch3.Checked ? (" " + _p23_Ch3.Text + ",") : "")
+ (_p23_Ch4.Checked ? (" " + _p23_Ch4.Text + ",") : "")
+ (_p23_Ch5.Checked ? (" " + _p23_Ch5.Text + ",") : "")
+ (_p23_Ch6.Checked ? (" " + _p23_Ch6.Text + ",") : "")
+ (_p23_Ch7.Checked ? (" " + _p23_Ch7.Text + ",") : "")
+ (_p23_Ch8.Checked ? (" " + _p23_Ch8.Text + ",") : "")
+ (_p23_Ch9.Checked ? (" " + _p23_Ch9.Text + ",") : "")
+ (_p23_Ch10.Checked ? (" " + _p23_Ch10.Text + ",") : "")
+ (_p23_Ch11.Checked ? (" " + _p23_Ch11.Text + ",") : "")
+ (_p23_Ch12.Checked ? (" " + _p23_Ch12.Text + ",") : "")
+ (_p23_Ch13.Checked ? (" " + _p23_Ch13.Text + ",") : "")
+ (_p23_Ch14.Checked ? (" " + _p23_Ch14.Text + ",") : "")
+ (_p23_Ch15.Checked ? (" " + _p23_Ch15.Text + ",") : "")
+ (_p23_Ch16.Checked ? (" " + _p23_Ch16.Text + ",") : "")
+ (_p23_Ch17.Checked ? (" " + _p23_Ch17.Text + ",") : "")
+ (_p23_Ch18.Checked ? (" " + _p23_Ch18.Text + ",") : "")
+ (_p23_Ch19.Checked ? (" " + _p23_Ch19.Text + ",") : "")
+ (_p23_Ch20.Checked ? (" " + _p23_Ch20.Text + ",") : "")
+ (_p23_Ch21.Checked ? (" " + _p23_Ch21.Text + ",") : "")
+ (_p23_Ch22.Checked ? (" " + _p23_Ch22.Text + ",") : "")
+ (_p23_Ch23.Checked ? (" " + _p23_Ch23.Text + ",") : "")
+ (_p23_Ch24.Checked ? (" " + _p23_Ch24.Text + ",") : "")
+ (_p23_Ch25.Checked ? (" " + _p23_Ch25.Text + ",") : "")
+ (_p23_Ch26.Checked ? (" " + _p23_Ch26.Text + ",") : "")
+ (_p23_Ch27.Checked ? (" " + _p23_Ch27.Text + ",") : "")
+ (_p23_Ch28.Checked ? (" " + _p23_Ch28.Text + ",") : "")
+ (_p23_Ch29.Checked ? (" " + _p23_Ch29.Text + ",") : "")
+ (_p23_Ch20.Checked ? (" " + _p23_Ch30.Text + ",") : "")
+ (_p23_Ch31.Checked ? (" " + _p23_Ch31.Text + ",") : "")
+ (_p23_Ch32.Checked ? (" " + _p23_Ch32.Text + ",") : "")
+ (_p23_Ch33.Checked ? (" " + _p23_Tb.Text) : "")).TrimEnd(new char[] { ' ', ',' }),
((_p24_Ch1.Checked ? (" " + _p24_Ch1.Text + ",") : "")
+ (_p24_Ch2.Checked ? (" " + _p24_Ch2.Text + ",") : "")
+ (_p24_Ch3.Checked ? (" " + _p24_Tb.Text) : "")).TrimEnd(new char[] { ' ', ',' }),
FillTbl25(),
RblTxt(_p26_Rbl1) + " " + _p26_Tb.Text + ". " + RblTxt(_p26_Rbl2),
((_p27_Ch1.Checked ? (" " + _p27_Ch1.Text + ",") : "")
+ (_p27_Ch2.Checked ? (" " + _p27_Ch2.Text + ",") : "")
+ (_p27_Ch3.Checked ? (" " + _p27_Ch3.Text + ",") : "")
+ (_p27_Ch4.Checked ? (" " + _p27_Ch4.Text + ",") : "")
+ (_p27_Ch5.Checked ? (" " + _p27_Ch5.Text + ",") : "")
+ (_p27_Ch6.Checked ? (" " + _p27_Ch6.Text + ",") : "")
+ (_p27_Ch7.Checked ? (" " + _p27_Tb.Text) : "")).TrimEnd(new char[] { ' ', ',' }),
_p28_Tb.Text,
b("Минимальная продолжительность заезда ") + _p29_Tb.Text + " дней",
"от " + _p30_Tb1.Text + " до " + _p30_Tb2.Text + " лет " + _p30_Tb3.Text,
((_p31_Ch1.Checked ? (" " + _p31_Ch1.Text + " " + _p31_Tb1.Text) : "")
+ "<br/>" + (_p31_Ch2.Checked ? (" " + _p31_Ch2.Text + " " + _p31_Tb2.Text) : "")
+ "<br/>" + (_p31_Ch3.Checked ? (" " + _p31_Ch3.Text + " " + _p31_Tb3.Text) : "")
Бэкенды крупнейшего российского туроператора. На отдел разработки уходит 1500000 рб/мес.
+138
foreach (var table in group_tables)
{
foreach (var line in table.lines)
{
for (int i = 0; i < group_tables.Count; i++)
{
for (int j = 0; j < group_tables[i].lines.Count; j++)
{
if (line.stream == group_tables[i].lines[j].stream && line.discipline_name == group_tables[i].lines[j].discipline_name &&
line.discipline_type == group_tables[i].lines[j].discipline_type)
{
group_tables[i].lines[j].teacher_name = line.teacher_name;
group_tables[i].lines[j].time = line.time;
group_tables[i].lines[j].auditory_number = line.auditory_number;
group_tables[i].lines[j].day_index = line.day_index;
}
}
}
}
}
Не знаю на сколько это говнокод, но вот прям чую что именно он.
−100
#Было
def extract_brand(x):
x = x[0].lower()
for brand in brands:
if x.count(brand):
return brand
il.brand_out = extract_brand
#Стало после кодревью
il.brand_in = lambda x: [brand for brand in brands if brand.lower() in x[0].lower()]
Кто то смог прочитать второй вариант?
+145
Ошибка сервера в приложении '/'. Выполнение этой команды требует открытого доступного соединения. Текущее состояние соединения: разорвано. Описание: Необработанное исключение при выполнении текущего веб-запроса. Изучите трассировку стека для получения дополнительных сведений о данной ошибке и о вызвавшем ее фрагменте кода. Сведения об исключении: System.InvalidOperationException: Выполнение этой команды требует открытого доступного соединения. Текущее состояние соединения: разорвано. Ошибка источника: Необработанное исключение при выполнении текущего веб-запроса. Информацию о происхождении и месте возникновения исключения можно получить, используя следующую трассировку стека исключений. Трассировка стека: [InvalidOperationException: Выполнение этой команды требует открытого доступного соединения. Текущее состояние соединения: разорвано.] System.Data.Objects.ObjectContext. EnsureConnection() +11438147 System.Data.Objects.ObjectContext. CreateFunctionObjectResult (EntityCommand entityCommand, ReadOnlyMetadataCollection`1 entitySets, EdmType[] edmTypes, MergeOption mergeOption) +133 System.Data.Objects.ObjectContext. ExecuteFunction(String functionName, MergeOption mergeOption, ObjectParameter[] parameters) +411 System.Data.Objects.ObjectContext. ExecuteFunction(String functionName, ObjectParameter[] parameters) +78 Dmir.ContentCommon.Entities. ContentCommonDb.ContentGet (Nullable`1 contentID, Nullable`1 isModerator) in D:\Projects \DmirCollection\CommonObject \Dmir.ContentCommon \Dmir.ContentCommon\Entities \Model1.cs:745 Dmir.ContentCommon.Entities. ContentCommonRepository. ContentGet(Guid contentID, Boolean isModerator) in D:\Projects \DmirCollection\CommonObject \Dmir.ContentCommon \Dmir.ContentCommon\Entities \ContentCommonRepository.cs:30 Dmir.ContentCommon.Services. ContentCommonService.ContentGet (Guid contentID, Boolean isModerator) in D:\Projects\DmirCollection \CommonObject \Dmir.ContentCommon \Dmir.ContentCommon\Services \ContentCommonService.cs:142 Dmir.Realty.Content.MvcApp. Controllers.ContentHelperController. View(Guid contentViewID, Int32 page, Boolean isModerator) in D: \Projects\DmirCollection\WebSite \Dmir.Realty.Content \Dmir.Realty.Content.MvcApp \Controllers \ContentHelperController.cs:211 lambda_method(Closure , ControllerBase , Object[] ) +252 System.Web.Mvc. ReflectedActionDescriptor.Execute (ControllerContext controllerContext, IDictionary`2 parameters) +261 System.Web.Mvc. ControllerActionInvoker. InvokeActionMethod (ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39 System.Web.Mvc.Async.<>c__ DisplayClass42.< BeginInvokeSynchronousActionMethod >b__41() +34 System.Web.Mvc.Async.<>c__ DisplayClass39.< BeginInvokeActionMethodWithFilters> b__33() +124 System.Web.Mvc.Async.<>c__ DisplayClass4f.<InvokeActionMethodF ilterAsynchronously>b__49() +839035 System.Web.Mvc.Async.<>c__ DisplayClass37.< BeginInvokeActionMethodWithFilters> b__36(IAsyncResult asyncResult) +15 System.Web.Mvc.Async.<>c__ DisplayClass2a.<BeginInvokeAction>b __20() +33 System.Web.Mvc.Async.<>c__ DisplayClass25.<BeginInvokeAction>b __22(IAsyncResult asyncResult) +839620 System.Web.Mvc.<>c__ DisplayClass1d.<BeginExecuteCore>b __18(IAsyncResult asyncResult) +28 System.Web.Mvc.Async.<>c__ DisplayClass4.<MakeVoidDelegate>b_ _3(IAsyncResult ar) +15 System.Web.Mvc.Controller. EndExecuteCore(IAsyncResult asyncResult) +65 System.Web.Mvc.Async.<>c__ DisplayClass4.<MakeVoidDelegate>b_ _3(IAsyncResult ar) +15 System.Web.Mvc.Controller. EndExecute(IAsyncResult asyncResult) +51 System.Web.Mvc.<>c__ DisplayClass8.<BeginProcessRequest> b__3(IAsyncResult asyncResult) +42 System.Web.Mvc.Async.<>c__ DisplayClass4.<MakeVoidDelegate>b_ _3(IAsyncResult ar) +15 System.Web.Mvc.MvcHandler. EndProcessRequest(IAsyncResult asyncResult) +51 System.Web.CallHandlerExecutionStep .System.Web.HttpApplication. IExecutionStep.Execute() +606 System.Web.HttpApplication. ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288 Информация о версии: Платформа Microsoft .NET Framework, версия:4.0.30319; ASP.NET, версия:4.0.30319.18446
http://dm-realty.ru/RepairConstruction/View?contentViewID=317f4680-bdb0-4d4e-a423-041a0d833e71
И нахуй вот это простому пользователю?