Блог*
#music Цепляющий электронный бит Знатоки могут понять, во что я недавно играл.
YouTube
Helltaker - "Vitality" (8-bit Style Cover)
I've had this song from Helltaker stuck in my head forever and just had to do an 8-bit version lol. It's not strictly VRC6 or 2A03. I used Sunvox Tracker to make it. I had a lot of fun with this one.
Enjoy my music? Consider buying me a coffee ( -_-)旦~
…
Enjoy my music? Consider buying me a coffee ( -_-)旦~
…
Forwarded from Меня заставили создать канал
По :debian: в Телеграме выползает эмодзи 🍥 теперь.
Forwarded from мне не нравится реальность
#prog #article
Статья про паттерн для работы с IO.
"There’s a pattern that I keep recommending to teams over and over again, because it helps separate concerns around I/O; sending and receiving things over a network, interacting with AWS, saving and loading things from data stores. It’s an old idea; you’ll find it filed under “Decorator” in your Gang of Four book.
<...>
Decorators are a great compositional pattern allowing the different concerns that inevitably cluster around I/O boundaries to be neatly separated and recombined. This opportunity presents itself several times in every app we write, and does not require any fancy language, type system, or framework."
Статья про паттерн для работы с IO.
"There’s a pattern that I keep recommending to teams over and over again, because it helps separate concerns around I/O; sending and receiving things over a network, interacting with AWS, saving and loading things from data stores. It’s an old idea; you’ll find it filed under “Decorator” in your Gang of Four book.
<...>
Decorators are a great compositional pattern allowing the different concerns that inevitably cluster around I/O boundaries to be neatly separated and recombined. This opportunity presents itself several times in every app we write, and does not require any fancy language, type system, or framework."
REA Group Ltd
Use the decorator pattern for clean I/O boundaries | REA Group Ltd
Всё в этой жизни уравновешано: если сегодня ты стукнулся правой коленкой, то завтра стукнешься левой
Forwarded from iggisv9t channel
This media is not supported in your browser
VIEW IN TELEGRAM
Кажется, я теперь буду скупать все призмы и похожие штуки. Посередине кубик со световыми фильтрами.
#prog #article
Статья (и продолжение) о дизайне hypothesis — библиотеки для property-based тестирования (вообще для Python, но с портами на другие языки, включая Rust). В отличие от родоначальника подхода QuickCheck, в котором для генерирования произвольных значений опирается на классы типов (и, следовательно, типы), hypothesis опирается на явные генераторы значений, которые, в отличие от генераторов QuickCheck, могут иметь состояние. В статьях убедительно аргументируется, что это позволяет сделать минификацию тест-кейсов значительно более эффективной, как в смысле райнтайм-производительности, так и в смысле снижения числа отбрасываемых тест-кейсов.
А вообще советую почитать остальные статьи в блоге, там много интересных.
Статья (и продолжение) о дизайне hypothesis — библиотеки для property-based тестирования (вообще для Python, но с портами на другие языки, включая Rust). В отличие от родоначальника подхода QuickCheck, в котором для генерирования произвольных значений опирается на классы типов (и, следовательно, типы), hypothesis опирается на явные генераторы значений, которые, в отличие от генераторов QuickCheck, могут иметь состояние. В статьях убедительно аргументируется, что это позволяет сделать минификацию тест-кейсов значительно более эффективной, как в смысле райнтайм-производительности, так и в смысле снижения числа отбрасываемых тест-кейсов.
А вообще советую почитать остальные статьи в блоге, там много интересных.
hypothesis.works
Integrated vs type based shrinking - Hypothesis
Integrated vs type based shrinking One of the big differences between Hypothesis and Haskell QuickCheck is
how shrinking is handled.
Specifically, the way shrinking is handled in Haskell QuickCheck is bad
and the way it works in Hypothesis (and also in test.check…
how shrinking is handled.
Specifically, the way shrinking is handled in Haskell QuickCheck is bad
and the way it works in Hypothesis (and also in test.check…
Forwarded from Врен о Японии для туриста
Собственная Фудзи должна быть у каждого японского школьника - об этом позаботилась компания PLUS Stationery. Она продает стирательные резинки, которые поначалу выглядят обычно (слева на фото), но постепенно превращаются в Фудзи со снежной шапкой. Изобретательно!
Линейка таких резинок постоянно обновляется, и сейчас в продажу поступил осенний вариант с кленовыми листьями.
Линейка таких резинок постоянно обновляется, и сейчас в продажу поступил осенний вариант с кленовыми листьями.
#prog #rust #rustlib
fmt_ext — библиотека для прикрепления кастомных реализаций
Вместо тысячи слов:
fmt_ext — библиотека для прикрепления кастомных реализаций
Debug
и Display
к чужим типам.Вместо тысячи слов:
use std::{fmt, marker::PhantomData};
use fmt_ext::{debug::*, DebugExt};
// Create a type that will implement custom debug...
struct SliceWithLenDebug<T>(PhantomData<T>);
// Implement custom debug...
impl<T> CustomDebug for SliceWithLenDebug<T>
where
T: fmt::Debug,
{
type Target = [T];
fn fmt_target(target: &Self::Target, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "Slice {{ len: {}, items: {:?} }}", target.len(), target)
}
}
// Attach custom debug implementation to the target type...
impl<T> AttachDebug<SliceWithLenDebug<T>> for [T] {}
// Look! Now we have just call `debug` method on the target type...
fn main() {
let numbers = [0, 1, 2, 3];
println!("{:?}", numbers.debug());
let strings = vec!["I", "am", "a", "custom", "debug"];
println!("{:?}", strings.debug());
}
(thanks @ilyavenner)#prog
Даниил опять рассказывает интересное. На этот раз — про внутреннее устройство branch predictor-а
Даниил опять рассказывает интересное. На этот раз — про внутреннее устройство branch predictor-а
Telegram
Experimental chill
Недавно задался вопросом, а где вообще почитать про процессоры и как они устроены. К сожалению, архитектура практически всех современных процессоров закрыта.
С одним небольшим исключением, которое мне скинули друзья из ARM. Это процессоры Exynos, которые…
С одним небольшим исключением, которое мне скинули друзья из ARM. Это процессоры Exynos, которые…
#prog #rust #article #rustlib
Статья про фреймворк для тестирования программ на Rust при помощи генерации случайных программ и их исполнения при помощи miri. За счёт применяемых методик позволяет генерировать программы, которые тайпчекаются по построению. Несмотря на пачку ограничений, авторы сумели найти несколько багов в существующих библиотеках.
"The goal of this paper is to develop a methodology for automatically generating Rust programs to effectively test Rust library APIs. The main challenge is to synthesize well-typed Rust programs to account for proper chaining of API calls and Rust’s ownership type system and polymorphic types. We develop a program synthesis technique for Rust library API testing, which relies on a novel logical encoding of typing constraints from Rust’s ownership type system. We implement SyRust, a testing framework for Rust libraries that automatically synthesizes semantically valid test cases. Our experiments on 30 popular open-source Rust libraries found 4 new bugs."
Статья про фреймворк для тестирования программ на Rust при помощи генерации случайных программ и их исполнения при помощи miri. За счёт применяемых методик позволяет генерировать программы, которые тайпчекаются по построению. Несмотря на пачку ограничений, авторы сумели найти несколько багов в существующих библиотеках.
"The goal of this paper is to develop a methodology for automatically generating Rust programs to effectively test Rust library APIs. The main challenge is to synthesize well-typed Rust programs to account for proper chaining of API calls and Rust’s ownership type system and polymorphic types. We develop a program synthesis technique for Rust library API testing, which relies on a novel logical encoding of typing constraints from Rust’s ownership type system. We implement SyRust, a testing framework for Rust libraries that automatically synthesizes semantically valid test cases. Our experiments on 30 popular open-source Rust libraries found 4 new bugs."