摘要: package com.kaibing.thread; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public class ABCAlternate { pu... 阅读全文
posted @ 2018-07-03 14:14 楷兵 阅读(432) 评论(0) 推荐(0) 编辑
摘要: package com.kaibing.design; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public class ProductorAndCustomerLo... 阅读全文
posted @ 2018-07-03 13:43 楷兵 阅读(179) 评论(0) 推荐(0) 编辑
摘要: package com.kaibing.design; public class ProductorAndCustomer { public static void main(String[] args) { Clerk clerk = new Clerk(); Productor productor = new Productor(clerk);... 阅读全文
posted @ 2018-07-03 13:30 楷兵 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 查询优化: 定位问题: 1.记录慢查询 show profile set profiling = 1 开启 show profiles show profile for query 表ID show status :计数器 show processlist :记录线程 explain/desc :分 阅读全文
posted @ 2018-07-01 16:00 楷兵 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 安装之前先检查一下系统有没有自带open-jdk 命令: rpm -qa |grep java rpm -qa |grep jdk rpm -qa |grep gcj 如果没有输入信息表示没有安装。 如果安装可以使用rpm -qa | grep java | xargs rpm -e --nodep 阅读全文
posted @ 2018-07-01 10:24 楷兵 阅读(159) 评论(0) 推荐(0) 编辑
摘要: package com.kaibing.sortandfind; import org.junit.jupiter.api.Test; public class Find { public int[] arr = {1, 2, 3, 4, 5}; @Test public void binaryFind() { System.out.print... 阅读全文
posted @ 2018-06-29 14:09 楷兵 阅读(113) 评论(0) 推荐(0) 编辑
摘要: package com.kaibing.sort; import org.junit.jupiter.api.Test; public class UpSort { public int[] arr = {1, 3, 2, 7, 5}; /** * 冒泡排序:思想每次把目标(最大或最小)移到末尾 * 时间:平均=O(n^2) | 最坏=O(n^2) ... 阅读全文
posted @ 2018-06-29 11:20 楷兵 阅读(108) 评论(0) 推荐(0) 编辑
摘要: package com.kaibing.thread; /** * 线程的通信 * * wati() * notify():随机唤醒一个 * notifyAll():全部唤醒 */ class PrintNum implements Runnable { int num = 1; @Override public void run() { ... 阅读全文
posted @ 2018-06-27 13:09 楷兵 阅读(114) 评论(0) 推荐(0) 编辑
摘要: public class DeadLock { static StringBuffer sb1 = new StringBuffer(); static StringBuffer sb2 = new StringBuffer(); public static void main(String[] args) { new Thread(()->{ ... 阅读全文
posted @ 2018-06-27 12:48 楷兵 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ranking num 阅读全文
posted @ 2018-06-10 22:18 楷兵 阅读(179) 评论(0) 推荐(0) 编辑