- 1
- 2
- 3
- 4
- 5
#include <iostream>
int main(){
std::cout << "Hello, world!" << std::endl;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
#include <iostream>
int main(){
std::cout << "Hello, world!" << std::endl;
}
лучший в мире код сосите
+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);
}
Код для вычисления длины данного гамнакода.
+1
ПPOЦ COKO_БAH;
ИMEHA:P,B,PR,И,ИM,Г;
975->P;
767->B;
<32,100,27,141,65,AДPЧ(6994),169,32,133,83,169,0,133,153,169,0,133,152,32,79,187,32,92,27,76,96,27>->PR;
ДЛЯ И OT 1 ДO #PR::
AДPЗ(P+И,PR[И]);
BCE;
ДЛЯ Г ИЗ<"1","2">::
"S"+Г->ИM;
ДЛЯ И OT 1 ДO 30::
ECЛИ И>#ИM TO
AДPЗ(B+И,160);
ИHAЧE
AДPЗ(B+И,KOД(ИM[И]));
BCE;
BCE;
AДPBЫЗ(976);
BCE;
AДPBЫЗ(17548);
KHЦ;
«Сокобан» («Мудрый крот») из пакета «Роботландия» для «Агата».
Язык программирования: «Рапира».
Форматирование моё (в оригинале был однострочник).
+2
В боте @GovnokodBot обновление:
Теперь говнокоды отправляются скриншотами.
Также создан канал "Говнокода" в "Telegram": https://t.me/GovnokodChannel
Баги и пожелания можно писать сюда.
Зеркала Говнокода и полезные ресурсы:
* https://govnokod.xyz/
* https://gcode.space/
* индекс оффтопов: https://index.gcode.space/
* https://t.me/GovnokodBot
* https://pethu.ru
+1
#include <stdio.h>
#include <stdlib.h>
#define SPLICE(a,b) SPLICE_1(a,b)
#define SPLICE_1(a,b) SPLICE_2(a,b)
#define SPLICE_2(a,b) a##b
#define PP_ARG_N( \
_1, _2, _3, _4, _5, _6, _7, _8, _9, _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, N, ...) N
/* Note 63 is removed */
#define PP_RSEQ_N() \
62, 61, 60, \
59, 58, 57, 56, 55, 54, 53, 52, 51, 50, \
49, 48, 47, 46, 45, 44, 43, 42, 41, 40, \
39, 38, 37, 36, 35, 34, 33, 32, 31, 30, \
29, 28, 27, 26, 25, 24, 23, 22, 21, 20, \
19, 18, 17, 16, 15, 14, 13, 12, 11, 10, \
9, 8, 7, 6, 5, 4, 3, 2, 1, 0
#define PP_NARG_(...) PP_ARG_N(__VA_ARGS__)
/* Note dummy first argument _ and ##__VA_ARGS__ instead of __VA_ARGS__ */
#define PP_NARG(...) PP_NARG_(_, ##__VA_ARGS__, PP_RSEQ_N())
#define PRINT_1(a1) \
printf(a1);
#define PRINT_2(a1, b1) \
printf(a1, b1);
#define PRINT_3(a1, b1, a2) \
PRINT_2(a1, b1); PRINT_1(a2)
#define PRINT_4(a1, b1, a2, b2) \
PRINT_2(a1, b1); PRINT_2(a2, b2);
#define PRINT_5(a1, b1, a2, b2, a3) \
PRINT_4(a1, b1, a2, b2); PRINT_1(a3);
#define PRINT_6(a1, b1, a2, b2, a3, b3) \
PRINT_4(a1, b1, a2, b2); PRINT_2(a3, b3)
#define PRINT_7(a1, b1, a2, b2, a3, b3, a4) \
PRINT_6(a1, b1, a2, b2, a3, b3); PRINT_1(a4)
#define PRINT_8(a1, b1, a2, b2, a3, b3, a4, b4) \
PRINT_6(a1, b1, a2, b2, a3, b3); PRINT_2(a4, b4);
//..... дальше лень ...
#define PRINTS_(N, ...) \
SPLICE(PRINT_, N)(__VA_ARGS__)
#define PRINTS(...) \
PRINTS_(PP_NARG(__VA_ARGS__), __VA_ARGS__)
int main(void)
{
PRINTS("10 = %d", 10, "; 3 + 3 = %d", 3+3, "\n" );
return EXIT_SUCCESS;
}
Имитация крестопарашного cout через препроцессор
https://wandbox.org/permlink/px4DCDSCGfUlbcFL
0
IT Оффтоп #56
#28: https://govnokod.ru/26372 https://govnokod.xyz/_26372
#29: https://govnokod.ru/26385 https://govnokod.xyz/_26385
#30: https://govnokod.ru/26413 https://govnokod.xyz/_26413
#31: https://govnokod.ru/26423 https://govnokod.xyz/_26423
#32: https://govnokod.ru/26440 https://govnokod.xyz/_26440
#33: https://govnokod.ru/26449 https://govnokod.xyz/_26449
#34: https://govnokod.ru/26456 https://govnokod.xyz/_26456
#35: https://govnokod.ru/26463 https://govnokod.xyz/_26463
#36: https://govnokod.ru/26508 https://govnokod.xyz/_26508
#37: https://govnokod.ru/26524 https://govnokod.xyz/_26524
#38: https://govnokod.ru/26539 https://govnokod.xyz/_26539
#39: https://govnokod.ru/26556 https://govnokod.xyz/_26556
#40: https://govnokod.ru/26568 https://govnokod.xyz/_26568
#41: https://govnokod.ru/26589 https://govnokod.xyz/_26589
#42: https://govnokod.ru/26600 https://govnokod.xyz/_26600
#43: https://govnokod.ru/26604 https://govnokod.xyz/_26604
#44: https://govnokod.ru/26627 https://govnokod.xyz/_26627
#45: https://govnokod.ru/26635 https://govnokod.xyz/_26635
#46: (vanished) https://govnokod.xyz/_26646
#46: (vanished) https://govnokod.xyz/_26654
#47: https://govnokod.ru/26671 https://govnokod.xyz/_26671
#48: https://govnokod.ru/26707 https://govnokod.xyz/_26707
#49: https://govnokod.ru/26750 https://govnokod.xyz/_26750
#49: https://govnokod.ru/26776 https://govnokod.xyz/_26776
#50: https://govnokod.ru/26804 https://govnokod.xyz/_26804
#51: https://govnokod.ru/26809 https://govnokod.xyz/_26809
#52: https://govnokod.ru/26817 https://govnokod.xyz/_26817
#53: https://govnokod.ru/26833 https://govnokod.xyz/_26833
#54: https://govnokod.ru/26840 https://govnokod.xyz/_26840
#55: https://govnokod.ru/26844 https://govnokod.xyz/_26844
0
https://habr.com/ru/company/ruvds/blog/514776/
−1
#include <iostream>
#include <windows.h>
int i;
using namespace std;
int main() {
setlocale(LC_ALL, "RUSSIAN");
cout << "супер антиверус "чистелка гавна" от леомакс готов к запуську" << endl;
for (i;i<101;i++) {
switch(i) {
case 11:{
cout << "проверка на наличие говнакода" << endl;
break;
};
case 28:{
cout << "говнакод не найдет" << endl;
break;
}
case 50:{
cout << "исчу трайани" << endl;
break;
}
case 64:{
cout << "песдец" << endl;
break;
}
case 90:{
cout << "готова!!111!!!11!" << endl;
break;
}
}
Sleep(100);
}
cout << "супер антиверус от леосракс "чистелка гавна" нашел верус в вашем компьюктере, с вас всего 999р на нашу карту, если не скинете, вам песдъа"
return 0;
}
Антивирус "Чистилка Говна" от Leomax. Всего за 999Р!!! Успейте купить сегодня!!!
+1
SELECT
`1000, 1000000 field`
(SELECT group_concat(band_category_languages.name SEPARATOR ', ')
FROM calendar_entry_categories
LEFT JOIN band_category_languages ON band_category_languages.band_category_id = calendar_entry_categories.band_category_id
WHERE calendar_entry_categories.calendar_entry_id = calendar_entries.id
AND band_category_languages.language_id = 1
GROUP BY calendar_entry_categories.calendar_entry_id) AS band_category_string,
(SELECT entry.id
FROM calendar_entries AS entry
WHERE entry.entry_kind_parent_id = calendar_entries.id
AND entry.profile_type_id = 10869
AND entry.profile_type = 1) AS move_to_personal_calendar,
(SELECT count(moved_entry.id)
FROM calendar_entries AS moved_entry
WHERE moved_entry.entry_kind_parent_id = calendar_entries.id
AND moved_entry.status = 3) AS count_moved,
(SELECT user_images.image
FROM calendar_entries AS calendar_entries1
LEFT JOIN user_images ON user_images.id = calendar_entries1.image
WHERE calendar_entries1.id = calendar_entries.entry_kind_parent_id
AND calendar_entries.entry_kind = 4) AS festival_image,
(SELECT countries1.code
FROM calendar_entries AS calendar_entries1
LEFT JOIN locations AS locations1 ON locations1.id = calendar_entries1.location_id
LEFT JOIN countries AS countries1 ON countries1.id = locations1.country_id
WHERE calendar_entries1.id = calendar_entries.entry_kind_parent_id
AND calendar_entries.entry_kind = 4) AS festival_country_code,
(SELECT count(*)
FROM calendar_entry_likes
WHERE calendar_entry_likes.calendar_entry_id = calendar_entries.id) AS count_of_likes,
(SELECT count(*)
FROM calendar_entry_likes
WHERE calendar_entry_likes.calendar_entry_id = calendar_entries.id
AND calendar_entry_likes.user_id = 10869 ) AS is_like,
(SELECT group_concat(entry_type_languages.name SEPARATOR ', ')
FROM calendar_entry_types
LEFT JOIN entry_type_languages ON entry_type_languages.entry_type_id = calendar_entry_types.entry_type_id
WHERE (calendar_entry_types.calendar_entry_id = calendar_entries.id
OR calendar_entry_types.calendar_entry_id = calendar_entries.entry_kind_parent_id)
AND entry_type_languages.language_id = 1
GROUP BY calendar_entry_types.calendar_entry_id) AS entry_types_string,
(SELECT band_addresses.city_name
FROM band_addresses
WHERE band_addresses.band_id = calendar_entries.profile_type_id) AS band_city_name,
(SELECT countries.code
FROM band_addresses
LEFT JOIN countries ON countries.id = band_addresses.country_id
WHERE band_addresses.band_id = calendar_entries.profile_type_id) AS band_country_code,
(SELECT group_concat(genre_languages.name SEPARATOR ', ')
FROM calendar_entry_genres
LEFT JOIN genre_languages ON genre_languages.genre_id = calendar_entry_genres.genre_id
WHERE calendar_entry_genres.calendar_entry_id = calendar_entries.id
AND genre_languages.language_id = 1
GROUP BY calendar_entry_genres.calendar_entry_id) AS genre_string
FROM `calendar_entries`
LEFT JOIN `locations` ON `locations`.`id` = `calendar_entries`.`location_id`
LEFT JOIN `calendar_entries` AS `festival` ON `festival`.`id` = `calendar_entries`.`entry_kind_parent_id`
LEFT JOIN `locations` AS `festival_location` ON `festival_location`.`id` = (
SELECT calendar_entries1.id
FROM calendar_entries AS calendar_entries1
WHERE calendar_entries1.id = calendar_entries.entry_kind_parent_id
AND calendar_entries.entry_kind = 4
)
LEFT JOIN `countries` ON `countries`.`id` = `locations`.`country_id`
LEFT JOIN `country_languages` ON `country_languages`.`country_id` = `locations`.`country_id`
LEFT JOIN `states` ON `states`.`id` = `locations`.`state_id`
LEFT JOIN `bands` ON `bands`.`id` = `calendar_entries`.`profile_type_id`
AND `bands`.`soft_delete` = 0
AND `bands`.`status` = 1
LEFT JOIN `band_images` ON `band_images`.`id` = `calendar_entries`.`image`
LEFT JOIN `band_privacy_settings` ON `band_privacy_settings`.`band_id` = `calendar_entries`.`profile_type_id`
WHERE (`bands`.`soft_delete` = 0 OR `bands`.`soft_delete` IS NULL)
AND (`bands`.`status` = 1 OR `bands`.`status` IS NULL)
AND ((
(SELECT count(*)
FROM band_administrators
WHERE band_administrators.band_id = bands.id
AND band_administrators.user_id = 10869 ) > ? OR `band_privacy_settings`.`band_privacy_level` != ?
) AND (
(SELECT user_type
FROM users
WHERE users.id = 10869 ) = ? OR `band_privacy_settings`.`band_privacy_level` != ?
) AND (
(SELECT count(*)
FROM user_bands
WHERE user_bands.band_id = bands.id
AND user_bands.status = 1
AND user_bands.user_id = 10869 ) > ? OR `band_privacy_settings`.`band_privacy_level` != ?
) OR `band_privacy_settings`.`band_privacy_level` IS NULL
) AND (`festival`.`entry_kind` = ? OR `festival`.`id` IS NULL)
AND (date(`calendar_entries`.`date_from`) >= ?)
AND `calendar_entries`.`soft_delete` = ?
AND (`country_languages`.`language_id` = ? OR `country_languages`.`language_id` IS NULL)
AND `calendar_entries`.`entry_kind` IN (?, ?)
AND `calendar_entries`.`event_class` IN (?, ?)
AND `calendar_entries`.`status` = ?
GROUP BY `1000, 1000000 field`
ORDER BY calendar_entries.date_from
LIMIT 1000, 20
Сидить замовник такий не тужить тай думку гадає, а що це я буду платити півтори куска спеціалусту за роботу, як є "профі" за 500 доларів, а тут ше і Вася програміст каже, а шо це ти будеш платити таку суму, як я зроблю дешевше за 300! Настрій хороший, угода укладена, робота кипить. Проходить не так багато часу, як замовник каже, а що це сторінка 2хв грузиться, а Вася каже, то нічо ми то все оптимізуємо! Проходить ще декілька місяців, а результату нема. Тоді замовнек розуміє, що Вася не профі і шукає профі в Х рази дорощого! Не так багато часу пройшло, як профі за 1000 каже, я в два рази оптимізував, більше не реально! Замовник пригнічений, шукає профі, і в один прекрасний момент знаходиться дійсно профі, який по домовленості в зарплату X оптимізував, повикидував, переписав, дописав і в результаті 50 мс при 500000 записів. Підсумок: 300 + 1000 + X != 300 :)
+2
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Data;
using Indusoft.PolypropylenPowder.Info;
//СУКИ ИНДАСОФТОВСКИЕ
namespace Indusoft.PolypropylenPowder.Converters
{
public class BeginXxConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null) return null;
var s = value as IEnumerable<object>;
var res = 45.0;
var flag = false;
if (s != null)
{
foreach (var a in s)
{
var b = a as DataTemplate5Item;
if (b != null)
{
if (b.IsActive5)
{
flag = true;
break;
}
}
res += 91;
}
}
if (!flag)
{
return 0;
}
return res;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
ух сука питухи, а мне это говно поддерживать