- 1
- 2
- 3
https://beautifulracket.com/appendix/thoughts-on-rhombus.html
http://greghendershott.com/2019/07/future-of-racket.html
https://github.com/racket/rhombus-brainstorming/blob/master/resources/goals.md
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
https://beautifulracket.com/appendix/thoughts-on-rhombus.html
http://greghendershott.com/2019/07/future-of-racket.html
https://github.com/racket/rhombus-brainstorming/blob/master/resources/goals.md
Авторы Racket планируют в течение нескольких лет выпустить новый диалект языка, в котором, среди прочего, снизить порог вхождения, в том числе, вероятно, избавившись от скобочек™.
В связи с этим возникает два вопроса:
1) правда ли они думают, что сложность освоения Racket и lisp-подобных языков в скобочках (а не например в мощной системе макросов, метапрограммирования и возможности написания языков в языке)
2) переизобретут ли они Dylan спустя три десятка лет
+1
x = 0; y = 0
def gcd(a, b):
#{
global x, y
if (a == 0):
#{
x = 0; y = 1;
return b;
#}
d = gcd(b%a, a);
t = x
x = y - (b // a) * x;
y = t;
return d;
#}
#int main()
#{
#ios_base::sync_with_stdio(0); in.tie(0);
#I n, p, w, d, dd, ww;
#in >> n >> p >> w >> d;
n, p, w, d = map(int, input().split())
gc = gcd(d, w);
dd = x; ww = y
g = w * d // gc;
if (p % gc):
print(-1); exit(0)
dd *= p // gc;
ww *= p // gc;
if (ww < 0):
#{
di = (-ww + g // w - 1) // (g // w);
ww += g // w * di;
dd -= g // d * di;
if (dd < 0):
print(-1); exit(0)
#}
elif (dd < 0):
#{
di = (-dd + g // d - 1) // (g // d);
dd += g // d * di;
ww -= g // w * di;
if (dd < 0):
print(-1); exit(0)
#}
if (ww < 0 or dd < 0):
print(-1); exit(0)
di = dd // (g // d);
dd -= g // d * di;
ww += g // w * di;
if (ww + dd <= n):
print(ww, dd, n - ww - dd)
else:
print(-1);
#}
Когда на соревновании по спортивному программированию пишешь код на C++ и внезапно понимаешь, что int64_t тебе недостаточно.
0
/(?<=это же )отсос\?/
https://ideone.com/DbFj9D
+1
https://govnokod.xyz/fakes
0
/**
* <p>Статический метод размещает все аргументы и ключи по парам.</p> <p>Нечетные аргументы - массивы, четные - ключи, по которым искать в массивах.</p> <p>Ключи могут быть массивами. В этом случае поиск происходит во вложенных массивах. Возвращает первый не пустой элемент пары аргумент/ключ.</p>
*
*
* @param array $arraya массив для анализа
*
* @param array $string Ключи поиска
*
* @param strin $integerk Неограниченные последовательно проверяемые пары массив\ключ
*
* @param integer $mixeda
*
* @return mixed
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/type/collection/firstnotempty.php
* @author Bitrix
*/
public static function firstNotEmpty()
{
$argCount = func_num_args();
for ($i = 0; $i < $argCount; $i += 2)
{
$anArray = func_get_arg($i);
$key = func_get_arg($i+1);
if (is_array($key))
{
$current = &$anArray;
$found = true;
foreach ($key as $k)
{
if (!is_array($current) || !array_key_exists($k, $current))
{
$found = false;
break;
}
$current = &$current[$k];
}
if ($found)
{
if (is_array($current) || is_object($current) || $current != "")
return $current;
}
}
elseif (is_array($anArray) && array_key_exists($key, $anArray))
{
if (is_array($anArray[$key]) || is_object($anArray[$key]) || $anArray[$key] != "")
return $anArray[$key];
}
}
return "";
}
Чо ?
+1
// https://gcc.gnu.org/onlinedocs/cpp/Directives-Within-Macro-Arguments.html
// Occasionally it is convenient to use preprocessor directives within the arguments
// of a macro. The C and C++ standards declare that behavior in these cases is
// undefined. GNU CPP processes arbitrary directives within macro arguments in
// exactly the same way as it would have processed the directive were the
// function-like macro invocation not present.
// If, within a macro invocation, that macro is redefined, then the new definition
// takes effect in time for argument pre-expansion, but the original definition is
// still used for argument replacement. Here is a pathological example:
#define f(x) x x
f (1
#undef f
#define f 2
f)
// which expands to
// 1 2 1 2
Ну и хуйня.
+1
use Unicornify::URL;
my $url = unicornify_url( email => '[email protected]' );
https://metacpan.org/pod/Unicornify::URL
+1
Функция УбратьПробел(стрЧисло)
//убирает пустой пробел
нСтр = "";
Для п=1 По СтрДлина(стрЧисло) Цикл
р = Сред(стрЧисло,п,1);
Если р = "1" ИЛИ р = "2" ИЛИ р = "3" ИЛИ р = "4" ИЛИ р = "5" ИЛИ р = "6" ИЛИ р = "7" ИЛИ р = "8" ИЛИ р = "9" ИЛИ р = "0" ИЛИ р = "," Тогда
нСтр = нСтр+р;
КонецЕсли;
КонецЦикла;
Возврат нСтр;
КонецФункции
Senior
+1
#!/usr/bin/perl
# Fetch all JS from govno
use strict;
use warnings FATAL => 'all';
use LWP;
my $res = LWP::UserAgent->new->request(HTTP::Request->new("GET" => "http://govnokod.xyz/"));
die "Failed: " . $res->code unless $res->is_success;
for (split /\n/, $res->content) {
print if /<script/ ... /script>/ and !m/[<>]/;
}
кууик.
Официальный тред для ржания над пятым перлом
0
Выборка = Запрос.Выполнить.Выбрать();
Пока Выборка.Следующий() цикл
Петух = Выборка.Хуй;
Прервать;
конеццикла;
классика