Fastest way to bulk delete in Django

Was faced with an optimisation problem today at work. Our product analyses large datasets every day and as our number of user grew over the last few months, we’ve had to optimise our algorithm that generates and saves recommendations to our database. Poking around a bit, I noticed the step that deleted rows in our recommendations table was taking a long time to process.

cheetah running
Photo by Cara Fuller on Unsplash

Continue reading “Fastest way to bulk delete in Django”

Training users to do the right thing

the dashboard of a Mitsubishi Mirage car with eco mode indicator on

I was in Perth, Australia this weekend with Mei and we drove around in a small blue Mitsubishi Mirage hatchback. It had a manual transmission, which did take a day to get used to… but as we drove from cafe to restaurant (food was the one of the main reasons for the trip), I noticed the green eco indicator on the car dashboard. Food was on my mind, so I let that observation take a back seat. You know, in my blue Mitsubishi Mirage.

Continue reading “Training users to do the right thing”

Make iframe hyperlinks redirect correctly in main document

At work recently we had to figure a way to redirect a user to another webpage when she clicks on a URL. This is obviously a trivial task for 99 percent of cases – just use <a href="http://destination-url.com">Click</a>. But within an <iframe>, URL redirects can act strangely.

Continue reading “Make iframe hyperlinks redirect correctly in main document”