-
+1004
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
// shit.h :
#if END_SHIT == 0
bagor++;
#if BIT0 == 0
#undef BIT0
#define BIT0 1
#else
#undef BIT0
#define BIT0 0
#if BIT1 == 0
#undef BIT1
#define BIT1 1
#else
#undef BIT1
#define BIT1 0
#if BIT2 == 0
#undef BIT2
#define BIT2 1
#else
#undef BIT0
#undef BIT1
#undef BIT2
#define END_SHIT 1
#endif
#endif
#endif
#include "shit.h"
#endif
//shit.c
#include <stdio.h>
int main(void) {
int bagor = 0;
#define BIT0 0
#define BIT1 0
#define BIT2 0
#include "shit.h"
printf("bagor = %i\n", bagor);
return 0;
}
http://govnokod.ru/20947#comment348047
CHayT 3 часа назад # 0
> нет ни циклов, ни рекурсий
Можно, думаю, файлы сами в себя инклудить, чем не рекурсия. Не очень понятно, что с этим делать, правда.
-----
Но ведь совершенно очевидно, что с этим можно делать. Очередной шедевр макроговна
j123123,
25 Августа 2016
-
+918
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
#include <iostream>
template<typename T>
struct A {
typedef int R();
template<typename U>
static U *f(int) {
return 0;
}
static int f() {
return 0;
}
};
template<typename T>
bool g() { A<T> a; return !(typename A<T>::R*)a.f<int()>(0); }
template<typename T>
bool h() { A<T> a; return !( A<T>::R*)a.f<int()>(0); }
int main() {
std::cout << g<void>() << f<void>() << std::endl;
}
Как можно было придумать такой синтаксис :(
Bobik,
25 Августа 2016
-
+2424
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
// Most profiles should run only on one loader (they don't coordinate multiple instances,
// and do not test performance).
// We explicitly specify that some profiles should run on multiple loaders:
singleLoader := true
switch params.Config.Foo.Profile.Name() {
case (*foo_config.ProfileIO).Name(nil):
singleLoader = false
}
if singleLoader {
// Setting TargetLoaders to a single random loader.
}
Вот думаем подарить человеку книжку про судоку, а то творческую натуру негде применить.
wvxvw,
24 Августа 2016
-
+2302
- 1
- 2
- 3
- 4
- 5
http://govnokod.ru/20924
Запрашиваемая страница не найдена!
Возможно, её и не было никогда
http://dump.bitcheese.net/files/pimarut/%D0%93%D0%BE%D0%B2%D0%BD%D0%BE%D0%BA%D0%BE%D0%B4_%2320924_%E2%80%94_C___%E2%80%94_%D0%93%D0%BE%D0%B2%D0%BD%D0%BE%D0%BA%D0%BE%D0%B4.%D1%80%D1%83.html
но бекап я сделал, так что хуй вам. Я требую продолжения банкета.
j123123,
24 Августа 2016
-
+491
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
app::storage()->setUserUploadDir('public');
app::storage()->avatar = 'profile/avatars';
app::storage()->background = 'profile/background';
app::storage()->audioFile = 'music';
app::storage()->videoFile = 'video/file';
app::storage()->videoScreen = 'video/screen';
app::storage()->forum = 'forum';
app::storage()->systemImages = 'system/images';
app::storage()->tmpUpload('upload');
app::storage()->registerMethod('avatar', function($id, $type = false)
{
if($type==true){
return app::storage()->fileExists(app::storage()->path('avatar').'/'.$id.'.png') ? '/'.app::storage()->path('avatar').'/'.$id.'.png' : null;
}else{
return '/'.app::storage()->path('avatar').'/'.$id.'.png';
}
} );
app::storage()->registerMethod('defaultAvatar', function()
{
return '/'.app::storage()->path('systemImages').'/noavatar.png';
} );
Загрузка файлов от программиста с двадцатилетним стажем.
pravka,
24 Августа 2016
-
+458
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
tinyxml2::XMLDocument doc;
doc.Parse(xhtml.c_str());//парсируем до конца
tinyxml2::XMLElement* xml_element =
doc.FirstChildElement("html")->FirstChildElement("body")->FirstChildElement("div")->
NextSiblingElement("div")->NextSiblingElement("div")->FirstChildElement("div")->
NextSiblingElement("div")->FirstChildElement("div")->NextSiblingElement("div")->
FirstChildElement("div")->FirstChildElement("div")->NextSiblingElement("div")->
FirstChildElement("form");
jangolare,
23 Августа 2016
-
+545
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
<?php
/**
* Объединяет массивы, сохраняя элементы присутствующие лишь в одном из массивов
* + сортирует без сохранения ключей
* @param array $a1
* @param array $a2
* @return array
*/
function array_xor_merge($a1, $a2) {
$allr = array_merge($a1, $a2);
$allp = array_flip($allr);
foreach (array_count_values($allr) as $key => $cnt) {
if ($cnt > 1) {
unset($allp[$key]);
}
}
$res = array_flip($allp);
sort($res);
return $res;
}
Rijen,
22 Августа 2016
-
+2004
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
// ==UserScript==
// @name GK refine
// @version 0.1
// @description opens comments on govnokod.ru... etc
// @match http://govnokod.ru/*
// @match http://www.govnokod.ru/*
// @grant none
// ==/UserScript==
// Показывает в стоке "new" около нового комментария
// и пишет, сколько времени назад его оставили
(function(){
if(location.pathname != '/comments') return;
var key = 'fcd0d66f-9ff0-4827-82f1-e183dc1ab98c-last-time';
var lastTime = localStorage[key] ? +localStorage[key] : 0;
var now = new Date();
$('abbr.published').each(function(){
var d = + new Date($(this).attr('title'));
$(this).text(((now-d) / 1000 / 60).toFixed(2) + 'm');
if(d > lastTime) $(this).after('<span style="color: red">NEW </span>');
});
localStorage[key] = +now;
})();
// Открывает скрытые комменты
$("div.entry-comment-hidden").removeClass('entry-comment-hidden');
Смотрю, а багры в стоке комментарий подменяют, чтобы пользователи не видели, где новый багор, а где старый.
Я только сейчас это понял потому, что у меня около непросмотренного в стоке пишется "NEW" уже несколько месяцев.
Запилил потому, что даже без багров не помнил, что открыл, а что нет. А тут в тему будет для тех, у кого платного аккаунта нет.
1024--,
21 Августа 2016
-
+2000
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
unsigned int get_spoofed() {
char spa[21];
int a, b, c, d;
srand(time(0));
random_ct = rand();
random_num = ((random_ct % 254) + 1);
a = random_num;
random_ct = rand();
random_num = ((random_ct % 254) + 1);
b = random_num;
random_ct = rand();
random_num = ((random_ct % 254) + 1);
c = random_num;
random_ct = rand();
random_num = ((random_ct % 254) + 1);
d = random_num;
snprintf(spa, sizeof(spa), "%d.%d.%d.%d", a, b, c, d);
return ((unsigned int)host2ip(spa));
}
Ддосбот для роутеров https://github.com/eurialo/lightaidra/blob/master/source/utils.c
nyaknyan,
20 Августа 2016
-
+1873
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
function translate_a_name_of_the_winter_to_the_foreign_language(language: String): String;
begin
if language = 'авестийский' Result := 'zimō'
else if language = 'белорусский' Result := 'зіма'
else if language = 'болгарский' Result := 'зима'
else if language = 'верхнелужицкий' Result := 'zyma'
else if language = 'греческий' Result := 'χειμώνας'
else if language = 'древнепрусский' Result := 'semo'
else if language = 'латинский' Result := 'hiems'
else if language = 'латышский' Result := 'ziema'
else if language = 'литовский' Result := 'žiema'
else if language = 'македонский' Result := 'зима'
else if language = 'нижнелужицкий' Result := 'zyma'
else if language = 'осетинский' Result := 'зымӕг'
else if language = 'польский' Result := 'zima'
else if language = 'русский' Result := 'зима'
else if language = 'санскрит' Result := 'hima'
else if language = 'сербский' Result := 'зима'
else if language = 'словацкий' Result := 'zima'
else if language = 'словенский' Result := 'zima'
else if language = 'талышский' Result := 'зымыстон'
else if language = 'таджикский' Result := 'зимистон'
else if language = 'украинский' Result := 'зима'
else if language = 'хорватский' Result := 'zima'
else if language = 'чешский' Result := 'zima'
end;
Из одного очень серьёзного проекта.
Amayak_Akopyan,
20 Августа 2016