- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
#include <iostream>
#include <vector>
template <typename T>
struct Vec {
T x, y;
Vec& operator /=(const T& d) {
x /= d;
y /= d;
return *this;
}
};
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 62
0
#include <iostream>
#include <vector>
template <typename T>
struct Vec {
T x, y;
Vec& operator /=(const T& d) {
x /= d;
y /= d;
return *this;
}
};
Найдите баг в коде.
Посмотрел этот видос: https://www.youtube.com/watch?v=4M1MlW0sP0Q
0
#include <string>
#include <iostream>
int main() {
std::string kakoi("Какой багор )))", 5);
std::string bagor((std::string)"Какой багор )))" , 5);
std::cout << kakoi << bagor << std::endl;
}
Наверняка было, но ладно.
https://ideone.com/syFnI2
+3
data:text/html,<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
Энтузиаст создал Flappy Bird на минималках весом всего лишь 228 байт.
А чтобы запустить игру, достаточно скопировать этот код в адресную строку браузера.
+1
console.log("Hello, World!");
https://en.wikipedia.org/wiki/World_Hello_Day
0
pituhs.reserve(kurochkas.size());
for (auto& kurochka : kurochkas) {
pituhs.push_back(kurochka.snesti_jajichko());
}
reserve заебал.
Коллега (да, тот же самый) пихает его везде.
Я понимаю зачем это нужно, но блядь, я читаю на одну строку больше, чем мог бы, и лишний раз напрягаю мозг.
И это сливается со словом «reverse».
Кстати, оптимизаторы могли бы такую хуйню сами детектить, и резервировать сами.
0
#include <iostream>
using namespace std;
struct Foo {char a; int b; char c;};
struct Bar {char a; char b; int c;};
int main() {
cout << sizeof(Foo) << endl;
cout << sizeof(Bar) << endl;
}
https://ideone.com/XKWey3
Какой бароп )))
0
-module(server).
-export([start/0]).
start() ->
rooster:start(#{port => 8080},
#{routes => [hello()]}).
hello() ->
{'GET', "/hello", fun(_) -> {200, #{message => <<"hello world">>}} end}.
https://github.com/fbeline/rooster
Rooster
Simplistic REST framework that runs on top of mochiweb.
0
class HelloRooster implements EditorPlugin {
getName() {
return 'HelloRooster';
}
initialize(editor: Editor) {}
dispose() {}
onPluginEvent(e: PluginEvent) {
if (e.eventType == PluginEventType.KeyPress && e.rawEvent.which == 65) {
alert('Hello Rooster');
}
}
}
https://github.com/microsoft/roosterjs
+1
tar -czvf arhiv.tar.hz .
tar -xzf arhiv.tar.hz
Как запомнить эти команды? Бывает гуглю их в день по нескольку раз )))
Сделать алиаснюшню "tar pack" и "tar unpack"?
+1
private function _postPhotoWidth($post) {
$raw_code = rtrim(str_replace("\r", '', $post->post_content));
$lines = explode("\n", $raw_code);
if (count($lines) <= 1) {
return -1;
}
$text_width = 0;
foreach ($lines as $line) {
$text_width = max($text_width, mb_strlen($line) + substr_count($line, "\t") * 7);
}
return (int)(max(20 + $text_width, 60) * 18.5);
}
Код для вычисления длины данного гамнакода.