- 1
//START ADDING CODE HERE TODAY. !!
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+63
//START ADDING CODE HERE TODAY. !!
Прямо посреди класса
+132
private static string TestExistFiles(ref int maxd, ref Hashtable executedgroups)
+153
$amount = (int) "".((float)$a*100);
Считаем сумму в копейках
+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";
}
+157
function firm_out_current_rayon($frwb = 0)
{
global $_conf;
Current rayon
+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-коде.
+156
function mpeval($file_name, $arg = array(), $vr = 1){
global $conf;
foreach(explode(':', $conf['fs']['path'], 2) as $k=>$v)
if (file_exists($file = "$v/$file_name")) break;
if (!file_exists($file = "$v/$file_name")) return "<div style=\"margin-top:100px; text-align:center;\"><span style=color:red;>Ошибка доступа к файлу</span> $v/$file_name</div>";
ob_start();
eval('?>'. strtr(file_get_contents($file), array('<? die;'=>'<?', '<?php die;'=>'<?php')));
$content = ob_get_contents();
ob_end_clean();
return $content;
}
eval`им вовсю
+168
<script type="text/javascript">
<!--
var h=(new Date()).getHours();
if (h > 23 || h < 7) document.write("Доброй ночи!");
if (h > 6 && h < 12) document.write("Доброе утро!");
if (h > 11 && h < 19) document.write("Добрый день!");
if (h > 18 && h < 24) document. write("Добрый вечер!");
if (h > 25 && h < 1000) document. write("Доброго апокалипсиса!");
-->
</script>
Найдено на одном из клиентских сайтов: