Walrus operator
Walrus operator To finalize previous post. ```python n = 0 while (s := input()).lower() != "конец": n += 1 print(n) ``` I think, it's the most elegant approach. But it uses "walrus operator" which appeared only in python
EN / RU
Walrus operator To finalize previous post. ```python n = 0 while (s := input()).lower() != "конец": n += 1 print(n) ``` I think, it's the most elegant approach. But it uses "walrus operator" which appeared only in python
De Morgan's rule One of the subscribers brought me a problem. Roughly, it sounds like this: “Read standard input and count strings. Stop counting when the user enters конец or КОНЕЦ.” The question was how to write the lo
Algorithm Flood In comments you can bring interesting programming tasks and discuss it
Qbasic and polar coordinates I think it's quite a controversial take. Progress gives us far more powerful computers, instruments nobody could imagine 5 years ago. And still qbasic feels like the best way to start writing
Word of the day: spendthrift Spend means “to give away”, thrift — “to keep”. If you know these words, spendthrift may sound like “keep your money while you can”. And that would be totally wrong. Spendthrift means to spen
Sine cosine machine I’m a physicist, and for me sine and cosine are first and foremost laws of motion: the horizontal and vertical shadows of a pin on the edge of a rotating disc, cast on a wall. Some time ago I decided
Sunflowers. MapReduce. P.S. While writing this post, I realized this algorithm can be improved. There’s some unnecessary work: first I build a (x, y) → h dictionary, and then I rebuild it into h → [(xi, yi), …]. We can g
MapReduce in The Farmer Was Replaced Code discussion. Part II. In the [previous post](<https://t.me/phys_math_dev/86>) we discussed [the code](<https://github.com/tarstars/tfwr/blob/main/sunflowers_ach.py>) which uses ma
Competitive programming guides. When somebody asks about best guides for competitive programming, my first reaction is: * [A. Shen: "Programming: theorems and problems"](<https://sch57.ru/files/pub/prog/Programming_theor
Word of the day I’m in ɔ of this world. Three letters → one ɔ.
GBDTE presentation. Unstable class. I’m working now on a presentation for my upcoming public talk. Here’s a picture that illustrates a small but telling idea: an applicant with exactly three unique phone numbers in their
MapReduce in The Farmer Was Replaced Code discussion. Part I. 27 years ago Google was born. One of its key ideas was PageRank – a “credibility” score for a web page. ([the paper](<https://snap.stanford.edu/class/cs224w-r
Sunflower achievement We have already started to discuss multidrone programming. I applied this technique to get the "Sunflower" achievement. I'm not quite happy with the code yet, but here we are: it works. [code](<http
Heteronym of the day SOW 🐷 noun: "female pig", sound: /saʊ/ 🐷 verb: "to plant seeds", sound: /soʊ/
sin(a+b), cos(a+b) Hello everyone! Today, while doing my dishes, I suddenly realized that sin and cos of a sum can be derived through the consecutive matrix multiplication. But I definitely remember that in school our te
the point of no return has been crossed 🔪The Rubicon has been crossed. 🔪We've crossed the point of no return. 🔪There’s no turning back now. 🔪The die is cast. 🔪The bridge behind us has been burned. So, except "The die is
A short update on GBDTE presentation. The die is cast. I set the date for my presentation on Gradient Boosted Decision trees. It's Jan 15. I'm aiming for a 45 minutes presentation, so like 30 slides to make. The timeline
Programming flood To discuss programming tasks in comments