自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(211)
  • 资源 (17)
  • 收藏
  • 关注

原创 跟我学storm教程2-并行机制及数据流分组

topology的四个组成部分Nodes(服务器)即为storm集群中的supervisor,会执行topology的一部分运算,一个storm集群一般会有多个nodeworkers(JVM虚拟机)node节点上运行的相互独立的jvm进程,每个节点上可以运行一个或者多个worker。一个复杂的topology会分配到多个worker上运行。Executor(线程)指某个jvm进程中运行的j

2017-05-02 21:09:41 1088

原创 跟我学storm教程1-基本组件及分布式wordCount

storm拓扑组成结构        storm的分布式计算拓扑结果英文为topology,由数据流(stream)、数据源(spout)、运算单元(bolt)三个部分组成。数据源的数据流(stream)按照一定的方式(是否分组等等,这个概念后续会讲)流入一级bolt做运算,之后这些一级bolt的输出再按照一定的方式流入下一级bolt,如下图所示。storm跟hadoop等离线批量计算框架的最

2017-05-01 17:14:49 1368

原创 连接github Permission denied (publickey).解决

连接github Permission denied (publickey).解决本地配置生成ssh-key1、ssh-keygen -t rsa -b 4096 -C [email protected] file in which to save the key 2、设置id名称(/Users/hostName/.ssh/id_rsa): id_xxx3、输入密码Enter pa

2017-05-01 15:17:13 2102

原创 python-2.7.11 already installed, it's just not linked解决办法

通过brew安装python失败,提示:sudo brew install pythonPassword:Warning: python-2.7.11 already installed, it's just not linked解决办法:sudo brew link --overwrite python

2016-07-25 09:16:19 4855

原创 【leetCode】House Robber II python实现

原题链接House Robber II实现原理解析 该题在House Robber的基础上让首位链接形成环,那么即表示第一个和最后一个不能同时被抢,则问题分解为House Robber(nums[0:len(nums)-1])和House Robber(nums[1:len(nums)]),两者中比较大的那个即为结果python代码实现class Solution(object): d

2016-06-19 21:25:46 1251

原创 【leetCode】House Robber python实现

House Robber原题链接House Robber实现原理解析 动态规划实现python代码实现class Solution(object): def rob(self, nums): """ :type nums: List[int] :rtype: int """ if len(nums) ==

2016-06-19 02:20:41 905

原创 【leetCode】Binary Tree Level Order Traversal python实现

Binary Tree Level Order Traversal原题链接Binary Tree Level Order Traversal实现原理解析 层次遍历即可python代码实现class Solution(object): def __init__(self): self.result = [] def levelOrder(self, root):

2016-06-19 01:41:14 1021

原创 【leetCode】Binary Tree Zigzag Level Order Traversal python实现

Binary Tree Zigzag Level Order Traversal原题链接Binary Tree Zigzag Level Order Traversal实现原理解析 层次遍历即可,对于偶数层的做反向python代码实现import copy# Definition for a binary tree node.# class TreeNode(object):# d

2016-06-19 01:18:58 1264

原创 【leetCode】Sum Root to Leaf Number python实现

Sum Root to Leaf Numbers原题链接Path Sum II实现原理解析 该题使用深度搜索找到所有路径,然后把每个路径下的数加起来即可python代码实现import copyclass Solution(object): def __init__(self): self.paths = [] self.path = []

2016-06-18 22:40:32 516

原创 【leetCode】Path Sum II python实现

Path Sum II原题链接Path Sum II实现原理解析 该题使用深度搜索实现即可python代码实现import copy# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.le

2016-06-18 21:54:06 1586

原创 【contains-duplicate】leetCode python实现

原题链接contains-duplicate实现原理解析 该题比较简单,比较去重后的长度和原始长度是否一致即可python代码实现class Solution(object): def containsDuplicate(self, nums): """ :type nums: List[int] :rtype: bool

2016-06-18 17:16:09 612

原创 【leetCode】 Balanced Binary Tree python版实现

原题链接Balanced Binary Tree实现原理解析 该题比较简单,主要思想是递归的判断左右子树的高度不大于1即可,注意异常处理python代码实现class Solution(object): def isBalanced(self, root): """ :type root: TreeNode :rtype: bool

2016-06-18 16:56:00 1363

原创 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?思路:爬楼梯的问题,斐波那契数列,应该见过很多回了

2014-12-01 23:48:41 579

原创 Plus One

题目:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.思路:简单的大数加法class

2014-12-01 23:35:01 515

原创 Valid Palindrome

code:class Solution: # @param s, a string # @return a boolean def isPalindrome(self, s): zheng = '' fan = '' for i in s: if (i >= 'a' and i = 'A' and

2014-12-01 21:59:26 523

原创 Find Minimum in Rotated Sorted Array

Find Minimum in Rotated Sorted Array

2014-12-01 21:04:53 682

原创 Python的异常处理

Python中的异常类型分如下几种:1、NameError:尝试访问一个未申明的变量>>>  vNameError: name 'v' is not defined2、ZeroDivisionError:除数为0>>> v = 1/0ZeroDivisionError: int division or modulo by zero3、Synt

2014-11-29 22:03:13 868

原创 Python多线程

首先看一个简单的没有线程支持的情况下的顺序执行:from time import sleep, ctimedef loop0(): print('start loop 0 at:', ctime()) sleep(4) print('loop 0 done at:', ctime())def loop1(): print('start loop 1

2014-11-29 21:39:52 1130

原创 Python 列表元素去重的3种方法

以前面试的时候遇到过这个问题,今天闲着整理了以下,大概想到以下三种方法。class delect_duplicate: def method_set(self,mlist): print("method_set is called") print("before process mlist is", mlist) l2 = set

2014-11-29 17:07:06 2289 1

原创 C++ string类的简单实现

#include #include using namespace std;class String{public: String(const char* str = NULL); String(const String &other); String & operator=(const String &other); ~String();protected:privat

2014-10-14 20:19:17 968

原创 Path Sum

Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree and sum

2014-10-05 23:17:58 773

原创 Populating Next Right Pointers in Each Node II

Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution still work?Note:You may only use constant extr

2014-10-05 22:12:22 684

原创 Binary Tree Level Order Traversal II

Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree {3,9,20,#,#,15,7},

2014-10-05 21:18:11 902

原创 Maximum Depth of Binary Tree

Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.点击打开原题链接这个题剑指offer里也有,简单的递归即可,代码很清晰:

2014-10-05 20:30:44 770

原创 4Sum_leetCode

Given an array S of n integers, are there elements a,b, c, and d in S such that a + b +c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:Elements

2014-10-05 16:34:48 746

原创 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 elements from B

2014-10-05 16:16:25 455

原创 Subsets

Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.For example,I

2014-10-03 19:56:11 890

原创 Unique Paths

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the bo

2014-10-03 14:16:28 609

原创 Decode Ways

//下述算法应该是对的,不过超时// class Solution // {// public:// int numDecodings(string s) // {// if (s.length() == 0)// {// return 0;// }// else if (s.length() == 1)// {// if (s ==

2014-10-03 12:53:14 713

原创 Binary Tree Level Order Traversal

Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,9,20,#,#,15,7}, 3 / \ 9 20 /

2014-10-03 10:52:08 508

原创 Remove Duplicates from Sorted List II

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5.Given 1->1->

2014-09-29 20:10:54 730

原创 Remove Duplicates from Sorted Array II

Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array A = [1,1,1,2,2,3],Your function should return length = 5, and A is now [1,1,2,2,3]

2014-09-29 19:11:47 452

原创 Sqrt(x)

Implement int sqrt(int x).Compute and return the square root of x.原题链接

2014-09-29 18:43:04 536

原创 Evaluate Reverse Polish Notation

Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1", "+",

2014-09-29 16:48:57 446

原创 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".Clarification:What constitutes a word?A sequence of non-space ch

2014-09-29 16:15:36 621

原创 求100的阶乘结果后面有多少个0(百度面试题)

这个题最简单的办法就是对每个乘数

2014-09-29 10:55:20 5782

原创 快速排序简单实现

快速排序是C.R.A.Hoare于1962年提出的一种划分交换排序。它采用了一种分治的策略,通常称其为分治法(Divide-and-ConquerMethod)。该方法的基本思想是:1.先从数列中取出一个数作为基准数。2.分区过程,将比这个数大的数全放到它的右边,小于或等于它的数全放到它的左边。3.再对左右区间重复第二步,直到各区间只有一个数。 虽然快速排序称为分治法,但分

2014-08-21 13:57:49 826

原创 逆向打印链表

递归实现,很简单,直接贴代码

2014-08-21 10:54:51 602

原创 《UNIX环境高级编程》第二版源码在Ubuntu下的编译

《UNIX环境高级编程》第二版源码在Ubuntu下的编译

2014-05-08 19:42:32 2358

转载 ORACLE用户介绍

ORACLE用户介绍昨天朋友在群里询问,EMPLOREE这张表在那里,,怎么查询不到,,,,后面告诉他,不同的表属于不同的用户,要查看表,最好是先用该用户登入进去,,或者是 用户.表名 ,朋友用SCOTT用户登入,,,而那张表是在HR用户下,所以,结果显而易见帮朋友解决问题的同时,,顺便复习了一下ORACLE的用户知识,,,,要知道,ORACLE10G里面有很多默认帐户,一些是系统本身

2014-05-08 02:09:22 2445

Android蓝牙通信代码

Android和HC05蓝牙模块通信代码

2015-03-23

android触摸位置显示

android触摸位置显示,详情见博客http://blog.csdn.net/hongkangwl/article/details/19162883

2014-02-13

STM32编码器程序

STM32 编码器 程序 亲测可用,串口输出

2014-01-06

经典常用ALLEGRO16.3的PCB库

经典常用ALLEGRO16.3的PCB库

2013-11-12

串口通信的类,非常好用

串口通信的类,非常好用

2013-10-09

线性表链式存储结构C语言实现

线性表 链式存储结构 C语言实现 VC6.0

2013-10-04

线性表顺序存储C语言实现

数据结构 C语言 线性表 顺序存储 DEV 代码

2013-10-04

ubuntu下的dnw安装包

ubuntu下的dnw安装包,绝对可用,安装后直接运行sh文件即可

2013-09-16

人民银行招聘考试复习资料计算机类

人民银行招聘 考试 复习资料 计算机类 淘宝买30大洋买的 无偿献给大家

2013-08-27

PUMA560基于Matlab系统仿真

PUMA560 Matlab 系统仿真 测试通过

2013-08-27

MAG3110代码基于stm32

MAG3110 代码 基于stm32 亲测通过

2013-08-25

-LPC1788-SDK Example V1.0 Beta version LPC1788例程

-LPC1788-SDK Example V1.0 Beta version LPC1788例程

2013-08-23

STM32 DMP MPU6050

STM32 DMP MPU6050 测试成功

2013-08-20

平衡小车MPU6050

MPU6050 平衡小车 segway 调试通过

2013-08-17

STM32 MPU6050

STM32 MPU6050 代码调试通过

2013-08-17

Linux_C函数库参考手册_目录

Linux_C 函数库 参考手册_ 目录 嵌入式

2012-10-22

STM32开发指南V1.0 库函数版本

STM32 开发指南 库函数版本

2012-10-22

空空如也

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

TA关注的人

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