- 1
''''''''''''''''''''">LK""":;''''''''''''''''''''''''''">LK""":;''''''
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+143
''''''''''''''''''''">LK""":;''''''''''''''''''''''''''">LK""":;''''''
''''''''''''''''''''">LK""":;''''''
−96
class SomeServer:
def __init__(self, ...)
self.__dispatcher = {"CMD1" : self.invoke_cmd1_command, \
"CMD2" : self.invoke_cmd2_command, \
"CMD3" : self.invoke_cmd3_command, \
"CMD4" : self.invoke_cmd4_command, \
... : ...}
def handle_some_request(self, request):
command, arguments = extract_command_and_arguments(request)
try:
self.__dispatcher[command](command, arguments)
except Exception as e:
... log it ...
... return error to client...
... whatever ...
Комментарии излишни
+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, полный ппц, тошнит до сих пор
+152
private Integer employeeId;
public Integer getEmployeeId() {
return employeeId;
}
public void setEmployeeId(Integer customerId) {
this.employeeId = customerId;
}
Проперти бина, а также его геттер и сеттер. Особенно сеттер.
+144.1
<div styleborder:3px solid #000000;
height: 300px;
width: 600px;
text-align:center;>
background:url(http://cs4288.vkontakte.ru/u29274663/90187299/x_a74c614b.jpg) no-repeat center;">
</div>
html-опус
+142.3
//------------------------------Запись в профиль ----------------------------//
$ufile = file(BASEDIR."local/profil/$log.prof");
$udata = explode(":||:",$ufile[0]);
if($udata[10]>0){
$udata[10]=0;
$udata[14]=$ip;
for ($u=0; $u<$config_userprofkey; $u++){
$utext.=$udata[$u].':||:';}
if($udata[0]!="" && $udata[1]!="" && $udata[4]!="" && $utext!=""){
$fp=fopen(BASEDIR."local/profil/$log.prof","a+");
flock ($fp,LOCK_EX);
ftruncate ($fp,0);
fputs($fp,$utext);
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);
unset($utext);
}}
Из говно cms wap motor
+130.9
Long newlim = Long.valueOf(scorLim);
BigDecimal newSum = new BigDecimal(newlim.doubleValue());
// округлить сумму
if (reqCurrency.equalsIgnoreCase("RUR")) {
newSum = newSum.setScale(0, BigDecimal.ROUND_HALF_DOWN);
newSum = newSum.divide(new BigDecimal(1000), BigDecimal.ROUND_DOWN).multiply(new BigDecimal(1000));
} else {
newSum = newSum.setScale(0, BigDecimal.ROUND_HALF_DOWN);
newSum = newSum.divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).multiply(new BigDecimal(10));
}
newlim = new Long(newSum.longValue());
Система EGAR.
+134.3
if ($fset=@file_get_contents(H.'sys/dat/settings_6.2.dat'))
{
$set=unserialize($fset);
}
else{
if (!($fset=@file(H.'sys/dat/settings.dat')) && is_file(H.'install/index.php'))
{
header("Location: /install/");
exit;
}
for ($i=0;$i<count($fset) ;$i++ ) {
if (ereg('[^//].*=', trim($fset[$i]))){
$sset=explode('=', trim($fset[$i]), 2);
$sset[0]=eregi_replace('(^ *)|( *$)', '', $sset[0]);
$sname=$sset[0];
$set_komm[$sname]=eregi_replace('^.*//', '', $sset[1]);
$set_komm[$sname]=eregi_replace('(^ *)|( *$)', '', $set_komm[$sname]);
$sset[1]=eregi_replace('//.*$', '', $sset[1]);
$sset[1]=eregi_replace('(^ *)|( *$)', '', $sset[1]);
$set[$sname]=$sset[1];
}
}
}
Ещё одно творение автора "DCMS". Убил бы за такое количество eregi_replace
+157.5
if($city == "Chicago" || $city == "chicago" || $city == "LosAngeles" || $city == "losangeles" || $city == "Orlando" || $city == "orlando" || $city == "LongIsland" || $city == "longisland" || $city == "Baltimore" || $city == "baltimore" || $city == "SouthFlorida" || $city == "southflorida" || $city == "Hartford" || $city == "hartford" || $city == "Allentown" || $city == "allentown" || $city == "Stamford" || $city == "stamford" || $city == "Greenwich" || $city == "greenwich" || $city == "HamptonRoads" || $city == "hamptonroads" || $city == "OrangeCounty" || $city == "orangecounty")
{
if($city == "chicago")
$city = "Chicago";
if($city == "losangeles")
$city = "LosAngeles";
// Еще двадцать таких условий...
if($city == "Chicago")
{
$x = rand(1, 9);
$headerIMG = "/img/".$city."/".$x.".jpg";
$affiliateDomain = "http://wtf.somesite.com";
$affiliateURL = "http://wtf.somesite.come/wtf.jsp";
$poweredByIMG = "/img/poweredBy_wtf.jpg";
$upsellIMG = "/img/wtf.jpg";
$upsellURL = "http://wtf.somesite.com/wtf.aspx";
$searchIMG = "/img/search_".$city.".jpg";
$searchURL = "http://wtf.somesite.com/wtf.jsp";
$topArea = "searches_Chicago.php";
$stateDefault = "IL";
$privacyPolicyURL = "http://wtf.somesite.com/wtf";
$termsURL = "http://wtf.somesite.com/services/wtf";
$showWebID = "1";
}
/// И еще двадцать штук таких блоков..
+141.4
www.govnokod.ru
<b class="r1"></b><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b><b class="r5"></b><b class="r7"></b><b class="r10"></b>
Хмм... Может показать разрабам, как закруглять углы у блоков без набора этого говна?.. Особенно если используются JS фрэймворки...
html