自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(27)
  • 资源 (3)
  • 问答 (1)
  • 收藏
  • 关注

原创 Leveldb源码解析第七篇【log】

版权声明:本文为博主原创文章,未经博主允许不得转载。这里的 log 非彼 log,这里的 log 是记录下用户的所有操作,防止设备异常导致 memtable 里面的数据丢失,用户在操作数据的时候首先会将操作写到 log 中,然后才会对数据进行操作 log相关的源码文件有db/log_format.hdb/log_reader.hdb/log_reader.ccdb/log_writer

2017-06-09 17:29:33 938

原创 Leveldb源码解析第六篇【memtable】

版权声明:本文为博主原创文章,未经博主允许不得转载。数据在插入内存中的时候会在key前面和后面添加不同的表示,形成多种分类搞懂Memtable需要阅读如下源码db/MemTable.hdb/MemTable.ccdb/dbformat.hdb/dbformat.ccMemTable.hclass MemTable { public: // 构造方法,传入的是InternalKey类型的比

2017-06-09 17:28:18 940

原创 Leveldb源码解析第五篇【memtable之skiplist】

版权声明:本文为博主原创文章,未经博主允许不得转载。前面讲到了在 table 中插入数据,然后将数据持久化到磁盘中,这些都是一下底层的操作,用户真正写数据是放到内存中。本章就来介绍 key-value 在内存的操作skiplistkey-value 存放在在内存中采用的结构是 skiplist,结构如下所示head_------>7---------------------------------

2017-06-09 17:25:54 2071

原创 Leveldb源码解析第四篇【sstable添加key的流程】

版权声明:本文为博主原创文章,未经博主允许不得转载。添加一个key-value需要构造一个TableBuilder在构造TableBuilder时会构造一个Rep Rep里面有BlockBuilder类型的data_block和index_block,还有FilterBlockBuilder类型的filter_blockindex_block的重启点频率设置为1(默认是16)filter_b

2017-06-09 17:22:51 784 1

原创 Leveldb源码解析第三篇【sstable 收尾】

版权声明:本文为博主原创文章,未经博主允许不得转载。前面介绍完了table的data block和filter block,今天就来讲table收一下尾,table还剩meta index block,index block,footer这几个都比较简单,就一起介绍了table.h中是用来解析一个table的,在没搞懂table是什么东西前直接解析有点困难,而了解table最快速的办法就是看怎么t

2017-06-09 17:21:58 982 1

原创 Leveldb源码解析第二篇【Meta Block】

版权声明:本文为博主原创文章,未经博主允许不得转载。上一章中详细讲解了 table 中的 data block 的结构以及涉及的源码,本章中将讲解 table 结构中的 meta blocktable 结构 <beginning_of_file> [data block 1] [data block 2] ... [data block N] [met

2017-06-09 17:20:54 2023 3

原创 Leveldb源码解析第一篇【Data Block】

版权声明:本文为博主原创文章,未经博主允许不得转载。leveldb 作为一个 key-value 数据库,它和 redis 的区别在于不仅没有把所有的数据放在内存中,而是把大部分数据放在了磁盘中leveldb 存数据的流程先指定一块内存写数据(这块内存称为 MemTable),当占用的内存高于阈值后,将这块内存转为只读(这块只读内存称为 Immutable MemTable)同时开辟一块新的内

2017-06-09 17:17:41 10430 11

原创 关于openCV图片裁剪和图片合并的问题

最近做了一个可以视频的聊天程序

2014-06-07 19:32:03 2565 1

原创 leetcode-Valid Palindrome

问题描述:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" 

2014-05-15 09:42:22 443

原创 2048-jquery版

两个晚上做了一个2048,还不是很完善,但是

2014-05-12 00:27:35 1068

原创 leetcode-Validate Binary Search Tree

题目描述:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than the node

2014-05-11 23:16:56 460

原创 leetcode-Reverse Words in a String

问题描述:Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".zhiqian

2014-05-05 16:52:14 491

原创 leetcode-Merge Sorted Array

问题描述:Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold additional eleme

2014-05-05 10:40:09 327

原创 leetcode-Set Matrix Zeroes

问题描述:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.Follow up:Did you use extra space?A straight forward solution using O(mn) space is probabl

2014-05-05 09:02:43 377

原创 leetcode-Climbing Stairs

题目描述:You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?做了半天,就是运行不起来,最后heng

2014-05-05 00:17:00 449

原创 leetcode-Valid Number

问题描述:Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended for the problem statement to b

2014-05-04 22:02:26 629

原创 leetcode-Insert Interval

问题描述:Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start

2014-05-04 20:50:47 446

原创 leetcode-Merge Intervals

描述:Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].找出公共区间

2014-05-04 19:05:36 449

原创 leetcode-Implement strStr()

问题描述:mplement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.实现strStr(

2014-05-04 15:26:41 402

原创 leetcode-Merge Two Sorted Lists

描述:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.将两个已经排序好的链表heb

2014-05-04 11:12:05 368

原创 leecode-Valid Parentheses

问题描述:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all v

2014-05-02 09:08:14 426

原创 leetcode-3Sum

从今天开始刷leetcode,记录我做题的每一步

2014-05-02 00:39:25 832 1

转载 页面调度算法

使用FIFO调度算法时,页面装入和调出的情况如下:页面号  7 0 1 2 3 0 4 3 2 3 6 7 3 1 5 7 6 2 6 7页面1   7 7 7 7 3 3 3 3 3 3 3 3 3 1 1 1 1 1 1 7页面2     0 0 0 0 0 4 4 4 4 4 4 4 4 5 5 5 5 5 5页面3       1 1 1 1 1 1 1 1 6 6 6 6

2014-04-10 23:33:46 1006

原创 进程与线程的区别

面试经常被问道这样的问题,记下来印象深刻一点

2014-04-08 19:34:22 408

原创 进程通信

进程通信分为:1、低级进程通信

2014-04-08 13:26:39 638

原创 qt做的一个动态实时监控项目

做了一个摄像头监控的项目环境:qtcreator-2.5.2+Qt4.7.3+MinGW+openCV2.1(装在c盘根目录下,在项目中引入的时候有用)功能介绍:监控笔记本摄像头,通过opencv的函数打开摄像头,用帧差分算法判断监控的区域有没有发生变化,也就是有没有物体进入监控区域,当监控的区域发生变化时,将这一帧发送给服务器端之前环境不允许,一直用一台电脑既当服务器又当客户端,挺成

2014-04-07 19:44:10 6589

原创 从今天起开始写博客

从今天起开始记录每一天,每天都不知道在干啥,记录下来

2014-03-29 13:29:38 374

2048网页版源码

网页版2048源码,代码才300多行,jquery练手

2014-05-12

QT实时监控

实时监控多台电脑的摄像头,从摄像头捕捉画面,通过帧差分算法判断画面是否发生了变化,若发生变化,将捕捉的画面发送到服务器端,服务器显示画面,这样做的好处是不用将捕捉到的画面全部发给服务器,只需将发生变化的画面发送给服务器

2014-04-07

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

TA关注的人

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