#math #article
How knowing math helps you write better software
> So I like to justify why learning mathematics will make you, in your day-to-day life, write better software. Disclaimer: I’m going to be doing a lot of handwaving here and bring up very historically inaccurate examples. I call this style “Hillel is writing a newsletter and doesn’t want to do research”.
---
> The book I’m using to learn graph theory, the Wilson book, is really good at emphasizing this. Every chapter ends with a selection of real world problems that don’t look like they have anything to do with graphs, but are elegantly modeled with them. One example is Hall’s theorem: if we have a given set of talks and a given set of slots in the schedule, where each talk can only go in a subset of the slots, can we successfully pair up the talks and slots? This problem can be represented as a bipartite graph, which gives us necessary-and-sufficient conditions for there being a solution. That’s really cool!
---
> I want to emphasize the difference between “math as knowledge” and “math as a skill”. There’s the pure math skill of being able to prove that the eigenvector of a stochastic matrix represents a steady state. There’s the applied math skill of being able to find the eigenvector by hand, or transform the matrix to make it more amenable to computation. For us, those skills aren’t nearly as important. It’s better to know more kinds of things that can be used as abstractions, properties of those abstractions, and what transformations are possible than it is to actually prove those properties or make those transformations.
(There’s still a skill here: being able to faithfully translate between the world and the abstraction. Recognizing a problem is represented by a stochastic matrix is useless if you can’t actually write the corresponding stochastic matrix.)
How knowing math helps you write better software
> So I like to justify why learning mathematics will make you, in your day-to-day life, write better software. Disclaimer: I’m going to be doing a lot of handwaving here and bring up very historically inaccurate examples. I call this style “Hillel is writing a newsletter and doesn’t want to do research”.
---
> The book I’m using to learn graph theory, the Wilson book, is really good at emphasizing this. Every chapter ends with a selection of real world problems that don’t look like they have anything to do with graphs, but are elegantly modeled with them. One example is Hall’s theorem: if we have a given set of talks and a given set of slots in the schedule, where each talk can only go in a subset of the slots, can we successfully pair up the talks and slots? This problem can be represented as a bipartite graph, which gives us necessary-and-sufficient conditions for there being a solution. That’s really cool!
---
> I want to emphasize the difference between “math as knowledge” and “math as a skill”. There’s the pure math skill of being able to prove that the eigenvector of a stochastic matrix represents a steady state. There’s the applied math skill of being able to find the eigenvector by hand, or transform the matrix to make it more amenable to computation. For us, those skills aren’t nearly as important. It’s better to know more kinds of things that can be used as abstractions, properties of those abstractions, and what transformations are possible than it is to actually prove those properties or make those transformations.
(There’s still a skill here: being able to faithfully translate between the world and the abstraction. Recognizing a problem is represented by a stochastic matrix is useless if you can’t actually write the corresponding stochastic matrix.)
buttondown.email
How knowing math helps you write better software
Projects Update TLA+ workshop last week went really well! I’m super happy with the current state of the workshop and while I’ll still be making a bunch of...
👍1🔥1
С днём рождения, Андрей "ozkriff" Лесников!
Telegram
ozkriff.games 🦀
👋 I'm @ozkriff: Rust zealot, hobby game developer, fan of turn based games, one of arewegameyet.rs' maintainers and gamedev.rs' editors. ex-Wargaming, ex-JetBrains.
See the pinned message for more info and links: https://t.iss.one/ozkriff_games/4
See the pinned message for more info and links: https://t.iss.one/ozkriff_games/4
🎉16
PONV Daily
https://twitter.com/AStrasser116/status/1576648460194807808/
Как находить paper-ы. Мне точно пригодится
#prog #rust
cargo careful: run your Rust code with extra careful debug checking
Или лёгкий способ запустить программу с отладочными ассертами в std.
cargo careful: run your Rust code with extra careful debug checking
Или лёгкий способ запустить программу с отладочными ассертами в std.
www.ralfj.de
cargo careful: run your Rust code with extra careful debug checking
Did you know that the standard library is full of useful checks that users never get to see? There are plenty of debug assertions in the standard library that will do things like check that...
👍4
#prog #rust #rustasync #article
How (and why) nextest uses tokio, part 1
Или хороший пример того, как async может пригодиться в программе, которая вообще никак не связана с общением по сети.
How (and why) nextest uses tokio, part 1
Или хороший пример того, как async может пригодиться в программе, которая вообще никак не связана с общением по сети.
How (and why) nextest uses tokio
How (and why) nextest uses tokio ꞏ sunshowers
How my open source test runner uses async Rust.
🔥2
#prog #rust #article
Brute forcing protected ZIP archives in Rust
Комментарии к статье на Reddit едва ли не ценнее самой статьи. Спойлер: на rayon и проще, и быстрее.
Brute forcing protected ZIP archives in Rust
Комментарии к статье на Reddit едва ли не ценнее самой статьи. Спойлер: на rayon и проще, и быстрее.
agourlay.github.io
Brute forcing protected ZIP archives in Rust
Yet another programming blog
🤔23👎12😢1
#prog #c #article
Type Punning Functions in C
Type Punning Functions in C
#include <math.h>
#include <stdio.h>
double DoubleToTheInt(double base, int power) {
return pow(base, power);
}
int main() {
// cast to a function pointer with arguments reversed
double (*IntPowerOfDouble)(int, double) =
(double (*)(int, double))&DoubleToTheInt;
// prints 0.366032
printf("(0.99)^100: %lf \n", DoubleToTheInt(0.99, 100));
// also prints 0.366032
printf("(0.99)^100: %lf \n", IntPowerOfDouble(100, 0.99));
}
www.evanmiller.org
Type Punning Functions in C – Evan Miller
🤔4👍3🤮1
Forwarded from Врен о Японии для туриста
Арочный мост Кинтай - главная достопримечательность японского города Ивакуни. Он был построен еще в 1673 году и до сих пор выглядит (почти) как при самураях.
До отказа от феодального строя, кстати, только самураям и разрешалось ходить по ценному мосту - и так приходилось чинить его слишком часто. Крестьяне переправлялись через реку на лодках.
До отказа от феодального строя, кстати, только самураям и разрешалось ходить по ценному мосту - и так приходилось чинить его слишком часто. Крестьяне переправлялись через реку на лодках.
🔥3
мне не нравится реальность
Все же уже слышали про новый формат QOI (quite ok image format, qoiformat.org), который lossless сжимает картинки +- так же хорошо, как PNG, но при этом в 20-50 раз быстрее, а его спецификация умещается на одну страницу? Хотели бы кодинг стрим где я бы подумал…
#prog #haskell #article
ТоварищМёртвопищ 0xd34df00d написал декодер и енкодер QOI на хаскелле. И весьма быстрые.
Haskell is quite OK for images: decoding QOI
Haskell is quite OK for images: encoding QOI
Товарищ
Haskell is quite OK for images: decoding QOI
Haskell is quite OK for images: encoding QOI
❤6👍3😁2🤯2