- 1
- 2
- 3
$stat_connect = @mysql_connect("stats.amxbans.de","amxbstats","");
*skipped…*
@mysql_close($stat_connect) or die(mysql_error());
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+150
$stat_connect = @mysql_connect("stats.amxbans.de","amxbstats","");
*skipped…*
@mysql_close($stat_connect) or die(mysql_error());
+73
private long tournamentId;
/**
* The winner takes it all
* The loser standing small
* Beside the victory
* That's her destiny
*/
private boolean theWinnerTakesItAll;
+145
#ifndef __MUGCMediator_h_
#define __MUGCMediator_h_
namespace MUGClient{
class MUGCMediator{
public:
MUGCMediator(void);
~MUGCMediator(void);
MUGClient::MUGCApplication *getApplication(void);
bool operator+(MUGClient::MUGCApplication *arg);
//bool registerCameraController(MUGClient::MUGCCamera *arg);
protected:
MUGClient::MUGCApplication *clientApplication;
//MUGClient::MUGCCamera *clientCamera;
};
};
#endif
−124
# Relocate
if (open(my $reloc, "support/reloc.txt")) {
# ...
print "Relocating...";
my $count = 0;
local $_;
while (<$reloc>) {
chomp;
my($type, $f) = split(' ', $_, 2);
$f = "$prefix/$f";
$f =~ s,/,\\,g;
#print "Relocating $f...\n";
my $read_only;
unless (-w $f) {
$read_only++;
run("\@attrib", "-r", $f);
}
open(my $fh, "+<", $f) || die "Can't open $f: $!";
binmode($fh);
my $content = do { local $/; <$fh> };
if ($type eq "B") {
$content =~ s,\Q$sponge\E([^\0]*),$prefix$1$binary_pad,go;
}
else {
$content =~ s,\Q$sponge\E,$prefix,go;
$content =~ s,\Q$sponge_str\E,$prefix_str,go if $^O eq "MSWin32";
truncate($fh, length($content)) || die "Can't truncate '$f': $!";
}
seek($fh, 0, 0) || die "Can't reset file pos on '$f': $!";
print $fh $content;
close($fh) || die "Can't write back content to '$f': $!";
run("\@attrib", "+r", $f) if $read_only;
$count++;
}
print "done ($count files relocated)\n";
}
установщик перл...
reloc.txt содержит 137 файлов.
+163
if ($context['make_event'])
echo '
var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function generateDays()
{
...
}';
К сожалению, так во всем проекте..., весь HTML и JS выводиться через echo, + отсутствует нормальная логика системы..., файлов проекта over 150...
−104
private var color_mixer:ColorPanel = new ColorPanel([
[0xFFFFFF,0xEEEEEE,0xCCCCCC,0xAAAAAA,0x888888,0x666666,0x444444,0x222222,0x000000],
[0xFFCCCC,0xFF9999,0xFF6666,0xFF3333,0xFF0000,0xCC0000,0x990000,0x660000,0x330000],
[0xCCFFCC,0x99FF99,0x66FF66,0x33FF33,0x00FF00,0x00CC00,0x009900,0x006600,0x003300],
[0xCCCCFF,0x9999FF,0x6666FF,0x3333FF,0x0000FF,0x0000CC,0x000099,0x000066,0x000033]
]);
Мне одному кажется что это можно было сделать... ну даже не знаю.... ПО ЧЕЛОВЕЧЕСКИ ????????
+148
function ArrayTopics() {
global $db;
$db->Select('news_topics','');
$top = array();
while($topic=$db->FetchRow()) {
$top[$topic['id']] = $topic;
}
return $top;
}
Из той же русской CMS... опять PHP костыль вместо нормального SQL запроса...
+144
if ((text == '' || text == '\n') && document.getElementById('log').innerHTML == '...')
Вот такое говнецо я сделал. Надо исправить.
Следуя лозунгу говнокода "Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!", выкладываю.
КЭП: document.getElementById('log').innerHTML == '...' - Фэйл, не надо завязываться на содержимое.
+159
//функция конвертации времени в таймстамп, добавлено 08.07.2010
function convertDate($date){
$dateArr = explode(".", $date);
$date = mktime(0,0,0,$dateArr[1],$dateArr[0],$dateArr[2]);
return $date;
// 21.10.2010: а чем strtotime не устраивает?
}
И чем strtotime() не устроило, не понятно.
+159
class Request_BrowserDetector
{
public static function singleton()
{
if (null === self::$_instance)
{
self::$_instance = new self;
}
return self::$_instance;
}
protected static $_instance = null;
public function __construct()
{
$this->_sigs = Application::singleton()->cfg('request.browser.signatures');
}
public function detect($str)
{
if (isset($this->_cache[$str]))
{
$out = $this->_cache[$str];
}
else
{
$notFound = true;
foreach ($this->_sigs as $k => $v)
{
if (false !== strpos($str, $k))
{
$out = $v;
$notFound = false;
break;
}
}
if ($notFound)
{
$out = $this->_escape($str);
}
$this->_cache[$str] = $out;
}
return $out;
}
protected function _escape($str)
{
return mysql_real_escape_string($str);
}
protected $_sigs, $_cache = array();
}
синглетон такой, синглетон