原创 如何把數據庫的多行搜索結果聚合成一行

1.首先我們需要了解下什麼是聚合函數 聚合函數aggregation function又稱爲組函數。 認情況下 聚合函數會對當前所在表當做一個組進行統計。 2.聚合函數的特點 1.每個組函數接收一個參數(字段名或者表達式) 統計結

原创 java線程池源碼解讀

自己實現的一個線程池 IThreadPool package pool; import java.util.List; /** * @author Mingming * @Description * @Date Crea

原创 第五屆阿里雲中間件天池大賽總結

雲生不知處隊伍 初賽 兩個指標: 爭取儘可能多的完成率。(三個 provider 的一共 1300+個線程,consumer 只有 1024 個線程,靠線程數分配即可做到 100%的完成率) 爭取儘量多的完成數(運用兩個指標,

原创 關於 RocketMQ中 GroupID 與 Topic 訂閱關係的疑問

問題 在阿里雲服務提供的消息隊列服務(RocketMQ)中,給出了一份關於訂閱關係一致的最佳實踐,在文檔中指出同一個 GroupID 中的所有消費者實例最好訂閱同樣的 Topic+Tag。這讓我有一些疑問,爲什麼一個 GroupI

原创 Add Binary

描述 Given two binary strings, return their sum (also a binary string). For example, a = “11” b = “1” Return 100. 分析

原创 Reorder List

描述: Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You may not modify the va

原创 Reverse Nodes in k-Group

描述 Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number

原创 LRU Cache---如何實現一個簡單的 LRU 緩存

描述 Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following opera

原创 關於快速失敗(fail-fast)和安全失敗(fail-safe)的區別

fail-fast和fail-safe比較 Iterator 的安全失敗是基於對底層集合做拷貝,因此,它不受集合上的修改的影響。java.util 包下面所有的集合類都是安全失敗的。快速失敗的迭代器會拋出 ConcurrentMo

原创 Remove Duplicates from Sorted List

描述 Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1-

原创 Linked List Cycle II

描述 Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can y

原创 OAuth 協議

OAuth:一個關於授權(authorization)的開放網絡標準,目前版本是2.0版。 OAuth 協議 1.0 授權步驟 應用向服務提供方申請請求令牌(Request Token),服務提供方驗證通過後將令牌返回。這個步驟

原创 234. Palindrome Linked List

Given a singly linked list, determine if it is a palindrome. Example 1: Input: 1->2 Output: false Example 2: Input:

原创 Linked List Cycle

Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an in

原创 Simplify Path

Given an absolute path for a file (Unix-style), simplify it. Or in other words, convert it to the canonical path. I