Failed image loading

Python: Solving slow eval

Welcome to another one of my interesting findings, where I explore some stuff for fun and profit just fun A while back I was solving AOC and for a problem (day 13), I had this sort of clever idea of using eval to skip writing a if else ladder. The input file had the following structure Starting items: 91, 65 Operation: new = old * 13 Test: divisible by 5 If true: throw to monkey 7 If false: throw to monkey 4 ...

January 10, 2023
Failed image loading

Why does my drive mount as read only?

Today I tried to write an fstab entry so that my drive would automount on boot. It went as smoothly as I had hoped (at first). So, I ran sudo blkid to find the UUID of the drive I wanted to mount and added the entry UUID=288C1E6C8C1E3532 /hdrive auto defaults 0 0 following the steps in this wonderful article. (Some options are different after I realized what I wanted.) Article Then I ran sudo mount -a to check if the mounts were working properly. But here the problem began. The drive was mounted as readonly. There is no mention of readonly mount in the options. In fact I learnt that defaults option is shorthand for rw (read write) and bunch of other options. Then I tried various mount options and got sick of rebooting. I tried directly mounting as ntfs instead of auto. But it didn’t work. After lot of struggle I figured out the problem. It was because of my Windows Installation! I have dual boot setup. And turns out windows stores some files for faster booting (fast boot) in the harddisk thus linux cannot mount the drive cleanly and can only mount it as a read only drive. So to fix this I had to boot to windows and change the fast boot setting. Here’s how, ...

January 17, 2022
Failed image loading

Google Sheets as Database?

I recently learned that Google Sheets can be used as a database (although with caveats I hear). And I love it. It is so much easier to see what is in the spreadsheet than on a sqlite file. Plus, google sheets works everywhere! So, to get started, the official way to do this is from the google developers website. https://developers.google.com/sheets/api/guides/concepts It is not so easy to understand for a beginner(which I am). So, upon further looking around I came across this wonderful python library that makes things so much easier. It’s gspread. ...

December 14, 2021
Failed image loading

String Bug

Today the coding calendar Advent of Code started. You should try it too, Advent of Code. I tried to solve the first challenge. It was pretty straight forward. Except, I was stumped by a simple problem. Here is my first attempt, 1 2 3 4 5 6 7 8 9 10 11 12 ...

December 1, 2021

First

Welcome! This is the first post of my blog! What is this about? In an attempt to make myself “productive”, I try to write about anything I find interesting. Tell me something interesting at [email protected]

November 21, 2021