- 1
Пиздец-оффтоп #46
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
Пиздец-оффтоп #46
#16: https://govnokod.ru/27328 https://govnokod.xyz/_27328
#17: https://govnokod.ru/27346 https://govnokod.xyz/_27346
#18: https://govnokod.ru/27374 https://govnokod.xyz/_27374
#19: https://govnokod.ru/27468 https://govnokod.xyz/_27468
#20: https://govnokod.ru/27469 https://govnokod.xyz/_27469
#21: https://govnokod.ru/27479 https://govnokod.xyz/_27479
#22: https://govnokod.ru/27485 https://govnokod.xyz/_27485
#23: https://govnokod.ru/27493 https://govnokod.xyz/_27493
#24: https://govnokod.ru/27501 https://govnokod.xyz/_27501
#25: https://govnokod.ru/27521 https://govnokod.xyz/_27521
#26: https://govnokod.ru/27545 https://govnokod.xyz/_27545
#27: https://govnokod.ru/27572 https://govnokod.xyz/_27572
#28: https://govnokod.ru/27580 https://govnokod.xyz/_27580
#29: https://govnokod.ru/27738 https://govnokod.xyz/_27738
#30: https://govnokod.ru/27751 https://govnokod.xyz/_27751
#31: https://govnokod.ru/27754 https://govnokod.xyz/_27754
#32: https://govnokod.ru/27786 https://govnokod.xyz/_27786
#33: https://govnokod.ru/27801 https://govnokod.xyz/_27801
#34: https://govnokod.ru/27817 https://govnokod.xyz/_27817
#35: https://govnokod.ru/27822 https://govnokod.xyz/_27822
#36: https://govnokod.ru/27826 https://govnokod.xyz/_27826
#37: https://govnokod.ru/27827 https://govnokod.xyz/_27827
#38: https://govnokod.ru/27833 https://govnokod.xyz/_27833
#39: https://govnokod.ru/27862 https://govnokod.xyz/_27862
#40: https://govnokod.ru/27869 https://govnokod.xyz/_27869
#41: https://govnokod.ru/27933 https://govnokod.xyz/_27933
#42: https://govnokod.ru/27997 https://govnokod.xyz/_27997
#43: https://govnokod.ru/28042 https://govnokod.xyz/_28042
#44: https://govnokod.ru/28080 https://govnokod.xyz/_28080
#45: https://govnokod.ru/28086 https://govnokod.xyz/_28086
0
def _generate_greeting(self) -> str:
date = datetime.datetime.fromtimestamp(time.time(), pytz.timezone(config.TIMEZONE))
if 6 <= date.hour < 11:
return 'Доброе утро!'
elif 11 <= date.hour < 18:
return 'Добрый день.'
elif 18 <= date.hour < 23:
return 'Добрый вечер.'
else:
return 'Доброй ночи.'
0
Политота #12
#1: https://govnokod.ru/15804 https://govnokod.xyz/_15804
#2: https://govnokod.ru/19910 https://govnokod.xyz/_19910
#3: https://govnokod.ru/23643 https://govnokod.xyz/_23643
#4: (vanished) https://govnokod.xyz/_24822
#5: https://govnokod.ru/24868 https://govnokod.xyz/_24868
#6: (vanished) https://govnokod.xyz/_26648
#7: https://govnokod.ru/26673 https://govnokod.xyz/_26673
#8: https://govnokod.ru/27052 https://govnokod.xyz/_27052
#9: https://govnokod.ru/27852 https://govnokod.xyz/_27852
#10: https://govnokod.ru/28060 https://govnokod.xyz/_28060
#11: https://govnokod.ru/28091 https://govnokod.xyz/_28091
+1
<?php defined('SYSPATH') or die('No direct script access.');
/*
* Базовый класс главной страницы
*/
class Controller_Index extends Controller {
public function before() {
parent::before();
I18n::lang('ru');
$settings = Kohana::config('settings');
Cookie::$salt = 'asd12d2';
Session::$default = 'cookie';
$this->session = Session::instance();
}
public function action_index() {
//Путь до файла первоночального xml (xsl)
$path_xml='tpl/xml.xsl';
//Путь конечного xsl
$path_xsl='tpl/index.xsl';
$url = $this->request->param('stuff');
//print_r($_SERVER);
/*if($_SERVER ['REQUEST_URI']=='/'){
$this->request->redirect($_SERVER ['HTTP_X_FORWARDED_PROTO'].'://'.$_SERVER['HTTP_HOST'],'301');
}*/
if(empty($url)){
$url='/';
}
$htmlfile='cache-html/'.md5($url);
$allurl=$_SERVER ['REQUEST_URI'];
if($allurl=='/20-40-kvm') $this->request->redirect('/sadovye-domiki','301');
if($allurl=='/40-80-kvm') $this->request->redirect('/sadovye-domiki','301');
if($allurl=='/80-i-bolee-kvm') $this->request->redirect('/sadovye-domiki','301');
if($allurl=='/nashi-proecty?searcher=48291§ion=3924&destination%5B%5D=0&destination%5B%5D=1&destination%5B%5D=2&technology%5B%5D=0&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=0-400') $this->request->redirect('/sadovye-domiki','301');
if($allurl=='/nashi-proecty?searcher=48291§ion=3924&destination%5B%5D=1&technology%5B%5D=0&technology%5B%5D=1&technology%5B%5D=2&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=81-400') $this->request->redirect('/80-i-bolee-kvm','301');
if($allurl=='/nashi-proecty?searcher=48291§ion=3924&destination%5B%5D=1&technology%5B%5D=0&technology%5B%5D=1&technology%5B%5D=2&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=40-80') $this->request->redirect('/40-80-kvm','301');
if($allurl=='/nashi-proecty?searcher=48291§ion=3924&destination%5B%5D=0&technology%5B%5D=0&technology%5B%5D=1&technology%5B%5D=2&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=0-400') $this->request->redirect('/stroitelstvo-dachnyh-domov','301');
if($allurl=='/nashi-proecty?searcher=48291§ion=3924&destination%5B%5D=2&technology%5B%5D=0&technology%5B%5D=1&technology%5B%5D=2&technology%5B%5D=3&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=0-400') $this->request->redirect('/kottedzhi','301');
if($allurl=='/nashi-proecty?searcher=48291§ion=3924&destination%5B%5D=3&technology%5B%5D=0&technology%5B%5D=2&technology%5B%5D=3&floors%5B%5D=1&floors%5B%5D=1.5&price=0-3000000&area=0-400') $this->request->redirect('/bani','301');
if($allurl=='/nashi-proecty?searcher=48291§ion=3924&destination%5B%5D=3&technology%5B%5D=2&floors%5B%5D=1&floors%5B%5D=1.5&price=0-3000000&area=0-400') $this->request->redirect('/bani-iz-profilirovannogo-brusa','301');
if($allurl=='/nashi-proecty?searcher=48291§ion=3924&destination%5B%5D=3&technology%5B%5D=0&floors%5B%5D=1&floors%5B%5D=1.5&price=0-3000000&area=0-400') $this->request->redirect('/karkasnye-bani','301');
if($allurl=='/nashi-proecty?searcher=48291§ion=3924&destination%5B%5D=3&technology%5B%5D=3&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=0-400') $this->request->redirect('/bani-iz-ocilindrovannogo-brevna','301');
if($allurl=='/nashi-proecty?searcher=48291§ion=3924&destination%5B%5D=0&destination%5B%5D=1&destination%5B%5D=2&technology%5B%5D=2&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=316018-3000000&area=0-400') $this->request->redirect('/brus','301');
if($allurl=='/nashi-proecty?searcher=48291§ion=3924&destination%5B%5D=0&destination%5B%5D=1&destination%5B%5D=2&technology%5B%5D=2&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=0-400') $this->request->redirect('/kottedzhi-profilirovannyj-brus','301');
if($allurl=='/nashi-proecty?searcher=48291§ion=3924&destination%5B%5D=0&destination%5B%5D=1&destination%5B%5D=2&technology%5B%5D=0&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=329056-3000000&area=0-400') $this->request->redirect('/dachnye-doma-karkasnaya-tehnologiya','301');
if($allurl=='/nashi-proecty?searcher=48291§ion=3924&destination%5B%5D=0&destination%5B%5D=1&destination%5B%5D=2&technology%5B%5D=1&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=0-400') $this->request->redirect('/individualnye-proekty','301');
Там ещё дальше веселье продолжается, но гк не дает запостить больше
0
Борманд, у тебя спина рыжая!
Ха-ха, я пошутил, с первым апреля )))
+1
function rand:LongInt;
{$IFOPT J-} {$J+} {$DEFINE NoJ} {$ENDIF}
const next:LongInt=1;
{$IFDEF NoJ} {$J-} {$UNDEF NoJ} {$ENDIF}
begin
next:=next*1103515245+12345;
Result:=(next div 65536) mod 32768;
end;
Краткая инструкция как сделать static unsigned long int на Delphi.
0
.org 80h
src: db "++++++++++[>+++++++>++++++++++>+++<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+."
table:
db 0h db 3Eh dw @i1
db 0h db 3Ch dw @i2
db 0h db 2Bh dw @i3
db 0h db 2Dh dw @i4
db 0h db 5Dh dw @i5
db 0h db 2Eh dw @i6
db 0h db 5Bh dw @i7
start: ; %a iptr %b dptr ;
.loop:
mov %cl [%a + @src]
cmp %cl 0h
je @.loop.break
mov %si 0h
.tloop:
mov %ch [4h * %si + {@table + 1h}]
cmp %cl %ch
jne @.tloop.continue
push @.tloop.break
mov %ip [4h * %si + {@table + 2h}]
.tloop.continue:
inc %si
cmp %si 8h
jl @.tloop
.tloop.break:
inc %a
jmp @.loop
.loop.break:
int 0h
i1: ; > ;
inc %b ret
i2: ; < ;
dec %b ret
i3: ; + ;
push %el
mov %el [%b + @data]
inc %el
mov [%b + @data] %el
pop %el
ret
i4: ; - ;
push %el
mov %el [%b + @data]
dec %el
mov [%b + @data] %el
pop %el
ret
i5: ; ] ;
push %c
mov %cl [%b + @data]
cmp %cl 0h
je @.loop.break
mov %c 0h
dec %a
.loop:
cmpb [%a + @src] 5Dh ; ']' ;
jne @.loop.1
inc %c
.loop.1:
cmpb [%a + @src] 5Bh ; '[' ;
jne @.loop.2
cmp %c 0h
jz @.loop.break
dec %c
.loop.2:
loop %a @.loop
.loop.break:
pop %c
ret
i6: ; . ;
push %cl
outb E9h [%b + @data]
.wait:
inb %cl E9h
cmp %cl 0h
jne @.wait
pop %cl
ret
i7: ; [ ;
push %c
mov %c [%b + @data]
cmp %c 0h
jne @.loop.break
mov %c 0h
.loop:
cmpb [%a + @src] 5Bh ; '[' ;
jne @.loop.1
inc %c
.loop.1:
cmpb [%a + @src] 5Dh ; ']' ;
jne @.loop.2
cmp %c 0h
jz @.loop.break
dec %c
.loop.2:
inc %a
jmp @.loop
.loop.break: pop %c ret
Hello World!
0
.org {5h * 2h}
dw @int5
.org 30h
data:
db "10"
.org 80h
start:
mov %sp FFFFh
mov %al {3h * 2h}
int 5h
int 0h
int5:
push %a
mov %ah [{@data + 1h}]
add %al %ah
outb E9h %al
.wait:
inb %al E9h
cmp %al 0h
jne @.wait
pop %a
rei
встречайте новую фичу
0
procedure TF_dvij.rg_sortClick(Sender: TObject);
var k :Integer;
s,str1,str2 :string;
fl :boolean;
begin
if G.Columns[9].Visible then
begin
fl := Q_dvij.Active ;
with Q_dvij do
begin
if fl then k := RecNo;
if rg_sort.ItemIndex=0 then s:='order by obd,gr,exped,grot'
else
if rg_sort.ItemIndex=1 then s:='order by exped,gr,obd,grot'
else
if rg_sort.ItemIndex=2 then s:='order by gr,vp,exped,obd,grot'
else
if rg_sort.ItemIndex=3 then s:='order by id_korr,exped,obd,gr,grot'
else
if rg_sort.ItemIndex=4 then s:='order by grot,gr,exped,obd'
else
s:='order by strn,obd,gr,exped,grot';
if rg_sort.ItemIndex=3 then
begin
str1 := 'select vp, id_korr,' ; //100
str2 := 'group by 1,2,3,4,5,6,7,8' //192
end
else
begin
str1 := 'select vp, max(id_korr) as id_korr,' ;
str2 := 'group by 1,3,4,5,6,7,8'
end ;
Active:=false;
SQL.Delete(100);
SQL.Insert(100, str1 );
SQL.Delete(192);
SQL.Insert(192, str2 );
SQL.Delete(262);
SQL.Insert(262, s);
Active:= fl;
if fl then RecNo := k;
G.Refresh;
end;
end;
сортировОЧКА
0
#exclude <conio.h>
конио