- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
#include <iostream>
using namespace std;
void wtf() {
return 0;
}
int main() {
return wtf();
cout << wtf();
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−3
#include <iostream>
using namespace std;
void wtf() {
return 0;
}
int main() {
return wtf();
cout << wtf();
}
Решил нопейсать ватафак-код.
Классика жанра. Ретурн в воидовской функции. Плюс действие после ретурна.
+1
protocol Multi {
associatedtype T
associatedtype U
func printSelf()
}
extension Multi where T == Int, U == Float {
func printSelf() {
print("Int & Float!")
}
}
extension Multi where T == String, U == Int {
func printSelf() {
print("String & Int!")
}
}
extension Multi {
func printSelf() {
print("Unknown")
}
}
class MultiImplementationIntFloat: Multi {
typealias T = Int
typealias U = Float
}
class MultiImplementationStringInt: Multi {
typealias T = String
typealias U = Int
}
class MultiImplementationInvalid: Multi {
typealias T = Float
typealias U = String
}
let m1 = MultiImplementationIntFloat()
m1.printSelf()
let m2 = MultiImplementationStringInt()
m2.printSelf()
let m3 = MultiImplementationInvalid()
m3.printSelf()
Multimethods в Swift с проверкой в compile-time
0
#include <stdio.h>
#include <string.h>
#include <math.h>
char *questions[] = {
"Answer these questions please.",
"I am HACTEHbKA. Do you know about me?",
"Do you like my love stories?",
"By the way, what is your name?",
"Do you like C++?",
"Do you like bormand?",
"bormand is cool, isn't he?",
"Do you know what does it mean?",
0,
};
int main () {
char answer[10], **question = questions, z[30] = {0}, Z = questions[0x04][0x10];
while (*++question) {
float x = 1, y = 7;
char* a = answer;
puts(*question);
gets(answer);
while (*a) {
x *= 10;
x += *a / 90;
a ++;
}
y = (9/x - 120)/x/x/x;
if (y > 170/x - 1263 - 437/x/x) {
int U = **questions;
for (U = 1/(x+1); U < ' '; U += 0x10) {
float bormand = 9*y-6*x*sqrt(y)-6*sqrt(y)+1.0*x*x*x*x-5.2*x*x*x+11.14*x*x-6.788*x+6;
z[Z|U] = questions[5-U/5+1/(int)bormand][(int)(Z + questions[0x06][0x10] / 2.6)];
if ((Z|U|7) * (int)question[1] < 30) puts(z + U);
}
Z++;
}
}
return answer == questions[1];
}
https://ideone.com/zDcuG2
0
Признавайтесь
http://bash.im/quote/448842
Недавно насрал туда анекдотом http://bash.im/quote/448781, зашёл покармадрочить, смотрю -- в стоке гк.
−104
//-------------------------------------
Процедура ПриНачалеРаботыСистемы()
//Ограничиваем цикл на пользователей...
Если (СокрЛП(ИмяПользователя())="Вася") тогда
//Делаем вызов процедуры "Оповещение" раз в 3600 секунд (1 час)...
ОбработкаОжидания("Оповещение",3600);
КонецЕсли;
КонецПроцедуры
Когда надо сделать циклическое обращение к другой процедуре через определённое кол-во времени...
+3
#include <windows.h>
int main() {
HDC dc = CreateCompatibleDC (NULL);
SetLayout (dc, LAYOUT_RTL);
ScaleWindowExtEx (dc, -2147483647 - 1, -1, 1, 1, NULL);
}
bsod
+8
public static class StringExtensions
{
public static bool IsNulldOrEmpty(this string str)
{
return string.IsNullOrEmpty(str);
}
}
why
+5
WCT воскрес.
http://habrahabr.ru/post/271519/
+142
void BloomPattern::process(GLuint rectangleVao, float blurRadius) const
{
sptrFrameBufferTwo->enable();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
sptrBrightPassShaderProgram->enable();
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, sptrFrameBufferThree->getColorTexture().getTexture());
sptrBrightPassShaderProgram->setUniform("colorTexture", 0);
glBindVertexArray(rectangleVao);
glViewport(0, 0, windowWidth >> 1, windowHeight >> 1);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, nullptr);
sptrFrameBufferOne->enable();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
sptrBlurShaderProgram->enable();
glBindTexture(GL_TEXTURE_2D, sptrFrameBufferTwo->getColorTexture().getTexture());
sptrBlurShaderProgram->setUniform("defaultTexture", 0);
sptrBlurShaderProgram->setUniform("blurRadius", 1.0F / (windowWidth >> 1), 0.0F, blurRadius);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, nullptr);
sptrFrameBufferTwo->enable();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBindTexture(GL_TEXTURE_2D, sptrFrameBufferOne->getColorTexture().getTexture());
sptrBlurShaderProgram->setUniform("defaultTexture", 0);
sptrBlurShaderProgram->setUniform("blurRadius", 0.0F, 1.0F / (windowHeight >> 1), blurRadius);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, nullptr);
sptrFinalFrameBuffer->enable();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
sptrBloomShaderProgram->enable();
glBindTexture(GL_TEXTURE_2D, sptrFrameBufferThree->getColorTexture().getTexture());
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, sptrFrameBufferTwo->getColorTexture().getTexture());
sptrBloomShaderProgram->setUniform("defaultTexture", 0);
sptrBloomShaderProgram->setUniform("brightpassTexture", 1);
glViewport(0, 0, windowWidth, windowHeight);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, nullptr);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
+169
for (var i = 0; i < result.Results.length; i++) {
data = result.Results;
if (i == 0) {
$calendarPins = jQuery.parseJSON(data[i].Markers);
GoogleMapsInitialization();
}
}
Аж за душу взяло...