- 1
<cms:CMSWebPartZone ZoneID="AnalZone" runat="server" />
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 39
0
<cms:CMSWebPartZone ZoneID="AnalZone" runat="server" />
ASP.NET, аналитика
+138
public new string ID
{
get
{
return base.ID;
}
set
{
base.ID = value;
}
}
+136
private Action<Action, Action<Exception>> ToCallbackAction(Action a)
{
return (sc, ec) =>
{
try
{
a();
sc();
}
catch (Exception e)
{
ec(e);
}
};
}
толково или говно? Мнения разделились
+104
catch (Exception ex)
{
try
{
if (ex.Message == "Thread was being aborted.")
{
+133
string dirUp = striBuildDir + striBinaryDir + "\\" + striTempDir + "\\";
string dirRelease = strDirBin;
int i = 1;
while (ConfigurationSettings.AppSettings["SettingDir" + i] != null)
{
и еще строк 100500 такого же стиля
+137
System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
+135
FileInfo[] fi = new DirectoryInfo(di.FullName).GetFiles();
var creationList = from file in fi
where file.CreationTime.CompareTo(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day)) < 0 //This instance is earlier than value.
group file.CreationTime by DateTime.Parse(file.CreationTime.ToString("yyyy-MM-dd")) into ct
select ct.Key;
что делает этот код?
+137
public static string AddControlDigits(string input)
{
if (String.IsNullOrEmpty(input))
return "";
try
{
XDocument doc = XDocument.Parse(input.JavaSubString(input.IndexOf("<contracts>"), input.IndexOf("</contracts>") + "</contracts>".Length));
String s = new String(doc.ToString().ToCharArray());
XElement rootElement = doc.Root.Element("list_item");
string basicNumber = rootElement.Element("basicNumber").Value;
string endNumber = rootElement.Element("endNumber").Value;
string loanCaseNumber = rootElement.Element("loanCaseNumber").Value;
string loanCaseComplementNumber = rootElement.Element("loanCaseComplementNumber").Value;
string bridgeLoanComplementNumber = rootElement.Element("bridgeLoanComplementNumber").Value;
int checkNumber = CalcCheckDigitCU(basicNumber + endNumber);
int loanCaseCheckNumber = calcCheckDigitUP(loanCaseNumber);
int bridgeLoanCheckNumber = CalcCheckDigitCU(basicNumber + bridgeLoanComplementNumber);
rootElement.Add(new XElement("checkNumber", checkNumber));
rootElement.Add(new XElement("loanCaseCheckNumber", loanCaseCheckNumber));
rootElement.Add(new XElement("bridgeLoanCheckNumber", bridgeLoanCheckNumber));
input = input.Replace(s, doc.ToString());
return "";
}
catch (Exception ex)
{
throw;
}
}
жопа
+138
Control authorizationPanel= iddbd
.Controls.Cast<Control>().Where(x => x.Name == "panelMaxim").FirstOrDefault()
.Controls.Cast<Control>().Where(x => x.Name == "panelInternetB").FirstOrDefault()
.Controls.Cast<Control>().Where(x => x.Name == "panelPassiveIB").FirstOrDefault()
.Controls.Cast<Control>().Where(x => x.Name == "panelPhone").FirstOrDefault();
не, ну а как его еще достать? У нас это квест такой на работе - "Найди контрол" называется
+133
var firstLocation = new Tuple<Point, Point>(new Point(12, 444 - 38), new Point(30, 446 - 38));
var secondLocation = new Tuple<Point, Point>(new Point(12, 464 - 38), new Point(30, 464 - 38));
var thirdLocation = new Tuple<Point, Point>(new Point(12, 486 - 38), new Point(30, 484 - 38));
var first = new Tuple<Control, Control>(chbDimaGaugeNewContractPS, lblDimaGaugeNewContractPS);
var second = new Tuple<Control, Control>(chbDimaGaugeNewContractIBanking, lblDimaGaugeNewContractIBanking);
var third = new Tuple<Control, Control>(chbDimaGaugeNewContractActivePS, lblDimaGaugeNewContractActivePS);
var controls = new List<Tuple<Control, Control>> { first, second, third };
var points = new List<Tuple<Point, Point>> { firstLocation, secondLocation, thirdLocation };
int i = 0;
foreach (var t in controls.Where(x => !x.Item1.Enabled))
{
t.Item1.Location = points[i].Item1;
t.Item2.Location = points[i].Item2;
i++;
}
кортежи в .NET - хорошо или плохо?