Forwarded from Awful Rust snippets for fun and profit
this code compiles and runs without panicking
thanks to @asokol123 for bringing it
original tweet by @m_ou_se
code on playground
relevant RFC with rationale for this design decision
thanks to @asokol123 for bringing it
original tweet by @m_ou_se
code on playground
relevant RFC with rationale for this design decision
😱5
Forwarded from мне не нравится реальность
Добавлять "safety footgun" линты в компилятор весело потому что даже тесты писать не обязательно, просто запускаешь билд стандартной библиотеки и он падает потому что стандартная библиотека это сплошной "safety footgun"
Мне нужен буфер обмена между телефоном и компьютером.
А пока что есть "Избранное" в Telegram.
А пока что есть "Избранное" в Telegram.
👍13❤2
Вафель: шитпостит
Подписчики Вафеля: улыбаются, говорят, какой Вафель хороший, и просят ещё
Я: шитпостю
Мои подписчики: отписываются
Подписчики Вафеля: улыбаются, говорят, какой Вафель хороший, и просят ещё
Я: шитпостю
Мои подписчики: отписываются
😁17👍6❤1
#prog #rust
github.com/rust-lang/rust/pull/101514
This change stabilizes the associated
github.com/rust-lang/rust/pull/101514
This change stabilizes the associated
BITS constant for NonZero{U,I}{8,16,32,64,128,size} integersGitHub
Stabilize `nonzero_bits` by nvzqz · Pull Request #101514 · rust-lang/rust
Closes #94881, implemented by #93292.
This change stabilizes the associated BITS constant for NonZero{U,I}{8,16,32,64,128,size} integers, e.g.:
impl NonZeroUsize {
pub const BITS: u32 = usize::...
This change stabilizes the associated BITS constant for NonZero{U,I}{8,16,32,64,128,size} integers, e.g.:
impl NonZeroUsize {
pub const BITS: u32 = usize::...
🤔3🔥1💩1
Forwarded from Generative Anton
Наткнулся на статью 1994ого года про продуктивность разработчика и языки (Haskell/Ada/C++) и случайно заметил AWS.
❤2
> how to trim string in rust
Just use scissors, silly. It doesn't matter whether a string is covered with rust or not
Just use scissors, silly. It doesn't matter whether a string is covered with rust or not
👍9😐4❤3😁3
> how to trim string in python
Why the heck would you need to cut a string inside of a snake?
Why the heck would you need to cut a string inside of a snake?
❤5💩3👍1
> how to trim string in C
You do not cut strings to tune them to specific notes, you stretch them instead
You do not cut strings to tune them to specific notes, you stretch them instead
❤14👍2
Forwarded from Кіт ✙ без шляпи🇺🇦
> how to trim string in go
You do not cut strings in hurry, just stop and trim them
You do not cut strings in hurry, just stop and trim them
👍7❤1
> how to trim string in java
Just like in every other country, I guess. I mean, I didn't hear that cutting strings there is prohibited by law
Just like in every other country, I guess. I mean, I didn't hear that cutting strings there is prohibited by law
👍8❤1
> how to trim string in haskell
Firstly, they are called tendons, not strings. Secondly, leave messing with body to professional surgeons
Firstly, they are called tendons, not strings. Secondly, leave messing with body to professional surgeons
👍5❤1😁1
Forwarded from TechSparks
Гугл приготовил не очень приятный сюрприз для всяких быстро обученных аналитиков, которых выпускают курсы и буткемпы. Основное умение такого аналитика, как правило, состоит в том, что он(а) может покрутить данные в разных опенсорсных моделях и выявить, например, аномалии или сформулировать простейшие предсказания. Без минимальных навыков программирования это невозможно, и именно эти навыки и продаются.
Но вот Гугл начал интегрировать возможности своего TensorFlow прямо в Sheets, называется это очень адекватно SimpleML. Теперь имея таблицу данных, можно безо всякого программирования напустить на данные машинное обучение, и простейшие его результаты получить не покидая Sheets.
Everything runs completely on the user browser. Your data doesn’t leave Google Sheets and models are saved to your Google Drive so you can use them again later.
И, похоже, это только начало: наверняка и более сложные сценарии тоже в итоге в таблицы интегрируют. Очень впечатляющая и реально полезная реализация no code подхода. https://venturebeat.com/ai/google-brings-machine-learning-to-online-spreadsheets-with-simple-ml-for-sheets/
Но вот Гугл начал интегрировать возможности своего TensorFlow прямо в Sheets, называется это очень адекватно SimpleML. Теперь имея таблицу данных, можно безо всякого программирования напустить на данные машинное обучение, и простейшие его результаты получить не покидая Sheets.
Everything runs completely on the user browser. Your data doesn’t leave Google Sheets and models are saved to your Google Drive so you can use them again later.
И, похоже, это только начало: наверняка и более сложные сценарии тоже в итоге в таблицы интегрируют. Очень впечатляющая и реально полезная реализация no code подхода. https://venturebeat.com/ai/google-brings-machine-learning-to-online-spreadsheets-with-simple-ml-for-sheets/
VentureBeat
Google brings machine learning to online spreadsheets with Simple ML for Sheets
Today Google announced a beta release of Simple ML for Sheets, which allows users without ML experience to try ML out on their spreadsheets.
#prog #rust
Посмотрим вот на этот код:
Отличаются эти две функции, помимо названия, лишь порядком лайфтаймов в определении. Тем не менее, проверка показывает, что вторая функция компилируется, а первая — нет.
Это — баг компилятора. К счастью, фикс есть, надеюсь, скоро смержат.
Посмотрим вот на этот код:
async fn fail<'a, 'b, 'c>(_: &'static str)
where
'a: 'c, 'b: 'c,
{}
async fn pass<'a, 'c, 'b>(_: &'static str)
where
'a: 'c, 'b: 'c,
{}
Отличаются эти две функции, помимо названия, лишь порядком лайфтаймов в определении. Тем не менее, проверка показывает, что вторая функция компилируется, а первая — нет.
Это — баг компилятора. К счастью, фикс есть, надеюсь, скоро смержат.
play.rust-lang.org
Rust Playground
A browser interface to the Rust compiler to experiment with the language
👍8🤔3🔥1🤯1
#prog #rust #article
Self-referential types for fun and profit
<...>Contrary to usual answers, this will show how to create self-referential types manually. A very important subset of such types are straightforward to reason about and, most importantly, can be manipulated through a safe interface. We will not rewrite the borrow checker, we will not use
Self-referential types for fun and profit
<...>Contrary to usual answers, this will show how to create self-referential types manually. A very important subset of such types are straightforward to reason about and, most importantly, can be manipulated through a safe interface. We will not rewrite the borrow checker, we will not use
std::pin, but we will use a bit of unsafe. You’ve been warned.More Stina Blog!
Self-referential types for fun and profit
Some Rust questions are asked over and over, and are therefore met with short and well-rehearsed answers. “Compile in release mode when measuring performance.” “Don’t try to…
❤1