| 2016-09-19Ubuntu 下使用 sysv-rc-conf 管理开机启动服务sysv-rc-conf gives an easy to use interface for managing “/etc/rc{runl ...
| 2016-09-18Eclipse Java 注释模板自己总结的比较规范的 Eclipse Java 注释模板 Eclipse Java 注释模板设置Window -> Preference -> Java -> CodeStyle -> Code Template 然后展开 Comments 节点就是所有需设置注释的元素 各项注释模板Files/** * Copyright © ${year}. All rights reserved. * * @Title: ${fi ...
| 2016-09-18MySQL LIMIT 查询优化最近常在 SQL 中使用到 LIMIT ? ?,在执行 LIMIT 0, 1000 与 LIMIT 100000, 1000 时,查询速度明显有很大的区别,而且随着 LIMIT 的偏移量的增加,查询速度越来越慢。是否有办法对 SQL 中 LIMIT 查询进行优化呢? LIMIT 速度慢的原因LIMIT 100000, 1000 的意思扫描满足条件的 101000 行,扔掉前面的 100000 行,返回最后的 1000 行,问题就在这里。 LIMIT 优化思路1、尽可能从索 ...
| 2016-09-14Eclipse Maven 配置使用国内镜像库Windows 下因为 Eclipse 自带了 Maven 插件,还算够用就懒得安装 Maven 了。在不使用代理的情况下,用 Maven 的下载库不是一般的慢。Eclipse Maven 的插件怎么配置国内的镜像库呢?其实很简单。 创建 settings.xml 文件注意两个地方:1、<localRepository>C:\Users\Lenovo\.m2\repository</localRepository> 本地仓库位置2、镜像配置,选取的 ...
| 2016-09-14LeetCode Database Trips and Users 262262. Trips and Users  The Trips table holds all taxi trips. Each trip has a unique Id, while Client_Id and Driver_Id are both foreign keys to the Users_Id at the Users table. Status is an ENUM type of (‘completed’, ‘cancel ...
| 2016-09-12LeetCode Database Department Highest Salary 184184. Department Highest Salary  The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id. +----+-------+--------+--------------+| Id | Name | Salary | De ...
| 2016-09-11LeetCode Database Consecutive Numbers 180180. Consecutive Numbers  Write a SQL query to find all numbers that appear at least three times consecutively. +----+-----+| Id | Num |+----+-----+| 1 | 1 || 2 | 1 || 3 | 1 || 4 | 2 || 5 | 1 || 6 | 2 || ...
| 2016-09-11LeetCode Database Second Highest Salary 176176. Second Highest Salary  Write a SQL query to get the second highest salary from the Employee table. +----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 || 3 | 300 |+----+--------+ For example ...
| 2016-09-11LeetCode Database Rising Temperature 197197. Rising Temperature  Given a Weather table, write a SQL query to find all dates’ Ids with higher temperature compared to its previous (yesterday’s) dates. +---------+------------+------------------+| Id(INT) | Date(DAT ...
| 2016-09-10Mybatis Generator 使用配置MyBatis Generator (MBG) 是一个 Mybatis 的代码生成器。MBG 可以内省数据库的表(或多个表)然后生成可以用来访问(多个)表的基础对象。 这样和数据库表进行交互时不需要创建对象和配置文件。MBG 的解决了对数据库操作有最大影响的一些简单的 CRUD(插入、查询、更新、删除)操作。 Mybatis Generator 文档 Mybatis Generator 官方原版 Mybatis Generator 中文版 通过 Maven 运行 MBGMy ...