- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
.selection-href {
height: inherit !important;
font-size: 1em !important;
font-weight: inherit !important;
box-sizing: inherit !important;
width: inherit !important;
text-transform: none !important;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+1
.selection-href {
height: inherit !important;
font-size: 1em !important;
font-weight: inherit !important;
box-sizing: inherit !important;
width: inherit !important;
text-transform: none !important;
}
+1
{header}
<p style="font-weight: bold; text-decoration: underline">{$orgName}</p>
<p style="font-weight: bold">Адреса: {$orgBillingAddress}, тел.: {$orgPhone}</p>
<div style="font-weight: bold; text-align: center">Зразок заповенння платіжного доручення</div>
<table border="1" cellpadding="2">
<tr>
<td width="140">ЄДРПО {$orgInn}</td><td width="140">ІДПРС {$orgKpp}</td><td rowspan="2" width="50"><br/><br/>Рахунок. №</td><td rowspan="2" width="200"><br/><br/>{$orgBankAccount}</td>
</tr>
<tr>
<td colspan="2" width="280"><span style="font-size: 8pt">Одержувач</span><br/>{$orgName}</td>
</tr>
<tr>
<td colspan="2" rowspan="2" width="280"><span style="font-size: 8pt">Банк отримувача</span><br/>{$orgBankName}</td>
<td width="50">БІК</td>
<td rowspan="2" width="200">{$orgBankId}<br/>{$orgCorrAccount}</td>
</tr>
<tr>
<td width="50">Рахунок. №</td>
</tr>
</table>
<br/>
<h1 style="text-align: center">Рахунок № {$invoice_no} від {$invoice_invoicedate}</h1>
<br/><br/>
<table border="0">
<tr>
<td width="100">Платник:</td><td width="450"><span style="font-weight: bold">{$account_accountname}</span></td>
</tr>
<tr>
<td width="100">Одержувач:</td><td width="450"><span style="font-weight: bold">{$orgName}</span></td>
</tr>
</table>
{/header}
{table_head}
<table border="1" style="font-size: 8pt" cellpadding="2">
<tr style="text-align: center; font-weight: bold">
<td width="30">№</td>
<td width="260">Назва<br/>товару</td>
<td width="65">Одиниця<br/>вимір-<br/>рювання</td>
<td width="35">Кіль-<br/>кість</td>
<td width="70">Ціна</td>
<td width="70">Сумма</td>
</tr>
{/table_head}
{table_row}
<tr>
<td width="30">{$productNumber}</td>
<td width="260">{$productName} {$productComment}</td>
<td width="65" style="text-align: center">{$productUnits}</td>
<td width="35" style="text-align: right">{$productQuantityInt}</td>
<td width="70" style="text-align: right">{$productPrice}</td>
<td width="70" style="text-align: right">{$productNetTotal}</td>
</tr>
{/table_row}
{summary}
</table>
<table border="0" style="font-size: 8pt;font-weight: bold">
<tr>
<td width="460">
<table border="0" cellpadding="2">
<tr><td width="460" style="text-align: right">Разом:</td></tr>
<tr><td width="460" style="text-align: right">Сумма ПРД:</td></tr>
<tr><td width="460" style="text-align: right">Всього до сплати:</td></tr>
</table>
</td>
<td width="70">
<table border="1" cellpadding="2">
<tr><td width="70" style="text-align: right">{$summaryNetTotal}</td></tr>
<tr><td width="70" style="text-align: right">{$summaryTax}</td></tr>
<tr><td width="70" style="text-align: right">{$summaryGrandTotal}</td></tr>
</table>
</td>
</tr>
</table>
<p>
Всього найменувань {$summaryTotalItems}, на сумму {$summaryGrandTotal} грн.<br/>
<span style="font-weight: bold">{$summaryGrandTotalLiteral}</span>
</p>
{/summary}
{ending}
<br/>
<p>Крівник підприємства __________________ ( {$orgDirector} ) <br/>
<br/>
Головний бухгалтер __________________ ( {$orgBookkeeper} )
</p>
{/ending}
генератор пдф
+1
TBufferedFileInput storage(sprintf("%s", path));
Весьма оригинальный способ приведения типа к самому себе.
+1
public class UnionDocumentJournalController : BaseDocumentJournalController
<UnionDocumentJournalFilterViewModel, UnionDocumentJournalEntityViewModel, UnionDocumentJournalDataViewModel,
UnionDocumentDataProvider, UnionDocumentDataManager, UnionLegalEntityDocumentsJournalViewModelMapper>
{ }
public class UnionDocumentJournalFilterViewModel : BaseJournalFilterViewModel<UnionDocumentJournalEntityViewModel>
{
...
}
public class UnionDocumentJournalEntityViewModel : LegalEntityDocumentJournalEntityViewModel
{
...
}
public class UnionDocumentJournalDataViewModel : BaseJournalDataViewModel<UnionDocumentJournalEntityViewModel>
{ }
public class UnionDocumentDataManager :
DocumentDataManager
<UnionDocumentDataProvider, UnionDocumentJournalFilterViewModel, UnionDocumentJournalEntityViewModel>
{
...
}
public class UnionLegalEntityDocumentsJournalViewModelMapper :
LegalEntityDocumentsJournalViewModelMapper<UnionDocumentJournalEntityViewModel, UnionDocumentJournalDataViewModel>
{
...
}
Горе от ума
+1
Главный хтмл файл:
<div id="load-script" style="display:none">
$(document).ready(function() {
$('.social-needs-container__slider-container').slick({
slidesToShow: 3,
slidesToScroll:1,
...
});
});
</div>
Директива:
link: function link($scope, iElement) {
Api.get({
...
}).$promise.then(function(data) {
$scope.getContentUrl = function() {
var template = 'http://localhost:1337/app/js/modules/core/templates/projects/types/';
...
return template;
}
...
var init = angular.element("#load-script");
var code = init.text();
init.remove();
var f = new Function(code);
$timeout(f, 350);
...
});
},
Суть в том, что нужно динамически подключать темплейт по урлу, попутно инициализировав сторонний плагин (slick slider).
Переписовать код слайдера под уже готовую slick-директиву видимо было лень.
+1
function windowSize(){
if (jQuery(window).width() <= '995'){
var pdiv = jQuery('#fw_c > div:nth-child(5) > div > div > div.vc_row.wpb_row.vc_inner.vc_row-fluid > div:nth-child(2)').parent('#fw_c > div:nth-child(5) > div > div > div.vc_row.wpb_row.vc_inner.vc_row-fluid > div:nth-child(2)');
pdiv.insertAfter(pdiv.next());
}
}
Верстаем адаптивно
http://ru.stackoverflow.com/questions/454209/
+1
function cashBonusCalculator(currentDepositValue, el) {
var $scope = el;
if (!currentDepositValue) {
currentDepositValue = 0;
}
var max_bonus_01 = $scope.find('[name="progr_step_01_max"]'),
max_bonus_02 = $scope.find('[name="progr_step_02_max"]'),
max_bonus_03 = $scope.find('[name="progr_step_03_max"]'),
bonus_start_01 = $scope.find('[name="progr_step_01_start"]'),
bonus_start_02 = $scope.find('[name="progr_step_02_start"]'),
bonus_start_03 = $scope.find('[name="progr_step_03_start"]'),
bonus_amount_01 = $scope.find('[name="progr_step_01_amount"]'),
bonus_amount_02 = $scope.find('[name="progr_step_02_amount"]'),
bonus_amount_03 = $scope.find('[name="progr_step_03_amount"]');
if (cash_bonuses_list[0]) {
max_bonus_01.text('max ' + cash_bonuses_list[0].maxbonus.toMonetaryString());
bonus_start_01.text(cash_bonuses_list[0].f.toMonetaryString());
bonus_amount_01.text(cash_bonuses_list[0].bonus + '%');
main_gift_conditions.text('x' + cash_bonuses_list[0].wager + ' ' + wagerType +'; ' + cash_bonuses_list[0].ttl + _('h'));
gift_progress.addClass('cash_gift_progress_level_01');
}
if (cash_bonuses_list[1]) {
max_bonus_02.text('max ' + cash_bonuses_list[1].maxbonus.toMonetaryString());
bonus_start_02.text(cash_bonuses_list[1].f.toMonetaryString());
bonus_amount_02.text(cash_bonuses_list[1].bonus + '%');
main_gift_conditions.text('x' + cash_bonuses_list[1].wager + ' ' + wagerType + '; ' + cash_bonuses_list[1].ttl + _('h'));
gift_progress.addClass('cash_gift_progress_level_02');
}
if (cash_bonuses_list[2]) {
max_bonus_03.text('max ' + cash_bonuses_list[2].maxbonus.toMonetaryString());
bonus_start_03.text(cash_bonuses_list[2].f.toMonetaryString());
bonus_amount_03.text(cash_bonuses_list[2].bonus + '%');
main_gift_conditions.text('x' + cash_bonuses_list[2].wager + ' ' + wagerType + '; ' + cash_bonuses_list[2].ttl + _('h'));
gift_progress.addClass('cash_gift_progress_level_03');
}
if (window.CASHBONUSES && window.CASHBONUSES.length > 0) {
var progressSteps = 3;
if (cash_bonuses_list[0]) {
progressSteps = 1;
}
if (cash_bonuses_list[1]) {
progressSteps = 2;
}
if (cash_bonuses_list[2]) {
progressSteps = 3;
}
if (cash_bonuses_list[0] && currentDepositValue <= cash_bonuses_list[0].t && currentDepositValue >= cash_bonuses_list[0].f) {
$scope.find('[name="cash_gift_progressbar"]').css({
width: (((main_progress_width / progressSteps) * ( (currentDepositValue - cash_bonuses_list[0].f) / (((cash_bonuses_list[0].t - cash_bonuses_list[0].f) / 100)) * 0.01))) + 'px'
});
main_gift_amount.text(cash_bonuses_list[0].c + ' ' + currentBonusSumm(cash_bonuses_list[0].bonus, cash_bonuses_list[0].maxbonus, fromCashDepositValue));
} else if (!cash_bonuses_list[1] && cash_bonuses_list[0] && currentDepositValue > cash_bonuses_list[0].t && currentDepositValue >= cash_bonuses_list[0].f){
$scope.find('[name="cash_gift_progressbar"]').css({
width: '100%'
});
main_gift_amount.text(cash_bonuses_list[0].c + ' ' + currentBonusSumm(cash_bonuses_list[0].bonus, cash_bonuses_list[0].maxbonus, fromCashDepositValue));
} else if (cash_bonuses_list[1] && currentDepositValue <= cash_bonuses_list[1].t && currentDepositValue >= cash_bonuses_list[1].f) {
$scope.find('[name="cash_gift_progressbar"]').css({
width: (((main_progress_width / progressSteps) * ( (currentDepositValue - cash_bonuses_list[1].f) / (((cash_bonuses_list[1].t - cash_bonuses_list[1].f) / 100)) * 0.01)) + (main_progress_width / progressSteps)) + 'px'
});
main_gift_amount.text(cash_bonuses_list[1].c + ' ' + currentBonusSumm(cash_bonuses_list[1].bonus, cash_bonuses_list[1].maxbonus, fromCashDepositValue));
} else if (!cash_bonuses_list[2] && cash_bonuses_list[1] && currentDepositValue > cash_bonuses_list[1].t && currentDepositValue >= cash_bonuses_list[1].f){
$scope.find('[name="cash_gift_progressbar"]').css({
width: '100%'
});
main_gift_amount.text(cash_bonuses_list[1].c + ' ' + currentBonusSumm(cash_bonuses_list[1].bonus, cash_bonuses_list[1].maxbonus, fromCashDepositValue));
} else if (cash_bonuses_list[2] && currentDepositValue <= cash_bonuses_list[2].maxbonus && currentDepositValue >= cash_bonuses_list[2].f){
$scope.find('[name="cash_gift_progressbar"]').css({
width: (((main_progress_width / progressSteps) * ( (currentDepositValue - cash_bonuses_list[2].f) / (((cash_bonuses_list[2].maxbonus - cash_bonuses_list[2].f) / 100)) * 0.01)) + ((main_progress_width / progressSteps) * 2)) + 'px'
});
+1
private function check($data) {
$result = $this->checkData($data);
if ($result === true) return true;
$sm = new SystemMessage();
return $sm->message($result);
}
protected function checkData($data) {
return false;
}
С видеокурса Михаила Русакова
+1
import std.io;
import std.string;
import calendar.month;
module calendar.date;
namespace Chrono
{
export
struct Date {
Date(int, Month, int);
int day() const
{
return d;
}
Month month() const
{
return m;
}
Int year() const
{
return y;
}
private:
int d;
Month m;
int y;
};
export
std::ostream &operator<<(std::ostream &, const Date &);
export
std::string to_string(const Date &);
}
По мотивам: http://habrahabr.ru/company/infopulse/blog/267781/
зы. https://github.com/isocpp/CppCoreGuidelines/blob/master/talks/Large-Scale-C%2B%2B-With-Modules.pdf
+1
class DBUSLIB_EXPORT DBusLib : public QObject
{
Q_OBJECT
public:
DBusLib(QObject* parent = 0);
void requestId(const QString &req, const int &reqTimeOut);
QByteArray replyData;
QString name;
MyPair reqStruct; // id, partsCount
QVector<QByteArray> vecFile;
int partsCount; //кол-во частей
int parts; //кол-во пришедших
QTimer *timer = new QTimer(this);
signals:
void doneSignal(QByteArray& fileData);
public slots:
void requestMap(const MyPair &dbm);
void partsFile(const MyPair &part);
void requestFail(const QDBusError& error);
void timeIsOver();
};
Студент принес говна. Паблик морозов, ценные комментарии и все такое.
Вот только мне любопытна 14 строчка. C++11 не включен.
Конпелятор mingw492 выбрасывает ворнинг
D:\projects\test_dbus\client_v2\client_l ib\dbuslib.h:35: предупреждение: non-static data member initializers only available with -std=c++11 or -std=gnu++11
QTimer *timer = new QTimer(this);
^
Но при этом все компилится и работает. Значит, 03 стандарт разрешает такое?