Pandas in jupyter

Read data from mysql and draw a chart. %matplotlib inline import pymysql import pandas as pd import pandas.io.sql as sql conn = pymysql.connect(host='192.168.56.1', user='root', passwd='qwer-1235', db='pdss') s = 'select number_value from quality_data_item_record where item_id = 11' df = sql.read_sql_query(s, conn) df.plot()

Javascript library notes

Some notes on a few popular javascript libraries. bootstrap-daterangepicker How to get startDate and endDate? var range = $("#range").daterangepicker(); var start = range.data("daterangepicker").startDate; var end = range.data("daterangepicker").endDate; lodash map var data = [{label: '4/1', value: 10}, {label: '4/2', value: 14}]; var labels = _.map(data, function(item) { return item.label; }); var values = _.map(data, function(item) { return item.value; }); It is especially useful when preparing data for some chart libraries.

book reading record 2017

Read 夜色人生 Software Prefactoring How to win friends and influence people Eat, pray, love 猎豹 Great gatsby 四步创业法 To kill a mocking bird Then there were none 你应该像喜欢苦一样喜欢甜 清醒思考的艺术 垂暮之战 幽灵旅 消失的殖民地 东方快车谋杀案 Reading Getting to YES Inspired, how to create products customers love On managing yourself Software architecture for developers To be read Redis In Action Alice in wonder world 身份的焦虑 简单的哲学 深入浅出数据分析 演讲之禅

Introduction

Try to use hugo to setup the blog again.

dynamic form with springmvc and thymeleaf

Requirements SubjectGroup and SubjectGroupOption has one-to-many relationship. When adding a subject group, subject group options can be added inline. Things I’ve learned. When adding an option, don’t need to use javascript to handle the added html snippet. Just submit the add request to controller and handle the adding in the controller (Add a new options into the option list of subject group), then return to the add page. Spring mvc’s data binding and thyme leaf’s for loop will handle the html.