package main
import (
"fmt"
"math/rand"
"time"
)
see wiki
if (0 == x) {
...
}
To execute sudo command on macOS, use:
$ sudo -s
enter your password and enjoy
When go get complains about terminal prompts disabled
, set environment variable GIT_TERMINAL_PROMPT
to 1
to enable it.
# export GIT_TERMINAL_PROMPT=1
$ GIT_TERMINAL_PROMPT=1 go get xxx
When rustc complains that xxx syntax is experimental
, switch to nightly build
$ rustup toolchain install nightly
$ rustup default nightly
If some feature has to be activated, the compiler usually say which one.
Learn REST API with Python script, slides : http://www.slideshare.net/larrycai/learn-rest-apiwithpython
REST/JSON is perfect match to fetch web data, and python requests module
- Ex1: using command line tool
curl
and browser to access http://httpbin.org/get - Ex2: Install
requests
module and try to access http://httpbin.org/get in python interactive module, print r.json() - Ex3: Use below
restapi.py
as base to implement access data in script - Ex4: continue to access https://api.github.com via GET method
NewerOlder