Posts

rest vs graphql good things from rest stateless API, which make web-scalable and easy-manage resource-oriented programming and structured accessto resources, which make many goods, such as cacheable, retriable. the bad things with rest `1+N` problem: fetch list api, fetch every detail api to get more message. overfetching(fetch too much data which was not requried) underfetching(not-enough data from api, which make it need multi request to get the data). too flexible, may things this like dynamic(rest) vs static(graphql).
Dec 5, 2020
2 min read
bokeh can provide interactive visualization for modern web browsers. elegant, concise, vesatile graphics, *afford high-performacne interactiivity onver lagerge or streaming datasets. bokeh provide two interface levels: bokeh.models: low-level interface provide most flexibility bokeh.plotting: higher-level interface centered around composing visual glyphs. this focus on bokeh.plotting. installation # recommend way # conda install deps, and exmaples in *examples/* subdirectory conda install bokeh # using pip, you need install ~numpy~ and so on. pip install bokeh get-starting [] TODO output bokeh plot to or-babel result you can download sample-date and example from bokeh
Nov 17, 2020
3 min read
package main import ( "fmt" "http" "reflect" ) // search ... func search(resp http.ResponseWriter, req *http.Request) { var data struct { Labels []string `http:"1"` MaxResults int `http:"max"` Exact bool `http:"x"` } data.MaxResults = 10 if err := Unpack(req, &data); err != nil { http.Error(resp, err.Error(), http.StatusBadRequest) return } fmt.Fprintf(resp, "Search: %+v\n", data) } // Unpack func Unpack(req *http.Request, ptr interface{}) error { if err := req.ParseForm(); err != nil { return err } fields := make(map[string]reflect.
Jul 18, 2021
1 min read