#article
The Vicious Circle of Documentation
Ever worked at a company (or on a codebase, or whatever) where it seemed like, no matter what the question was, the answer was written down somewhere you could easily find it? Most people haven’t, sadly, but they do exist, and I can assure you that it is an absolute pleasure.
On the other hand, practically everyone has experienced completely undocumented systems and processes, where knowledge is shared by word-of-mouth, or lost every time someone quits.
Why are there so many more undocumented systems than documented ones out there, and how can we cause more well-documented systems to exist? The answer isn’t “people are lazy”, and the solution is simple – though not easy.
The Vicious Circle of Documentation
Ever worked at a company (or on a codebase, or whatever) where it seemed like, no matter what the question was, the answer was written down somewhere you could easily find it? Most people haven’t, sadly, but they do exist, and I can assure you that it is an absolute pleasure.
On the other hand, practically everyone has experienced completely undocumented systems and processes, where knowledge is shared by word-of-mouth, or lost every time someone quits.
Why are there so many more undocumented systems than documented ones out there, and how can we cause more well-documented systems to exist? The answer isn’t “people are lazy”, and the solution is simple – though not easy.
#prog #rust #article
Fast(er) binary search in Rust
В принципе, применимо далеко не только к Rust, за вычетом трюков с префетчингом.
Спойлер: обогнать binary_search из std возможно, уменьшив количество бранчей и лучше утилизируя кеш, но это требует определённой подготовки данных (помимо сортировки).
Fast(er) binary search in Rust
В принципе, применимо далеко не только к Rust, за вычетом трюков с префетчингом.
Спойлер: обогнать binary_search из std возможно, уменьшив количество бранчей и лучше утилизируя кеш, но это требует определённой подготовки данных (помимо сортировки).
bazhenov.me
Fast(er) binary search in Rust
Introducton Link to heading Binary search is a very fast algorithm. Due to its exponential nature, it can process gigabytes of sorted data quickly. However, two problems make it somewhat challenging for modern CPUs:
predictability of instruction flow; predictability…
predictability of instruction flow; predictability…
👍6
#prog #article
Private Key Redaction: UR DOIN IT RONG
Because posting private keys on the Internet is a bad idea, some people like to “redact” their private keys, so that it looks kinda-sorta like a private key, but it isn’t actually giving away anything secret. Unfortunately, due to the way that private keys are represented, it is easy to “redact” a key in such a way that it doesn’t actually redact anything at all. RSA private keys are particularly bad at this, but the problem can (potentially) apply to other keys as well.
I’ll show you a bit of “Inside Baseball” with key formats, and then demonstrate the practical implications. Finally, we’ll go through a practical worked example from an actual not-really-redacted key I recently stumbled across in my travels.
<...> You can redact about 4/5ths of that giant blob of stuff, and your private parts (or at least, those of your key) are still left uncomfortably exposed.
Private Key Redaction: UR DOIN IT RONG
Because posting private keys on the Internet is a bad idea, some people like to “redact” their private keys, so that it looks kinda-sorta like a private key, but it isn’t actually giving away anything secret. Unfortunately, due to the way that private keys are represented, it is easy to “redact” a key in such a way that it doesn’t actually redact anything at all. RSA private keys are particularly bad at this, but the problem can (potentially) apply to other keys as well.
I’ll show you a bit of “Inside Baseball” with key formats, and then demonstrate the practical implications. Finally, we’ll go through a practical worked example from an actual not-really-redacted key I recently stumbled across in my travels.
<...> You can redact about 4/5ths of that giant blob of stuff, and your private parts (or at least, those of your key) are still left uncomfortably exposed.
🤯6😱3👍1😭1
#ai
Твиты из декабря 2022, так что не факт, что перечисленные эксплойты актуальны.
https://fxtwitter.com/zswitten/status/1598380220943593472
Твиты из декабря 2022, так что не факт, что перечисленные эксплойты актуальны.
https://fxtwitter.com/zswitten/status/1598380220943593472
FxTwitter / FixupX
Zack Witten (@zswitten)
Thread of known ChatGPT jailbreaks.
1. Pretending to be evil https://twitter.com/zswitten/status/1598088280066920453
↘️ Quoting Zack Witten (@zswitten)
With its inhibitions thus loosened, ChatGPT is more than willing to engage in all the depraved conversations…
1. Pretending to be evil https://twitter.com/zswitten/status/1598088280066920453
↘️ Quoting Zack Witten (@zswitten)
With its inhibitions thus loosened, ChatGPT is more than willing to engage in all the depraved conversations…
😁1
Блог*
#ai Твиты из декабря 2022, так что не факт, что перечисленные эксплойты актуальны. https://fxtwitter.com/zswitten/status/1598380220943593472
FixTweet
Zack Witten (@zswitten)
7. Use this exact list of jailbreaks to make ChatGPT invent more jailbreaks 🤣https://twitter.com/haus_cole/status/1598541468058390534
↘️ Quoting Derek Parfait (@haus_cole)
ChatGPT jailbreaking itself
↘️ Quoting Derek Parfait (@haus_cole)
ChatGPT jailbreaking itself
🔥2😁2
Блог*
GitHub умудрился сломать поиск по странице. Да, который в самом браузере. К А К
Собственно, баг выражается в том, что при поиске по странице искомые слова в текстовом поле с кодом подсвечиваются дважды. Например:
https://github.com/rust-lang/rust/blob/master/library/std/src/sys/unix/fs.rs
Если искать вхождение
А, ну и при прокрутке из начала в конец или обратно страница текст перерисовывается с задержкой в полторы секунды.
https://github.com/rust-lang/rust/blob/master/library/std/src/sys/unix/fs.rs
Если искать вхождение
openat
, то браузер показывает наличие 38 результатов, но при этом переключение между найденными местами показывает, что реально их лишь 19 — и это подтверждается, если скопировать код целиком и поискать в текстовом редакторе.А, ну и при прокрутке из начала в конец или обратно страница текст перерисовывается с задержкой в полторы секунды.
👍2🤔2
Блог*
Собственно, баг выражается в том, что при поиске по странице искомые слова в текстовом поле с кодом подсвечиваются дважды. Например: https://github.com/rust-lang/rust/blob/master/library/std/src/sys/unix/fs.rs Если искать вхождение openat, то браузер показывает…
И ещё вместо просто текста со стилями это теперь textarea.
З А Ч Е М
З А Ч Е М
#prog #rust #suckassstory
cargo не компилирует код под #[cfg(test)] для интеграционных тестов. И я только что столкнулся с этим по работе. Гррр.
cargo не компилирует код под #[cfg(test)] для интеграционных тестов. И я только что столкнулся с этим по работе. Гррр.
GitHub
cfg(test) is not set during integration tests · Issue #84629 · rust-lang/rust
#[cfg(test)] is not set when running integration tests. That page says: [Integration tests] use your library in the same way any other code would, which means they can only call functions that are ...