动态固定行转列
需求要看最近7天新增评论数,而且每天都要查一次SQL不复杂 SELECT to_char(createtime,'yyyy-mm-dd') createtime,count(*) c FROM mvbox_space.user_comment where createtime>=trunc(sysdate - interval '7' day) &n...
二进制字符串相加
转载自:https://leetcode.com/problems/add-binary/discuss/洋人写的好优雅啊
判断是否是回文数字
解题思路: 这道题很明显是一道数学题,计算一个数字是否是回文数字,我们其实就是将这个数字除以10,保留他的余数,下次将余数乘以10,加上这个数字再除以10的余数.负数不是回文数字.0是回文数字.
给定数字生成中文数字(MySQL)
接前文http://blog.itpub.net/29254281/viewspace-2143103/用MySQL实现select group_concat( target order by id desc Separator '') result from ( select  ...
给定数字生成中文数字
public class T { public static void main(String[] args) { int i=123456789; Solution s=new Solution(); &...
Reverse Integer
click to show spoilers.
Two Sum
You may assume that each input would have exactly one solution, and you may not use the same element twice.Given nums = [2, 7, 11, 15], target = 9,Because nums[0] + nums[1] = 2 + 7 = 9,return [0, 1].https://leetcode.com/problems/two-sum/description/我想出来的办法,简单...
Longest Substring Without Repeating Characters
Given a string, find the length of the without repeating characters.Examples:Given , the answer is , which the length is 3.Given , the answer is , with the length of 1.Given , the answer is , with the length of 3. Note that the answer must be a ,...
MySQL REPLACE死锁问题深入剖析
https://mp.weixin.qq.com/s?__biz=MjM5MjIxNDA4NA==&mid=2649738284&idx=1&sn=ef02227375e485340bbcd7d2df45c680&chksm=beb2d10789c55811115dc9ba44f39dbeebf7dc837df346a2e62a7acc1a33de0f0fcf912695c8&mpshare=1&scene=23&srcid=07287BusnAcnbD33aGP2d5sP#rd
MySQL存储过程使用if子查询判断需要注意
MySQL存储过程环境 5.6.14drop procedure if exists p;DELIMITER $$CREATE PROCEDURE `p` ()BEGIN start transaction; if(select 10 from dual where 1=1 < 5 ) then &nb...
MySQL过程真要慎用if not exists写法
接前文http://blog.itpub.net/29254281/viewspace-2133936/除了前文提到的问题,今天还发现了MySQL 过程 if not exists 的另外一个问题.https://bugs.mysql.com/bug.php?id=85431版本 5.6.14环境CREATE TABLE `t1` ( `id` int(11) NOT NULL, `batchid` int(11) DEFAULT NULL, `state` int(11...
可重复读引起的问题一则
这是群友公司的一个问题模拟环境如下
验证数据库中URL的有效性
曲库中一些歌曲的URL虽然存在,但是根据URL已经下载不到音乐了.Nginx显示404错误.验证数据库中歌曲的URL是否能够下载首先,先把数据库中的歌曲URL导出到文件.如下格式(歌曲ID,音乐地址类型,路径)1000;AccompanimentURL ;/00/00/00001000_accompaniment.m4a然后使用程序扫描URL  ...
正确使用MySQL JDBC游标
、当设置以下属性时,采用的是流数据接收方式,每次只从服务器接收部份数据,直到所有数据处理完毕,不会发生。 setFetchSize(Integer.MIN_VALUE); 、调用的方法,实际上方法内部封装的就是第种方式。、设置连接属性版驱动开始支持,以打开,再设置参数,表示...
Excel巧录权限矩阵
领导要录入一个权限矩阵的数据入数据库,问我有没有什么好办法?能说没有么?通篇Excel都是类似如下的矩阵,矩阵非常多,每个矩阵还非常大.创建测试表.create table t( id int primary key auto_increment, f varchar(32) not null, t varchar(32) not null,...
Reactor模式
青木大师https://github.com/goudai/gd-rpc在这个基础上,抽取的Reactor模式 简化理解的版本这个JAVA nio和多线程结合的问题,已经困扰了好几年了.通过阅读青木的代码,终于有点明白了
aliyun阿里云Maven仓库地址——加速你的maven构建
http://www.cnblogs.com/geektown/p/5705405.htmlhttp://maven.aliyun.com/nexus/#view-repositories;public~browsestorage复制代码 nexus-aliyun Nexus aliyun ...
安装HAWQ
MySQL多个timestamp字段自动添加默认值的问题
http://www.cnblogs.com/yjf512/archive/2012/11/02/2751058.htmltimestamp设置随着表变化而自动更新是ON UPDATE CURRENT_TIMESTAMP但是由于一个表中至多只能有一个字段设置CURRENT_TIMESTAMP 1234...
Nginx limit模块限制并发数
http://hopestar.github.io/2013/06/08/nginx-limit-moule-note/vi /export/servers/nginx/conf/nginx.conf limit_zone one $binary_remote_addr 20m;limit_req_zone $binary_remote_addr zone=req_one:20m rate=12r/s; 2.添加limit_conn 和limit_req 这个变量可以在http, server, location使用 我是限制nginx上...