November 30 2023, 22:30

Interestingly enough, I don’t remember what I was coding, but during the process, I realized that I’ve never been bitten by mosquitoes around here. I’ve never heard a mosquito buzzing at home, even though we leave the balcony wide open all summer. There’s a pond with frogs just a 5-minute walk away, or ten minutes if you’re a mosquito. Today I read about a homemade laser anti-mosquito system with radar and realized that if I built it, I’d have nowhere to test it. So I wrote on nextdoor, neighbors, where have the mosquitoes gone?

I was expecting links to successful stories about the introduction of mosquito saboteurs. I wanted to write a post about the results. Indeed, such an experiment is being conducted in our state – they catch mosquitoes, inject them with GMO potion in the butt, and release them into the wild. They happily start families at the nearest pond, and soon the mosquito wife starts noticing that the foreign dad is only making sons, while the daughters vanish into mosquito heaven before even being born. With dad’s genes, sons fly off to start their own families, resulting in the same outcome, a shortage of brides begins, and eventually, there’s a significant mosquito die-off.

Anyway, I asked the neighbors where the mosquitoes had gone. And they started replying. That there are tons of mosquitoes around here, and they’re devouring the neighbors insatiably. Every second person responds that I don’t have any because they all flew to his or her place. Overall, I don’t know what they’re being injected with, but now the imbalance is elsewhere. I don’t know what’s wrong with us, maybe because we’re not yet true Americans.

I think it’s all Yuki’s doing. He clicks his teeth and eats anything that flies, and apparently, in the mosquito community, our house is marked with a red cross. And when Liz’s cat comes over, it’s marked with two.

November 30 2023, 16:37

Published an article on hybrismart about my utility for comparing file system snapshots. It’s amusing that this is actually the second iteration—the first was made under DOS, to share a library of warez according to friends’ choices. Of course, the utility now has broader applications possible 🙂

Briefly, it works like this. Vasya does a dir /S on his Windows machine or ls -lR on his Mac and sends the file to Petya. Petya opens it in my program, selects a hundred files from different directories, and creates a request file, which is essentially a script or a flat list of files, and sends it back to Vasya. Vasya receives this script, executes it on his machine, retrieves an archive with only the selected files, and passes this archive to Petya. Petya unpacks the archive, and all the files are placed into the corresponding spots in his file system, preserving all directories.

The second case is when both Vasya’s and Petya’s machines contain the same huge archive of something, which is supposed to be identical, but things happen, and something gets corrupted or deleted that wasn’t supposed to be, or, conversely, some extraneous files are created that alter the system’s behavior on Petya’s end differently from Vasya’s, even though you would think the source code, which is under version control, is the same. How to figure this out? That’s where the utility comes in. Each takes snapshots of the directory with all subdirectories, and then the utility compares them and shows the difference. Comparing them in other ways is very tricky, especially if Vasya and Petya are on different operating systems, or on the same operating system but in different languages, or on the same OS but different versions or modifications.

The source code is included. Requires Python/QT.

November 29 2023, 22:25

My first little Swift program for macOS! I am now 0.01% a junior developer for Macs! Look, I can do this in any editor, on video it’s Outlook, select any text, and by pressing a key combination, rephrase the selected text (Cmd-Option-R). If it’s in Russian, it will be translated and rephrased. Translation only — Cmd-Option-T. There’s also a feature to correct the grammar without changing the sentence – Cmd-Option-G. ChatGPT is used for this, of course, so a paid account is needed.

From start to finish, developing this little program took two hours. Including installing XCode and trying to figure out how everything works there. Of course, ChatGPT helped. It’s my first time seeing Swift.

I’ve uploaded it on GitHub. Just insert your own OpenAI key 🙂

November 29 2023, 00:48

I’m reading something interesting from Sapolsky. It’s well-known that bees and ants have their own communication methods, through which they transmit information about where food is and in which direction. For this discovery, Karl von Frisch received the Nobel Prize in Physiology or Medicine. But here’s what’s interesting: when several bees return, who determines which one to listen to and why? Eventually, one option is chosen. Either the nearest or the best.

And here is what Sapolsky writes. It’s important that the better the food source found by a scout, the longer he performs one part of the dance — thus, information about the quality is conveyed. In the second phase, other bees fly randomly around, and if they bump into the dancing scout, they go and check the food source reported by the scout… and then return to dance the news themselves. Since the best potential source = longer dance, it is more likely that one of the random bees encounters a bee with great news rather than just good news. This increases the chances that soon there will be two dancers with great news, then four, then eight, until the whole colony converges on the optimal spot. And the initial scout with good news would have long stopped dancing, encountered a dancer with great news, and been attracted to the optimal solution.

Note — there is no decision-making bee who receives information about both places, compares the two options, chooses the best and leads everyone there. Instead, the longer dance attracts bees, who will dance longer, and comparison and optimal choice arise implicitly; this is the essence of swarm intelligence.

Similarly, suppose two scout bees find two potential places that are equally good, but one is twice as close to the hive as the other. The bee with local news will need half the time to reach its food source and back compared to the bee with distant news — meaning that the doubling of two, four, eight starts sooner, exponentially muffling the signal of the bee with distant news. Soon everyone will head to the nearest source.

Ants find the optimal spot for a new colony in the same way. Scouts go out, and each finds a possible place; the better the place, the longer they stay there. Then random wanderers disperse with the rule that if you stumble upon an ant standing on a possible place, it might be worth checking that place.

To add from myself: it is known that ants communicate using chemical signals – pheromones. When a scout finds a good place, they can leave a pheromonal trail leading to that place. If other ants follow the scout (or simply cross the path of that ant), they are likely to follow the trail, and if they also find the place acceptable, they enhance the pheromone trail, making it even more attractive to subsequent explorers. This creates positive feedback: the more ants visit the place, the stronger the signal becomes.

Then, a shorter path means a more strongly scented pheromone. Since they evaporate over time, ants choose the shorter path when given options.

To add from myself, likewise, lichens find their way out of mazes in a similar manner.

Higher quality becomes a stronger signal for attraction, which becomes self-sustaining.

There is a scientist, Deborah Gordon. In her work, she shows an additional level of adaptability: how far ants disperse, how much time they spend on a good site compared to a mediocre one, and so on. She shows that these parameters vary in different ecosystems depending on how abundant the food sources are, how scattered they are, and how costly it is to forage for food (e.g., foraging is more costly in terms of water loss for desert ants than for forest ants); the better a colony has evolved to tune these parameters perfectly to its particular environment, the higher the likelihood that it can survive and leave offspring.

It’s interesting how nature arranges everything.

November 28 2023, 22:41

I visited the science museum in Chicago: It turns out that not only does forte piano signify the progenitor of the modern grand piano, but also velocipede is the ancestor of the bicycle. Interestingly, velocipede refers to any muscle-powered vehicle without pedals and with any number of wheels, but typically produced between 1828 and 1880. Therefore, a bicycle is essentially a two-wheeled velocipede. There’s also a dicycle – a vehicle with two parallel wheels, like segways for example.

The science museum in Chicago is fabulous. I’ve been to several, and this one is the best. They managed to make it interesting for both children and adults. I particularly liked the room there with three-dimensional stages of child development from the first days to birth.

November 28 2023, 00:41

Wow! Dr. Sobhani — he’s my primary care doctor. I’ve been going to his clinic for the last 8 years, and to him personally for about a couple of years now. Well, I haven’t needed to see him for quite some time.

And then comes the news — they revoked the American citizenship of him, born in the US to an Iranian family.

Sobhani has been living in the US for over 50 years, and received his citizenship “when he still couldn’t read”. Since then, he has been educated in the US, and has had his own practice and clinic, which essentially bears his name, for 30 years. During a recent — clearly not the first — passport issuance, the immigration service denied the issuance and revoked his citizenship.

Generally, under the Constitution, it’s impossible to strip someone of citizenship, but there’s one reason — citizenship can be annulled without the person’s consent only in cases of fraud in the naturalization process or if the initial naturalization was illegal.

The immigration service informed him of the reason: “Those born in the United States to parents with diplomatic immunity do not receive US citizenship at birth.” At that time, more than 50 years ago, citizenship was granted to him, but now some bell rang. Consequently, Sobhani is currently stateless. This is where there should probably be an emoji, but really, if you think about it, the situation is pretty awful.

Everything will probably be sorted out and his citizenship will be returned. Well, one would hope so, of course. Especially if he doesn’t have citizenship of another country.

November 27 2023, 20:15

There are two interesting YouTube channels for engineers: Droider (in Russian) and Adam Savage’s Tested (in English). Currently, I’m listening to Droider’s TSMC episode, and I recently enjoyed learning about the differences between the original Airpods Pro 2 and the fake ones. The folks there do CT scans and rotate 3D models while commenting. Links in the comments.

November 27 2023, 15:01

A very good channel by Kathy Joseph about the history of science, mainly about physics, but with a focus on history.

This video is about how these various voltage standards in household outlets appeared. I just returned from Chicago, and she talks about Chicago’s role in all this. In October 1871, the Great Chicago Fire destroyed much of the city. At that time, Chicago was an important hub on the route to the gold from the eastern coast and was growing rapidly. Houses were built hastily, which is why it all ended so sadly. Ultimately, the city was rebuilt with an emphasis on high-rise buildings. It was around this time that Chicago became the fastest-growing city, not only in population but also upward, in floors. It seems to still hold the record for the highest average building height in the world.

So, besides the problem of making sure houses didn’t fall apart from the wind 🙂, Chicagoans addressed how to prevent them from blowing up due to the gas used almost universally in homes, from stoves to lamps. And lifting gas to the nth floor was also a non-trivial task at the time. In general, the focus on electricity was largely supported by the burgeoning Chicago. The firm “Westinghouse Electric” showcased a column of 15,000 multicolored light bulbs that lit up in a specific sequence; Incidentally, the development of these light bulbs involved the prominent Russian scientist A. N. Lodygin, who was invited to build a light bulb factory. During the exhibition, the Third International Electrotechnical Congress took place, establishing universal international electrotechnical units, named after their inventors: Ampere, Watt, Volt, Joule, Ohm, etc. Regarding Russian scientists: Kathy further talks about Mikhail Dolivo-Dobrovolsky, a Russian-Polish engineer who developed the first three-phase motor in 1891, as well as a three-phase generator and transformer. Their design remained more or less unchanged for at least the next hundred years.

In fact, the high-rise buildings under construction made electricity accessible because less copper was needed per apartment (look up the skin effect). By the way, this was also one of the factors for the “victory” of alternating current, promoted by George Westinghouse and Nikola Tesla, over direct current, promoted by Thomas Edison. And at that moment, different standards spread worldwide. It turned out that direct current simply required more copper for wiring. And significantly more so. Another important factor was the invention of a meter by Oliver Shallenberger, which only worked on alternating current (because it involved a rotating wire, essentially a sort of motor). A vast number of such meters had been manufactured by that time, which also contributed to the expansion.

It turned out that the 110 volt standard was chosen simply because being shocked by such a current had fewer fatal consequences, while still providing sufficient power for various domestic purposes. Thomas Edison tested and soon patented a three-wire electrical network: +110V, -110V, and a neutral conductor.

In the U.S., by the way, not everything is 110V. Looks like today I might go repair a clothes dryer. It’s powered by 220V.

So, returning to the topic. Such a network was sufficient for powering an Edison incandescent light bulb with a carbon filament: it required just 100V, but Edison added another 10%, accounting for potential losses while the current traveled through the wires. In Europe, after 1883, they switched to bulbs with metal filaments, which required voltages exceeding 110 volts. This essentially laid the foundation for different countries, and now it’s prohibitively expensive to change. Look at Japan – they manage to use different frequencies (50 and 60 Hertz) in the same network on the west and east coasts of the country. Some equipment is sensitive to the frequency and requires adapters in Japan (expensive and bulky). But mostly, everything modern still works. Interestingly, in Japan, the voltage is even lower than in the U.S., at 100 volts.