- 1
- 2
- 3
class UnathorizedDevice : ArgumentException { public UnathorizedDevice() : base() { } }
class LocalException : ArgumentException { public LocalException(string message) : base(message) { } }
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+134
class UnathorizedDevice : ArgumentException { public UnathorizedDevice() : base() { } }
class LocalException : ArgumentException { public LocalException(string message) : base(message) { } }
Говно или не говно? Мне кажется первое
+133
rem Check if Windows XP or Windows 7
rem XP: C:\Documents and Settings (or language specific folder)
rem 7: C:\Users
set oprsystem=%appdata:~3,5%
if %oprsystem%==Users (
set ops=win7
) else (
set ops=winxp
)
Batch
http://members.ferrara.linux.it/freddy77/encfs.html
+128
ng-include="'views/partials/header.html'"
- class="navbar navbar-static-fixed-top nav"></div>
+ /*class="navbar navbar-static-fixed-top nav"*/></div>
<ui-view id="main" class="container" id="mainContainer"></ui-view>
GIT commit diff for Angular template
+57
#include "TrayIcon.h"
// ----------------------------------------------------------------------------
TrayIcon::TrayIcon(QObject* parent) : QSystemTrayIcon(parent),
INTERVAL(1000),
WIDTH_ICON(30), HEIGHT_ICON(30)
{
currentDate = QDate(0, 0, 0);
defaultIcon = QPixmap(WIDTH_ICON, HEIGHT_ICON);
defaultIcon.fill(Qt::black);
reminderIcon = QPixmap(WIDTH_ICON, HEIGHT_ICON);
reminderIcon.fill(Qt::yellow);
thousandthDayIcon = QPixmap(WIDTH_ICON, HEIGHT_ICON);
thousandthDayIcon.fill(Qt::green);
dialogBoxIsActive = false;
readSettings();
wasReminder = false;
wasCongratulation = false;
wasSetNewDate = false;
slotUpdateDate();
QMenu* contextMenu = new QMenu;
contextMenu->addAction("Set date of birth...",
this, SLOT(slotSetDateOfBirth()));
QAction* autorunAction = contextMenu->addAction("Autorun",
this, SLOT(slotSetAutorun(bool)));
autorunAction->setCheckable(true);
autorunAction->setChecked(autorun);
contextMenu->addSeparator();
contextMenu->addAction("About...", this, SLOT(slotAboutMyProgram()));
contextMenu->addSeparator();
contextMenu->addAction("Quit", qApp, SLOT(quit()));
setContextMenu(contextMenu);
QTimer* timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), SLOT(slotUpdateDate()));
timer->start(500);
}
// ----------------------------------------------------------------------------
void TrayIcon::slotUpdateDate()
{
if((currentDate != QDate::currentDate()) || wasSetNewDate)
{
currentDate = QDate::currentDate();
daysToThousandthDay
= INTERVAL - dateOfBirth.daysTo(currentDate) % INTERVAL;
wasCongratulation = false;
wasReminder = false;
wasSetNewDate = false;
if((daysToThousandthDay != INTERVAL) && (daysToThousandthDay != 1))
{
setIcon(QIcon(defaultIcon));
setToolTip("Until next thousandth day in " +
QString().number(daysToThousandthDay) + " days.");
}
else
{
if(daysToThousandthDay == 1)
{
if(!wasReminder)
reminderBeforeDay();
}
else
{
if(!wasCongratulation)
congratulation();
}
}
}
}
Описание конструктора и одного из методов класса иконки в системном трее из программы, которая должна оповещать пользователя о каждом тысячном дне его жизни. Написано на Qt.
Полная версия:
main: http://pastebin.com/DEKiMWdb
хедер класса иконки трея: http://pastebin.com/rN9NwBPB
.cpp класса иконки трея: http://pastebin.com/uuyf5uxX
хедер класса окна ввода даты рождения: http://pastebin.com/bmfAbFwg
.cpp класса окна ввода даты рождения: http://pastebin.com/3R8BaPFC
+118
if (operator instanceof TUOperatorStacker) {
dump.put("operator_type", "TUOperatorStacker");
} else if (operator instanceof TUOperatorDestacker) {
dump.put("operator_type", "TUOperatorDestacker");
} else if (operator instanceof TUOperatorTargetedStacker) {
dump.put("operator_type", "TUOperatorTargetedStacker");
} else if (operator instanceof TUOperatorTargetedDestacker) {
dump.put("operator_type", "TUOperatorTargetedDestacker");
}
<...>
String typeString = (String) dump.get("operator_type");
TUOperator operator = null;
if (typeString.equals("TUOperatorStacker")) {
operator = new TUOperatorStacker(simElement);
} else if (typeString.equals("TUOperatorDestacker")) {
operator = new TUOperatorDestacker(simElement);
} else if (typeString.equals("TUOperatorTargetedStacker")) {
operator = new TUOperatorTargetedStacker(simElement);
} else if (typeString.equals("TUOperatorTargetedDestacker")) {
operator = new TUOperatorTargetedDestacker(simElement);
}
+154
if (d_min < 0) {
// push out by normal * |d_min|
x = x - d_min * T[t_min];
y = y - d_min * T[t_min + 1];
y = z - d_min * T[t_min + 2];
Сука, блядь, пиздец, два часа убил.
+70
* Calculates the minimum number of bits necessary to represent the given number. The
* number should be given in its unsigned form with the starting bits equal to 1 if it is
* signed. Repeatedly compares number to another unsigned int called x.
* x is initialized to 1. The value of x is shifted left i times until x is greater
* than number. Now i is equal to the number of bits the UNSIGNED value of number needs.
* The signed value will need one more bit for the sign so i+1 is returned if the number
* is signed, and i is returned if the number is unsigned.
* @param number the number to compute the size of
* @param bits 1 if number is signed, 0 if unsigned
*/
public static int minBits(int number, int bits)
{
int val = 1;
for (int x = 1; val <= number && !(bits > 32); x <<= 1)
{
val = val | x;
bits++;
}
if (bits > 32)
{
assert false : ("minBits " + bits + " must not exceed 32");
}
return bits;
}
Адоб, как обычно, порадовал (условие окончания цикла).
[color=blue]https://git-wip-us.apache.org/repos/asf/flex-sdk/repo?p=flex-sdk.git;a=blob;f=modules/swfutils/src/java/flash/swf/SwfEncoder.java;h=03a100dda92989d537b00b 96033d614c73c47801;hb=HEAD#l320[/code]
+63
renderer->SetBackground(.0, .0, .0); // Background color green
+124
quicksort [] = []
quicksort (h:t) = (quicksort(filter (=h) t))
quicksort на хаскель. лаба. масло. 2014
+153
public function indexAction()
{
if (Zend_Auth::getInstance()->hasIdentity()) {
Zend_Auth::getInstance()->getIdentity();
}
}