Week #44 - 2022

Week #44 - 2022

Joash Xu
·Nov 7, 2022·

2 min read

Subscribe to my newsletter and never miss my upcoming articles

Finished reading Building a Second Brain by Tiago Forte. I am quite familiar with the concept. But still, it is a pretty good read since it is condensed and structured nicely. If you think about it, the ideas are not new. Capture everything. Take notes. Organize them. Make summary. These are simple pieces of advice that you should have heard. But, Building a Second Brain helps you to make a cohesive, productive system out of these seemingly simple ideas.


If you have a list of integers, and you need to match another integer to the closest item in that list, you can use the Python min functions key parameter.

times = [700, 1500, 2000, 2500, 3000]

def match_number(num):
    return min(times, key=lambda x: abs(num - x))
In [1]: match_number(710)
Out[1]: 700

In [2]: match_number(2500)
Out[2]: 2500

In [3]: match_number(2520)
Out[3]: 2500

In [4]: match_number(2990)
Out[4]: 3000

In [5]: match_number(1999)
Out[5]: 2000

In [6]: match_number(2056)
Out[6]: 2000

In [7]: match_number(2350)
Out[7]: 2500

To have a productive day, you need to pay attention to your energy level. There is a lot of good advice on this. Exercise has been shown to increase your energy levels. So have an exercise routine and stick to it. Sleep is also an essential factor. Make sure you have enough sleep. Don't sleep too much, but don't get cheap on sleeping. And for me, I find out that I am more effective when I fast in the morning. And I take some caffeine.

 
Share this