- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
if (Label125->Color == clGreen)
{
CreateOrderApi();// создаем накладную
}
else
{
MessageBox("Не удалось создать накладную", "Ошибка", MB_OK | MB_ICONERROR);
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+9
if (Label125->Color == clGreen)
{
CreateOrderApi();// создаем накладную
}
else
{
MessageBox("Не удалось создать накладную", "Ошибка", MB_OK | MB_ICONERROR);
}
+1
void __fastcall TExpressProgForm::miAddClick (TObject *Sender)
{
/* куча гавна */
if (Sender != miAdd && !SuperUser && GridMain->FieldByName ("ID_city")->AsString != GetValue (DB, "SELECT @EXPRESS_CITY")
&& GetValue (DB, "SELECT 1 FROM debitor_cfo WHERE ID_city=" + GridMain->FieldByName ("ID_city")->AsString) == 1
&& GetValue (DB, "SELECT @EXPRESS_CITY") != 1538)
{
FrameEdit->Edit2->ReadOnly = true;
FrameEdit->CheckBox1->Enabled = false;
FrameEdit->Panel4->Enabled = false;
FrameEdit->miDelEmployee->Enabled = false;
}
/* куча гавна */
}
+17
......
$password = hash("sha256", $password);
......
elseif(strlen($password) < 5)
error("Пароль слишком короткий.");
......
+11
<?php
if($emailhide == 1 OR $emailhide == true OR $emailhide == 'true'){
...
}
+7
public bool IsInRange(string ip, string cidrMask)
{
string[] parts = cidrMask.Split('/');
int iIp = IPAddress.Parse(parts[0].Trim()).GetHashCode();
int iCidr = IPAddress.Parse(ip.Trim()).GetHashCode();
int iCidrMask = IPAddress.HostToNetworkOrder(-1 << (32 - int.Parse(parts[1].Trim())));
return ((iIp & iCidrMask) == (iCidr & iCidrMask));
}
Финт ушами - превращение IPv4 в Int32 через вызов GetHashCode
+1
if (jQuery('.products-items').attr('init-load') !== 'true') {
if (jQuery(this).parent().find('ul.subcategory').length > 0) {
if (jQuery(this).parent().find('ul.subcategory:first').is(":visible")) {
} else {
}
getProductsList({
search: ''
});
} else {
getProductsList({
search: ''
});
}
}
Я просто оставлю это здесь
+1
public function save() {
if (!empty(self::$single)) {
if (isset(self::$single['id'])) {
$id = self::$single['id'];
unset(self::$single['id']);
$arraySetters = [];
foreach (self::$single as $key => $value) {
$arraySetters[] = '`'.$key.'` = \''.$value.'\'';
}
self::$single['id'] = $id;
self::$exec = static::$db->prepare('UPDATE '.self::$table.' SET '.implode(', ', $arraySetters).' WHERE `id` = '.$id.' LIMIT 1');
return self::$exec->execute();
} else {
$arrayKeys = [];
$arrayValues = [];
foreach (self::$single as $key => $value) {
$arrayKeys[] = '`'.$key.'`';
$arrayValues[] = '\''.$value.'\'';
}
self::$exec = static::$db->prepare('INSERT INTO '.self::$table.' ('.implode(', ', $arrayKeys).') VALUES ('.implode(', ', $arrayValues).')');
if ($status = self::$exec->execute()) {
self::$single['id'] = static::$db->lastInsertId();
}
return $status;
}
}
return false;
}
+4
NDS_U1 946 0.1 0.0 0 0 ? Zl 00:00 0:00 [SCD_Process] <defunct>
NDS_U2 950 4.7 0.0 0 0 ? Zl 00:00 0:27 [MW_Process] <defunct>
NDS_U3 951 3.1 0.0 0 0 ? Zl 00:00 0:18 [APP_Process] <defunct>
NDS_U4 952 0.3 0.0 0 0 ? Zl 00:00 0:02 [CA_Process] <defunct>
Все основные процессы в железке выполняются как зомби, утверждается, что это самый дешевый способ демонизации. Но как-то от него сильно попахивает. По крайней мере, в таком виде если я хочу перезапустить хотя бы один из этих процессов, я должен перезагружать коробку. Да и вообще, разве процесс зомби может что-то делать полезное?
+6
echo '<!DOCTYPE html> ';
?>
<<?='h'.'t'.'m'.'l'?>>
<<?='h'.'e'.'a'.'d'?>>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo htmlspecialchars($content['meta_title'])?></title>
<meta name="keywords" content="<?php echo htmlspecialchars($content['meta_keys'])?>">
<meta name="description" content="<?php echo htmlspecialchars($content['meta_desc'])?>">
<link rel='icon' href='/favicon.jpg' type='image/x-icon' />
<link rel='shortcut icon' href='/favicon.jpg' type='image/x-icon'/>
<link rel="stylesheet" type="text/css" href="<?=TEMP_FOLDER?>css/slide_show.css">
<? if(file_exists(ROOT_DIR.'favicon.ico')) echo '<link rel="shortcut icon" href="'.SITE_URL.'favicon.ico" type="image/x-icon" />';?>
<base href="<?php echo SITE_URL?>">
<?require('css.php')?>
<?require('javascripts.php')?>
<?require('celi.php')?>
<?/*<script src="http://ie.microsoft.com/testdrive/HTML5/CompatInspector/inspector.js"></script>*/?>
</<?='h'.'e'.'a'.'d'?>>
<?php flush();
$query = "SELECT pid FROM ".TABLE_SITEMENU." WHERE id = ";
$lvl = Site_Sitemenu::gI()->get_levels($_GET['id'], $param = 'pid', $query);
?>
не доложил в прошлый раз
+1
$content = array(
'html' => '',
'meta_title' => $sitename,
'meta_keys' => $sitename,
'meta_desc' => $sitename,
'left_menu' => '',
'path' => ''
);
if ($_GET['module'] == 'page')
$_GET['module'] = 'site';
if (!isset($_GET['module'])) {
$_GET['module'] = 'site';
}
l('modules');
/* подключение текущего модуля, все остальные грузятся через __autoload() в includes/function.php */
$file = ROOT_DIR . 'modules/' . $_GET['module'] . '/i.php';
if (file_exists($file)) {
//l('load_module '. $file);
require($file);
} else {
echo 'Файл modules/' . $_GET['module'] . '/i.php не найден';
}
if (empty($content['path']) || $content['path'] == '')
$site->_404();
if (!empty($content['html'])) {
$content['html'] = fix_content($content['html']);
}
почти на уровне 1 != 1