-
Лучший говнокод
- В номинации:
-
- За время:
-
-
−1
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
#include <stdio.h>
#include <inttypes.h>
int main(void) {
uint64_t a = 1<<31;
uint64_t b = 1<<32;
uint64_t c = (uint64_t)1<<32;
printf("a:%llx\n", a);
printf("b:%llx\n", b);
printf("c:%llx\n", c);
return 0;
}
a:ffffffff80000000
b:0
c:100000000
Занимался битоёбством и не сразу понял откуда в алгоритме мусор.
govnokod3r,
16 Июля 2018
-
+1
- 1
- 2
- 3
- 4
- 5
- 6
...
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
...
.bashrc по умолчанию в Xubuntu.
Мне казалось, что приглашение должно быть другого цвета, чтобы можно было быстро найти начало вывода программы:
user@computer:~$ cat blah.txt
<много текста>
<много текста>
<много текста>
<много текста>
<много текста>
Но тут, понимаешь, решили, что нечего цвета разводить.
Steve_Brown,
06 Мая 2018
-
−2
Челлендж: НОРМАЛЬНЫЙ человек должен собрать с помощью docker PHP 5.3 с его требованиями к древним и automake, и autoconf, и bison и запустить сие существо вместе с Apache2 и MySQL.
Сакральный смысл челленджа в том, чтобы в здравом уме начать, в здравом уме окончить.
dm_fomenok,
06 Марта 2018
-
0
- 1
- 2
- 3
- 4
/**
Константа
*/
private static let dateFormat = "dd.MM.yy_HH.mm.ss"
Комментарий от бога.
wwweshka,
29 Января 2018
-
+5
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
function ехал(f) { f(); }
function через(f) { f.call(null); }
function видит(f) { setTimeout(f, 0); }
function сунул(f) { Promise.resolve(null).then(f); }
function в(f) { alert("Hello functional world!"); return f; }
ехал(function() {
через(function() {
видит(function() {
(function(_function) {
сунул(function() {
_function(в(function() {}))
})
})(function(_function() {
_function(function() {})
})
})
})
})
someone,
20 Ноября 2017
-
+1
- 1
github.com/php/php-src/commit/0e097f2c96ce31b16fa371981045f224e5a37160#diff-e0dff85f21e939e4e2a778bddb8a72d7R819
Кто мне объяснит, как вообще работает этот PHP до сих пор, если они через строчку получают длину строки siezof'ом и при этом это ещё помогло исправить баг?
d_fomenok,
18 Ноября 2017
-
0
- 1
- 2
- 3
...
([dictionary stringObjectForKey:@"scale"].length > 0) ? (_scale = [dictionary stringObjectForKey:@"scale"]) : (_scale = @"1");
...
Инициализация переменной с помощью тернарной операции.
r1817821,
03 Ноября 2017
-
+8
- 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
#include <vector>
#include <iostream>
template<class T>
struct reverse_view_impl {
const T& cont;
reverse_view_impl(const T& cont): cont(cont) {}
using iterator = typename T::const_reverse_iterator;
};
template<class T>
reverse_view_impl<T> reverse_view(const T& cont) {
return reverse_view_impl<T>(cont);
}
template<class T>
typename reverse_view_impl<T>::iterator begin(const reverse_view_impl<T>& view) {
return view.cont.crbegin();
}
template<class T>
typename reverse_view_impl<T>::iterator end(const reverse_view_impl<T>& view) {
return view.cont.crend();
}
std::vector<int> one_two_three() { return { 1, 2, 3 }; }
int main() {
for (auto i : reverse_view(one_two_three())) {
std::cout << i << std::endl;
}
}
// Surprise, motherfucker
Bobik,
10 Августа 2016
-
+7
- 1
http://dump.bitcheese.net/images/aditoso/sc.png
Умножение двух трехбитных чисел с применением https://ru.wikipedia.org/wiki/Дешифратор
Для сравнения - вот умножение через сумматоры https://i.imgur.com/9JCy2D2.png
j123123,
06 Августа 2016
-
+7
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
#include <iostream>
struct Test {
operator auto() -> bool { return true; }
};
int main() {
std::cout << std::boolalpha << Test() << std::endl;
}
operator auto() завезли!
http://ideone.com/sGxeQn
Antervis,
20 Июля 2016