1.83K subscribers
3.3K photos
131 videos
15 files
3.57K links
Блог со звёздочкой.

Много репостов, немножко программирования.

Небольшое прикольное комьюнити: @decltype_chat_ptr_t
Автор: @insert_reference_here
Download Telegram
Документация Go: "Go — простой язык, в нём есть только один цикл: for".

Тем временем for:

- Безусловный цикл
- Цикл с предусловием
- Цикл в стиле C
- Цикл по слайсу
- Цикл по строке
- Цикл по мапе
- Цикл по каналу
🤡26😁11👎32👏2👍1🥴1🤣1
#prog #rust #rustlib #amazingopensource

aya-rs

eBPF is a technology that allows running user-supplied programs inside the Linux kernel. For more info see https://ebpf.io/what-is-ebpf.

Aya is an eBPF library built with a focus on operability and developer experience. It does not rely on libbpf nor bcc - it's built from the ground up purely in Rust, using only the libc crate to execute syscalls. With BTF support and when linked with musl, it offers a true compile once, run everywhere solution, where a single self-contained binary can be deployed on many linux distributions and kernel versions.

Some of the major features provided include:

* Support for the BPF Type Format (BTF), which is transparently enabled when supported by the target kernel. This allows eBPF programs compiled against one kernel version to run on different kernel versions without the need to recompile.
* Support for function call relocation and global data maps, which allows eBPF programs to make function calls and use global variables and initializers.
* Async support with both tokio and async-std.
* Easy to deploy and fast to build: aya doesn't require a kernel build or compiled headers, and not even a C toolchain; a release build completes in a matter of seconds.
🔥11👍1
#rust

Increasing the glibc and Linux kernel requirements

TL;DR: с версии Rust 1.64.0 будут подняты минимальные требования для версий ядра Linux и glibc (как для компиляции, так и для запуска бинарей):

- glibc >= 2.11 ➡️ glibc >= 2.17
- ядро >= 2.6.32 ➡️ ядро >= 3.2

Учитывая, что обеим упомянутым старым версиям почти по десять лет, скорее всего, вас это не коснётся.
2
#prog #rust #rustasync #article

Fixing the Next Thousand Deadlocks: Why Buffered Streams Are Broken and How To Make Them Safer

<...> Last month, our service was brought down for days by a nasty deadlock bug, and this isn’t the first deadlock we’ve seen - it’s at least the fourth. And just last week, we saw yet another deadlock-induced outage. Fortunately, four of the five deadlocks (including the most recent two) have the same root cause - futures::stream::Buffered is inherently prone to deadlocks. In this post, I will explain the issue and explore ways to prevent this from happening again.

<...>

If there’s one lesson from decades of software engineering, it is the failure of “just be careful” as a strategy. C/C++ programmers still experience memory corruption constantly, no matter how careful they are. Java programmers still frequently see NullPointerExceptions, no matter how careful they are. And so on. One of the reasons that Rust is so successful is that it adds automated checks to prevent many common mistakes.

As shown by the fact that we keep seeing new deadlock bugs, despite our best efforts to avoid them, “just be careful” is not a strategy that can avoid this kind of bug in nontrivial codebases. We need some way to statically eliminate the issue.

P. S.:

> I am fortunate enough to work on a production Rust service (a real one, not cryptocurrency nonsense)

Ке-ке-ке
Forwarded from Neural Shit
У нас тут новые статьи в нейроуголовном кодексе. Помните, что незнание правил не освобождает от ответственности.

>>Статья 93.Неосторожная генитальная стимуляция при прослушивании рок- музыки.

>>Статья 54.Изменение внешности путем подмены человеческих лиц собачьими и свиными

>>Статья 129.Перманентное обивание порогов власти.

>>Статья 348.Незаконные переговоры с дьяволом, инфернальной силой, исчадиями ада, укурками, с немецким Гитлером, западной демократией

>>Статья 451.Нежелание разъяснить своим детям смысл происходящих в стране событий

>>Статья 144.Бегство из Москвы в волчьем облике

>>Статья 874.Мобилизация падших женщин для продолжения рода оборотней.

>>Статья 443.Отказ от предложенной водки.

>>Статья 113.Пытки, вызываемые щекотанием и игрой на музыкальных инструментах.

>>Статья 82.Перемещение отрицательной энергии, заблокированной кармой.

>>Статья 65.Подражание Джордано Бруно

>>Статья 398.Превращение людей в полулюдей-полукошек

>>Статья 127.Использование младенца (зачатого под влиянием гипноза) в качестве Цукерберга
👍6🤔1💩1
#meme про акульи тапочки
👎2
😁212🔥1
#prog #game #article

Factorio Is The Best Technical Interview We Have (перевод, но его качество в комментариях ругают)

There's been a lot of hand-wringing over The Technical Interview lately. Many people realize that inverting a binary tree on a whiteboard has basically zero correlation to whether or not someone is actually a good software developer. The most effective programming test anyone's come up with is still Fizzbuzz. One consequence of this has been an increased emphasis on Open Source Contributions, but it turns out these aren't a very good metric either, because most people don't have that kind of time.

The most effective programming interview we have now is usually some kind of take-home project, where a candidate is asked to fix a bug or implement a small feature within a few days. This isn't great because it takes up a lot of time, and they could recieve outside help (or, if the feature is sufficiently common, google it). On the other hand, some large companies have instead doubled-down on whiteboard style interviews by subjecting prospective engineers to multiple hour-long online coding assessments, with varying levels of invasive surveillience.

All these interviewing methods pale in comparison to a very simple metric: playing Factorio with someone. Going through an entire run of Factorio is almost the best possible indication of how well someone deals with common technical problems. You can even tweak the playthrough based on the seniority of the position you're hiring for to get a better sense of how they'll function in that role.
👍10🤔1
Forwarded from Life of Tau
но сразу после этого довольно позитивный твит

[twitter]
2
#prog #meme

К сожалению, жиза 🥲
7😁4😢4💩2👍1
#prog #sql #article

A Formalization of SQL with Nulls (pdf)

SQL is the world’s most popular declarative language, forming the basis of the multi-billion-dollar database industry. Although SQL has been standardized, the full standard is based on ambiguous natural language rather than formal specification. Commercial SQL implementations interpret the standard in different ways, so that, given the same input data, the same query can yield different results depending on the SQL system it is run on. Even for a particular system, mechanically checked formalization of all widely-used features of SQL remains an open problem. The lack of a well-understood formal semantics makes it very difficult to validate the soundness of database implementations. Although formal semantics for fragments of SQL were designed in the past, they usually did not support set and bag operations, lateral joins, nested subqueries, and, crucially, null values. Null values complicate SQL’s semantics in profound ways analogous to null pointers or side-effects in other programming languages. Since certain SQL queries are equivalent in the absence of null values, but produce different results when applied to tables containing incomplete data, semantics which ignore null values are able to prove query equivalences that are unsound in realistic databases. A formal semantics of SQL supporting all the aforementioned features was only proposed recently. In this paper, we report about our mechanization of SQL semantics covering set/bag operations, lateral joins, nested subqueries, and nulls, written in the Coq proof assistant, and describe the validation of key metatheoretic properties. Additionally, we are able to use the same framework to formalize the semantics of a flat relational calculus (with null values), and show a certified translation of its normal forms into SQL.

(thanks @daily_ponv)

Пара моментов:

В этой формализации не рассматриваются операции агрегирования и группировки.

Семантика, построенная для их формализации SQL, параметризована используемой логикой. Она может быть классической булевой (двухзначной) или же трёхзначной, как в SQL. В статье авторы показывают, что трёхзначность логики на самом деле не добавляет выразительности: они доказывают (конструктивно), что для любого запроса в трёхзначной логике есть эквивалентный в смысле семантики запрос, работающий в двухзначной логике. Обратное тоже верно.

---

Вообще, на мой взгляд, это какая-то дичь, что оптимизаторы запросов в БД до сих пор делают, не утруждаясь доказательствами корректности преобразований запросов.
👍2
Forwarded from Generative Anton
Cмотрим на красную точку 30 секунд не отрываясь и очень пристально, а потом переводим взгляд на стену и начинаем быстро моргать.

Работает это из-за перенасыщения одной группы цветовых рецепторов в глазу (сине-желтые) и синие перенасыщаются, а желтые -- нет. Вот тут описание феномена: https://www.verywellmind.com/what-is-an-afterimage-2795828

Когда решал соревнование с саккадами, то столько нового узнал про зрение. Там костыль на костыле. Хуже чем в любом продакшне.
👍3
😁72👍2🥰1💩1
Forwarded from Neural Machine
Поддерживать отношения со своим мозгом — хорошая идея.
👍13
Резидент «Сколково» создал замену популярного во всём мире британского компьютера Raspberry Pi — и назвал её Repka Pi.

Примечательно, что предзаказы принимают уже сейчас (причём исключительно через форму заказа, без указанной цены), а степень готовности — "Подготовка начала производства".

Ы - ымпортозамещение.
🤡13😁2
#prog #gamedev #article

Cramming 'Papers, Please' Onto Phones (перевод)

Статья от автора 'Papers, Pleaze' о том, как он портировал игру на мобильные устройства и о том, на какие сложности он наткнулся: как технические, так и куда как более значительные интерфейсные.

P. S.: Слава Арстоцке!
🔥61👍1