- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
class ForDemo {
public static void main(String args[]) {
long C;
for(C = 0; C < 9999999; C++)
System.out.println("This is count: " + C);
System.out.println("Done!");
}
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+146
class ForDemo {
public static void main(String args[]) {
long C;
for(C = 0; C < 9999999; C++)
System.out.println("This is count: " + C);
System.out.println("Done!");
}
}
Говнокод убивающий командную строку =),
Применять только по необходимости(!)
Так же можно проследить между строк упоминание о C++
+162
window.onload = function() {
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
canvas.height = canvas.height;
canvas.width = canvas.width;
// …
}
+146
<font color="#FF0000">
Срок работы пробной версии продукта истек.
Через две недели этот сайт полностью прекратит свою работу.
Вы можете купить полнофункциональную версию продукта на сайте
<a href="http://www.1c-bitrix.ru/?r1=bsm7trial&r2=expiried">
www.1c-bitrix.ru
</a>.
</font>
чуваки так заняты организацией, что как то забыли прикупить лицензию
http://www.cloudconf.ru/msk2011/
+161
<?php
define('PATH_LEN', 32);
define('ALPH_SIZE', 66);
class Security
{
public static $rus_alphabet = array('А', 'а', 'Б', 'б', 'В', 'в', 'Г', 'г', 'Д', 'д', 'Е', 'е', 'Ё', 'ё', 'Ж', 'ж', 'З', 'з', 'И', 'и', 'Й', 'й', 'К', 'к', 'Л', 'л', 'М', 'м', 'Н', 'н', 'О', 'о', 'П', 'п', 'Р', 'р', 'С', 'с', 'Т', 'т', 'У', 'у', 'Ф', 'ф', 'Х', 'х', 'Ц', 'ц', 'Ч', 'ч', 'Ш', 'ш', 'Щ', 'щ', 'Ъ', 'ъ', 'Ы', 'ы', 'Ь', 'ь', 'Э', 'э', 'Ю', 'ю', 'Я', 'я');
public static $eng_alphabet = array('A', 'a', 'B', 'b', 'V', 'v', 'G', 'g', 'D', 'd', 'E', 'e', 'Yo', 'yo', 'Zh', 'zh', 'Z', 'z', 'I', 'i', 'Ji', 'ji', 'K', 'k', 'L', 'l', 'M', 'm', 'N', 'n', 'O', 'o', 'P', 'p', 'R', 'r', 'S', 's', 'T', 't', 'Y', 'y', 'F', 'f', 'H', 'h', 'C', 'c', 'Ch', 'ch', 'Sh', 'sh', 'Ch', 'ch', '_', '_', '_', '_', '_', '_', '_', '_', 'U', 'u', 'Ya', 'ya');
static public function Transform($string)
{
$string = htmlspecialchars($string);
$string = strip_tags($string);
return $string;
}
static public function TransformName($string)
{
$temp = '';
for($i = 0; $i < strlen($string); $i++)
{
if($string[$i] === ' ')
{
$temp += '_';
continue;
}
for($j = 0; $j < ALPH_SIZE; $j++)
if(Security::$rus_alphabet[$j] === Security::$string[$i])
{
$temp += Security::$eng_alphabet[$j];
continue 2;
}
$temp += $string[$i];
}
return $temp;
}
}
?>
+173
$pattern = '/[^A-Za-zА-Яа-я0-9]/u';
$phrase = $this->data['ProjectsPhrase']['phrase'];
$phrase = preg_replace($pattern, ' ', $phrase);
$phrase = str_replace(' ', ' ', $phrase);
$phrase = str_replace(' ', ' ', $phrase);
$phrase = str_replace(' ', ' ', $phrase);
$phrase = str_replace(' ', ' ', $phrase);
$phrase = str_replace(' ', ' ', $phrase);
$phrase = str_replace(' ', ' ', $phrase);
$phrase = str_replace(' ', ' ', $phrase);
$phrase = trim($phrase);
Вот такое говнокодище встретил в проекте. Паранойя такая паранойя…
+123
string numberAsString = number.ToString();
foreach(char x in numberAsString)
{
string y = x.ToString();
int z = int.Parse(y);
Console.WriteLine(z*z);
}
+145
Интересно, а есть тут еще те, которые помнят этого персонажа в футере сайта?
Вообще, есть ли у кого скриншоты старых версий сайта? Говнопость памяти
+171
#include <iostream>
template <int n>
struct Solution
{
static const int count = Solution<n / 10>::count + 1;
static const int sum = Solution<n / 10>::sum + n % 10;
static const int last = n % 10;
static const int first = Solution<n / 10>::first;
};
#define DECLARE_ONE_DIGIT_SOLUTION(n) template <>\
struct Solution<n>\
{\
static const int count = 1;\
static const int sum = n;\
static const int last = n;\
static const int first = n;\
};
DECLARE_ONE_DIGIT_SOLUTION(0)
DECLARE_ONE_DIGIT_SOLUTION(1)
DECLARE_ONE_DIGIT_SOLUTION(2)
DECLARE_ONE_DIGIT_SOLUTION(3)
DECLARE_ONE_DIGIT_SOLUTION(4)
DECLARE_ONE_DIGIT_SOLUTION(5)
DECLARE_ONE_DIGIT_SOLUTION(6)
DECLARE_ONE_DIGIT_SOLUTION(7)
DECLARE_ONE_DIGIT_SOLUTION(8)
DECLARE_ONE_DIGIT_SOLUTION(9)
int main()
{
const int number = 1024; // <-- то самое число a
std::cout << "Number of digits: " << Solution<number>::count << std::endl;
std::cout << "Sum: " << Solution<number>::sum << std::endl;
std::cout << "Last digit: " << Solution<number>::last << std::endl;
std::cout << "First digit: " << Solution<number>::first << std::endl;
return 0;
}
Это один из ответов к слезной просьбе какого-то школьника (студента) выполнить за него д/з на С++ в разделе development форума на ЛОРе. Такую программу нарочно хрен напишешь.
Само задание: «Дано натуральное число а (a≤100). Напишите программу, определяющую количество цифр в этом числе, сумму его цифр, выводящую на экран первую и последнюю цифру через два пробела».
+121
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult SaveLastReport(string gridHtml)
{
var buf = Convert.FromBase64String(gridHtml);
var str = System.Text.Encoding.UTF8.GetString(buf, 0, buf.Length);
System.IO.File.WriteAllText(Server.MapPath("~/content/lastreport.html"), str);
return RedirectToAction("LastReport");
}
Вот так иногда закрываются формальные требования по ТЗ...
+161
std::auto_ptr<ItemDesc> desc(new ItemDesc());
...
m_items.insert(desc->m_item->m_name, desc.release());
Да, я тоже говнокодер. А ведь предупреждали...