73 Matching Annotations
  1. Jun 2022
  2. May 2022
    1. git diff-tree -p COMMIT

      command to show code change in given commit

    2. git show COMMIT --compact-summary

      command to show code change in given commit

    3. git diff <root_commit>^!

      command to show code change of one commit: git diff <root_commit>^ git diff <root_commit>^!

    1. Spark properties mainly can be divided into two kinds: one is related to deploy, like “spark.driver.memory”, “spark.executor.instances”, this kind of properties may not be affected when setting programmatically through SparkConf in runtime, or the behavior is depending on which cluster manager and deploy mode you choose, so it would be suggested to set through configuration file or spark-submit command line options; another is mainly related to Spark runtime control, like “spark.task.maxFailures”, this kind of properties can be set in either way.

      spark properties

    1. __init__.py is required to import the directory as a package, and should be empty.

      to import the directory as a package

    1. profit_color = [{p<0: 'red', 0<=p<=2: 'orange', p>2: 'green'}[True] for p in profit]

      color bar based on value

  3. Apr 2022
    1. To create a new theme, copy an existing theme file to a new name in the same directory, reload Notepad++, and use the Style Configurator to edit the color and font settings (or edit the XML file directly, and reload).

      To create notepad++ theme

    1. You can close the single quotes before starting the double quotes and do the reverse at the end of that inner section to achieve what you want:

      This is how to use variable in single quotes. It works well also for tcsh.

    1. The result from the above request includes a _scroll_id, which should be passed to the scroll API in order to retrieve the next batch of results.

      This is the way to use scroll.

    1. Use with caution!

      Using regular expression in this way might cause "Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]", especially when together with "query?scroll=1m"

    1. GIT_INDEX_FILE is the path to the index file (non-bare repositories only).

      export GIT_INDEX_FILE=".git/index.linux" if you are working on Linux

      export GIT_INDEX_FILE=".git/index.windows" if you are working on Linux

  4. Dec 2021
    1. To change your prefix from C-b to C-a, simply add following lines to your tmux.conf:
  5. datatracker.ietf.org datatracker.ietf.org
    1. The NFS version 3 protocol is designed to allow servers to be as simple and general as possible. Sometimes the simplicity of the server can be a problem, if the client implements complicated file system semantics. For example, some operating systems allow removal of open files. A process can open a file and, while it is open, remove it from the directory. The file can be read and Callaghan, el al Informational [Page 96] RFC 1813 NFS Version 3 Protocol June 1995 written as long as the process keeps it open, even though the file has no name in the file system. It is impossible for a stateless server to implement these semantics. The client can do some tricks such as renaming the file on remove (to a hidden name), and only physically deleting it on close. The NFS version 3 protocol provides sufficient functionality to implement most file system semantics on a client.
  6. Aug 2021
    1. Chris Hoffman is Editor-in-Chief of How-To Geek. He oversees all How-To Geek's content to ensure it's as accurate and in-depth as possible. Since 2011, Chris has personally written over 2,000 articles that have been read nearly one billion times---and that's just here at How-To Geek.

      A Good Editor had many helpful articles.

    1. The tree obtained is the logical structure of the program, which is then converted to bytecode (.pyc or .pyo).

    2. Python is often used as the programming language for many small-form devices, such as the Raspberry Pi and other microcontrollers

    3. The Python programming language was created by Guido Von Rossum in 1991 and started with a previous language called ABC.

    4. Here is a list of some open data available online. You can find a more complete list and details of the open data available online in Appendix B.

      DataHub (http://datahub.io/dataset)

      World Health Organization (http://www.who.int/research/en/)

      Data.gov (http://data.gov)

      European Union Open Data Portal (http://open-data.europa.eu/en/data/)

      Amazon Web Service public datasets (http://aws.amazon.com/datasets)

      Facebook Graph (http://developers.facebook.com/docs/graph-api)

      Healthdata.gov (http://www.healthdata.gov)

      Google Trends (http://www.google.com/trends/explore)

      Google Finance (https://www.google.com/finance)

      Google Books Ngrams (http://storage.googleapis.com/books/ngrams/books/datasetsv2.html)

      Machine Learning Repository (http://archive.ics.uci.edu/ml/)

      As an idea of open data sources available online, you can look at the LOD cloud diagram (http://lod-cloud.net ), which displays the connections of the data link among several open data sources currently available on the network (see Figure 1-3).

    1. If this time is very small (say less than 0.2 seconds), it is probably very inaccurate, and it may be better to run your code many times to get a more accurate time. For this, you can use timeit (https://docs.python.org/3/library/timeit.html).

    2. After you work with scikit-learn, you may take your AI programming using Python to the next level and explore k-means clustering.

  7. Jul 2021
    1. This shift is largely due to technology: The average American child is said to spend 4 to 7 minutes a day in unstructured play outdoors, and over 7 hours a day in front of a screen.

      "7 hours" is much longer than the time which my son spent in front of screen.

    1. It is crucial to ensure that your child develops, maintains, and enjoys other, non-screentime activities.

      To have other interests is important for child.

  8. datatracker.ietf.org datatracker.ietf.org
    1. To meet this goal, the path validation process verifies, among other things, that a prospective certification path (a sequence of n certificates) satisfies the following conditions

      how to validate certificate by trust anchor

  9. Jun 2021
  10. datatracker.ietf.org datatracker.ietf.org
    1. The vendor assigns this form of DUID to the device.

      How to assign?

    2. Clients listen for DHCP messages on UDP port 546. Servers and relay agents listen for DHCP messages on UDP port 547.

      DHCPv6 Server and Client Ports.

    1. M = 0, O = 1  : Client gets stateless address from RA. DHCPv6 only assign other configuration settings to client. This combination is known as DHCPv6 stateless.

      DHCPv6 stateless

    2. When a router sends an RA with ‘O’ bit set, but does not set the ‘M’ bit, the client can do Stateless Address Autoconfiguration (SLAAC) to obtain its IPv6 address, and use DHCPv6 for obtaining additional information. (An example of additional information is DNS). This mechanism is well known as Stateless DHCPv6, because the DHCPv6 server does not need to keep track of the client address bindings.

      Explained how SLAAC works.

    3. DHCPv6 M-bit and O-bit

    1. Currently there are two option spaces defined for the DHCPv4 daemon: “dhcp4” (for the top-level DHCPv4 options) and “vendor-encapsulated-options-space”, which is empty by default but in which options can be defined.

      How about the option spaces for DHCPv6?

  11. komkom.github.io komkom.github.io
    1. Jsonc is a simplified json format which allows comments and unquoted values delimited by whitespace. A jsonc formatted file can be transformed to a json file. Comments will be stripped out and quotes added.

      Good definition of jsonc file.

  12. datatracker.ietf.org datatracker.ietf.org
    1. local physical subnet

      how does the client know this "local physical subnet"?

    2. DHCP messages from a client to a server are sent to the 'DHCP server' port (67), and DHCP messages from a server to a client are sent to the 'DHCP client' port (68).

      DHCPv4 Ports of Server and Client

    1. GRUB hidden menu change FAQ  

      details about grub menu hidden and how to enable, access, etc

    1. The GRUB 2 configuration file, grub.cfg, is generated during installation, or by invoking the /usr/sbin/grub2-mkconfig utility, and is automatically updated by grubby each time a new kernel is installed. When regenerated manually using grub2-mkconfig, the file is generated according to the template files located in /etc/grub.d/, and custom settings in the /etc/default/grub file. Edits of grub.cfg will be lost any time grub2-mkconfig is used to regenerate the file, so care must be taken to reflect any manual changes in /etc/default/grub as well.

      Explained how grub.cfg file is generated and the relationship to /etc/default/grub and /etc/grub.d

    2. rhgb
    1. The x86 "PC" version GNU GRUB 2 has a vbeinfo command for printing out available video modes and vbetest for trying a specific mode. They use a built-in table instead of Funcion 01h. For other platforms, including x86 EFI, they are replaced by the more generic videoinfo and videotest.

      The commands vbeinfo and videoinfo can be used to print all supported resolutions. To exit vbetest or videotest in grub, need to send "ctrl+alt+delete" to go back to grub menu list.

    1. When creating a BIOS Boot Partition on a GPT system, you should make sure that it is at least 31 KiB in size.

      This is important. If not set this, the OS won't be detected when grub is used with GPT system.

    1. The Master Boot Record (MBR) is a small, dedicated section at the beginning of the hard disk which holds the boot information and partition layout for the whole disk. The MBR itself is only a single physical sector in length (512 bytes), but it is required in order to create or maintain partitions on the disk, or even boot the computer.

      MBR is very important for OS on disk.

    1. You will need to change BOOTPROTO from dhcp to static and add IPADDR, NETMASK, BROADCAST and NETWORK variables.

      To try this to make fedora in virtualbox be accessible from host

    1. local physical subnet

      how is this physical subnet is defined or decided? for example, my docker container inet address of eth0 is 172.17.0.2. How 172.17.0 is defined?

    1. Using Kea #1 - DHCP Fundamentals - Carsten Strotmann

      This series is very helpful to understand Kea and DHCP.

    1. It is a compile-time error if an enum declaration has the modifier abstract orfinal.

      enum is implicitly static and final, no reason to have modifiers final and abstract.

    1. This means that the request had pass to the external network but did not come back...

      Good to know to check if it works well on proxy in this way: Run below command in one terminal: sudo tcpdump -n -i en0 host 8.8.8.8

      And run below command in another terminal: dig @8.8.8.8 www.google.com

    1. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.

      The key point is "from the first one that exists and is readable". It won't read and execute all of them but only the first one.

  13. May 2021
    1. Those thoughts should beseparated from each other with blank lines.

      Only use blank lines to separate different thoughts. Don't use it everywhere arbitrarily. Especially, don't use it for every line code.