Github actions getting stuck in limbo, never starting. No fear! There is a solution!Continue reading
Error running pre-commit:
Type tag 'jupyter' is not recognized. Try upgrading identify and pre-commit?
A string identifier is attached to every function at creation time
- Which is nice for debug:
>>> dance.__name__ 'dance'
Functions capture local state
- A closure remembers the values from its enclosing scope when it was created
To check whether something is callable
- Objects can be made callable, by being assigned function as value
- So, to check whether an object is callable:
>>> callable(foo) True/False
Benefit of functions being first class
- We are able to abstract and pass around behaviours
2 Errors that were painful to debug.Continue reading
Sometimes data is corrupted, and you just want to nuke the whole world and start a new life. In which case do:
$ docker container prune $ docker volume prune
And, what is the difference between raising normal errors and assertions? Basically:
|Intended for users||Intended for developers|
|Happens when user action is illegal||Happens when code contains bug|
|To signal to user to take a different course of action||To easily find where code starts to error|
|Cannot and should not be disabled||Can be disabled during compilation,|
therefore should not be used in logics like data validation
Usually, the error
module x has no attribute y means that:
- Your working directory contains a
xfile, which collides with python’s
- You are running a python script from a directory (thereby making it your current working directory) where file
xcollides with python’s
The online service that I used to use for processing kindle clippings, my.clippings.io, released a new version this week. And lo and behold, everything useful is behind a paywall.
I only needed it for processing
My Clippings.txt to export it into Evernote, and it’s just file processing of standard format txt, so I thought I’d just whip up a simple version for my own use.
Initially I had planned to write a script for it, like the ruby one I did for cleaning up the mess of record files in kindle, after you delete books. But on second thought, it would be nice if other non-technical people can use it easily too. So, here it is:
On upload of a clippings file, it will have your highlights grouped by book title and sorted by location and timestamp.
An 101 intro to AWS’s numerous commonly confusing abbreviations.Continue reading