Blocking I/O, async-await, and thread pools in Python

Sorry about that jargon soup, but this post is technical and is intended for such audiences.

Programs can become slow if they spend all their time waiting for messages to be delivered or received. Such I/O is called “blocking” or “synchronous” I/O.

Python got a new framework for asynchronous I/O, async-await, starting in version 3.5. However, you cannot lay it on top of blocking I/O calls. i.e., if you call a function that is blocking, then the calling process still goes to sleep, so your efforts on asynchronous I/O are wasted.

What to do?

[Read More]

Rules for humans in the age of automation

I recently read Futureproof by Kevin Roose. Kevin is a technology writer for The New York Times. The book has two parts to it; I skimmed through the first part but found the second part interesting. It is a list of nine rules designed to help us, humans, navigate a world increasingly run by machines.

I want to call out four of them that struck me as very insightful.

[Read More]

Detecting irrigation with radar satellite and artificial intelligence

I’ve previously talked about detecting irrigated croplands in this blog. I used classical machine learning techniques in it, i.e. we decide what features to use, we fit a model or an ensemble of models, we predict. Modern machine learning, or what the press calls “Artificial Intelligence”, has gone way beyond it. In this post, I want to talk about a different approach to detect irrigated croplands. This method gave 95% test-set accuracy on a random sample of 2000 pictures from California. [Read More]

Gottlieb and other tales of psychotherapy

Back in 2004, when I was in Bangalore and still fresh out of college, I was mesmerized by a book with a title that asked you to kill the Buddha if you met him. The murderous Zen title notwithstanding, the book was written by a psychotherapist who drew parallels between literary characters and his patients. I wanted to read more such books, but as I said, I was in India and it was 2004. Only in the last year have I delved deep again into the realm of psychotherapy.

[Read More]

Lego piano

I built a mechanical Lego piano. It very much looks like a real piano, both on the outside and inside. It has keys, gears, hammers… its designers are piano teachers. The music comes from a companion Bluetooth app, but the piano makes convincing movements. I’m very impressed. This is my first Lego project, and the fact that I could do something this complex tells you how mature and professional Lego’s assembly instructions pictures are. [Read More]
toys  lego  music  piano 

George Saunders: A Swim in a Pond in the Rain

Close to the end of A Swim in a Pond in the Rain, George Saunders looks back on a class from his graduate school. His professor, a short-story writer, gave a reading of Chekhov. Saunders didn’t know much about Chekhov then: he thought Chekhov’s stories were “mild” and “voiceless”. The professor reads three stories, and in doing so, brings Chekhov to life. After that reading, Saunders was not only convinced of the power of the short story, but also “desperate” about writing better short stories himself. [Read More]

Ishiguro: Klara and the Sun

We are all familiar with sci-fi stories of evil robotic overlords. I’m not into science fiction as a genre, yet I thoroughly liked the movies Ex Machina (2015) and The Matrix (1999). Both movies are nominally about artificial intelligence, but ask deep philosophical questions.

[Read More]

Ghachar Ghochar, A Novella

I recently read Ghachar Ghochar, a novella by Vivek Shanbhag. The original is in Kannada, but I read the English translation by Srinath Perur.

The novel is slim; it runs to a little more than 100 pages. This is significant, because within these pages, the author still tells a wonderful story. It’s a story that leaves a lot unsaid, for the reader to fill in the details.

[Read More]