- 1
- 2
- 3
- 4
- 5
- 6
if( $options[ 'header_show' ] != 'disable-both' && $options[ 'header_show' ] == 'header-text' ) {
?>
...
<?php
}
elseif( $options[ 'header_show' ] != 'disable-both' && $options[ 'header_show' ] == 'header-logo' ) {
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+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
И нахуй вот это простому пользователю?
+80
private HttpClient httpServer = new DefaultHttpClient();
У нас в приложении есть свой сервер!!1
+75
public void onBackPressed() {
if (getSupportFragmentManager().getBackStackEntryCount()==0 || getSupportFragmentManager().getBackStackEntryCount()==1) {
finish();
android.os.Process.killProcess(android.os.Process.myPid());
((MainActivity)instance).onDestroy();
}
}
/* чуть дальше */
JSONObject jsonObjectA = null, jsonObjectB = null;
try {
jsonObjectA = new JSONObject(a.toString());
jsonObjectB = new JSONObject(b.toString());
} catch (JSONException e1) {
e1.printStackTrace();
}
if ((jsonObjectA != null || jsonObjectB != null) || (jsonObjectA != null && jsonObjectB != null)) {
try {
valA = jsonObjectA.getString("name");
valB = jsonObjectB.getString("name");
} catch (JSONException e) {
e.printStackTrace();
}
}
Первый фрагмент кода - это больше специфика Android - при нажатии кнопки назад: закрыть приложение, убить процесс и дернуть метод onDestroy() который в норме должен автоматом вызваться при закрытии приложения но не вызывается из-за того что мы убиваем процесс. Про то что условие if можно оптимизировать я умолчу.
На if() во втором фрагменте заглючил даже встроенный в intelliJ Idea инструмент рефакторинга...
+159
if(!preg_match('/@rambler.ru/', $item['email']) ) {
cmsCore::addSessionMessage('Можно использовать почту только <strong>rambler.ru</strong>', 'error');
$errors = true;
}
// код надо расширить добавив другие домены, тот кто это писал явно не думал что придется это делать..
−195
// optimization. Should only be used to read it. Never to write it.
extern CGFloat __ccContentScaleFactor;
Может быть, я бунтарь!
__ccContentScaleFactor = -666;
+142
public Config(string[] str)
{
InitializeComponent();
try
{
textBox5.Text = str[0];
textBox6.Text = str[1];
textBox1.Text = str[2];
textBox2.Text = str[3];
textBox3.Text = str[4];
textBox4.Text = str[5];
textBox7.Text = str[6];
raz = str[7];
}
catch (Exception)
{
return;
}
}
Классика. Говнокод эпохи барокко. Строк мало, но пованивает.