- 1
- 2
- 3
- 4
- 5
if (filter.getName() == null) {
navigator.setModifierName(filter.getName());
} else {
navigator.setModifierName(filter.getName());
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+153
if (filter.getName() == null) {
navigator.setModifierName(filter.getName());
} else {
navigator.setModifierName(filter.getName());
}
+153
program Drink;
{$APPTYPE CONSOLE}
uses
SysUtils,
Windows;
const
C: array[0..5] of Cardinal = ($64AABAB8, $54AAA288, $54AB3A90, $54AAAAA0, $563ABBB8,$60820000);
var
I: Byte;
B: PByte;
begin
for I := 191 downto 0 do
begin
B := @C[I div 32];
Inc(B, (I - (I div 32) * 32) div 8);
if (B^ and (1 shl (I mod 8))) <> 0 then
Write('X')
else
Write(' ');
if (I mod 32) = 0 then
Writeln('');
end;
ReadLn;
end.
+153
class RequiredLibraryClassNotFoundInALibraryDirectoryException extends Exception
{
//...
}
Ну и имя у класса:)
+153
function B2R(Bytes: Int64): string;
const
k: int64 = 1024;
begin
if Bytes < k then result := IntToStr(Bytes) + 'B' else
if Bytes < k*k then result := FloatToStr(Round(Bytes*10/k)/10) + 'K' else
if Bytes < k*k*k then result := FloatToStr(Round(Bytes*10/(k*k))/10) + 'M' else
if Bytes < k*k*k*k then result := FloatToStr(Round(Bytes*10/(k*k*k))/10) + 'G' else
if Bytes < k*k*k*k*k then result := FloatToStr(Round(Bytes*10/(k*k*k*k))/10) + 'T' else
result := IntToStr(Bytes);
end;
Функция из плагина для JAJC особенно "понравилось" созерцание деления и умножения на 10 ;)
+153
PROCEDURE changeValue ( KeyStore:IN OUT Keys'Class; value: IN INTEGER )
IS
BEGIN
IF value = 1024 THEN
Message ( "NOT IN RANGE" );
ELSIF value = 2048 THEN
Message ( "OUT OF RANGE" );
ELSIF value = KeyStore.def THEN
KeyStore.val = value;
ELSE
Message ( "IN RANGE");
END IF;
END changeValue;
Какой-то наркоманский код.
Трезвый такого не напишет.
Почему приходится дорабатывать такое... будто за кем-то ж.. подтираешь:)
+153
function _getUrlToNavigate( $categoryID )
{
$url = "index.php?categoryID=$categoryID";
$data = ScanGetVariableWithId( array("param") );
if ( isset($_GET["search_name"]) )
$url .= "&search_name=".$_GET["search_name"];
if ( isset($_GET["search_price_from"]) )
$url .= "&search_price_from=".$_GET["search_price_from"];
if ( isset($_GET["search_price_to"]) )
$url .= "&search_price_to=".$_GET["search_price_to"];
foreach( $data as $key => $val )
{
$url .= "¶m_".$key;
$url .= "=".$val["param"];
}
if ( isset($_GET["search_in_subcategory"]) )
$url .= "&search_in_subcategory=1";
if ( isset($_GET["sort"]) )
$url .= "&sort=".$_GET["sort"];
if ( isset($_GET["direction"]) )
$url .= "&direction=".$_GET["direction"];
if ( isset($_GET["advanced_search_in_category"]) )
$url .= "&advanced_search_in_category=".$_GET["advanced_search_in_category"];
return $url;
}
function _getUrlToSort( $categoryID )
{
$url = "index.php?categoryID=$categoryID";
$data = ScanGetVariableWithId( array("param") );
if ( isset($_GET["search_name"]) )
$url .= "&search_name=".$_GET["search_name"];
if ( isset($_GET["search_price_from"]) )
$url .= "&search_price_from=".$_GET["search_price_from"];
if ( isset($_GET["search_price_to"]) )
$url .= "&search_price_to=".$_GET["search_price_to"];
foreach( $data as $key => $val )
{
$url .= "¶m_".$key;
$url .= "=".$val["param"];
}
if ( isset($_GET["offset"]) )
$url .= "&offset=".$_GET["offset"];
if ( isset($_GET["show_all"]) )
$url .= "&show_all=".$_GET["show_all"];
if ( isset($_GET["search_in_subcategory"]) )
$url .= "&search_in_subcategory=1";
if ( isset($_GET["advanced_search_in_category"]) )
$url .= "&advanced_search_in_category=".$_GET["advanced_search_in_category"];
return $url;
}
И так почти для каждого адреса с параметрами
ShopScript
+153
function horiz($flag=0) {
for ($x=0;$x<$width;$x++) {
$cc=imagecolorat($im, $x, $height/2);
if($cc!=$bg){
for ($y=$height/2;$y<$height;$y++) {
$cc2=imagecolorat($im, $x-1-$flag, $y);
if ($cc!=$bg) {
$flag++;
horiz(-1);
}
}
}
}
}
+153
function showFormEdit($id="",$sMsg="", $p_iPageIndex="")
{
global $oGlobal;
eval( $oGlobal->getGlobalVars() );
$oGlobal->importUserClass( "rubik.CMoneyOXConfig");
RImporter::importRubikClass("ext.xpbox.RHtmlImageUploadForm");
RImporter::importRubikClass("ext.xpbox.RHtmlUploadForm");
RImporter::importRubikClass("ext.xpbox.RDbComboboxHtml");
$oGlobal->importUserClass("rubik.CRubikHelper");
$oModel = $this->m_oModel;
$dirHelper= CMoneyOXConfig::getInstance();
$sBlast = "Manage Download";
$assetPath = ASSET_PATH;
$helper = new CRubikHelper();
$x_title = htmlentities( @$_POST['x_title'], ENT_QUOTES );
$x_type = @$_POST['x_type'];
$x_status = @$_POST['x_status'];
$x_date = @$_POST['x_date'];
if(!empty($id))
{
$result = $oModel->getDownloadbyID($id);
$record = $result->recordSet;
$row = $record[0];
$sBlast = "Edit Download";
$title = $row['title'];
$date= date("Y-m-d ",strtotime($row['date']));
if($row['publish']) $sYes= " checked=\"true\"";
else $sNo= " checked=\"true\"";
//create upload image form
$picUpload = new RHtmlImageUploadForm("x_picture",$dirHelper->downloadImageDir,$row['preview_image']);
$htmlPicture = $picUpload->createUploadFormHtml(50);
//create upload file form
$fileUpload = new RHtmlUploadForm("x_file",$dirHelper->downloadFileDir,$row['download_image'],".zip,.rar");
$htmlFile = $fileUpload->createUploadFormHtml(50);
//create combobox type
$sql = "select id,name from download_setting order by id";
$categoryTypeHtml = new RDbComboboxHtml($sql,"id", "name", "type",$row['type']);
$cbxType = $categoryTypeHtml->createCombobox();
$thumb = $helper->getThumbName($row['preview_image'],$dirHelper->downloadThumbDir);
$thumb = ABS_PATH.$thumb;
$thumb = str_replace("administrator/","",$thumb);
$thumbHtml = "<img src=\"{$thumb}\" alt=\"\" class=\"borderimg1\"/><br />
<input type=\"checkbox\" name=\"remove\" id=\"x_remove\" value=\"remove\" border=\"0\" />
Remove Photo";
}
@eval( "\$tpl= \"".getTemplate( "edit.back", COMP_PATH . "templates/back" )."\";" );
$sys_sCompContent .= $tpl;
return $tpl;
}
Индусы жгут по полной, вот код написанный въетнамцами хех
14MB в gz, полный ппц, тошнит до сих пор
+153
TSearchRec sr;
if(FindFirst(Dir+"\\"+mask,iattr,sr)==0)
{
do
{
AnsiString Processes=Dir+"\\"+sr.Name;
//куча кода
AnsiString newName=sr.Name;
//еще код
AnsiString TmpFile=Dir+"\\"+newName;
if(RenameFile(Processes,TmpFile))
{
...
}
{
...
continue;
}
}while(FindNext(sr)==0);
}
И почему программа "виснет"? Это в клиенте платежной системы... Рыдаю... (стр. 19)
+153
print "<a href=\"index.php\">Index</a> \\n";
print "<?php \\n";
$menu = getMenu();
print "?> \\n";
Файл пример платежки, в 10000 строках одного файла скрыты все фнкций. Каждая строка вывода хтмл кодов выглядит так print " \\n";