- 1
min=(pSamplesVector->operator[](i)).x;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+164
min=(pSamplesVector->operator[](i)).x;
+164
$args['section'] = (int)$_POST['section'];
$args['type'] = 0;
if ($args['section'] == 1117){$args['section'] = 7;$args['type'] = 1;}
if ($args['section'] == 2227){$args['section'] = 7;$args['type'] = 2;}
if ($args['section'] == 11111){$args['section'] = 11;$args['type'] = 1;}
if ($args['section'] == 22211){$args['section'] = 11;$args['type'] = 2;}
Magic numbers в действии
+164
$exist = true;
while ($exist) {
$user = 'guest'.rand(1,100000);
if (!Customer::customerExists($email = $user.'@ya.ru'))
$exist = false;
}
Prestashop, хак, убирающий регистрацию. #5476 напомнил.
+164
$code = $id_user.rand(0,9).rand(0,12).rand(0,32).rand(0,32).rand(0,32).rand(0,32).rand(0,32).".txt";
Стопицотый генератор.
+164
{php}
header('Content-type: text/html; charset=utf-8');
$this->assign('host', $_SERVER['HTTP_HOST']);
{/php}
Увидел в проекте доставшемся по наследству и сел на пятую точку. Феерический гк
+164
<?
...
function toUpper($content){
$trans_eng = array('q' => 'Q', 'w' => 'W', 'e' => 'E', 'r' => 'R', 't' => 'T', 'y' => 'Y', 'u' => 'U', 'i' => 'I', 'o' => 'O', 'p' => 'P', 'a' => 'A', 's' => 'S', 'd' => 'D', 'f' => 'F', 'g' => 'G', 'h' => 'H', 'j' => 'J', 'k' => 'K', 'l' => 'L', 'z' => 'Z', 'x' => 'X', 'c' => 'C', 'v' => 'V', 'b' => 'B', 'n' => 'N', 'm' => 'M');
$trans_rus = array('а' => 'А', 'б' => 'Б', 'в' => 'В', 'г' => 'Г', 'д' => 'Д', 'е' => 'Е', 'ё' => 'Ё', 'ж' => 'Ж', 'з' => 'З', 'и' => 'И', 'й' => 'Й', 'к' => 'К', 'л' => 'Л', 'м' => 'М', 'н' => 'H', 'о' => 'О', 'р' => 'Р', 'п' => 'П', 'с' => 'С', 'т' => 'Т', 'у' => 'У', 'ф' => 'Ф', 'х' => 'Х', 'ц' => 'Ц', 'ч' => 'Ч', 'ш' => 'Ш', 'щ' => 'Щ', 'ъ' => 'Ъ', 'ь' => 'Ь', 'ы' => 'Ы', 'э' => 'Э', 'ю' => 'Ю', 'я' => 'Я');
$content = strtr($content, $trans_eng);
$content = strtr($content, $trans_rus);
return $content;
}
...
?>
+164
$proArray = array();
while(strlen($result))
{
// name
$keypos= strpos($result,'=') ;
$keyval = substr($result,0,$keypos);
// value
$valuepos = strpos($result,'&') ? strpos($result,'&') : strlen($result);
$valval = substr($result,$keypos+1,$valuepos-$keypos-1);
// decoding the respose
$proArray[$keyval] = $valval;
$result = substr($result,$valuepos+1,strlen($result));
}
Разбор URL-encoded ответа от платёжной системы.
Знал ли автор про функцию parse_str() ?
+164
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->CreateForm(__classid(TForm1), &Form1);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
Ну чтобы уж точно обработать все runtime-отбросы.
+164
// Licensed to Green Energy Corp (www.greenenergycorp.com) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. Green Enery Corp licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
#include "Objects.h"
#define MACRO_STATIC_INSTANCE(group, var) Group##group##Var##var Group##group##Var##var::mInstance;
namespace apl { namespace dnp {
MACRO_STATIC_INSTANCE(1,0)
MACRO_STATIC_INSTANCE(1,1)
MACRO_STATIC_INSTANCE(1,2)
MACRO_STATIC_INSTANCE(2,0)
MACRO_STATIC_INSTANCE(2,1)
MACRO_STATIC_INSTANCE(2,2)
MACRO_STATIC_INSTANCE(2,3)
<... 100500 строк ...>
MACRO_STATIC_INSTANCE(60,1)
MACRO_STATIC_INSTANCE(60,2)
MACRO_STATIC_INSTANCE(60,3)
MACRO_STATIC_INSTANCE(60,4)
MACRO_STATIC_INSTANCE(80,1)
MACRO_STATIC_INSTANCE(110,0)
MACRO_STATIC_INSTANCE(111,0)
MACRO_STATIC_INSTANCE(112,0)
MACRO_STATIC_INSTANCE(113,0)
//////////////////////////////////////////////
// Binary Input Types
//////////////////////////////////////////////
void Group1Var2::Write(apl::byte_t* p, const apl::Binary& v) const { DNPToStream::WriteQ(p, Group1Var2::Inst(), v); }
void Group2Var1::Write(apl::byte_t* p, const apl::Binary& v) const { DNPToStream::WriteQ(p, Group2Var1::Inst(), v); }
void Group2Var2::Write(apl::byte_t* p, const apl::Binary& v) const { DNPToStream::WriteQT(p, Group2Var2::Inst(), v); }
void Group2Var3::Write(apl::byte_t* p, const apl::Binary& v) const { DNPToStream::WriteQT(p, Group2Var3::Inst(), v); }
Binary Group1Var2::Read(const apl::byte_t* p) const { return DNPFromStream::ReadBinaryQV(p, Group1Var2::Inst()); }
Binary Group2Var1::Read(const apl::byte_t* p) const { return DNPFromStream::ReadBinaryQV(p, Group2Var1::Inst()); }
Binary Group2Var2::Read(const apl::byte_t* p) const { return DNPFromStream::ReadBinaryQV(p, Group2Var2::Inst()); }
Binary Group2Var3::Read(const apl::byte_t* p) const { return DNPFromStream::ReadBinaryQVT(p, Group2Var3::Inst()); }
"We provide world-class engineering services to companies leading the smart energy revolution."
посредством копипасты. малаца.
+164
if( $check_referer ) {
if( $_SERVER['HTTP_REFERER'] == ''and $_REQUEST['subaction'] != 'dologin') $allow_login = true;
elseif( clean_url( $_SERVER['HTTP_REFERER'] ) == clean_url( $_SERVER['HTTP_HOST'] ) ) $allow_login = true;
}else {
$allow_login = true;
}
dle software