- 1
- 2
- 3
- 4
template <class F, class G>
auto operator*(F&& f, G&& g) -> decltype(auto) {
return [=](auto ...args) { return f(g(args...)); };
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+2
template <class F, class G>
auto operator*(F&& f, G&& g) -> decltype(auto) {
return [=](auto ...args) { return f(g(args...)); };
}
Композиция функций
+2
<VAST version="3.0"><Ad id="5693910"><InLine><AdSystem version="1.0.0">Integros Adserver</AdSystem><MediaFiles><MediaFile id="13258463" delivery="progressive" type="video/mp4" width="852" height="480">https://df1da99b6f27b41d.com/f9ffc53e/226d88d1ea40.mp4</MediaFile></MediaFiles><VideoClicks><ClickTracking>https://afd4aaf58705a09a.com/_/MTUzNzIyMTY5NXxrTjZ6RDJXNDlRTExIYTVST3E4S2dpd3U1NllHY1lzRFVmblBPUnJSQkNRbUhqR0F4S3h3V2dtN0N5X190VkFLNV9kM0JDNy1JTTF1X2lhQXFfbXloQUNVZ3FhMnhPcFZ2aWNuN0k5dFFaeUhqUWhYMFU0X0Zoa1ZzTWdFYWpoT250ZFVRVGM2akE2TTJNdXVHV1BYc3QtSndETkFMMnVULXFyaWVhV3NEZzh3czI1anAxQmRjVUtHblRLSUdxbzE1dk1WdGRzbEg5N0JLZEF6V0NkU2R4dFo2SGNkT1NfdTN4VkZHMVVYLWlaSGMyeWcyX0dCVWJNWHlPTWxNTS0xUV9ER3g5OHo3MmFiaG9oTWxSaDBKR09JZFRJaDQ1Vy1aR01MYjhKVjVENks0cGxWMFA5TzR2NUFETzJZSlN6QWJkcDRmaDZ2TDBPRFBnczY5WFVhcGo2RkR0bHV2QmVFTHpTSTNTT0lRNDVlUzNjTzJFd0JiVFY1YVNZVlNUdzlHRUFfNGVuSXyiaqVx2xuQhv_zxFuD7whj3cFV3W-uqILcTaKKHoKblw==?p=[CONTENTPLAYHEAD]</ClickTracking><ClickThrough id="150081807">https://w3.adm78.com/?project=admiral-xxx&user=xxx-fox&adserv=intgrs&source=mw&id=stoner10&type=video&campaign=ruadblck&p_if</ClickThrough></VideoClicks></Linear></Creative></Creatives></InLine></Ad></VAST>
Не секрет, что многие сайты с фильмами, которые ещё не попали в базу роскомпозора, находятся в сговоре с азино 777, предваряя просмотр фильма показом рекламы - пресловутое видео под заголовком "сруби бабла", где парень-мажор сорит деньгами, находясь в обществе доступных девиц.
При анализе страницы выяснилось следующее.
Страница загружает JS-скрипт с рандомным именем по рандомной ссылке - блокировка бессмысленна, кроме того, это вызовет вызывает проблемы с воспроизведением, т.к. скрипт содержит ссылку на желаемый фильм.
Также подгружается XML и далее создаётся iframe плеера. Ссылка на ресурс берётся из поля MediaFile.
Переключения вкладок и потеря ими фокуса отслеживаются скриптом, который немедленно приостанавливает видео - таким образом, пользователь вынужден смотреть ролик до конца. Сраный роскомпозор, убивший сотню-другую полезных сайтов здесь опять показал свою никчемность...
Вопрос: как запломбировать это рекламное гуано?
+2
#include <bits/stdc++.h>
using namespace std;
int main(){
int x1,y1,x2,y2;
string xy1,xy2;
cin>>xy1>>xy2;
if (xy1[0]=='A')x1=1;
if (xy1[0]=='B')x1=2;
if (xy1[0]=='C')x1=3;
if (xy1[0]=='D')x1=4;
if (xy1[0]=='E')x1=5;
if (xy1[0]=='F')x1=6;
if (xy1[0]=='G')x1=7;
if (xy1[0]=='H')x1=8;
if (xy1[1]=='1')y1=1;
if (xy1[1]=='2')y1=2;
if (xy1[1]=='3')y1=3;
if (xy1[1]=='4')y1=4;
if (xy1[1]=='5')y1=5;
if (xy1[1]=='6')y1=6;
if (xy1[1]=='7')y1=7;
if (xy1[1]=='8')y1=8;
if (xy2[0]=='A')x2=1;
if (xy2[0]=='B')x2=2;
if (xy2[0]=='C')x2=3;
if (xy2[0]=='D')x2=4;
if (xy2[0]=='E')x2=5;
if (xy2[0]=='F')x2=6;
if (xy2[0]=='G')x2=7;
if (xy2[0]=='H')x2=8;
if (xy2[1]=='1')y2=1;
if (xy2[1]=='2')y2=2;
if (xy2[1]=='3')y2=3;
if (xy2[1]=='4')y2=4;
if (xy2[1]=='5')y2=5;
if (xy2[1]=='6')y2=6;
if (xy2[1]=='7')y2=7;
if (xy2[1]=='8')y2=8;
if ((abs(x1-x2)==1&&abs(y1-y2)==0)||
(abs(x1-x2)==0&&abs(y1-y2)==1)||
(abs(x1-x2)==1&&abs(y1-y2)==1)||
(y1==y2||x1==x2||abs(x1-x2)==abs(y2-y1))||
(y1==y2||x1==x2)||
(abs(x1-x2)==abs(y2-y1))||
(abs(x1-x2)==1&&abs(y1-y2)==2)||
(abs(x1-x2)==2&&abs(y1-y2)==1)||
(x1==x2&&((y1==2&&y2==y1+2)||(y1>=2&&y2==y1+1))))
{
//king
if(abs(x1-x2)==1&&abs(y1-y2)==0)
cout<<"King\n";
else if(abs(x1-x2)==0&&abs(y1-y2)==1)
cout<<"King\n";
else if(abs(x1-x2)==1&&abs(y1-y2)==1)
cout<<"King\n";
//queen
if(y1==y2||x1==x2||abs(x1-x2)==abs(y2-y1))
cout<<"Queen\n";
//rook
if(y1==y2||x1==x2)
cout<<"Rook\n";
//bishop
if (abs(x1-x2)==abs(y2-y1))
cout<<"Bishop\n";
//knight
if(abs(x1-x2)==1&&abs(y1-y2)==2)
cout<<"Knight\n";
else if(abs(x1-x2)==2&&abs(y1-y2)==1)
cout<<"Knight\n";
//pawn
if(x1==x2&&((y1==2&&y2==y1+2)||(y1>=2&&y2==y1+1)))
cout<<"Pawn\n";
}
else cout<<"Nobody";
}
Нашел его в старом добром ACMP и он работает
+2
select * from
(
select case when (case when datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365 = 0 then 'Y y.,' else cast((datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) as varchar(20)) + ',' end + case when (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/30 - (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) * 12) = 0 then 'M m.' else cast((datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/30 - (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) * 12) as varchar(20)) end) = 'Y y.,M m.' then '' else (case when datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365 = 0 then 'Y y.,' else cast((datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) as varchar(20)) + ',' end + case when (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/30 - (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) * 12) = 0 then 'M m.' else cast((datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/30 - (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) * 12) as varchar(20)) end) end as 'Возраст', date as date1, (select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date) as date2 from Battles as P1 where (select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date) is not null) as t
union
(select case when (case when datediff(day,date,CONVERT (date, GETDATE()))/365 = 0 then 'Y y.,' else cast((datediff(day,date,CONVERT (date, GETDATE()))/365) as varchar(20)) + ',' end + case when (datediff(day,date,CONVERT (date, GETDATE()))/30 - (datediff(day,date,CONVERT (date, GETDATE()))/365) * 12) = 0 then 'M m.' else cast((datediff(day,date,CONVERT (date, GETDATE()))/30 - (datediff(day,date,CONVERT (date, GETDATE()))/365) * 12) as varchar(20)) end) = 'Y y.,M m.' then '' else (case when datediff(day,date,CONVERT (date, GETDATE()))/365 = 0 then 'Y y.,' else cast((datediff(day,date,CONVERT (date, GETDATE()))/365) as varchar(20)) + ',' end + case when (datediff(day,date,CONVERT (date, GETDATE()))/30 - (datediff(day,date,CONVERT (date, GETDATE()))/365) * 12) = 0 then 'M m.' else cast((datediff(day,date,CONVERT (date, GETDATE()))/30 - (datediff(day,date,CONVERT (date, GETDATE()))/365) * 12) as varchar(20)) end) end, date, CONVERT (date, GETDATE()) from Battles as T1 where (select top (1) date from Battles as T2 where T2.date > T1.date order by T2.date) is null
);
BDcorabli@nomer5
+2
if (!(fs_info->workers && fs_info->delalloc_workers &&
fs_info->submit_workers && fs_info->flush_workers &&
fs_info->endio_workers && fs_info->endio_meta_workers &&
fs_info->endio_meta_write_workers &&
fs_info->endio_write_workers && fs_info->endio_raid56_workers &&
fs_info->endio_freespace_worker && fs_info->rmw_workers &&
fs_info->caching_workers && fs_info->readahead_workers &&
fs_info->fixup_workers && fs_info->delayed_workers && // <===
fs_info->fixup_workers && fs_info->extent_workers && // <===
fs_info->qgroup_rescan_workers)) {
err = -ENOMEM;
goto fail_sb_buffer;
}
https://bugzilla.kernel.org/show_bug.cgi?id=82021+2
#include <malloc.h>
#include <string.h>
void print( void **p, int n ) {
int i = 0;
for(; i < n; ++i ) {
printf( "%x ", *( p + i ) );
}
printf( "\n" );
}
void get( void** pp, void** p ) {
*p = *pp;
}
void set( void** pp, void **p ) {
*pp = *p;
}
int main() {
printf( "sizeof: void* = %d, void** = %d\n", sizeof( void* ), sizeof( void** ) );
void ** pv = malloc( sizeof( void* ) * 8 ), **pp2;
memset( pv, 1, 8 * sizeof( void* ) );
printf( "pv = %x\n", pv );
print( pv, 8 );
pp2 = pv + 2 * sizeof( void** );
void *p = (void*)0x01020304c, *p2 = p;
*pp2 = p;
printf( "pv = %x, pp2 = %x, p=%x, p2 = %x\n", pv, pp2, p, p2 );
get( pv + 1, &p );
printf( "result get( pv + 1, &p ) -> *( pv + 1 ) = %x, p = %x\n", *( pv + 1 ), p );
set( pv + 2, &p2 );
printf( "result set( pv + 2 *, p2 ) -> *( pv + 2 ) = %x, p2 = %x\n", *( pv + 2 ), p2 );
print( pv, 8 );
free( pv );
return 0;
}
Просто оставлю это здесь, на будущее.
О том, как работать с void**.
+2
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the ActiveQt framework of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
Вот блин, почти в любом проекте в начале каждого файла такая вот куча . Я блядь открываю файл, чтобы посмотреть, что это, хотя бы одну строчку написали: этот класс занимается тем-то и тем-то, так нет, а вот всю эту бурду "ASS PISS" LSD LICENCE - пожалуйста.
+2
#include <iostream>
#include <string>
int main()
{
std::string s1 = "";
const char s2[] = "";
std::cout << std::boolalpha
<< std::empty(s1) << std::endl
<< std::size(s1) << std::endl
<< std::empty(s2) << std::endl
<< std::size(s2) << std::endl;
s1.assign("", 1);
std::cout << std::empty(s1) << std::endl
<< std::size(s1) << std::endl;
system("pause");
return 0;
}
true
0
false
1
false
1
Ой-вэй, абстракции потекли!
+2
https://s22.postimg.cc/5zky9jn1t/Image_from_i_OS.jpg
+2
http://faqs.org.ru/progr/c_cpp/watcom_c.htm
WATCOM C/C++ FAQ
version 3.0
29 Aug 1998
compiled by Lenik Terenin, 2:5061/1
Maintained by Cyril Pertsev, 2:5020/1415.1
Please send your additions and suggestions to the above address.
Для удобства потpебления данного текста
добавления выделены символом квотинга
...
> Q: Гpафическая библиотека ваткома отказывается пеpеключать pежимы/банки
> или делает это кpиво
>A: В результате ковыряния в библиотеке выяснилось, что криворукие
>ваткомовцы
>совершенно не задумываются ни о какой переносимости и универсальности их
>библиотек. В результате, если видео-карта имеет в биосе прошитое имя
>производителя или другую информацию о нем, то для нее будет вызываться
>вместо
>функции переключения банков через VESA, другая функция, работающая с
>картой
>напрямую (иногда даже через порты).
>Единственная проблема, что у каждого производителя (ATI, в моем случае),
>рано
>или поздно выходят новые и продвинутые карты, раскладка портов в которых
>может
>отличаться от той, которая использовалась в старых моделях. В результате,
>все
>это свинство начинает глючить и иногда даже виснуть.
>После того, как я руками заткнул ему возможность использовать "родные"
>фишки
>для конкретной карты и прописал пользоваться только VESA -- все работает
>как из
>пушки ;))
>Как затыкать -- а просто, есть переменная: _SVGAType, которую я
>описывается
>следующим образом: "extern "C" int _SVGAType;", и потом _перед_ (важно!)
>вызовом _setvideomode нужно сказать "_SVGAType = 1;".
Люблю читать несвежие FAQ.
Сегодня-то такого не встретишь, чтобы кто-то прямо в порты в видеокарту что-то писал, эхх...