自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(281)
  • 资源 (9)
  • 收藏
  • 关注

原创 mc代码分析

基于memcached-1.4.33, commitid:bd578fc34b96abe0f8d99c1409814a09f51ee71c1.connection当conn到来时使用lib_event库处理,处理的过程是一个状态机,conn一直在这个状态机的不同状态之间轮转。 2.内存结构primary_hashtable当后面的链表

2016-12-23 00:43:28 4559

原创 Redis slots迁移丢key问题排查

1.问题redis slots迁移的时候,在迁移之后key数量会变少.2.排查2.1思考redis 3.x也是比较成熟的产品了,为什么会丢key?别人有没有遇到同样的问题?假设丢key了,如果key是因为expire丢失,那应该是正常,如果没有expire丢失,就是问题了,首先复现问题。2.2复现问题0.准备集群造了两个节点的集群:10.0.0.10:20003和10.0.0.10:20004

2016-12-23 00:35:32 7048 1

原创 mc集群写入恍惚问题排查

最近在公司的wiki里写了几篇查问题的日志,感觉有分享的必要,就贴出来了。1.现象业务方反馈在向memcache集群写入数据时,出现不稳定。表现为向mc写入一个creative和ad对象的list,有的时候能写进去并读出来,有的时候写成功但是读不出来。2.问题排查2.1 复现问题a.有的key没有问题,能够一直写+读。b.有的key一直都是写ok,读None。c.有的key写ok,有的时候读o

2016-12-23 00:29:02 1381

转载 redis cluster管理工具redis-trib.rb详解

读了一下redis-trib.rb的源码,想写一篇关于redis-trib.rb的文章,后来发现有人写的很清楚了,所以就直接转载过来了,有稍微的改动。 原文地址:redis cluster管理工具redis-trib.rb详解概述redis-trib.rb是redis官方推出的管理redis集群的工具,集成在redis的源码src目录下,是基于redis提供的集群命令封装成简单、便捷、实用的操作工

2016-11-13 16:15:36 3050 1

转载 Redis与Memcached的比较

本文转自NoSQL数据库:Redis适用场景及产品定位1.网络IO模型  Memcached是多线程,非阻塞IO复用的网络模型,分为监听主线程和worker子线程,监听线程监听网络连接,接受请求后,将连接描述字pipe 传递给worker线程,进行读写IO, 网络层使用libevent封装的事件库,多线程模型可以发挥多核作用,但是引入了cache coherency和锁的问题,比如,Memcache

2016-10-22 23:33:19 573

转载 Cassandra中的各种策略

转自董的博客:Cassandra中的各种策略1. 背景介绍Cassandra 使用分布式哈希表(DHT)来确定存储某一个数据对象的节点。在 DHT 里面,负责存储的节点以及数据对象都被分配一个 token。token只能在一定的范围内取值,比如说如果用 MD5 作为 token 的话,那么取值范围就是 [0, 2^128-1]。存储节点以及对象根据 token 的大小排列成一个环,即最大的 to

2016-10-22 22:12:17 1152

原创 Cassandra一些运维操作

1.查看集群是否使用了vnodes用途:使用了virtual nodes,删除了节点之后它会自动均衡数据,不要你手动处理。 主要看你的cassandra.yml配置文件中,是否配置了initial_token,如果没有配置,就是使用了vnodes。cassandra/conf$ less cassandra.yaml# initial_token allows you to specify to

2016-10-22 16:33:06 3812

原创 Cassandra介绍和一些常用操作

NoSQL数据库是为高扩展性系统设计的,采用了key/value模型,但它的缺点,正如NoSQL这个名字表明地那样,不支持SQL操作。这听起来像是一个很严重的缺陷。本文介绍了一些在SQL中常见的操作怎样在cassandra中自然而又有效的实现。0.示例column family表1:CREATE TABLE example ( id int, name ascii, age

2016-10-22 00:20:56 12412

原创 leveldb源码分析

我正在读leveldb的源码,如果你有问题,可以一起交流。 这篇文章是读完代码之后需要写的,先立一个flag。 2016.10.15 at Bunny Drop

2016-10-15 19:10:04 727

翻译 LevelDB使用指南

这篇文章是levelDB官方文档的译文,原文地址:LevelDB library documentation这篇文章主要讲leveldb接口使用和注意事项。 leveldb是一个持久型的key-value数据库。key,value可以是任意的字节数组,key之间是有序的。key的比较函数可以由用户指定。1. 打开数据库leveldb使用文件系统目录名作为name,并把数据库所有内容都存储在这个目录

2016-10-15 18:20:18 11010 1

翻译 levelDB实现细节

这篇文章是levelDB官方文档的译文,原文地址:Implementation notesFilesleveldb的实现和一个单点的Bigtable tablet (section 5.3)很相近。然而,文件的组织形式又有些不太一样,下文会解释这一点。 每一个数据库都是存储在一个目录的一系列文件的集合。有以下几种不同类型的文件:Log filesA log file (*.log) stores

2016-10-15 15:18:39 1753

翻译 leveldb日志文件格式

这篇文章是levelDB官方文档的译文,原文链接:Format of a log file日志文件是一系列32KB大小的记录块,唯一例外就是文件的末尾可能包含一个部分记录块。 block := record* trailer? // 译者注:多个record块,可能包含一块几个字节的空白。 record := checksum: uint32 // crc32

2016-10-15 14:44:06 1696

翻译 levelDB immutable Table的文件格式

这篇文章是levelDB官方文档的译文,原文地址文件格式概览: <beginning_of_file> [data block 1] [data block 2] ... [data block N] [meta block 1] ... [meta block K] [metaindex block] [index block] [Footer]

2016-10-15 13:59:43 1051

原创 leetcode 328. Odd Even Linked List

Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.You should try to do it in

2016-10-11 09:45:38 497

原创 leetcode 189. Rotate Array

Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].Note:Try to come up as many solutions as yo

2016-10-11 09:06:32 519

原创 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?这个问题可以用O(n)的空间来做,但是如果用O(1)的空间的话,只能考虑其他的方法了。链表经常用到的方法就是快慢指针,如果用快慢指针的话,把链表分为

2016-10-07 23:50:28 393

原创 leetcode 238. Product of Array Except Self

Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements ofnums except nums[i].Solve it without division and in O(

2016-10-07 22:27:16 362

原创 leetcode 152. Maximum Product Subarray

Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has the largest

2016-10-07 22:06:36 393

原创 leetcode 198. House Robber

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house

2016-10-06 18:29:34 405

原创 leetcode 220. Contains Duplicate III

Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] andnums[j] is at most t and the difference between i and

2016-10-06 17:26:54 476

原创 leetcode 219. Contains Duplicate II

Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j]and the difference between i and j is at most k.

2016-10-06 15:31:57 334

原创 leetcode 217. Contains Duplicate

Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element

2016-10-06 15:01:55 275

原创 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 recursively. Could you implement both?递归:/** * Definition for singly-lin

2016-10-06 14:40:57 262

原创 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 any loop / recursion?class Solution {public: bool isPowerOfThree(int n)

2016-10-04 20:21:40 332

原创 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 = "nagaram", return true.s = "rat", t = "car", return false.Note:You may ass

2016-10-04 19:59:58 288

原创 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 value

2016-10-04 19:48:41 311

原创 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 non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after calling you

2016-10-04 19:31:28 330

原创 Leetcode 226. Invert Binary Tree

Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired by this original tweet by Max Howe

2016-10-04 19:06:58 292

原创 Leetcode-292. Nim Game

You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the

2016-10-04 18:57:15 357

原创 Largest Submatrix of All 1’s--POJ3494

原题链接:http://poj.org/problem?id=3494DescriptionGiven a m-by-n (0,1)-matrix, of all its submatrices of all 1’s which is the largest? By largest we mean that the submatrix has the most elements.

2016-10-04 17:29:30 508

原创 Largest Rectangle in a Histogram-POJ2559

原题链接http://poj.org/problem?id=2559DescriptionA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have differen

2016-10-04 15:44:20 458

原创 LevelDB使用入门

1,下载levelDB源码git clone https://github.com/google/leveldb.git2,编译LevelDBcd leveldb & make all编译完成之后在当前目录多了两个目录:out-shared和out-static在out-static目录下有我们需要的libleveldb.a3,在当前目录新建文件夹test

2016-10-03 12:17:59 13030 2

转载 Leveldb 实现原理

转自:http://www.cnblogs.com/haippy/archive/2011/12/04/2276064.htmlLevelDb日知录之一:LevelDb 101  说起LevelDb也许您不清楚,但是如果作为IT工程师,不知道下面两位大神级别的工程师,那您的领导估计会Hold不住了:Jeff Dean和Sanjay Ghemawat。这两位是

2016-10-03 00:18:20 1644

转载 LevelDB原理探究与代码分析

1. 概述Level DB(http://code.google.com/p/leveldb/)是google开源的Key/Value存储系统,它的committer阵容相当强大,基本上是bigtable的原班人马,包括像jeff dean这样的大牛,它的代码合设计非常具有借鉴意义,是一种典型的LSM Tree的KV引擎的实现,从它的数据结构来看,基本就是sstable的开源实现,而且针对

2016-10-03 00:13:43 781

转载 谈谈Memcached与Redis

1. Memcached简介Memcached是以LiveJurnal旗下Danga Interactive公司的Bard Fitzpatric为首开发的高性能分布式内存缓存服务器。其本质上就是一个内存key-value数据库,但是不支持数据的持久化,服务器关闭之后数据全部丢失。Memcached使用C语言开发,在大多数像Linux、BSD和Solaris等POSIX系统上,只要安装了libe

2016-10-02 15:36:22 405

转载 python线程和GIL

GIL 与 Python 线程的纠葛GIL 是什么?它对 python 程序会产生怎样的影响?我们先来看一个问题。运行下面这段 python 代码,CPU 占用率是多少?# 请勿在工作中模仿,危险:)def dead_loop(): while True: passdead_loop()答案是什么呢,占用 100% CPU?那是单核!还得

2016-05-19 23:54:38 542

转载 [Redis] redis-cli 命令总结

一、string命令示例:1. SET/GET/APPEND/STRLEN:    /> redis-cli   #执行Redis客户端工具。    redis 127.0.0.1:6379> exists mykey                   #判断该键是否存在,存在返回1,否则返回0。    (integer) 0    redis 127.0.0.1:6

2016-05-19 21:37:45 10528

转载 Cassandra原理介绍

Cassandra最初源自Facebook,结合了Google BigTable面向列的特性和[Amazon Dynamo](http://en.wikipedia.org/wiki/Dynamo(storagesystem) ) 分布式哈希(DHT)的P2P特性于一身,具有很高的性能、可扩展性、容错、部署简单等特点。它虽然有多的优点,但国内使用的公司貌似不多,远没有Hbase和M

2016-04-05 21:02:05 13723 1

转载 开源日志系统比较

1. 背景介绍许多公司的平台每天会产生大量的日志(一般为流式数据,如,搜索引擎的pv,查询等),处理这些日志需要特定的日志系统,一般而言,这些系统需要具有以下特征:(1) 构建应用系统和分析系统的桥梁,并将它们之间的关联解耦;(2) 支持近实时的在线分析系统和类似于Hadoop之类的离线分析系统;(3) 具有高可扩展性。即:当数据量增加时,可以通过增加节点进

2016-03-29 20:14:18 3080

原创 《计算广告学之内容匹配广告&展示广告原理、技术和实践》学习笔记

第1章内容匹配广告投放技术:网盟概述&工程架构1.1网盟概述角色关注网站主(Publishers)用户体验,赚钱广告主(Advertisers)投资回报率ROI网民有用的信息,良好的体验网盟(Ad network/Matcher)赚钱,找到网名和广告的

2016-03-21 10:07:56 7834

数据挖掘引论-6.clustering.pdf

中国科学院 数据挖掘引论 刘莹 课件

2011-09-19

数据挖掘引论-5.classification.pdf

中国科学院 数据挖掘引论 刘莹 课件

2011-09-19

数据挖掘引论-4.ARM.pdf

中国科学院 数据挖掘引论 刘莹 课件

2011-09-19

数据挖掘引论-3.Preprocessing_upload.pdf

中国科学院 数据挖掘引论 刘莹 课件

2011-09-19

数据挖掘引论-2.Data_Warehouse.pdf

中国科学院 数据挖掘引论 课件 刘莹

2011-09-19

数据挖掘引论-1.Intro.pdf

中国科学院 数据挖掘引论 课件 刘莹

2011-09-19

Android获取运营商代码

Android获取运营商代码 IMSI MCC MNC MIN

2011-08-16

自动售货机的设计与实现

数字逻辑课程设计 自动售货机 VHDL

2009-08-31

数据结构 树和二叉树 ppt

我们老师的课件 ,是学数据结构的好东西,老师可是花了很多的心血啊, 树和二叉树。

2009-05-03

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除