自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(49)
  • 收藏
  • 关注

转载 Message Queue - MQ Intro

之前做日志收集模块时,用到flume。另外也有的方案,集成kafaka来提升系统可扩展性,其中涉及到消息队列当时自己并不清楚为什么要使用消息队列。而在我自己提出的原始日志采集方案中不适用消息队列时,有几个基本问题:1. 日志文件上传过程,有个基本的生产者-消费者问题;2. 另外系统崩溃时,数据丢失的处理问题。  今天,几位同事再次谈到消息队列这么个东西,很NB的样子,我也想弄清楚,OK

2016-01-30 15:24:56 555

转载 Apache Kafka

简介Apache Kafka是分布式发布-订阅消息系统。它最初由LinkedIn公司开发,之后成为Apache项目的一部分。Kafka是一种快速、可扩展的、设计内在就是分布式的,分区的和可复制的提交日志服务。Apache Kafka与传统消息系统相比,有以下不同:它被设计为一个分布式系统,易于向外扩展;它同时为发布和订阅提供高吞吐量;它支持多订阅者,当失败时能自动平衡消费者

2016-01-30 15:22:44 269

转载 Spark Intro

Spark:一个高效的分布式计算系统Posted by jzou on 2013 年 9 月 10 日概述什么是SparkSpark是UC Berkeley AMP lab所开源的类Hadoop MapReduce的通用的并行计算框架,Spark基于map reduce算法实现的分布式计算,拥有Hadoop MapReduce所具

2016-01-30 15:14:24 366

转载 IM Architecture

微信使用的越来越广泛,我们来聊一聊如何设计微信后台架构。我们从三个方面入手:how to communicate?(网络层)how to store data?(数据层)how to build API?(逻辑层)1. how to communicate1) how to communicate betw

2016-01-30 13:03:12 258

转载 取模 and 求余

取模运算和求余运算的区别标签: python语言cshell脚本编程2011-10-09 16:16 29454人阅读 评论(6)收藏 举报分类: C语言(6) 版权声明:本文为博主原创文章,未经博主允许不得转载。通常情况下取模运算(mod)和求余(rem)运算被混为一谈,因为在大多数的编程语言里,都用'%'符号表

2016-01-27 23:39:41 515

转载 Ansi,UTF8,Unicode,ASCII编码的区别

1.  ASCII和Ansi编码    字符内码(charcter code)指的是用来代表字符的内码.读者在输入和存储文档时都要使用内码,内码分为     单字节内码 -- Single-Byte character sets (SBCS),可以支持256个字符编码.     双字节内码 -- Double-Byte character sets)(DBCS),可以支持65000个字

2016-01-27 23:38:37 257

转载 recursion versus iteration

33down votefavorite13Is it correct to say that everywhere recursion is used a for loop could be used? And if recursion is usually slower what is the technical reason for ever using it ov

2016-01-27 23:36:53 365

转载 Python List Pop

SyntaxFollowing is the syntax for pop() method −list.pop(obj=list[-1])Parametersobj -- This is an optional parameter, index of the object to be removed from the list.Return Val

2016-01-26 22:45:30 793

转载 Recursion Vs Iteration

深究递归和迭代的区别、联系、优缺点及实例对比1.概念区分递归的基本概念:程序调用自身的编程技巧称为递归,是函数自己调用自己.一个函数在其定义中直接或间接调用自身的一种方法,它通常把一个大型的复杂的问题转化为一个与原问题相似的规模较小的问题来解决,可以极大的减少代码量.递归的能力在于用有限的语句来定义对象的无限集合.使用递归要注意的有两点:1)递归就是在过程或

2016-01-26 17:38:59 856

转载 Python bitwise operator

bitwise 英 [bɪt'waɪz]    美 [bɪt'waɪz]   n.逐位;按位However,you probably won't use the bitwise operators much.然而,也许不必过于频繁地进行按位运算。Is a numeric value representing the inclu

2016-01-22 23:40:44 1145

转载 What are bitwise operators?

75down votefavorite54I'm someone who writes code just for fun and haven't really delved into it in either an academic or professional setting, so stuff like these bitwise operators r

2016-01-22 23:24:40 427

转载 Bitwise operation and usage

Consider this code:x = 1 # 0001x 2 # Shift left 2 bits: 0100# Result: 4x | 2 # Bitwise OR: 0011# Result: 3x & 1 # Bitwise AND: 0001# Result: 1I can understand

2016-01-22 23:11:40 1132

转载 Division Operators

Division OperatorsIn general, the data type of an expresion depends on the types of the arguments. This rule meets our expectations for most operators: when we add two integers, the result should

2016-01-22 20:55:05 291

转载 Why Netflix chose NGINX

Why Netflix Chose NGINX as the Heart of Its CDNIn the few years since its introduction, Netflix’s online video streaming service has grown to serve over 50 million subscribers in 40 countries. W

2016-01-21 17:35:52 606

转载 Mobile architecture

Mobile Needs A Four-Tier Engagement PlatformPosted by Ted Schadler on November 20, 201363 Recommendations" style="margin:0px; padding:0px; border:0px; font-family:inherit; font-size:

2016-01-21 17:02:03 859

转载 Netflix Architecture

Netflix's Viewing Data: How We Know Where You Are in House of CardsOver the past 7 years, Netflix streaming has expanded from thousands of members watching occasionally to millions of memb

2016-01-21 16:35:25 622

转载 BAT Levels

柳文霖、黑哥哥 等人赞同级别和薪资待遇,除非身居其位,否则你不会知道;但是等你到那个位置知道了,却又不能说,至少不能在公开场合谈论。题主真是问了一个群众喜闻乐见却又讳莫如深的话题。别问我是怎么知道答案的,答主不是互联网猎头,答主正在做的事就是要用互联网产品100offer-高端人才招聘网站 挑战猎头,因为猎头不透明、不全面,还死贵。各个公司头衔名字都不一样,级别的数目也不一样;

2016-01-21 15:57:57 604

转载 Find the Minimum Element in A sorted and Rotated Array

Find the minimum element in a sorted and rotated arrayA sorted array is rotated at some unknown point, find the minimum element in it. Following solution assumes that all elements are distin

2016-01-20 22:43:15 315

转载 Find a Peak Element

Find a peak elementGiven an array of integers. Find a peak element in it. An array element is peak if it is NOT smaller than its neighbors. For corner elements, we need to consider only one neig

2016-01-20 22:41:39 379

转载 Python - Search Insert Position

【LeetCode with Python】 Search Insert Position 标签: LeetCodeLeetCode with PythonPython2014-09-21 17:50 1027人阅读 评论(0) 收藏 举报 分类:LeetCode with Python(103) 版权声明:本文为博主原创文章,未经博主允

2016-01-16 19:52:32 567

转载 Python integer ranges

43 down vote favorite7In Python, is there a way to get the largest integer one can use? Is there some pre-defined constant like INT_MAX?pythoninteger shareimprove

2016-01-16 13:00:40 751

转载 Python - abs vs fabs

abs(-5)Secondimport mathmath.fabs(-5)How do these methods differ?pythonshareimprove this questionedited Feb 22 '14 at 16:46Paul Draper22.6k1156

2016-01-14 14:09:07 904

转载 Bisearch Summary

1. how to calculate middle - arithmetic progression(mean)   M-S=T-M =>2M=S+T2. while-loop or recursion: recursion will use system stack space, which should be avoided for simple problem. Recursion

2016-01-13 15:13:16 303

转载 Arithmetic Progression

Arithmetic Progression (A.P.)Let us recall some formulae and properties studied earlier. A sequence a1, a2, a3,…, an,… is called arithmetic sequence or arithmetic progression if an + 1 = a

2016-01-12 23:12:56 644

转载 二分查找(Binary Search)需要注意的问题,以及在数据库内核中的实现

Reference:http://ju.outofmemory.cn/entry/31508二分查找(Binary Search)需要注意的问题,以及在数据库内核中的实现OurMySQL 2013-06-18 400 阅读Binary 二分查找问题背景今年的实习生招聘考试,我出了一道二分查找(Binary Search)的题目。题目大意如

2016-01-12 22:46:12 344

转载 BinarySearch

转载请注明:http://blog.csdn.net/zhouyelihua/article/details/46665931二分查找的应用二分查找作为O(log(n))时间复杂度的查找算法得到了广泛的使用。1.在已排序的数组中查找特定的元素。或者是满足条件的第一个元素 2.数学常用的求解方程的解,也是数学家所指的对半查找。 3.程序调试中用来定位错误语句 

2016-01-12 22:41:43 223

转载 Python Division //

In Python 3, they made the / operator do a floating-point division, and added the // operator to do integer division (i.e. quotient without remainder); whereas in Python 2, the / operator was si

2016-01-12 21:42:26 1058

转载 Python Division and Remainders

1.4.1. Addition and SubtractionWe start with the integers and integer arithmetic, not because arithmetic is exciting, but because the symbolism should be mostly familiar. Of course arithmetic is imp

2016-01-12 21:25:48 500

转载 全排列算法的递归与非递归实现

全排列算法的递归与非递归实现全排列算法是常见的算法,用于求一个序列的全排列,本文使用C语言分别用递归与非递归两种方法实现,可以接受元素各不相同的输入序列。题目来自leetcode:Given a collection of numbers, return all possible permutations. For example, [1,2,3] have t

2016-01-12 20:21:22 360

转载 递归算法的时间复杂度终结篇

NOTE: 博主python27对本博客文章享有版权,网络转载请注明出处http://www.cnblogs.com/python27/。对解题思路有任何建议,欢迎在评论中告知。【算法16】递归算法的时间复杂度终结篇  开篇前言:为什么写这篇文章?笔者目前在学习各种各样的算法,在这个过程中,频繁地碰到到递归思想和分治思想,惊讶于这两种的思想的伟大与奇妙的同时,经常要

2016-01-11 21:02:40 400

转载 Exhaustive recursion and backtracking

Reference: https://see.stanford.edu/materials/icspacs106b/H19-RecBacktrackExamples.pdfCS106BJ ZelenskiHandout #19Feb 1, 2008Exhaustive recursion and backtrackingIn

2016-01-11 20:36:42 544

转载 穷举递归和回溯算法终结篇

factorial 英 [fæk'tɔːriəl]    美 [fæk'tɔːriəl]   adj.阶乘的;因数的;工厂的;代理商的n.阶乘Noun:the product of all the integers up to and including a given integer;"1, 2, 6, 24, and 120 are fa

2016-01-11 16:52:34 787

转载 递归回溯

搜索的本质是枚举.回溯是最常用的搜索方法之一,它采用深度优先的策略来枚举所有可能的解,结合题设条件的限定,从而得到问题的解.回溯(backtracking)是一种系统地搜索问题解答的方法。为了实现回溯,首先需要为问题定义一个解空间(solution space),这个空间必须至少包含问题的一个解(可能是最优的)。     下一步是组织解空间以便它能被容易地搜索。典型的组织方

2016-01-11 16:08:42 4069

转载 Write a program to print all permutations of a given string

Write a program to print all permutations of a given stringA permutation, also called an “arrangement number” or “order,” is a rearrangement of the elements of an ordered list S into a one-to-on

2016-01-11 15:13:38 519

转载 How to append list to second list

How to append list to second list (concatenate lists)up vote641down votefavorite77How do I concatenate two lists in Python?Example:listone = [1,2,3]l

2016-01-10 16:13:26 540

转载 总结

所有方案的个数*构造每个方案的时间复杂度

2016-01-10 12:25:25 174

转载 Python Binary Search

defbinarySearch( theValues, target ) :# Start with the entire sequence of elements.low = 0high = len(theValues) -1# Repeatedly subdivide the sequence in half until the target is found.wh

2016-01-07 23:45:00 1239

转载 Python Nested List Operation

1.列表就像数组:ist1=["I","love","python",2014]ist1['I', 'love', 'python', 2014] 列表的数据处理:假设你得到一组数据movies= ["The Holy Grail", 1975, "Terry Jones & Terry Gilliam", 91, [

2016-01-07 21:24:35 1423

转载 subsets

子集系列(一) 传统subset 问题,例 [LeetCode] Subset, Subset II, Bloomberg 的一道面试题引言Coding 问题中有时会出现这样的问题:给定一个集合,求出这个集合所有的子集(所谓子集,就是包含原集合中的一部分元素的集合)。或者求出满足一定要求的子集,比如子集中元素总和为定值,子集元素个数为定值等等。我把它们归类为子集系列问题

2016-01-07 16:13:40 327

转载 What are some of the differences between using recursion to solve a problem versus using iteration?

The fact is that recursion is rarely the most efficient approach to solving a problem, and iteration is almost always more efficient. This is because there is usually more overhead associated with mak

2016-01-06 23:13:50 308

空空如也

空空如也

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

TA关注的人

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