18 Matching Annotations
  1. Aug 2021
    1. a string is a sequence of characters, ie unicode codepoints; these are an abstract concept, and can't be directly stored on disk. A byte string is a sequence of, unsurprisingly, bytes - things that can be stored on disk. The mapping between them is an encoding - there are quite a lot of these (and infinitely many are possible) - and you need to know which applies in the particular case in order to do the conversion,

      string vs. byte string

    1. the @staticmethod decorator allows us to use a function without access to class instances as a class method; the @classmethod decorator can be used to call a method of a class instead of a class instance; the @property decorator is helpful when we want to access a method as an attribute.

      @staticmethod moves an outside function inside a class

    1. Two basic rules are that child classes precede parent classes and parent classes are placed in the order they were listed in.

      Dealing with the diamond problem of multi-inheritance

    1. Instead of manually writing the script name and arguments each time, you can set them in the configuration. For this in the Run area select Edit Configurations to open the Run/Debug Configurations dialog.

      PyCharm

  2. Jul 2021
    1. Press Ctrl + v to enter into visual block mode. Use ↑ / ↓ / j / k to select multiple lines. Press Shift + i and start typing what you want. After you press Esc, the text will be inserted into all the lines you selected.

      VIM

  3. Jun 2021
    1. 总的说来,就是先解放自己较为狭隘的思想,认识到世人生活得没有你想象中的那么好或坏,自己也并非一无是处,我们只需要跟自己比就够了,多专注于提升自己。然后建立自信的支撑点,也就是专注于把一件事做得比大多人都要好,从而给予自己成就感,建立起长久而真实的自信,告别无端的自卑。

      如何突破“内向自卑”

    1. 总结来说就是:很累、状态不好、行动力不足但必须干活时,挑出其中最重要的一两项,先做,其他的先放着不管、当它不存在。然后把挑中的事情拆成小块小块的,告诉大脑“吃掉一块就是赢”,然后没什么压力地就“吃”起来了。“吃掉”第一块后就会触发大脑奖赏机制、收获一点成就感,因此增加了一点自身能量动力,然后能更加容易地去“吃”下一块。“吃着吃着”发现这一天也做了挺多事的,很满足。

      “做一点是一点”方法

    1. I think this has to do with https://<ip>:<port> only. When I tried http://<ip>:<port> it worked. Not sure of the reason though.

      open Jupyterlab from my local web browser

    1. Rollout means running an episode with the trained model, which you specify by passing a checkpoint directory to the command.

      RLlib

    1. Operating System¶ Iridis 5 is using a new version (7.4 at time of writing) of Red Hat Enterprise Linux (RHEL). This has some significant modernisations compared to RHEL 6 on Iridis 4. In particular the versions of libopenssl and glibc on RHEL 6 are showing their age and are no longer compatible with all modern codes and uses.

      That's why I cannot run Rllib on Iridis4

  4. May 2021
    1. Call numpy.full(shape, fill_value) with shape as an x, y tuple to create an array with x rows, y columns, and each element as fill_value.an_array = np.full((3, 5), 8)

      create an ndarry with all identical values

    1. If you're using bash (on a Mac or GNU/Linux distro), add this to your ~/.bashrc export PYTHONPATH="${PYTHONPATH}:/my/other/path"

      Permanently add a directory to PYTHONPATH

    1. Our vision for the AI Economist is to enable an objective study of policy impact on real-world economies, at a level of complexity that traditional economic research cannot easily address. We believe the intersection of machine learning and economics presents a wide range of exciting research directions, and gives ample opportunity for machine learning to have positive social impact.

      Still difficult to persuade people to believe it.

    1. On your Mac, open Things. Locate your repeating to-do’s template. Just start typing “repeating” and select the Quick Find list Repeating from the results. Find your template and double-click to open it. Once you’ve opened the template, you can make the following changes:

      How to edit a repeating to-do in Things3

  5. Apr 2021
    1. The same is true with my time. So I started blocking all 24 hours of my time (mental breaks, yoga workouts, prepping dinner, sleep, everything) into my digital calendar. There is no time unaccounted for. 

      This Is the Time-Management Hack That Helped Me Double My Income

    1. It's important to bear in mind that shorter code does not imply better one, so you shouldn’t misuse list comprehension when working with nested lists.

      code is better when readable and intuitive

    1. Some might argue that the power of carrots to promote accurate information will be inadequate against engagement-optimizing algorithms and human tendencies that promote misinformation.

      Exactly, why social media do that if that may reduce their traffic?