Header logo.
Small Hallucinations
HomeArchiveTagsAboutFeed

Notes tagged with “week”

#19

I went through my finances using beancount. Double-entry bookkeeping seemed boring at first. But with the help of VSCode extensions for beancount that enable syntax highlighting and formatting, it became somewhat enjoyable.

I ran into problems over different currencies. I have a few transactions in USD and EUR. I wrote a Python script to convert bank statement formats to that of beancount.

Did you know you could use calc in Tailwind CSS? I was first mind-blown then felt it wrong. One should not choose to use the dark magic that is calc() unless it is her last option. Besides, by using Tailwind, we are telling ourselves now we are one step removed from the nuts and bolts of CSS. Using arbitrary numbers in brackets already feels “unidiomatic” in Tailwind. Last week when I found myself resorting to something like h-[calc(100%-20rem)] I grimaced very hard.

I created huge mess while trying to resolve a merge conflict. I was using GitHub Desktop. It was ill-equipped to compare and switch between different branches on GitHub Desktop. (And I was ill-equipped to use the commandline.) Thankfully, the web interface is quite advanced by now. Usually, small conflicts that do not involve files being deleted or moved around could be resolved by a few clicks in the browser. This time, though, it did involve files being moved around. That was a huge mess. ⋯

Gothenburg

I moved to Gothenburg from Stockholm. And I like Gothenburg better.

Stockkholm feels like an archipelago of settlements connected by highways, subways and pendeltåg. In the middle of the city, we have touristy areas in Gamla Stan, commercial areas in Norrmalm and Södermalm. And really fancy areas in Östermalm. Beyond these quarters, the city feels more like non-contiguous dots of inhabited areas separated by woods. Some of these dots are bustling urban areas in their own right, such as Solna and other centers of communes in Greater Stockholm Area. But at the same time, a lot of them feel like villages.

Gothenburg as a city is held together more closely. The downtown area of Gothenburg is more walkable than that of Stockholm. I live in Hisingen and I love the lively messiness around here.

Yet it's not just the lively messiness. A few bus stops away from the down-to-earth supermarkets, shopping malls, and a Taiwanese-owned hotpot restaurant, lies a campus of Gothenburg University and Chalmers, a science park and a bunch of tech companies. ⋯

Week 47

I spent some time last week to get myself more familiar with TypeScript.

Although I'd known the syntax, how to type things (props, components, etc) was at times still confusing. I probably saw more than a bunch of errors thrown at me.

Hopefully I'd love it when I get the hang of it. People on the internet say, all pros and cons considered, it's worth the while.

Week 46 gave me surprises

A few things:

Handling date and time is more complicated than I expected. python-dateutil is quite helpful when you need to parse a datetime string.

I tried updating a field in a MongoDB document using MongoEngine. The value of that field was an embedded document that contained four sub-fields. I intended to change the value of subkey2. But the entire embedded document was overwritten.

I'm quite glad I caught this potential bug early on. And indeed, smart people out there have figured it out. ⋯

So much fun in week 45

These are the fun I had in week 45, 2021.

I ended up in a situation where I decided to use Djongo to bridge MongoDB and Django.

MongoEngine team made a Django connector. But it does not seem to be actively maintained. So they pointed to Djongo and described it as “promising”. (Spoiler: If something is “promising”, the universe hasn't decided whether to resolve it or reject it.)

It seemed as if the only thing you needed to do is go to settings.py and change the database engine to Djongo like so. ⋯