原创 Largest Rectangle in a Histogram-POJ2559

原題鏈接http://poj.org/problem?id=2559 Description A histogram is a polygon composed of a sequence of rectangles aligned

原创 開源日誌系統比較

1. 背景介紹 許多公司的平臺每天會產生大量的日誌(一般爲流式數據,如,搜索引擎的pv,查詢等),處理這些日誌需要特定的日誌系統,一般而言,這些系統需要具有以下特徵: (1) 構建應用系統和分析系統的橋樑,並將它們之間的關聯解耦;

原创 [Redis] redis-cli 命令總結

一、string命令示例: 1. SET/GET/APPEND/STRLEN:     /> redis-cli   #執行Redis客戶端工具。    redis 127.0.0.1:6379> exists mykey    

原创 python線程和GIL

GIL 與 Python 線程的糾葛 GIL 是什麼?它對 python 程序會產生怎樣的影響?我們先來看一個問題。運行下面這段 python 代碼,CPU 佔用率是多少? # 請勿在工作中模仿,危險:) def dead_lo

原创 Leveldb 實現原理

轉自:http://www.cnblogs.com/haippy/archive/2011/12/04/2276064.html LevelDb日知錄之一:LevelDb 101   說起LevelDb也許您不清楚,但是如果

原创 談談Memcached與Redis

1. Memcached簡介 Memcached是以LiveJurnal旗下Danga Interactive公司的Bard Fitzpatric爲首開發的高性能分佈式內存緩存服務器。其本質上就是一個內存key-value數據庫,

原创 Leetcode 226. Invert Binary Tree

Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6

原创 leetcode 242. Valid Anagram

Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "na

原创 leetcode 326. Power of Three

Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it without using

原创 leetcode 283. Move Zeroes

Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the n

原创 leetcode 206. Reverse Linked List

Reverse a singly linked list. click to show more hints. Hint: A linked list can be reversed either iteratively or r

原创 Redis slots遷移丟key問題排查

最近在公司wiki寫了幾篇還不錯的wiki,感覺有分享的必要,所以貼出來和大家分享。 這個是redis的一個critical級別的bug,在目前的3.2.6的小版本都沒有修復,只有在4.0rc2裏面修了。就是說即使你們用12月發佈的3.

原创 Redis與Memcached的比較

本文轉自NoSQL數據庫:Redis適用場景及產品定位 1.網絡IO模型   Memcached是多線程,非阻塞IO複用的網絡模型,分爲監聽主線程和worker子線程,監聽線程監聽網絡連接,接受請求後,將連接描述字pipe 傳遞給work

原创 LevelDB使用指南

這篇文章是levelDB官方文檔的譯文,原文地址:LevelDB library documentation 這篇文章主要講leveldb接口使用和注意事項。 leveldb是一個持久型的key-value數據庫。key,value可以

原创 Cassandra中的各種策略

轉自董的博客:Cassandra中的各種策略 1. 背景介紹 Cassandra 使用分佈式哈希表(DHT)來確定存儲某一個數據對象的節點。在 DHT 裏面,負責存儲的節點以及數據對象都被分配一個 token。token只能在一定的範