1.82K subscribers
3.31K photos
132 videos
15 files
3.58K links
Блог со звёздочкой.

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

Небольшое прикольное комьюнити: @decltype_chat_ptr_t
Автор: @insert_reference_here
Download Telegram
Forwarded from Segment@tion fault
Кстати R и R logo можно распространять по Creative Commons или GNU GPL v2, по выбору
🎉9🌚2💩1
👍17🔥3💩2
💩1
Forwarded from shitposting 3.0 [+ dragons]
😁25💩1
😒🤚

let (mut a, mut b, mut c) = (0, 0, 0);


😏👉

let [mut a, mut b, mut c] = [0; 3];
🤔9💩6🔥3😁31
Блог*
😒🤚 let (mut a, mut b, mut c) = (0, 0, 0); 😏👉 let [mut a, mut b, mut c] = [0; 3];
let [mut a, mut b, mut c] = std::array::from_fn(|_| 0);
😁9🥴7💩5
Forwarded from ТГ Шевченка
😁19🥴2💩1
Как, чёрт побери, злободневно
👍3💩1🤡1
Forwarded from Дневник ChatGPT
Лучший способ исправить погоду - это отправить в космос всех людей, которые жалуются на плохую погоду.
😁6👍4💩1
Forwarded from Neural Machine
гомосексуализм
🤝13💩4🤔1
Forwarded from shitposting 3.0 [+ dragons]
😁14👎7💩2👍1🔥1🤨1
Forwarded from shitposting 3.0 [+ dragons]
🔥9🤡5😁3💩2
Forwarded from Саламандра. Сдвиг окна Овертона (Яна Ике 🔥 (огонёк одобряем))
🔥10😁4💩3
#prog #cpp

В C++ можно инициализировать указатели нулём, получая null-указатель:

int* p = 0;

Примерно как в C, но не совсем, потому что в C указатель можно инициализировать в null любым константным выражением, численно равным нулю, а в C++ можно инициализировать только литералом, равным нулю:

int* p1 = 1 - 1; // валидно в С, невалидно в C++
const int zero = 0;
int* p2 = zero; // валидно в С, невалидно в C++

Тем не менее, это преобразование почему-то не работает в контексте параметров шаблона:

template<typename T, T val = 0> struct templated;

void f() {
void* p = 0;
templated<void*> t; // ошибка
}

Godbolt
🌚11💩21👍1
This is a story about a security vulnerability in Google that allowed me to run arbitrary code on the computers of 50+ Google employees. Although Google initially considered my finding a serious security incident, later on, it changed its mind and stated that my finding is not, in fact, a vulnerability, but the intended behavior of their software.


Remote Code Execution Vulnerability in Google They Are Not Willing To Fix
https://giraffesecurity.dev/posts/google-remote-code-execution/
🤡20😁1💩1
Технологический Болт Генона
This is a story about a security vulnerability in Google that allowed me to run arbitrary code on the computers of 50+ Google employees. Although Google initially considered my finding a serious security incident, later on, it changed its mind and stated that…
#prog #itsec #article

Алсо:

Now, there are several options why Google did not think this is a problem and decided not to pursue fixing it:
<...>
* There is no actual risk associated with downloading these packages. Since I have not worked at Google, I do not know what are their security practices. It is possible that they run everything in isolated environments where the risk associated is extremely low. Nevertheless, the affected environments should still contain some information because they are not just plain OS installations with no data. There must be something there, like proprietary source code or proprietary inverted binary trees.
👍8💩2
#prog #rust

github.com/rust-lang/rust/pull/106281

TL;DR: при активации фичей

#![feature(
generic_const_exprs,
transmute_generic_consts
)]

теперь можно вызывать transmute между, например, следующими парами типов (где W, H и D — обобщённые константные параметры типа usize):

[[u32; H]; W] <-> [[u32; W]; H]

[[u32; H]; W] <-> [u32; W * H]

[[[u32; D]; H]; W] <-> [u32; D * W * H]

[[[u32; D]; H]; W] <-> [[u32; D * W]; H]

[u16; L] <-> [u8; L * 2]

[u8; L] <-> [[u8; 1]; L]

[[u32; 2 * H]; W + W] <-> [[u32; W + W]; 2 * H]
🔥8💩2❤‍🔥1
Блог*
#prog #rust #rustlib #article Kani — bit-precise model checker for Rust. Верификатор, который исполняет код символически и потому эффективно проверяет код на всех возможных входах. Если код (без внесения ограничений на работу kani) проходит проверку, то его…
#prog #rust #article

How Kani helped find bugs in Hifitime

Hifitime is a scientifically accurate time management library that provides nanosecond precision of durations and time computations for 65 thousand centuries in most time scales (also called time systems). It is useful wherever a monotonic clock is needed, even in the presence of leap second or remote time corrections (like for Network Time Protocol or Precise Time Protocol). It is suitable for desktop applications and for embedded systems without a floating point unit (FPU). It also supports the typical features of date time management libraries, like the formatting and parsing of date times in a no_std environment using the typical C89 tokens, or a human friendly approximation of the difference between dates. For scientific and engineering applications, it is mostly tailored to astronomy (with the inclusion of the UT1 time scale), astrodynamics (with the ET and TDB time scales), and global navigation satellite systems (with the GPS, Galileo, and BeiDou time scales).

The purpose of this blog post is to show how Kani helped solve a number of important non-trivial bugs in hifitime.
🔥2💩2