- 1
throw new GnuPGException(String.Format("An error occurred while trying to execute command {0}.", command, exp));
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+130
throw new GnuPGException(String.Format("An error occurred while trying to execute command {0}.", command, exp));
+131
foreach (var oi in order.Items)
{
if (oi.Offer.Name == "BRNCoreDigTrial" || oi.Offer.Name == "BRNCoreDig1Pay" || oi.Offer.Name == "BRNDigUpgrade5pay" || oi.Offer.Name == "BRNDigUpgrade1Pay"
|| oi.Offer.Name == "BRN04StdDIG1Pay" || oi.Offer.Name == "BRN04StdDIG3Pay" || oi.Offer.Name == "BRNCoreDig1PayOld" || oi.Offer.Name == "BRNCoreDigTrialOld"
|| oi.Offer.Name == "BRN04DlxDIG1Pay" || oi.Offer.Name == "BRN04DlxDIG3Pay" || oi.Offer.Name == "BRN04UltDIG1Pay" || oi.Offer.Name == "BRN04UltDIG3Pay")
{
isDigital = true;
break;
}
}
+132
private static string TestExistFiles(ref int maxd, ref Hashtable executedgroups)
+133
if (SellMenuEnable)
{
GUI.Box (new Rect (Screen.width/2 - 200, Screen.height/2 - 300, 400, 480),"");
if (GUI.Button (new Rect (Screen.width/2 + 180, Screen.height/2 - 300, 20, 20), "X" ))
{
SellMenuEnable = false;
}
// ШМОТКИ слево
if (SLOT1)
{
GUI.Box (new Rect (Screen.width/2 - 170, Screen.height/2 - 270, 160, 50),"1");
}
if (SLOT3)
{
GUI.Box (new Rect (Screen.width/2 - 170, Screen.height/2 - 210, 160, 50),"3");
}
if (SLOT5)
{
GUI.Box (new Rect (Screen.width/2 - 170, Screen.height/2 - 150, 160, 50),"5");
}
if (SLOT7)
{
GUI.Box (new Rect (Screen.width/2 - 170, Screen.height/2 - 90, 160, 50),"7");
}
if (SLOT9)
{
GUI.Box (new Rect (Screen.width/2 - 170, Screen.height/2 - 30, 160, 50),"9");
}
if (SLOT11)
{
GUI.Box (new Rect (Screen.width/2 - 170, Screen.height/2 + 30, 160, 50),"11");
}
if (SLOT13)
{
GUI.Box (new Rect (Screen.width/2 - 170, Screen.height/2 + 90, 160, 50),"13");
}
// ШМОТКИ с права
if (SLOT2)
{
GUI.Box (new Rect (Screen.width/2 + 10, Screen.height/2 - 270, 160, 50),"2");
}
if (SLOT4)
{
GUI.Box (new Rect (Screen.width/2 + 10, Screen.height/2 - 210, 160, 50),"4");
}
if (SLOT6)
{
GUI.Box (new Rect (Screen.width/2 + 10, Screen.height/2 - 150, 160, 50),"6");
}
if (SLOT8)
{
GUI.Box (new Rect (Screen.width/2 + 10, Screen.height/2 - 90, 160, 50),"8");
}
if (SLOT10)
{
GUI.Box (new Rect (Screen.width/2 + 10, Screen.height/2 - 30, 160, 50),"10");
}
if (SLOT12)
{
GUI.Box (new Rect (Screen.width/2 + 10, Screen.height/2 + 30, 160, 50),"12");
}
if (SLOT14)
{
GUI.Box (new Rect (Screen.width/2 + 10, Screen.height/2 + 90, 160, 50),"14");
}
}
http://unity3d.ru/distribution/viewtopic.php?f=105&t=16515
+140
private String GetCardType(String creditCardType)
{
switch (creditCardType)
{
case "A":
return "A";
case "Z":
return "D";
case "M":
return "M";
case "V":
return "V";
}
return "0";
}
+134
class Slovo
{
public string Word;
public int Count;
public Slovo(string slovo, int kolichestvo)
{
Word = slovo;
Count = kolichestvo;
}
}
class Program
{
static void Main(string[] args)
{
string s = "Один два четыре восемь число один и два дают вместе восемь а один умножить на один будет один";
List<string> word = new List<string>();
List<int> count = new List<int>();
string[] word_collection = s.ToLower().Split(' ');
foreach (string str in word_collection) if (!word.Contains(str))
{
word.Add(str);
count.Add(1);
}
else count[word.IndexOf(str)]++;
List<Slovo> spisok = new List<Slovo>();
for (int i = 0; i < word.Count; i++) spisok.Add(new Slovo(word[i], count[i]));
spisok.Sort((a, b) => b.Count - a.Count);
foreach (Slovo slovo in spisok) Console.WriteLine(slovo.Word.PadRight(12) + slovo.Count.ToString());
Console.ReadKey();
}
}
Найти в строке самые частоповторяющиеся слова
+124
private void HideActiveButtons()
{
try
{
}
catch (Exception)
{
throw;
}
}
Откопано в форме Windows Forms в страшном legacy-коде.
+132
int count = _repository.GetObjectList().Select(x => x).Where(x => x.Id > 4).Count();
Sql style
+126
<td width="150">\n\
<% if (editableParts.warehouseAssignment || shipping_map.length > 1) { %>\n\
<a class="shipping-map-link dashed" href="#">\n\
<% } else { %>\n\
<span class="grey">\n\
<% } %>\n\
<% if (shipping_map.length == 0) { %>\n\
не указан</span>\n\
<% } else { %>\n\
<% if (shipping_map.length == 1) { %>\n\
<%= shipping_map[0].warehouse.name %>\n\
<% } else { %>\n\
с нескольких складов\n\
<% } %>\n\
<% } %>\n\
<% if (editableParts.warehouseAssignment) { %>\n\
</a>\n\
<% } else { %>\n\
</span>\n\
<% } %>\n\
</td>\n\
+136
public static bool isLaterThan()
{
string hd = DateTime.Now.ToString("tt", new CultureInfo("en-US")).ToLower();
if (hd == "pm")
return false;
return DateTime.Now.Hour < 1;
}
уже есть час ночи?