- 1
- 2
- 3
- 4
- 5
apt update
apt upgrade
brew upgrade
brew update
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−1
apt update
apt upgrade
brew upgrade
brew update
Постоянно их путаю
+1
Яндекс сгнил :(
0
https://github.com/PlummersSoftwareLLC/Primes/blob/drag-race/PrimeChapel/solution_1/primes.chpl#L92
Царские анроллы.
0
try
{
}
catch(...) { /*um, nice weather!*/}
0
#include <iostream>
#include <string_view>
#include <source_location>
void log(const std::string_view message,
const std::source_location location =
std::source_location::current())
{
std::cout << "file: "
<< location.file_name() << "("
<< location.line() << ":"
<< location.column() << ") `"
<< location.function_name() << "`: "
<< message << '\n';
}
template <typename T> void fun(T x)
{
log(x);
}
int main(int, char*[])
{
log("Hello world!");
fun("Hello C++20!");
}
file: main.cpp(23:8) `int main(int, char**)`: Hello world!
file: main.cpp(18:8) `void fun(T) [with T = const char*]`: Hello C++20!
Previously, functions that desire to obtain this information about the call site (for logging, testing, or debugging purposes) must use macros so that predefined macros like __LINE__ and __FILE__ are expanded in the context of the caller. The source_location class provides a better alternative.
0
#define as ;while
int main(int argc, char* argv[])
{
int n = atoi(argv[1]);
do printf("n is %d\n", n) as ( n --> 0);
return 0;
}
0
class Foo {
std::atomic<bool> a{false};
std::atomic<bool> b{false};
public:
Foo()
{
}
void first(function<void()> printFirst) {
printFirst();
a.store(true, std::memory_order_release);
}
void second(function<void()> printSecond) {
while (!a.load(std::memory_order_acquire))
;
printSecond();
b.store(true, std::memory_order_release);
}
void third(function<void()> printThird) {
while (!b.load(std::memory_order_acquire))
;
printThird();
}
};
https://leetcode.com/problems/print-in-order/
36 / 36 test cases passed.
Runtime: 1697 ms
Memory Usage: 7 MB
Хочу, чтобы начался срач по поводу того, как достичь рантайма в 200мс
0
.org 80h
fib:
push %b
push %d
push %c
mov %d [%sp + 8h]
mov %b 1h
mov %a 0h
.loop:
add %b %a
mov %c %a
mov %a %b
sub %a %c
dec %d
jnz @.loop
pop %c
pop %d
pop %b
ret
start:
mov %sp 2000h
push Fh
call @fib
pop
int 0h
один чел захотел написать для моей вмки компилятор лиспоподобного языка с некими S-выражениями и попросил пример вычисления ряда фибоначчи.
пришлось накопипастить с вики.
0
Be gone, malicious spirit from the anus!
We don't say "amen", because we may step on the mines; we say "True"!
Херня рулит.
+1
$bIsExpressDelivery = !empty($arDeliveryTariff["UF_EXPRESS_DELIVERY"]) ? true : false;
Чтобы наверняка true или наверняка false...