- 1
- 2
public:
void* getThis(void){return this;};;;;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+179
public:
void* getThis(void){return this;};;;;
+137
rem ID generator
:idgen
set nsmb=36
set idstr=
for /l %%i in (1,1,8) do call :rsadd
echo ID=%idstr%
exit /b
rem Random symbol adding [0-9a-z]
:rsadd
set r=%random%
set /a c=r-r/nsmb*nsmb
if %c% lss 10 set idstr=%idstr%%c%
if %c% == 10 set idstr=%idstr%a
if %c% == 11 set idstr=%idstr%b
if %c% == 12 set idstr=%idstr%c
if %c% == 13 set idstr=%idstr%d
if %c% == 14 set idstr=%idstr%e
if %c% == 15 set idstr=%idstr%f
if %c% == 16 set idstr=%idstr%g
if %c% == 17 set idstr=%idstr%h
if %c% == 18 set idstr=%idstr%i
if %c% == 19 set idstr=%idstr%j
if %c% == 20 set idstr=%idstr%k
if %c% == 21 set idstr=%idstr%l
if %c% == 22 set idstr=%idstr%m
if %c% == 23 set idstr=%idstr%n
if %c% == 24 set idstr=%idstr%o
if %c% == 25 set idstr=%idstr%p
if %c% == 26 set idstr=%idstr%q
if %c% == 27 set idstr=%idstr%r
if %c% == 28 set idstr=%idstr%s
if %c% == 29 set idstr=%idstr%t
if %c% == 30 set idstr=%idstr%u
if %c% == 31 set idstr=%idstr%v
if %c% == 32 set idstr=%idstr%w
if %c% == 33 set idstr=%idstr%x
if %c% == 34 set idstr=%idstr%y
if %c% == 35 set idstr=%idstr%z
exit /b
Windows shell
Собственноручно написанное. Нашел, разбирая старые скрипты.
+137
int bufImin[32]={ 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000};
int bufImax[32]={20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000};
double bufPmin[32]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 315, 0, 0, 0, 0, 0, 0};
double bufPmax[32]={ 6, 10, 1, 10, 40, 10 , 10, 10, 10, -315, 0, 0, 100, 100, 10, 1000};
/*...*/
bufPmin[9]=(double)CR1_Lb1_4mA*5-500.0;
bufPmax[9]=(double)CR1_Lb1_20mA*5-500.0;
Presh[9]=CurrentToPresh(I_9, bufImax[9],bufImin[9],bufPmax[9],bufPmin[9]);
bufPmin[10]=(double)CR1_Lb2_4mA*5-500.0;
bufPmax[10]=(double)CR1_Lb2_20mA*5-500.0;
Presh[10]=CurrentToPresh(I_10, bufImax[10],bufImin[10],bufPmax[10],bufPmin[10]);
/*...*/
bufPmax[10]=(double)CR5_Tg_max;
Presh[15]==CurrentToPresh(I_15, bufImax[15],bufImin[15],bufPmax[15],bufPmin[15]);
Разгребаю г*вно от предыдущего программиста...
- зачем массивы на 32 элемента, если их всегда 16.
- зачем массивы с одинаковыми данными.
- зачем инициализировать массив числами, которые никогда не используются.
- массивы используются только для передачи значений в функцию.
- 17 строка. Это ж надо спутать индекс; как незаметно.
- 18 строка. :) ==3
- "Presh" отнюдь не значит "precious", как подумали б американцы. Это Pressure по своей сути.
+147
$url_view = 'pages/news';// страница вида
$data = array(); //Создаем массив дата
// сегменты урл
$data['segment_1'] = $filter_1;
$data['segment_2'] = $filter_2;
$limit = 10; // вывод новостей
$num_links = 4; // кол-во страниц во круг текущей
$uri_segment = 5; // сегмент ссылки
$offset = ($page - 1) * $limit; // переводим page в offset
if(!is_numeric($filter_2)) {$filter_2 = iconv('utf-8', 'windows-1251', urldecode($filter_2));}
$base_url = '/page/filter/'.$filter_1.'/'.$filter_2.'/';
// разбираем 1 фильтр для проверки
$filter_global = explode("_",$filter_1);
if($filter_global[0] == 'user') {$filter_1 = 'user'; $user_id = (int)$filter_global[1];}
// описание каждого элемента фильтра
switch($filter_1) {
case 'date':
$total = $this->paginations->count_posts_filter('news',$filter_1,$filter_2);
$data['materials'] = $this->paginations->list_posts_filter($limit, $offset, 'news', $filter_1, $filter_2);
break;
case 'date_day':
$total = $this->paginations->count_posts_filter('news',$filter_1,$filter_2);
$data['materials'] = $this->paginations->list_posts_filter($limit, $offset, 'news', $filter_1, $filter_2);
break;
case 'date_month':
$total = $this->paginations->count_posts_filter('news',$filter_1,$filter_2);
$data['materials'] = $this->paginations->list_posts_filter($limit, $offset, 'news', $filter_1, $filter_2);
break;
case 'date_year':
$total = $this->paginations->count_posts_filter('news',$filter_1,$filter_2);
$data['materials'] = $this->paginations->list_posts_filter($limit, $offset, 'news', $filter_1, $filter_2);
break;
case 'rating':
$total = $this->paginations->count_posts_filter('news',$filter_1,$filter_2);
$data['materials'] = $this->paginations->list_posts_filter($limit, $offset, 'news', $filter_1, $filter_2);
break;
case 'random':
$total = $this->paginations->count_posts_filter('news',$filter_1,$filter_2);
$data['materials'] = $this->paginations->list_posts_filter($limit, $offset, 'news', $filter_1, $filter_2);
break;
case 'moderation':
$total = $this->paginations->count_posts_filter('news',$filter_1,$filter_2);
$data['materials'] = $this->paginations->list_posts_filter($limit, $offset, 'news', $filter_1, $filter_2);
break;
case 'user':
$filter_1 = $filter_global[0].'_'.$filter_global[1]; // собираем обратно
$total = $this->paginations->count_posts_filter('news',$filter_1,$filter_2);
$data['materials'] = $this->paginations->list_posts_filter($limit, $offset, 'news', $filter_1, $filter_2);
break;
default:
$total = $this->paginations->count_posts_filter('news',$filter_1,$filter_2);
$data['materials'] = $this->paginations->list_posts_filter($limit, $offset, 'news', $filter_1, $filter_2);
break;
}
$this->auxiliary->pagination($base_url,$uri_segment,$num_links,$total,$limit);//настройки пагинации
$this->auxiliary->general_view($data,'title_best','description_best','keywords_best',$url_view); // общий вид
проверьте на наличие гавно кода .
Контроллер фильтра выдачи в Codeigniter
+101
double k;
if(deviceType == "firstType"){
for(int i = 0;i < 100000;i++)
k = pow(2,10);
}
else if(deviceType == "secondType"){
for(int i = 0;i < 700000;i++)
k = pow(2,10);
}
Думаю этот даунизм поймут все. Маразм крепчал)
+162
ModuleManagerImpl::ModuleManagerImpl()
{
ModuleManager::loadPlugins();
Config config = ProfileDialog::profilesInfo();
#ifdef QUTIM_SINGLE_PROFILE
bool singleProfile = true;
#else
bool singleProfile = false;
#endif
singleProfile = config.value("singleProfile", singleProfile);
if (singleProfile) {
if (!config.hasChildGroup("profile")) {
QWidget *wizard = new ProfileCreationWizard(this, QString(), QString(), true);
wizard->setAttribute(Qt::WA_DeleteOnClose, true);
wizard->setAttribute(Qt::WA_QuitOnClose, false);
SystemIntegration::show(wizard);
} else {
config.beginGroup("profile");
if(ProfileDialog::acceptProfileInfo(config, QString())) {
QTimer::singleShot(0, this, SLOT(initExtensions()));
} else {
qWarning("Can't login");
QDialog *dialog = new ProfileDialog(config, this);
SystemIntegration::show(dialog);
}
config.endGroup();
}
} else {
QDialog *dialog = new ProfileDialog(config, this);
SystemIntegration::show(dialog);
}
}
не знаю как вам, а мне не нравится объявление singleProfile.
qutim/core/src/modulemanagerimpl.cpp
+158
for (int i = 0; i < n; i++)
if (i == n + 2)
//действия
=)
+140
return (a >= factor || (a == factor && (c & 1) == 1)) ? 1 : 0;
https://github.com/mono/mono/blob/master/mono/metadata/decimal.c
+147
dirname(__FILE__)
+135
(+ 3 5)
(* 5 6 7)
(kupitj bulochnaja baton)
Можно записать выражения и посложнее:
(kupitj bulochnaja baton (+ 2 1))
«Купи в булочной батоны: два плюс ещё один». Просто, не правда ли? Давайте двигаться дальше.
(define (privet imja)
(display "Privet ")
(display imja)
(display "!")
(newline))
(define (polzovatel)
(write "Predstavtes:")
(read))
(privet (polzovatel))
Нашел этот пиздец в Введение в язык Scheme для школьников, сначала подумал что автор таким образом заставляет работать мозг школьника(пища все таки) но нет подобное продолжается. К сожалению полной версии "учебника" не имею надеюсь подобное затрагивает только вступление и дальше будет лучше..
З.ы думаю первый говнокод на Scheme....(: