Weekly #17

@Date : 2019-12-29 11:17:16

@Author : Lewis Tian (taseikyo@gmail.com)

@Link : github.com/taseikyo

@Range : 2019-12-29 - 2020-01-04

Table of Contents

review

  1. The Language Agnostic, All-Purpose, Incredible, Makefile

This post teaches you how to write a Makefile.

how to pass arguments to makefile:

# Makefile:
schedule_flight_to_krakow:
    echo $(krakow_date) > schedule_flight_to_krakow
$ make schedule_flight_to_krakow krakow_date=01/01/2020
$ cat schedule_flight_to_krakow
01/01/2020

It is essential to not attempt to define all of the commands up front. Updating and refining the Makefile is part of the development workflow itself; things change, and so does the Makefile over time. Because the Makefile is general and flexible, these changes are usually quite simple to implement.

YES!

  1. [Further Reading (not completed yet)] Notes for new Make users

tip

  1. How to use gitbook

Here is a simple intro and book.json config.

The follow is a simple GitBook structure. book.json is like a config file, including title, author, plugins etc.

.
├── book.json
├── README.md
├── SUMMARY.md
├── chapter-1/
|   ├── README.md
|   └── something.md
└── chapter-2/
    ├── README.md
    └── something.md

To install plugins, you need to put the plugins into the plugins field of the book.json file and then run gitbook install cmd.

{
    "title": "Gitbook Use",
    "author": "Lewis Tian",
    "description" : "My daily tasks desc.",
    "language": "en",
    "links": {
        "sidebar": {
            "Home": "https://github.com/taseikyo"
        }
    },
    "plugins": [
        "mathjax",
        "splitter",
        "github-buttons",
        "copy-code-button",
        "-search",
        "search-plus",
        "expandable-chapters-small",
        "anchor-navigation-ex",
        "code",
        "advanced-emoji"
    ]
}
  1. [Python] PIL draw multiline text on image

Suppose the text is what we want to draw on the image. Use textwrap.wrap to split the text into a list of lines, the maximum width of which is specified by width.

import textwrap

lines = textwrap.wrap(text, width=40)
y_text = h
for line in lines:
    width, height = font.getsize(line)
    draw.text(((w - width)/2, y_text), line, font=font, fill=FOREGROUND)
    y_text += height

share

  1. Oak trees in Southern U.S. cities are natural urban air filters

Researchers at the University of North Texas have found that two oak tree species, post oak and live oak, that are widespread across the U.S. South remove black carbon from the urban atmosphere.

The results, published in the journal Environmental Science & Technology, show that post oak trees capture approximately twice as much black carbon as live oak trees.

The findings may offer a natural way to improve climate and air quality.

  1. Exokernel: An Operating System Architecture for Application-Level Resource Management

  2. http://www.cs.cornell.edu/Info/Courses/Spring-97/CS614/exo.html

exokernel

results matching ""

    No results matching ""