-
Лучший говнокод
- В номинации:
-
- За время:
-
-
+1
- 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
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
void Start () {
carRight1 = GameObject.Find("CarRight1");
carRight2 = GameObject.Find("CarRight2");
carRight3 = GameObject.Find("CarRight3");
carRight4 = GameObject.Find("CarRight4");
carRight5 = GameObject.Find("CarRight5");
carRight6 = GameObject.Find("CarRight6");
carRight7 = GameObject.Find("CarRight7");
carRight8 = GameObject.Find("CarRight8");
carRight9 = GameObject.Find("CarRight9");
carRight10 = GameObject.Find("CarRight10");
carRight11 = GameObject.Find("CarRight11");
carRight12 = GameObject.Find("CarRight12");
carRight13 = GameObject.Find("CarRight13");
carRight14 = GameObject.Find("CarRight14");
carRight15 = GameObject.Find("CarRight15");
carRight16 = GameObject.Find("CarRight16");
carRight17 = GameObject.Find("CarRight17");
carLeft1 = GameObject.Find("CarLeft1");
carLeft2 = GameObject.Find("CarLeft2");
carLeft3 = GameObject.Find("CarLeft3");
carLeft4 = GameObject.Find("CarLeft4");
carLeft5 = GameObject.Find("CarLeft5");
carLeft6 = GameObject.Find("CarLeft6");
carLeft7 = GameObject.Find("CarLeft7");
carLeft8 = GameObject.Find("CarLeft8");
carLeft9 = GameObject.Find("CarLeft9");
carLeft10 = GameObject.Find("CarLeft10");
carLeft11 = GameObject.Find("CarLeft11");
carLeft12 = GameObject.Find("CarLeft12");
carLeft13 = GameObject.Find("CarLeft13");
carLeft14 = GameObject.Find("CarLeft14");
carLeft15 = GameObject.Find("CarLeft15");
carLeft16 = GameObject.Find("CarLeft16");
carLeft17 = GameObject.Find("CarLeft17");
carLeft18 = GameObject.Find("CarLeft18");
carLeft19 = GameObject.Find("CarLeft19");
carLeft20 = GameObject.Find("CarLeft20");
carLeft21 = GameObject.Find("CarLeft21");
carLeft22 = GameObject.Find("CarLeft22");
speed = 15f;
//gameObject.transform.localScale = new Vector3(0, 0, 0);
}
// Update is called once per frame
void Update () {
carRight1.GetComponent<Rigidbody>().velocity = carRight1.transform.forward * speed;
carRight2.GetComponent<Rigidbody>().velocity = carRight2.transform.forward * speed;
carRight3.GetComponent<Rigidbody>().velocity = carRight3.transform.forward * speed;
carRight4.GetComponent<Rigidbody>().velocity = carRight4.transform.forward * speed;
carRight5.GetComponent<Rigidbody>().velocity = carRight5.transform.forward * speed;
carRight6.GetComponent<Rigidbody>().velocity = carRight6.transform.forward * speed;
carRight7.GetComponent<Rigidbody>().velocity = carRight7.transform.forward * speed;
carRight8.GetComponent<Rigidbody>().velocity = carRight8.transform.forward * speed;
carRight9.GetComponent<Rigidbody>().velocity = carRight9.transform.forward * speed;
carRight10.GetComponent<Rigidbody>().velocity = carRight10.transform.forward * speed;
carRight11.GetComponent<Rigidbody>().velocity = carRight11.transform.forward * speed;
carRight12.GetComponent<Rigidbody>().velocity = carRight12.transform.forward * speed;
carRight13.GetComponent<Rigidbody>().velocity = carRight13.transform.forward * speed;
carRight14.GetComponent<Rigidbody>().velocity = carRight14.transform.forward * speed;
carRight15.GetComponent<Rigidbody>().velocity = carRight15.transform.forward * speed;
carRight16.GetComponent<Rigidbody>().velocity = carRight16.transform.forward * speed;
carRight17.GetComponent<Rigidbody>().velocity = carRight17.transform.forward * speed;
carLeft1.GetComponent<Rigidbody>().velocity = carLeft1.transform.forward * speed;
carLeft2.GetComponent<Rigidbody>().velocity = carLeft2.transform.forward * speed;
carLeft3.GetComponent<Rigidbody>().velocity = carLeft3.transform.forward * speed;
carLeft4.GetComponent<Rigidbody>().velocity = carLeft4.transform.forward * speed;
carLeft5.GetComponent<Rigidbody>().velocity = carLeft5.transform.forward * speed;
carLeft6.GetComponent<Rigidbody>().velocity = carLeft6.transform.forward * speed;
carLeft7.GetComponent<Rigidbody>().velocity = carLeft7.transform.forward * speed;
carLeft8.GetComponent<Rigidbody>().velocity = carLeft8.transform.forward * speed;
carLeft9.GetComponent<Rigidbody>().velocity = carLeft9.transform.forward * speed;
carLeft10.GetComponent<Rigidbody>().velocity = carLeft10.transform.forward * speed;
carLeft11.GetComponent<Rigidbody>().velocity = carLeft11.transform.forward * speed;
carLeft12.GetComponent<Rigidbody>().velocity = carLeft12.transform.forward * speed;
carLeft13.GetComponent<Rigidbody>().velocity = carLeft13.transform.forward * speed;
carLeft14.GetComponent<Rigidbody>().velocity = carLeft14.transform.forward * speed;
carLeft15.GetComponent<Rigidbody>().velocity = carLeft15.transform.forward * speed;
carLeft16.GetComponent<Rigidbody>().velocity = carLeft16.transform.forward * speed;
carLeft17.GetComponent<Rigidbody>().velocity = carLeft17.transform.forward * speed;
carLeft18.GetComponent<Rigidbody>().velocity = carLeft18.transform.forward * speed;
carLeft19.GetComponent<Rigidbody>().velocity = carLeft19.transform.forward * speed;
carLeft20.GetComponent<Rigidbody>().velocity = carLeft20.transform.forward * speed;
carLeft21.GetComponent<Rigidbody>().velocity = carLeft21.transform.forward * speed;
carLeft22.GetComponent<Rigidbody>().velocity = carLeft22.transform.forward * speed;
}
Обнаружил на ПК у "коллеги" по цеху. AI для машинок... (Сами переменные не влезли, но легко понять как они заданы.)
Morseliot,
29 Июня 2019
-
+3
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
<?php
error_reporting(E_ALL ^ E_NOTICE);
include('translate.class.php');
$x = new translator_text();
$text = 'Al Hotel Demo si vive in armonia con se stessi, immersi nel verde di una natura rigogliosa, con i boschi di pini, querce e tamerici in un terreno a terrazze sul mare. Il Villaggio Turistico è un moderno centro di vacanze, concepito e costruito per rispondere a tutte le esigenze dei suoi ospiti.';
echo'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
echo $x->translate(strip_tags(trim($text)), 'it', 'ru');
?>
Автоматический переводчик текста на "PHP"...
https://xdan.ru/avtomaticheskij-perevodchik-teksta-na-php-cherez-google-translate.html
Perevedi_na_PHP,
17 Марта 2019
-
−104
- 1
- 2
- 3
Иногда смотришь, такой с виду замечательный и правильный человек, Сильный человек,красивый и привлекательный, а после общения обнаруживаешь, что внутри-то гниль. Гнилой человек находится под влиянием сил и энергии невежества и деградации.
В Гнилом человеке нет Внутреннего Стержня, стоим ему столкнуться с вызовами жизни, и он купит, продаст, купит и снова продаст.
Своими поступками он вызывает брезгливость и чувство гадливости. Словом, снаружи человек, а внутри, при нажиме событиями извне – Гниль.
Гниль
rHujlou_xyu,
12 Ноября 2018
-
+1
- 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
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
#include <stdio.h>
//#include <ynopoTocTb.h>
#define PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__
#define CAT(...) PRIMITIVE_CAT(__VA_ARGS__)
#define EAT(...)
#define EXPAND(...) __VA_ARGS__
#define IIF(c) PRIMITIVE_CAT(IIF_, c)
#define IIF_1(...) __VA_ARGS__ EAT
#define IIF_0(...) EXPAND
#define COMPL(x) PRIMITIVE_CAT(COMPL_, x)
#define COMPL_1 0
#define COMPL_0 1
#define CHECK_N(x, n, ...) n
#define CHECK(...) CHECK_N(__VA_ARGS__, 0)
#define PROBE(x) x, 1
#define NOT(x) CHECK(PRIMITIVE_CAT(NOT_, x))
#define NOT_0 PROBE(~)
#define BOOL(x) COMPL(NOT(x))
#define IF(c) IIF(BOOL(c))
#define EMPTY()
#define DEFER(id) id EMPTY()
#define OBSTRUCT(id) id DEFER(EMPTY)()
#define EVAL(...) EVAL1(EVAL1(EVAL1(EVAL1(__VA_ARGS__))))
#define EVAL1(...) EVAL2(EVAL2(EVAL2(EVAL2(__VA_ARGS__))))
#define EVAL2(...) EVAL3(EVAL3(EVAL3(EVAL3(__VA_ARGS__))))
#define EVAL3(...) EVAL4(EVAL4(EVAL4(EVAL4(__VA_ARGS__))))
#define EVAL4(...) EVAL5(EVAL5(EVAL5(EVAL5(__VA_ARGS__))))
#define EVAL5(...) __VA_ARGS__
#define DEC(x) PRIMITIVE_CAT(DEC_, x)
#define DEC_0 0
#define DEC_1 0
#define DEC_2 1
#define DEC_3 2
#define DEC_4 3
#define DEC_5 4
#define DEC_6 5
#define DEC_7 6
#define DEC_8 7
#define DEC_9 8
#define FACTORIAL(x) \
IF(NOT(x)) (1) \
( \
OBSTRUCT(FACTORIAL_INDIRECT)()(DEC(x)) * x \
)
#define FACTORIAL_INDIRECT() FACTORIAL
#define PRIMITIVE_TO_STR(...) # __VA_ARGS__
#define TO_STR(...) PRIMITIVE_TO_STR(__VA_ARGS__)
int main() {
printf("7! = " TO_STR(EVAL(FACTORIAL(7))) " = %d", EVAL(FACTORIAL(7)));
return 0;
}
Продолжаю макроёбить.
https://ideone.com/WcG7i2
Использованы материалы из стотьи
https://github.com/pfultz2/Cloak/wiki/C-Preprocessor-tricks,-tips,-and-idioms
adrnin,
01 Ноября 2018
-
−1
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
if (context instanceof Activity) {
activity = (MainActivityMVI) context;
try {
listener = (OnOfferItemClickListenerS) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString() + "must implement OnOfferItemClickListenerS");
}
try {
listener2 = (OnLoadDataSearchMainFragmentListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString() + "must implement OnLoadDataSearchMainFragmentListener");
}
App.getComponent(activity).inject(this);
}
makesense,
16 Мая 2018
-
−2
- 1
- 2
Золотце
https://lj.rossia.org/users/sadkov/103320.html?nc=55
OpenGL - говно опенсурсное
Попытался реализовать getPixel и putPixel на OpenGL, в результате получение одного пикселя занимает болшьшую часть времени выполнения программы. Другие люди тоже жалуются на тормознутость функций OpenGL, вроде glDrawPixels и glReadPixels
https://stackoverflow.com/questions/39821850/why-is-glreadpixels-so-slow-and-are-there-any-alternative
https://stackoverflow.com/questions/36534933/gldrawpixels-vs-textures-to-draw-a-2d-buffer-in-opengl
>glDrawPixels is known to be very slow
Зачем вообще нужно все это 3d ускорение? В DOS все было идеально:
((uint8_t*)(0xB8000))[y*320+x] = pixel
почему нельзя современным программам предоставить такой 0xB8000 адрес и пару регистров вывода? Зачем все эти ритуалы? И да, MMU и protected mode значительно замедляют доступ к памяти, посему современный DOS работал бы на порядок быстрей Windows/Linux. Протекция памяти оправдана только на этапе разработки программы, а для release билда ее лучше отключить, чтобы иметь прямой доступ к реальной памяти.
И я не одинок в негодовании:
https://stackoverflow.com/questions/39430404/drawing-pixels-in-opengl
>I'm using integrated GPU (Intel HD graphics 4000), as far as I know CPU and GPU share the same memory so why is it that I need to download? Why is it impossible to get a pointer?
Начинаю думать, что Unabomber был прав во всем - надо к чертям взорвать офисы мразотных бюрократов из Khronos Group.
j123123,
05 Мая 2018
-
0
- 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
Alg Root;
arg x, y;
Root = getRoot(x, y, 1);
end;
Sub getRoot;
arg x, y, r;
if Power(r, x) < y then
getRoot = getRoot(x, y, r + 1);
else
if Power(r, x) = y then
getRoot = r;
else
getRoot = r - 1;
end;
end;
end;
Sub Power;
arg x, y;
if 0 < y then
Power = x * Power(x, y - 1);
else
Power = 1;
end;
end;
Написал напитоне простой интерпретатор функционального языка из учебника по теоретическим основам информатики, давайте обсудим
https://hastebin.com/ocadegapuv.py
сам учебник, в котором описывается язык и семантика (глава про функциональные программы)
http://www.ict.edu.ru/ft/003627/lect1.pdf
В оп-коде пример программы, которую ему можно скормить
(вычисляет целую часть корня степени x из числа y).
Подскажите, для начала, как распознать и развернуть в цикл хвостовую рекурсию.
И если кто напитоне работает, этот код вообще котируется, или есть явное палево?
vistefan,
18 Января 2018
-
+7
- 1
http://miryanka.ru/frame.js
Интернет-магазин православной одежды Мирянка. Православный скрипт и конструкции вида
function ПреобразоватьМесяцИзСХислаВСтроку(Месяц)
loki90,
24 Марта 2016
-
−1
- 1
- 2
- 3
- 4
- 5
- 6
..........................
//ДА ЧТО ЗА ЧЕЛОВЕК... КТО ЭТОТ КОД ПИСАЛ?! ПУСТЬ ОН/ОНА БОЛЬШЕ НИКОГДА НЕ ПИШЕТ КОД, А ЧИСТИТ КАЛОШИ... 2К++ запросов - это что за нах?!
// если рефакторить гавно, получится гавно, но запахом получше. Гавна есть запах ли хорош?
if(!$smarty->is_cached('output.tpl', $template_key)){
$xml='<document>';
..........................
Нашел на одном сайте, который делали очень давно и самые разные "программисты" )
AndreDev,
21 Октября 2015
-
+1
3_14dar,
08 Сентября 2015