- 1
Просто оффтоп #42
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
Просто оффтоп #42
#12: https://govnokod.ru/27153 https://govnokod.xyz/_27153
#13: https://govnokod.ru/27159 https://govnokod.xyz/_27159
#14: https://govnokod.ru/27200 https://govnokod.xyz/_27200
#15: https://govnokod.ru/27237 https://govnokod.xyz/_27237
#16: (vanished) https://govnokod.xyz/_27282
#17: https://govnokod.ru/27319 https://govnokod.xyz/_27319
#18: https://govnokod.ru/27380 https://govnokod.xyz/_27380
#19: (vanished) https://govnokod.xyz/_27500
#20: https://govnokod.ru/27607 https://govnokod.xyz/_27607
#21: https://govnokod.ru/27951 https://govnokod.xyz/_27951
#22: https://govnokod.ru/28076 https://govnokod.xyz/_28076
#23: https://govnokod.ru/28266 https://govnokod.xyz/_28266
#24: https://govnokod.ru/28373 https://govnokod.xyz/_28373
#25: https://govnokod.ru/28474 https://govnokod.xyz/_28474
#26: https://govnokod.ru/28563 https://govnokod.xyz/_28563
#27: https://govnokod.ru/28645 https://govnokod.xyz/_28645
#28: (vanished) https://govnokod.xyz/_28664
#29: https://govnokod.ru/28674 https://govnokod.xyz/_28674
#30: https://govnokod.ru/28680 https://govnokod.xyz/_28680
#31: https://govnokod.ru/28688 https://govnokod.xyz/_28688
#32: https://govnokod.ru/28695 https://govnokod.xyz/_28695
#33: https://govnokod.ru/28702 https://govnokod.xyz/_28702
#34: (vanished) https://govnokod.xyz/_28708
#35: https://govnokod.ru/28715 https://govnokod.xyz/_28715
#36: https://govnokod.ru/28725 https://govnokod.xyz/_28725
#37: https://govnokod.ru/28733 https://govnokod.xyz/_28733
#38: (vanished) https://govnokod.xyz/_28748
#39: https://govnokod.ru/28758 https://govnokod.xyz/_28758
#40: https://govnokod.ru/28885 https://govnokod.xyz/_28885
#41: https://govnokod.ru/29061 https://govnokod.xyz/_29061
0
function fib<T>(n: T) {
return n <= 2 ? n : fib(n - 1) + fib(n - 2);
}
function main()
{
print (fib(5));
print (fib(6.0));
}
я вам принес "рекурсивные генерики"..... внимание вопрос... а каким таким хером получилось вычеслить тут возвращаемый тип, а ?
0
function main()
{
let o = { x: 'hi', y: 17 }
const o2 = { ...o };
print(o2.x, o2.y);
}
а ты так можешь говнокодить на С/C++? дамп не дам.. (толку?)
0
#include <iostream>
#include <string>
using namespace std;
struct A
{
A() { cout << "A::A()" << endl; }
~A() { cout << "~A::A()" << endl; }
};
struct B
{
B() { cout << "B::B()" << endl; }
~B() { cout << "~B::B()" << endl; }
};
union U
{
A a;
B b;
int n;
U() { a = A {}; b = B {}; }
~U() {}
};
int main()
{
U u;
}
Запустить тут: cpp.sh/3ewfw
Получается информация о том, какой сейчас объект активен в union где-то хранится.
−104
Кто победит на выборах?
Я за Зеленского. Чисто по приколу.
−1
"phpMyAdmin" или "Adminer"?
−3
#define m_from(format) \
char buff[128]; \
sprintf(buff, format, value); \
data_ = std::string(buff);
inline void fromShort(short value)
{
m_from("%i");
}
inline void fromInt(int value)
{
m_from("%i");
}
inline void fromLong(long value)
{
m_from("%li");
}
inline void fromFloat(float value)
{
m_from("%f");
}
inline void fromDouble(double value)
{
m_from("%f");
}
https://github.com/FlightBlaze/Newtoo/blob/master/modules/misc/USVString.h
Собственно, занесения в аналы ГК достоин весь этот класс целиком.
+5
if ($count == 1 or $count == 21 or $count == 31 or $count == 41 or $count == 51 or $count == 61 or $count == 71 or $count == 81) ( $str = ' товар');
if ($count == 2 or $count == 3 or $count == 4 or $count == 22 or $count == 23 or $count == 24 or $count == 32 or $count == 33 or $count == 34 or $count == 42 or $count == 43 or $count == 44 or $count == 52 or $count == 53 or $count == 54 or $count == 62 or $count == 63 or $count == 64) ( $str = ' товара');
if ($count == 5 or $count == 6 or $count == 7 or $count == 8 or $count == 9 or $count == 10 or $count == 11 or $count == 12 or $count == 13 or $count == 14 or $count == 15 or $count == 16 or $count == 17 or $count == 18 or $count == 19 or $count == 20 or $count == 25 or $count == 26 or $count == 27 or $count == 28 or $count == 29 or $count == 30 or $count == 35 or $count == 36 or $count == 37 or $count == 38 or $count == 39 or $count == 40 or $count == 45 or $count == 46 or $count == 47 or $count == 48 or $count == 49 or $count == 50 or $count == 55 or $count == 56 or $count == 57 or $count == 58 or $count == 59 or $count == 60 or $count == 65) ( $str = ' товаров');
if ($count > 81){
$str=" тов";
}
Бронебойный pluralize
+134
public enum Hours
{
[Description("01")]
One = 1,
[Description("02")]
Two = 2,
[Description("03")]
Three = 3,
[Description("04")]
Four = 4,
[Description("05")]
Five = 5,
[Description("06")]
Six = 6,
[Description("07")]
Seven = 7,
[Description("08")]
Eight = 8,
[Description("09")]
Nine = 9,
[Description("10")]
Ten = 10,
[Description("11")]
Eleven = 11,
[Description("12")]
Twelve = 12
}
+109
BusinessLogic.Entity_InheritanceSetting.Save(
Session.SessionSettings.Settings.ContactID.Value,
Session.SessionSettings.Settings.SessionID.Value, copyID.Value,
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);