Posts

Showing posts from February, 2019

Review in 2018 and Plans for 2019

Have Done in 2018:  Jul 26, 2018, spent almost a month, work for Expise Technology ( http://www.expise.com ), do tensorflow.js developing. I got 500 dollars from this work. The boss is called Jamie. (This is the first time I realize that I’m useful for others and capable of being a programmer. Thanks to the world.) Almost at the same time, at 17/08/2018, I spent 10 days to record Machine Learning video tutorials for LiveEdu. After that, I spent another week to record another one. I got almost 2000 CNY at this job. (To be honest, I love teaching. Because that keep reminds me: I’m useful.) I participated in some college hardware programming competitions with C language but didn’t get the first prize. So I treat it as a failure. I’ve learned how to use Kotlin, and created a few useless apps. I’ve learned how to use Reactjs, and created a few useless websites. I’ve learned how to build a reinforcement learning model with Keras, and created a few failed projects. I’ve learned

General jupyter-vim-binding shortcuts (hotkeys)

## `vim mode` and `jupyter mode` `i` or `enter`: go to vim mode `shift + esc`: go back to jupyter mode ### vim mode i: start writing esc: exit vim editing mode j: up k: down > Everything just peace and fun, it's vim! Have fun! ### jupyter mode o: create a cell below shift + o: create a cell above ___ j: up k: down ___ dd: delete current cell ___ ctrl + 2: convert the cell to markdown cell 2: add `##` before the markdown text ctrl + 1: convert the cell to code cell ___ ctrl + s: save the document https://github.com/lambdalisue/jupyter-vim-binding

Why I love the culture of The United States

1. They encourage individual thinking (especially logical thinking). 2. Their law was created by people in that county (not by a little-privileged group). 3. Their society has an open mind to sex.

Use docker-compose with Nginx to serve multiple domains to a single server (IP address)

Use docker-compose with Nginx github: https://github.com/yingshaoxo/yingshaoxo.github.io/tree/master/0.Powered_by_nginx Generate key  apt install certbot certbot certonly --standalone -d yingshaoxo.xyz Download your key for backup (1) tar -zcvf keys.tar.gz /etc/letsencrypt/live/ python3 -m http.server 8000 Download your key for backup (2) # Back to your local terminal wget your_server_ip:8000/keys.tar.gz #docker-compose.yml version: '3' services: nginx: image: nginx:latest container_name: nginx volumes: - ./nginx.conf:/etc/nginx/nginx.conf - /etc/letsencrypt/:/etc/letsencrypt/ ports: - 80:80 - 443:443 #nginx.conf worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_

The computing world in my eyes

1. Linux  --> Ruled by C 2. Docker Container --> Ruled by Golang 3. Back-end Web Server --> Ruled by Python, PHP 4. Desktop view (including webpage) --> Ruled by Javascript 4. Mobile devices --> Ruled by Google(Java), Apple(Swift) ___ To be honest, I really don't know which way to go. But I think the oldest one, the kernel won't change.  I'd better study that. ___ And I also know, in any moment in the history, the final mission of programming is to automate everything, in another word, creating an AI to help us to do the job or replace humans.

A reasonable way to interact any command line program

``` import pexpect process = pexpect.spawn('python') while 1:     outputs = ''     try:         while 1:             char = process.read_nonblocking(timeout=1)             outputs += char.decode('utf-8')     except pexpect.TIMEOUT:         print(outputs)         process.send(input("What you wanna do? ") + "\n") ``` https://terminallabs.com/blog/a-better-cli-passthrough-in-python/