Understanding Cathodic Protection and its Role in Preventing Corrosion | June 18 2024, 16:19

Today I learned about “sacrificial anodes” used for corrosion protection. This mechanism, called “cathodic protection,” safeguards the ship’s hull from rusting. It works by establishing an electrical current between two different metals, either via a conductor or directly, because electrons are held with varying strengths in different metals. Thus, electrons physically transfer from one metal to another. Incidentally, this is roughly the same principle on which batteries operate. So, special little bars, usually made of zinc, are attached to the ship’s hull, causing an electron flow from the zinc, effectively turning the entire ship into a huge battery. As a result, it’s not the hull that corrodes but the material of these bars. That’s why they’re called sacrificial anodes.

How does corrosion work anyway? It’s a redox reaction that occurs in two stages. First, the metal is oxidized, meaning its atoms lose electrons and become positively charged ions. Then comes the reduction: they bond with OH ions, which are abundantly found in water, resulting in rust. This is, of course, a simplified explanation.

The main point is that both these processes occur on the same area on the surface of the metal. Cathodic protection, however, spatially separates them. On the sacrificial anode, oxidation strictly occurs as electrons leave zinc atoms, while iron acts as the cathode where the surplus electrons are reduced. The ions from the water are reduced, but the iron atoms remain untouched—which is exactly the intended goal. The anode degrades over time, but it can always be replaced. As long as it’s present, no rust will form.

It’s truly impressive how these small bars can save such a massive machine by sacrificing themselves.

By the way, the cathodic protection system is also used, for example, in the Burj Khalifa in Dubai. There’s a titanium grid underground with pulsed current supplied to it. If this generator is shut down, they say the building won’t last long. Burj Khalifa is located in an area with high humidity and air salinity due to its proximity to the Persian Gulf, and generally, building skyscrapers there seems like a strange idea. But with such engineering ingenuity, it’s feasible.

The hull’s bottom is often painted (or was painted) red. It turns out that without this, the bottom of the ship would quickly become covered with sea organisms such as algae and shells (these are known as foulers). Historically, red paint was used in anti-fouling paints, containing copper oxide, red lead, and other components. Copper (Cu) and its compounds (copper oxide (CuO) and copper sulfate (CuSO4)) are toxic to many marine organisms. Copper ions (Cu²⁺), released from the coating, interfere with the metabolic processes of marine organisms, disrupting their ability to attach and grow. In addition, a protective oxide film forms on the surface of the copper, which prevents further oxidation. Nowadays, chemistry has advanced, and the color of the protective layer can be any color, but historically, red has been used. And the shells have already adapted.

Ultrasonic Remote| June 17 2024, 01:35

Today I learned that one of the first wireless remote controls was ULTRASONIC and BATTERY-FREE. A tiny hammer inside the remote would strike one of four aluminum plates, generating ultrasound that was picked up by sensors in the television.

They couldn’t use radio frequency because they hadn’t figured out how to pair devices with specific televisions. Integrated circuits and microprocessors did not appear until more than a decade later. The limited range of ultrasound addressed this issue, a problem that was solved in later products using infrared radiation.

A Stroll Through Science and Architecture at Janelia Research Campus | June 13 2024, 18:19

Yesterday, I took a walk with my dog at Janelia Research Campus. It is a research institute located in Ashburn, managed by the Howard Hughes Medical Institute (HHMI). This is a place where scientists in the biotech field live and work, including Nobel laureates. Right here, in 2020, they created a detailed map of neural connections in the brain of a fruit fly, which was an important step towards understanding how neural networks function. But today, it’s about the images. The campus was designed by Rafael Viñoly, an Uruguayan architect (The super-thin residential skyscraper in New York is his work).

1700 panels of structural glass (bearing the weight of the building) from Saint-Gobain Glass, Belgium. It would be interesting to get inside—after all, the biotech theme is somewhat close to my heart. Overall, it’s all open, come in, walk wherever you want, but it’s still not customary here, and one should respect the openness.

Today, just some photos from the walk (mixed with a few from the net).

All these have been standing for almost 20 years now.

Andrey Anischenko | June 10 2024, 21:01

Such a great interview! Andrey is an amazing guy, very proud to know him and hoping it counts as friendship since around 2005 or so Andrey Anischenko

P.S. And, oh, when you decide to conquer North America, head north, ideally along the East Coast and preferably through Washington!

Everyone else – tune in, watch, Andrey really shares some interesting insights about the journey and the edtech market.

https://youtu.be/XWZ8f9RxUmw?si=bmnkUbSQzYISxnDT

Digital Sleuthing: Extracting Artist Names from a Book Using Technology | May 31 2024, 01:50

How convenient it has become to work with books nowadays. On Saturday, Alla Prima II by artist Richard Schmid will arrive for me. But even before the purchase, I couldn’t resist and found a 500MB PDF version of the book online, and have already read 50 pages. And then I thought, what if I wanted to extract all the mentioned artists in the book, could I do it?

It turned out to be quite simple.

1) Split the PDF into individual pages using pdfseparate . This resulted in 332 PDFs totaling 472 MB. It takes a few minutes.

2) Convert the individual PDFs to JPG using pdftoppm -jpeg . This resulted in 332 JPGs. It takes a few minutes.

3) Recognize the text using tesseract . This process takes about 10 minutes.

4) Pass each page’s text to the local llama3, and request it to extract the names of artists from the text of each of the 332 pages (i.e., 332 requests). On my Mac, this took 12 minutes. In the end, I got 953 lines.

Llama3 is a bit slow, but overall it does reasonably well. It generates a lot of “noise” also like “Based on the provided text, here are the extracted names of painters” or “I’m happy to help!”. The output text after processing 332 pages is small, only 953 lines. We sort it, remove duplicates (resulted in 556). We remove all more than three words and fewer than two words through cat names.txt | awk ‘NF>=2 && NF<=4’. Ended up with 139 lines. Among them, there is still some noise, for example, names like “Cobalt Blue”, “What an interesting text!” and “Sherlock Holmes” were included as artist names. To clean them up, we use openai, which is smarter. We ask it to keep only artists and remove everything else. We got the list.

Alfred Sisley, Alphonse Mucha, Anders Zorn, Andrew Loomis, Anton Sterba, Antonio Mancini, Arthur Rackham, Berthe Morisot, Bill Mosby, Cecilia Beaux, Charles Hunter, Claude Monet, Dan Gerhartz, Dean Mitchell, Diego Velazquez, Donald Llanuza, Edmund Tarbell, Edouard Manet, Edouard Vuillard, Edward Atkinson Hornel, Eliot Goldfinger, Elizabeth Sparhawk-Jones, Frank Duveneck, Frank Vincent DuMond, Franz Hals, Frederic Remington, Gene Byrnes, George Bridgman, Georges Seurat, Gilbert Stuart, Giovanni Boldini, Grace Arnold, Hans Holbein, Harry Anderson, Heinrich Kley, Henri de Toulouse-Lautrec, Howard Pyle, Ilya Repin, Isaac Levitan, J. W. Waterhouse, J. C. Leyendecker, J.H. Vanderpoel, James M. Dunlop, Jean Dagnan-Bouveret, Jeremy Lipking, Jessie H. Vanderpoel, Joaquin Sorolla, John Gannam, John Singer Sargent, John Singleton Copley, John Twachtman, Katie Swatland, Marcus Thomas, Mary Cassatt, Michael Wilcox, N. C. Wyeth, Nancy Guzik, Nicolai Fechin, Norman Rockwell, Paolo Michetti, Paul Mullally, Peter Paul Rubens, Philip Andreevich Maliavin, Ralph Mayer, Richard Schmid, Robert Henri, Rose Frantzen, Scott Burdick, Shannon Two, Stephen Rogers Peck, Susan Lyon, Thomas Eakins, Thomas Wilmer Dewing, Valentin Serov, Vincent Van Gogh, Wayman Adams, William H. Mosby, William Harnett, William Merritt Chase

5) Now, we send this list back to openai and ask if there are any non-artists among these names. It turned out that all are fine, all of them are artists.

6) For reliability, we also ask openai if there are names in this “clean” list that were not in the original (“dirty”) list, to check if openai invented any artist names when asked to extract from the “dirty” list. Great, it did not invent any.

Voilà! In just over half an hour, I have a list of artists mentioned in the book.

7) We ask openai to categorize the list and provide a brief description

RESULT

Impressionists and Post-Impressionists

=================================

* Alfred Sisley – French impressionist, known for his landscapes.

* Claude Monet – Founder of Impressionism, famous for his water lilies and series of landscapes.

* Berthe Morisot – French impressionist, known for her portraits and scenes from everyday life.

* Edouard Manet – French artist, a precursor to Impressionism, known for his portraits and scenes from Parisian life.

* Georges Seurat – French post-impressionist, founder of pointillism.

* Vincent Van Gogh – Dutch post-impressionist, known for his vivid and emotional paintings.

Realism and Academic Painting

=============================

* Edouard Vuillard – French artist, member of the Nabis group, known for his interiors and figurative compositions.

* Anders Zorn – Swedish artist, known for his portraits and genre scenes.

* Cecilia Beaux – American portrait artist who worked in the style of academic realism.

* Diego Velazquez – Spanish Baroque artist, known for his portraits and historical scenes.

* Edmund Tarbell – American artist, known for his impressionistic portraits and genre scenes.

* Franz Hals – Dutch portrait artist, one of the greatest artists of Holland’s Golden Age.

* Frederic Remington – American artist and sculptor, specialized in scenes of the Wild West.

* Gilbert Stuart – American artist, known for his portraits, including the depiction of George Washington.

* Hans Holbein – German Renaissance artist, known for his portraits and religious paintings.

* Ilya Repin – Russian realistic artist, known for his historical and genre paintings.

* Isaac Levitan – Russian landscape artist, master of lyrical landscape.

* John Singer Sargent – American portrait artist, known for his exquisite and elegant portraits.

* Thomas Eakins – American realist, known for his portraits and genre scenes.

* Valentin Serov – Russian portrait artist, one of the leading representatives of the Russian realistic school.

Art Nouveau and Illustration

=================================

* Alphonse Mucha – Czech artist, a key figure in Art Nouveau, known for his decorative posters.

* Arthur Rackham – British illustrator, known for his magical and fantastical images.

* Howard Pyle – American illustrator, founder of the Brandywine School of illustration.

* J. C. Leyendecker – American illustrator, known for his advertising and magazine covers.

* N. C. Wyeth – American illustrator and artist, known for his works for classic adventure novels.

* Norman Rockwell – American artist and illustrator, known for his idealized images of American life.

* Frank Vincent DuMond – American artist and educator, known for his landscapes and genre scenes.

Portraitists and Genre Artists

=============================

* Cecilia Beaux – American portrait artist who worked in the style of academic realism.

* Diego Velazquez – Spanish Baroque artist, known for his portraits and historical scenes.

* Franz Hals – Dutch portrait artist, one of the greatest artists of Holland’s Golden Age.

* John Singer Sargent – American portrait artist, known for his exquisite and elegant portraits.

* Thomas Eakins – American realist, known for his portraits and genre scenes.

* Valentin Serov – Russian portrait artist, one of the leading representatives of the Russian realistic school.

* Jean Dagnan-Bouveret – French academic artist, known for his genre scenes and portraits.

* Joaquin Sorolla – Spanish artist, master of light, known for his portraits and beach scenes.

* John Singleton Copley – American colonial artist, known for his portraits.

Masters of Landscape

==============

* Alfred Sisley – French impressionist, known for his landscapes.

* Claude Monet – Founder of Impressionism, famous for his water lilies and series of landscapes.

* Isaac Levitan – Russian landscape artist, master of lyrical landscape.

* John Twachtman – American impressionist, known for his lyrical landscapes.

* Dan Gerhartz – Contemporary American artist, known for his atmospheric landscapes and figurative works.

* Dean Mitchell – American artist, known for his watercolor landscapes and urban scenes.

Contemporary Artists

====================

* Dan Gerhartz – Contemporary American artist, known for his atmospheric landscapes and figurative works.

* Dean Mitchell – American artist, known for his watercolor landscapes and urban scenes.

* Jeremy Lipking – Contemporary American artist, known for his portraits and figurative works.

* Nancy Guzik – Contemporary American artist, known for her lyrical and romantic figurative works.

* Richard Schmid – American artist and educator, master of figurative painting.

Other Famous Artists

========================

* J. W. Waterhouse – British artist, known for his paintings on mythological and literary themes.

* Paolo Michetti – Italian artist, worked in the genres of realism and symbolism.

* Peter Paul Rubens – Flemish Baroque artist, known for his allegorical and mythological paintings.

* Gilbert Stuart – American artist, known for his portraits, including the depiction of George Washington.

* Giovanni Boldini – Italian portrait artist, known for his elegant and dynamic portraits.

* Henri de Toulouse-Lautrec – French post-impressionist, known for his posters and scenes of Parisian life.

* Howard Pyle – American illustrator, founder of the Brandywine School of illustration.

* Franz Hals – Dutch portrait artist, one of the greatest artists of Holland’s Golden Age.

* Frederic Remington – American artist and sculptor, specialized in scenes of the Wild West.

* Hans Holbein – German Renaissance artist, known for his portraits and religious paintings.

It’s amazing what you can now do with a computer and information!

LLMs Struggle with Simple Word Filtering Task | May 28 2024, 13:56

I recently encountered a task that no LLM can solve. It should be super simple for an LLM, but somehow they can’t manage it.

There’s a list of about 1000 words. I need to keep only the most functional words from it, like which, should, would, etc.

Request: I have a list of words: …. Select only 50 words from this list that are primarily functional and carry minimal meaning in the context of keyword searches (for example, which generate significant noise in the case of partial matches). Example – which, shall, very. Do not add any words not present on the list above. The resulting experienced list should contain only words, one word per line.

ChatGPT-4o: started outputting some words alphabetically, ending at the word asking. Thus, it did not even go past asking.

Google Gemini: began inventing words not in the list, despite clear instructions not to do so.

Google Gemini Pro: produced something, but again, invented words that weren’t on the list. Almost half invented.

Anthropic Claude also listed words alphabetically, and stopped at words starting with the letter d.

Mistral 8x7B Instruct also made up half.

In fact, no LLM has managed the task. And it’s about words, not mathematics.

https://pastebin.com/5B8w96au

Programming Quirks: Moon Phases and Easter Eggs in Code | May 26 2024, 11:19

Two fun stories about the daily life of programmers.

The first one:

Researchers (@maciejwolczyk, @CupiaBart) trained a neural network to play NetHack, an old role-playing game where everything is represented by text characters. It’s a very old RPG from the days (1987) when there were no normal user interfaces, and everything happened in the console. The player goes through levels, collects items and rewards, participates in battles, and scores points — all expressed through the simplest characters.

In general, they trained it. The model consistently scored 5000 points. However, suddenly something went wrong — the model started scoring only 3000 points. That is, it showed a significantly worse result. Debugging solutions is always fun, so the thread author tried:

— to find a problem in the agent model loading code

— to roll back the code a few days ago

— to roll back the code several weeks ago (well, surely everything works there?)

— to rebuild the environment

— to change the version of CUDA (drivers for running neural networks on a video card)

— to run the code on a personal laptop, not a server

Nothing helped — the model consistently showed 3000 points.

In desperation, the author wrote to the creator of the model @JensTuyls, and received an unexpected response:

— Maybe it’s a full moon today 🌕

What?? 😑

Upon checking the lunar calendar, it turned out that indeed it was a full moon that day. The author launched the game and saw the message: “You’re lucky! It’s a full moon today.”

In NetHack, there is a mechanic that changes the gameplay during a full moon, based on the system time. The character becomes luckier, werewolves appear in their beastly guise, and dogs start howling. The model was not trained with data from the full moon, so its scores dropped to 3000 points. By changing the system time, the author confirmed that the model again scored 5000 points.

This did not make the game more difficult, but the model simply did not understand how the rules had changed and tried to play as usual — hence the drop in points. To check, you can change the time on your computer — and the model again scores 5000 points.

Moral: When faced with an unexpected error, don’t forget to check the lunar calendar.

* * *

The second story is about the ‘man’ command in the console.

This is a command that outputs documentation about what is entered as the second parameter. For example, “man ls” provides documentation on ls, which shows a list of files and subdirectories of the current directory, and “man man” provides documentation about itself.

On StackExchange, someone was wondering why their tests were failing. Answers

Marnanel Thurman:

Uh, that’s my fault, I suggested it. Sorry. Almost the entire story is outlined in the commit. The programmer maintaining the ‘man’, a good friend of mine, and one day, six years ago, I jokingly told him that if you called ‘man’ after midnight, it should print “gimme gimme gimme”, because of the Abba song “Gimme gimme gimme a man after midnight”:

Well, he actually added it. It was fun for someone to discover this, and we mostly forgot about it until today.

I can’t speak for Cola, of course, but I never expected that it would ever cause any issues: what test would break down parsing man output with no specified page? I suppose I shouldn’t have been surprised that such a test was eventually found, but it took six years.”

Marble Statues | May 25 2024, 12:44

Today, to my surprise, I discovered that marble is not a durable material. After 150 years, signs of decay appear, and after 300-400 years, it completely deteriorates. Under the open sky, especially in places with variable humidity, it quickly gets covered with stains and crumbles. Granite and basalt, on the other hand, are a completely different matter.

Old marble statues that you see in museums are often heavily “patched” by restorers, both modern and from past centuries, plus they spent most of their history in a dry and stable climate (often artificially created, in those same museums).

I’ll also throw in another fact—apparently well-known, but relevant to the discussion. It seems that many Greek statues, probably even all of them, were painted, and what we now see is not what their contemporaries saw or how they were intended by the sculptor. I assume that we wouldn’t like the painted version now; they seem too gaudy for us. There are convincing evidences that many were painted, and it can be confidently assumed that painting was a common practice at the time, but it seems unclear whether there was a context in which the sculptures remained unpainted from the beginning, and why.

Illustration: “Ugolino and His Sons” by Jean-Baptiste Carpeaux

Surdin and Semikhatov Interview Severinov | May 19 2024, 03:42

Seems like I have a lot of posts today, sorry about that. Nice format. In Russian. Surdin (an astronomer) and Semikhatov (a physicist) are quizzing the guest (in this case, Severinov) on his topic. Since both are educated, the level of questioning is generally pretty good (with rare exceptions).

The first two-thirds are filled with a lot of interesting stuff from Severinov (mostly high school level, but still). In the last third, Semikhatov jumps in with quantum theory and totally outshines Severinov.

Listening to the rest of it now. They’re discussing Student’s t-test – it’s about statistical significance. Just a brief mention, no big deal. I decide to check out some details on Wikipedia and find something amusing:

…This test was developed by William Gosset to assess the quality of beer at the Guinness company. Due to confidentiality obligations (the Guinness management considered the use of statistical methods a trade secret), Gosset’s article was published in 1908 in the journal ‘Biometrika’ under the pseudonym ‘Student’.