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 I had to parse the file to get all values, but when parsing the second line I thought why not use the python interpretor itself....
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...
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)....
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 def part1(lines): prev = lines[0] more = 0 for i in range(len(lines) - 1): if lines[i+1] > prev: more += 1 prev = lines[i+1] print(more) if __name__ =='__main__': with open('....
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]