- 1
.
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−1
.
Как попасть в гугол по рекомендации Романа Кашицына?
+2
Только не это! Нет! Пожалуйста, не надо!!!
Ну ты питух...
+1
<GlobalConverters:EnumOrStringToSolidColorBrushConverter x:Key="UpdaterProcessStatusConverter" Mapping="UpdaterSuccessProcess-=-#01579B;UpdaterErrorProcess-=-#E53935;UpdaterWarningProcess-=-#FBBE44"/>
XAML из WPF
+3
// A sample standard C++20 program that prints
// the first N Pythagorean triples.
#include <iostream>
#include <optional>
#include <ranges> // New header!
using namespace std;
// maybe_view defines a view over zero or one
// objects.
template<Semiregular T>
struct maybe_view : view_interface<maybe_view<T>> {
maybe_view() = default;
maybe_view(T t) : data_(std::move(t)) {
}
T const *begin() const noexcept {
return data_ ? &*data_ : nullptr;
}
T const *end() const noexcept {
return data_ ? &*data_ + 1 : nullptr;
}
private:
optional<T> data_{};
};
// "for_each" creates a new view by applying a
// transformation to each element in an input
// range, and flattening the resulting range of
// ranges.
// (This uses one syntax for constrained lambdas
// in C++20.)
inline constexpr auto for_each =
[]<Range R,
Iterator I = iterator_t<R>,
IndirectUnaryInvocable<I> Fun>(R&& r, Fun fun)
requires Range<indirect_result_t<Fun, I>> {
return std::forward<R>(r)
| view::transform(std::move(fun))
| view::join;
};
// "yield_if" takes a bool and a value and
// returns a view of zero or one elements.
inline constexpr auto yield_if =
[]<Semiregular T>(bool b, T x) {
return b ? maybe_view{std::move(x)}
: maybe_view<T>{};
};
int main() {
// Define an infinite range of all the
// Pythagorean triples:
using view::iota;
auto triples =
for_each(iota(1), [](int z) {
return for_each(iota(1, z+1), [=](int x) {
return for_each(iota(x, z+1), [=](int y) {
return yield_if(x*x + y*y == z*z,
make_tuple(x, y, z));
});
});
});
// Display the first 10 triples
for(auto triple : triples | view::take(10)) {
cout << '('
<< get<0>(triple) << ','
<< get<1>(triple) << ','
<< get<2>(triple) << ')' << '\n';
}
}
«C++20»: ещё больше модерна! Ещё больше шаблонов! Ещё больше ебанутых конструкций! Ещё больше блядского цирка!
s: http://aras-p.info/blog/2018/12/28/Modern-C-Lamentations/
0
import java.io.File
import java.io.FileReader
fun main(args: Array<String>) {
val text = getText("Input line")
val fileName = getText("Input file name")
val mode = getInt("Input mode: 1 for rewrite, 2 for append", 1, 2)
doAction(mode, text, fileName)
}
fun doAction(mode: Int, text : String, fileName : String) {
val file = File(fileName)
when(mode) {
1 -> file.writeText(text)
2 -> file.appendText(text)
}
}
fun getInt(message: String, min : Int, max: Int) : Int {
var buffer : Int?
do {
print(message)
buffer = readLine()?.toIntOrNull()
}
while (buffer == null || buffer !in min..max)
return buffer
}
fun getText(message : String) : String {
print(message)
return readLine() ?: ""
}
Решил добавить немного говнокода на Kotlin
+2
https://www.researchgate.net/publication/325358150_cQASM_v10_Towards_a_Common_Quantum_Assembly_Language
cQASM v1.0: Towards a Common Quantum Assembly Language
The quantum assembly language (QASM) is a popular intermediate representation used in many quantum compilation and simulation tools to describe quantum circuits. Currently, multiple different dialects of QASM are used in different quantum computing tools. This makes the interaction between those tools tedious and time-consuming due to the need for translators between theses different syntaxes. Beside requiring a multitude of translators, the translation process exposes the constant risk of loosing information due to the potential incompatibilities between the different dialects. Moreover, several tools introduce details of specific target hardware or qubit technologies within the QASM syntax and prevent porting the code to other hardwares. In this paper, we propose a common QASM syntax definition, named cQASM, which aims to abstract away qubit technology details and guarantee the interoperability between all the quantum compilation and simulation tools supporting this standard. Our vision is to enable an extensive quantum computing toolbox shared by all the quantum computing community.
Вот это я понимаю, а то вон там мелкософт какие-то говношарпы придумывает очередные:
https://docs.microsoft.com/en-us/quantum/language/?view=qsharp-preview
+1
$today = new \DateTime('@'.strtotime(date("y-m-d", time())));
Today
0
Сумма = Цел(Окр(Сумма * 1000, 0, 1)) / 1000;
Или я мандаринов переел, или от этого портал должен открыться
+2
Дайте инвайт этому господину
https://habr.com/sandbox/125898/
0
const size_t page_num = 2000000;
const size_t page_size = sysconf(_SC_PAGE_SIZE);
assert(page_size == 4096);
const size_t buf_len = page_num * page_size;
size_t tmp = 0;
Того рот ебал, пыхамакаки в деле