- 1
- 2
- 3
sector_t * s = §ors[secnum];
if (!s->floorplane.isSlope()) s->reflect[sector_t::floor] = arg1/255.f;
if (!s->ceilingplane.isSlope()) sectors[secnum].reflect[sector_t::ceiling] = arg2/255.f;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+1
sector_t * s = §ors[secnum];
if (!s->floorplane.isSlope()) s->reflect[sector_t::floor] = arg1/255.f;
if (!s->ceilingplane.isSlope()) sectors[secnum].reflect[sector_t::ceiling] = arg2/255.f;
присвоил переменной и во второй раз не использовал
+1
https://www.google.com/search?q=%D0%B2%D0%BE%D1%80%D0%B5%D1%86%D0%B8%D0%B8
Насрали так, что все ссылки ведут на говнокод.
Как эта херомантия называется в науке?
3.14159265359, это ты придумал слово "вореции"?
+1
if (collection == null) collection = Rows.Where(r => r.ParentId == 0);
foreach (var row in collection.Where(r => r.ParentId > 0))
{
//немного кода
}
Сам писал. Вчера. Трезвый.
Сейчас вот думаю, а чо эта оно не работает?
+1
// 1188 references
internal static string CombinePaths(string firstPath, string secondPath)
{
return Path.Combine(firstPath, secondPath);
}
- Шо это было?!!
- Cэкономили точку. 1188 раз )))))
+1
public class FileStorage {
public FileStorage() {
try {
if (String.IsNullOrEmpty(Common.GlobalVariables.FileStorage)) {
throw new Exception(Common.GuiHelper.ShowErrorMessage("FileStorage", String.Empty));
}
if (!Directory.Exists(Common.GlobalVariables.FileStorage)) {
DirectoryInfo di = Directory.CreateDirectory(Common.GlobalVariables.FileStorage);
if (!di.Exists) {
throw new Exception(Common.GuiHelper.ShowErrorMessage("FileStorageDir", String.Empty));
}
}
} catch (Exception er) {
throw new Exception(er.Message);
}
}
public String CreateFileDirectory() {
try {
int iIdx = 0;
Boolean bIsCreated = false;
while (!bIsCreated && iIdx < 10) {
String sDir = Guid.NewGuid().ToString("N").ToLower();
sDir = sDir.Substring(0, 2);
if (!Directory.Exists(Common.GlobalVariables.FileStorage + sDir + @"\")) {
DirectoryInfo di = Directory.CreateDirectory(Common.GlobalVariables.FileStorage + sDir + @"\");
if (di.Exists) {
return Common.GlobalVariables.FileStorage + sDir + @"\";
}
}
iIdx++;
}
return null;
} catch (Exception er) {
throw new Exception(er.Message);
}
}
}
может я чего не понимаю, но зачем?
+1
<?php if($this->config->get('UniversumControl_status') == '1'){ ?>
<style type="text/css">
body {
<?php if(( $this->config->get('UniversumControl_body_bg_pattern') != null) && ($this->config->get('UniversumControl_body_bg_pattern') != 'pattern0.png')){ ?>
background:url("catalog/view/theme/<?php echo $this->config->get('config_template'); ?>/image/backgrounds/<?php echo $this->config->get('UniversumControl_body_bg_pattern');?>") top center repeat;
<?php } ?>
background-color:#<?php echo $this->config->get('UniversumControl_body_bg_color') ?>;
font-family:<?php echo $this->config->get('UniversumControl_body_font') ?>;
color:#<?php echo $this->config->get('UniversumControl_text_color') ?>;
}
h1,h2,h3,h4,h5,h6, #menu ul li a, #column-left .box .box-heading, #column-right .box .box-heading, .htabs a, .product-info .price-old, .product-info .price-new, .product-info .cart .button, .offer_title, div.prod_hold .prod-info-fly .name a, .accordeonHolder .name a, .prod_hold .name a, #content .boxPlain .box-heading {
<?php if(($this->config->get('UniversumControl_status') == '1') && ( $this->config->get('UniversumControl_custom_font') != null)){ ?>
font-family: '<?php echo $this->config->get('UniversumControl_custom_font_family');?>';
<?php } elseif (($this->config->get('UniversumControl_status') == '1') && ( $this->config->get('UniversumControl_custom_font') == null) && ( $this->config->get('UniversumControl_header_font') != 'Arial')){ ?>
<?php $headerFont = $this->config->get('UniversumControl_headings_font');
$font = str_replace("+", " ", $headerFont);
?> font-family: '<?php echo $font; ?>';
<?php } else { ?>
font-family: 'Ubuntu Condensed';
<?php } ?>
}
<?php if(($this->config->get('UniversumControl_status') == '1') && ( $this->config->get('UniversumControl_headings_color') != null)){ ?>
h1, h2, h2.heading_title, h3, h4, h5, h6, #column-left .box .box-heading, #column-right .box .box-heading {
color:#<?php echo $this->config->get('UniversumControl_headings_color') ?>;
}
<?php } ?>
<?php if(($this->config->get('UniversumControl_status') == '1') && ( $this->config->get('UniversumControl_headings1_size') != null)){ ?>
h1 {
font-size:<?php echo $this->config->get('UniversumControl_headings1_size') ?>px;
}
<?php } ?>
<?php if(($this->config->get('UniversumControl_status') == '1') && ( $this->config->get('UniversumControl_headings2_size') != null)){ ?>
h2, #content .boxPlain .box-heading {
font-size:<?php echo $this->config->get('UniversumControl_headings2_size') ?>px;
}
<?php } ?>
<?php if(($this->config->get('UniversumControl_status') == '1') && ( $this->config->get('UniversumControl_headings3_size') != null)){ ?>
h3 {
font-size:<?php echo $this->config->get('UniversumControl_headings3_size') ?>px;
}
<?php } ?>
<?php if(($this->config->get('UniversumControl_status') == '1') && ( $this->config->get('UniversumControl_headings4_size') != null)){ ?>
h4 {
font-size:<?php echo $this->config->get('UniversumControl_headings4_size') ?>px;
}
<?php } ?>
<?php if(($this->config->get('UniversumControl_status') == '1') && ( $this->config->get('UniversumControl_price_size') != null)){ ?>
.product-info .price {
font-size:<?php echo $this->config->get('UniversumControl_price_size') ?>px;
}
<?php } ?>
<?php if(($this->config->get('UniversumControl_status') == '1') && ( $this->config->get('UniversumControl_module_title_size') != null)){ ?>
#content h2.heading_title span {
font-size:<?php echo $this->config->get('UniversumControl_module_title_size') ?>px;
}
<?php } ?>
<?php if(($this->config->get('UniversumControl_status') == '1') && ( $this->config->get('UniversumControl_column_title_size') != null)){ ?>
#column-left .box .box-heading, #column-right .box .box-heading {
font-size:<?php echo $this->config->get('UniversumControl_column_title_size') ?>px;
}
И такого кода там еще на 1000 строк.
Интернет-магазин на опенкарте. Видимо кто то сделал систему настраивания css через админку))
+1
<?php
class Controller_Messages extends Controller {
function __construct() {
$this->log = new Log;
if(!defined('SECURITY_CONST')) {
$this->log->log('[controller_messages.php:'.__LINE__.'] SECURITY_CONST is undefined');
exit;
}
$this->user = new User;
$this->lang = new Lang;
$this->view = new View;
$this->model = new Model_Messages;
if(!$this->user->isAuth()) {
header('Location: /not_auth');
}
$this->user_lang = $this->user->getLang();
$this->lang->setLang($this->user_lang);
}
Открыл исходник и тут такое....
+1
Что за мемчик про вореции?
Желательно со ссылками на лурк.
+1
private int GetSroOper(MiscTransactionParams param)
{
if (param.ExpenseItem != null)
{
switch (param.ContractType)
{
case Entities.AT.ContractType.Undefined:
case Entities.AT.ContractType.TimeAndMaterials:
case Entities.AT.ContractType.Retainer:
switch ((int)param.ExpenseItem.ExpenseCategory)
{
case 2:
case 3:
case 29684252:
case 29684285:
case 29684805:
return param.BillingItem.IsNonBillable() ? Helper.SLServiceOrderOperation600 : Helper.SLServiceOrderOperation900;
default:
throw new InvalidOperationException("Unsupported Expense Category value");
}
case Entities.AT.ContractType.RecurringService:
switch ((int)param.ExpenseItem.ExpenseCategory)
{
case 2:
case 3:
case 29684252:
case 29684285:
case 29684805:
return param.BillingItem.IsNonBillable() ? Helper.SLServiceOrderOperation550 : Helper.SLServiceOrderOperation950;
default:
throw new InvalidOperationException("Unsupported Expense Category value");
}
case Entities.AT.ContractType.FixedPrice:
switch ((int)param.ExpenseItem.ExpenseCategory)
{
case 2:
case 3:
case 29684252:
case 29684285:
case 29684805:
return param.BillingItem.IsNonBillable() ? Helper.SLServiceOrderOperation500 : Helper.SLServiceOrderOperation950;
default:
throw new InvalidOperationException("Unsupported Expense Category value");
}
case Entities.AT.ContractType.Incident:
switch ((int)param.ExpenseItem.ExpenseCategory)
{
case 2:
case 3:
case 29684252:
case 29684285:
case 29684805:
return param.BillingItem.IsNonBillable() ? Helper.SLServiceOrderOperation600 : Helper.SLServiceOrderOperation950;
default:
throw new InvalidOperationException("Unsupported Expense Category value");
}
default:
throw new InvalidOperationException("Unsupported ContractType value");
}
}
else
{
switch (param.ContractType)
{
case Entities.AT.ContractType.Undefined:
case Entities.AT.ContractType.TimeAndMaterials:
case Entities.AT.ContractType.Retainer:
return param.BillingItem.IsNonBillable() ? Helper.SLServiceOrderOperation600 : Helper.SLServiceOrderOperation900;
case Entities.AT.ContractType.RecurringService:
return param.BillingItem.IsNonBillable() ? Helper.SLServiceOrderOperation550 : Helper.SLServiceOrderOperation950;
case Entities.AT.ContractType.FixedPrice:
case Entities.AT.ContractType.Incident:
int sroOper = (int)param.OrderOperation.EntityRow()[Constants.ServiceOrderOperation.Field.SroOper];
switch (sroOper)
{
case 500:
case 600:
case 800:
case 850:
case 950:
return sroOper;
default:
throw new InvalidOperationException("Unsupported Operation value");
}
default:
throw new InvalidOperationException("Unsupported ContractType value");
}
}
}
Это наш сеньор написал
+1
[DllImport("quickusb.dll", CharSet = CharSet.Ansi)]
static extern int QuickUsbWriteData(IntPtr Handle, byte[] outData, int length);
// ...
public bool Write(byte[] data)
{
// ...
int result = QuickUsbWriteData(handle, data, data.Length);
if (result != 0)
return true;
else if (result == 0)
{
LastError = "QUSB returned 0";
return false;
}
else
{
LastError = "Unknown error inside WriteData";
return false;
}
// ...
}
Видимо, последняя ветка - на случай зомби-апокалипсиса или особо сильных глюков после передоза.