祭夏--
码龄11年
关注
提问 私信
  • 博客:62,326
    社区:13,214
    75,540
    总访问量
  • 60
    原创
  • 1,171,699
    排名
  • 7
    粉丝
  • 0
    铁粉
IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:广东省
  • 加入CSDN时间: 2014-04-17
博客简介:

祭夏的专栏

查看详细资料
个人成就
  • 获得1次点赞
  • 内容获得1次评论
  • 获得12次收藏
创作历程
  • 6篇
    2016年
  • 47篇
    2015年
  • 7篇
    2014年
成就勋章
TA的专栏
  • Java
    13篇
  • 算法
  • LeetCode
    33篇
  • Linux
  • 计算机网络
    9篇
  • Git
    1篇
  • Node.js
    3篇
创作活动更多

如何做好一份技术文档?

无论你是技术大神还是初涉此领域的新手,都欢迎分享你的宝贵经验、独到见解与创新方法,为技术传播之路点亮明灯!

182人参与 去创作
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

线程池与定时器

1.在什么情况下使用线程池? 1.单个任务处理的时间比较短 2.将需处理的任务的数量大 2. 使用线程池的好处: 1.减少在创建和销毁线程上所花的时间以及系统资源的开销 2.如不使用线程池,有可能造成系统创建大量线程而导致消耗完系统内存以及”过度切换”。 3. 使用线程池的风险 虽然线程池是构建多线程应用程序的强大机制,但使用它
原创
发布博客 2016.10.16 ·
2120 阅读 ·
0 点赞 ·
0 评论 ·
2 收藏

各种格式之间转换

String转json String jstr=”{‘json’:’jsonvalue’,’bool’:true,’int’:1,’double’:’20.5’}”; JSONObject json=JSONObject.fromObject(jstr); boolean bool=json.getBoolean(“bool”); int i=json.getInt(“int”); dou
原创
发布博客 2016.10.16 ·
381 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Mock常用方法

http://www.tuicool.com/articles/J7BFr2AMock 测试是单元测试的重要方法之一。Mockito是基于Java的Mock测试框架。 什么是 Mock 测试 Mock 测试就是在测试过程中,对于某些不容易构造(如 HttpServletRequest 必须在Servlet 容器中才能构造出来)或者不容易获取比较复杂的对象(如 JDBC 中的ResultS
原创
发布博客 2016.10.16 ·
11340 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

rabbitmq组件断链重连机制

方案一: Rabbitmq在启动时,为rabbitmq设置一个status,在第一次建立连接的时候将其变为true,rabbitmq client在初始化时启动一个定时器,每隔一段时间开启一个线程,查询当前status的状态,如果status变为false,重新建立连接(包括connection、channel的连接)。方案二: Implement shutdown listener,如果rab
原创
发布博客 2016.10.16 ·
17001 阅读 ·
0 点赞 ·
0 评论 ·
9 收藏

rabbitmq的鉴权

详细内容可以查看(http://www.rabbitmq.com/access-control.html)Rabbitmq有两种鉴权方式:一种是利用内置数据库鉴权。另一种是rabbitmq-auth-backend-http鉴权插件来实现后端鉴权。 Rabbitmq中,Authentication 和 authorisation是有区别的,authentication是“identifying w
原创
发布博客 2016.10.16 ·
3024 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

rabbitmq基础

Exchange的三种typeDirect Exchange –通过binding key的完全匹配,binding key的名称与queue name的名称相同。 当P publish key是orange时,exchange会把它放到Q1。如果是black或者green那么就会到Q2。其余的Message都会被丢弃Fanout Exchange – 不通过bindingkey路由消息,excha
原创
发布博客 2016.10.16 ·
357 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode_3 Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for “abcabcbb” is “abc”, which the length is 3. For “
原创
发布博客 2015.08.03 ·
482 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode_234 Palindrome Linked List

Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space?public boolean isPalindrome(ListNode head) { if(head == null || h
原创
发布博客 2015.08.03 ·
305 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode_206 Reverse Linked List

Reverse a singly linked list. Hint: A linked list can be reversed either iteratively or recursively. Could you implement both?pre始终是首元结点的值,每次对pnext重新赋值 递归 public ListNode reverseList(ListNode
原创
发布博客 2015.08.03 ·
346 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode_237 Delete Node in a Linked List

Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with valu
原创
发布博客 2015.07.31 ·
321 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Leetcode_226 Invert Binary Tree

Invert a binary tree. 4/ \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 Trivia: This problem was inspired by this original tweet by Max Howell: Go
原创
发布博客 2015.07.30 ·
294 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode_199 Binary Tree Right Side View

Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For example: Given the following binary tree, 1
原创
发布博客 2015.07.30 ·
314 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode_145 Binary Tree Postorder Traversal

Given a binary tree, return the postorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [3,2,1]. private void resPreorder(TreeNode
原创
发布博客 2015.07.30 ·
306 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode_144 Binary Tree Preorder Traversal

Given a binary tree, return the preorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,2,3].List<Integer> result = new ArrayList
原创
发布博客 2015.07.30 ·
365 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode_124 Binary Tree Maximum Path Sum

Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example: Given the below binary tree, 1 / \ 2 3Return 6.如果这个作为root,那么最长路应该就是F(left) + F(ri
原创
发布博客 2015.07.30 ·
315 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode_222 Count Complete Tree Nodes

Given a complete binary tree, count the number of nodes. Definition of a complete binary tree from Wikipedia: In a complete binary tree every level, except possibly the last, is completely fill
原创
发布博客 2015.07.29 ·
356 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode_230 Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST’s total elements. Follow up: What i
原创
发布博客 2015.07.29 ·
313 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode_129 Sum Root to Leaf Numbers

Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which represents the number 123.Find the total sum of al
原创
发布博客 2015.07.29 ·
380 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode_235 Lowest Common Ancestor of a Binary Search Tree

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two
原创
发布博客 2015.07.29 ·
288 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode_114 Flatten Binary Tree to Linked List

Given a binary tree, flatten it to a linked list in-place.For example, Given 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should look like 1 \ 2 \
原创
发布博客 2015.07.29 ·
270 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏
加载更多