自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(38)
  • 资源 (25)
  • 收藏
  • 关注

原创 (leetcode 99) Recover Binary Search Tree

Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is pretty straight forward. Could you devis

2016-02-01 15:49:25 587

原创 (leetcode #55)Jump Game

Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine i

2016-01-31 14:20:16 493

原创 (leetcode #10)Regular Expression Matching --递归法

Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input st

2016-01-28 12:06:20 670

原创 bind 返回(Can't assign requested address)

macbook上错误码是49()我绑定本地ip为255.255.255.255的时候出错(macbook),但是在linux下就正确,两个系统差别还是很大的解决方式是:只指定port,不要指定addr

2016-01-14 18:11:41 2999 1

原创 Singleton

#include class Person{private: static Person *singlePerson; Person() { std::cout<<"Create Person"<<std::endl; } ~Person() { std::cout<<"Delete Person"<<std::endl; } class CGarInner{//

2015-09-16 16:22:13 370

转载 ffmpeg ios 编译

参考:http://blog.csdn.net/cpluser/article/details/41282817编译环境*Mac OS 10.10 with Xcode5.1*以编译ffmpeg2.0版本为例 第一步: 下载build-ffmpeg.sh脚本        见链接第二步: 下载gas-preprocessor.pl脚本,

2015-04-02 14:34:37 713

原创 MacOSX 下wireshark 找不到interface

需要管理员权限打开。>> su>> 。。。。>> wireshark

2015-03-30 11:45:15 1792

转载 FFMPEG之TimeBase成员理解

From:http://blog.csdn.net/supermanwg/article/details/14521869FFMPEG的很多结构中有AVRational time_base;这样的一个成员,它是AVRational结构的typedef struct AVRational{    int num; ///    int den; ///} AVRation

2015-03-25 18:11:26 692

转载 FFMPEG 中dts和pts区别

CopyFrom:http://www.cnblogs.com/yinxiangpei/articles/3892982.html视频的显示和存放原理对于一个电影,帧是这样来显示的:I B B P。现在我们需要在显示B帧之前知道P帧中的信息。因此,帧可能会按照这样的方式来存储:IPBB。这就是为什么我们会有一个解码时间戳和一个显示时间戳的原因。解码时间戳告诉我们什么

2015-03-25 17:46:19 17144

原创 Linux 下TCP简单通信

//TCP   server#include#include#include#include#include#include#includeint main(){int fd;int fd1;struct sockaddr_in server_addr;struct sockaddr_in cl

2015-03-25 14:20:31 525

原创 FFMPEG 实时流媒体 客户端 大致流程

@property unsigned int bActivitying;@property AVFormatContext *pFormatCtx;//video@property struct AVCodecContext *pVideoCodecCtx;@property struct AVFrame *

2015-01-28 17:46:59 1191

原创 Topological Sort

#include#include#includeusing namespace std;class Node{public: Node(string data) { this->data=data; begin=0; finish=0; color="white"; p=NULL; } string data; int begin; int finish

2014-11-16 14:25:28 579

转载 通过rtsp获取H264裸流并保存到mp4文件

copy from   http://www.cnblogs.com/wenjingu/p/3990071.html

2014-11-13 12:22:18 18828

转载 Win Socket-Raw

// RawSock.cpp : Defines the entry point for the console application.//#define _WINSOCK_DEPRECATED_NO_WARNINGS#include "stdio.h"#include "winsock2.h"#include "ws2tcpip.h" //IP_HDRINCL is here

2014-09-09 17:23:09 3260

原创 Linux下UDP的简单例子

http://blog.sina.com.cn/s/blog_85882089010159bd.html客户端代码 client.c#include #include #include #include int main(int argc, char **argv){    int sockfd;    struct sockaddr_in se

2014-08-27 09:51:18 956

原创 Margin-Border-Padding

.margin-border-padding{ word-break:break-all; height:150px; background-color: yellow; margin: 0px 20px 30px 40px; border: 3px solid red; border-top-style:dashed; padding: 30px 20px 6px 1

2014-07-28 00:18:14 781

转载 内存对齐

from    http://blog.chinaunix.net/uid-10995602-id-2918694.html 在最近的项目中,我们涉及到了“内存对齐”技术。对于大部分程序员来说,“内存对齐”对他们来说都应该是“透明的”。“内存对齐”应该是编译器的 “管辖范围”。编译器为程序中的每个“数据单元”安排在适当的位置上。但是C语言的一个特点就是太灵活,太强大,它允许你干预“内存

2014-03-10 09:31:23 544

转载 VC++中delete和delete [] 的区别

我们通常从教科书上看到这样的说明:delete 释放new分配的单个对象指针指向的内存delete[] 释放new分配的对象数组指针指向的内存那么,按照教科书的理解,我们看下下面的代码:int *a = new int[10];delete a;        //方式1delete [] a;     //方式2肯定会有很多人说方式1肯定存在内存泄漏,是这样吗?

2014-03-10 09:29:57 769

转载 函数数组

#include#includeusing namespace std;int f1(char *);int f2(char *);int f3(char *);int f4(char *);int f5(char *);int (*ftk[5])(char *pStr)={ f1,f2,f3,f4,f5,};int f1(char *pStr){ cout<<p

2013-02-27 20:13:03 439

原创 一个简单的算法2

#include#include#include#includeusing namespace std;void main(){ float a=1.0f; cout<<(int)a<<endl; cout<<&a<<endl; cout<<(int&)a<<endl; cout<<boolalpha<<((int)a == (int&)a)<<endl

2012-12-11 22:25:34 497

原创 先序中序后序非递归遍历

#include#include#includeusing namespace std;class Node{public: Node(char data,Node *left,Node *right):data(data),left(left),right(right),flag(false){} char data; Node *left,*right;

2012-10-09 00:06:29 649

转载 连续乘积最大值

From  :  http://topic.csdn.net/u/20071203/19/136ed1e8-993a-498c-8b03-9caa6965c432.html?1405646013 #include int max(int i,int j,int k) //取最大数{if (j>i) i=j;if (k>i) i=k;return i;}

2012-09-20 13:25:28 649

原创 一些简单的算法

#include#includeusing namespace std;//汉诺塔void Hano(int n,char A,char B,char C){ if(n==1) { cout"<<C<<endl; } else { Hano(n-1,A,C,B); cout"<<C<<endl; Hano(n-1,B,A,C);

2012-09-04 00:47:44 499

原创 找最低公共父节点

树的算法,用递归很方便,尽管复杂度可能较高。using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1{ class Node { public Node left; public Node

2012-08-22 22:42:49 1000 1

原创 重写全局的new ,delete

#include #include #include #includeusing namespace std;void* operator new(size_t size){ std::cout<<"operator new:"<<size<<" Byte"<<endl; void* m= malloc(size); if(!m) cout<<"o

2012-08-15 22:59:37 1509

转载 寻找“捣乱分子”对[

转载:http://blog.csdn.net/wuzhekai1985/article/details/6718256 问题描述:多人排成一个队列,我们认为从低到高是正确的序列,但是总有部分人不遵守秩序。如果说,前面的人比后面的人高(两人身高一样认为是合适的),那么我们就认为这两个人是一对“捣乱分子”,比如说,现在存在一个序列:176, 178, 180, 170, 171

2012-07-30 22:10:10 1092

原创 扔骰子,求概率

n 个骰子的点数。把n 个骰子扔在地上,所有骰子朝上一面的点数之和为S。输入n,打印出S 的所有可能的值出现的概率。ANSWER:All the possible values includes n to 6n. All the event number is 6^n.For nf(S,n) = f(S-6, n-1) + f(S-5, n-1) + … + f(S-1, n-1)

2012-07-29 18:19:50 793

原创 将一个n元素的数组平均分为m分,是每组和相等,求最大m

网上流行的一道题目,题目如下。最终利用穷取法来递归解决的。一个整数数组,长度为n,将其分为m 份,使各份的和相等,求m 的最大值比如{3,2,4,3,6} 可以分成{3,2,4,3,6} m=1;{3,6}{2,4,3} m=2{3,3}{2,4}{6} m=3 所以m 的最大值为3using System;using System.Collections.Generic;

2012-07-28 17:46:19 5293

原创 8大基础排序

#includeusing namespace std;//bubble sortvoid BubbleSort(int *arr,int left,int right){ int temp; for(int i=right-1;i>=left;i--) { for(int j=left;j<=i;j++) { if(arr[j]>arr[j+1]) {

2012-07-28 11:57:55 594

原创 和为n 连续正数序列

static void Main() { int Sum = 33; int N = (int)(Math.Sqrt(2 * Sum) + 1.0); for (int i = 2; i <= N; i++) { int an = Sum -

2012-07-20 21:55:11 822

原创 球队比赛问题

public static void Main() { int[] order = new int[] { 5, 0, 4, 1, 6, 2, 3 }; int[,] pk = new int[,] { {0, 0, 0, 3, 4, 0, 6},

2012-07-17 15:40:03 1613

原创 编程之美 数组分割 (能打印具体数据)

#include#include#include#include#include#include#include#include#include using namespace std;int main(){ const int N=4; int a[N+1]={0,4,3,7,1}; int sum=0; for(int i=0

2012-07-16 23:07:35 532

原创 寻找最长等差数列

(时间复杂度有点高,但是不知道如何优化了,如何更好DP) using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Program { //从一个已经排好序的数组中找出

2012-06-26 18:30:18 1131

原创 计算前N个数字钟1的个数(编程之美2.4 1的数目)

#include "point.h"using namespace std;int CalcOneHelp(int);int CalcOne(int);int power(int ,int);int CalcOne(int N)//穷举法,比较傻瓜,思路简单,运算速度慢{ int sum=0; for(int i=1;i<=N;i++) sum+=CalcOneHelp(i)

2012-06-16 14:10:38 862

原创 字符串距离(编程之美题目) &&& 最长公共子序列(算法导论)

字符串的距离,编程之美上给了一个最简答的递归的做法,显示时间复杂度很高,要写的更好一些,就必须是DP,C++代码如下:题目如下:        许多程序会大量使用字符串。对于不同的字符串,我们希望能够有办法判断其相似程度。我们定义了一套操作方法来把两个不相同的字符串变得相同,具体的操作方法为:1. 修改一个字符 (如 把“a”替换为“b”)。2. 增加一个字符 (如把“abdd”变

2012-06-09 18:12:39 1206

原创 一个数组算法题,利用递归-回溯求解

给你10 分钟时间,根据上排给出十个数,在其下排填出对应的十个数要求下排每个数都是先前上排那十个数在下排出现的次数。上排的十个数如下:【0,1,2,3,4,5,6,7,8,9】举一个例子,数值: 0,1,2,3,4,5,6,7,8,9分配: 6,2,1,0,0,0,1,0,0,00 在下排出现了6 次,1 在下排出现了2 次,2 在下排出现了1 次,3 在下排出现了

2012-05-25 23:13:20 502

原创 策略模式 ----- 排序例子

策略模式定义了一系列的算法,并将每一个算法封装起来,而且使它们还可以相互替换。策略模式让算法独立于使用它的客户而独立变化。(原文:The Strategy Pattern defines a family of algorithms,encapsulates each one,and makes them interchangeable. Strategy lets the algorithm v

2012-05-07 15:12:19 1229

原创 二分查找

using System;using System.Collections.Generic;using System.Text;using System.Collections;using System.IO;using System.Threading;using System.IO.Ports;namespace Program{ class Program

2012-05-05 15:37:48 659

ms-dos 71f 操作系统

ms-dos 使用方法见:http://blog.csdn.net/fssssssss/article/details/25079713

2014-05-27

数据库-bbs-设计-基础

数据库 bbs 设计 基础 一看就会哦

2013-01-07

桌面 屏幕 录制 软件 视频

桌面 录制 软件 视频 占资源小 录制很清晰 很好用 强力推荐

2012-05-06

C#基础教程 英文版 CSharp How to Program.pdf

C#基础教程 英文版 CSharp How to Program.pdf 只有英文版,很基础的教程 不但能学习C#语言 还能提高英文水平

2012-04-29

北斗 两星 协议 解析

北斗 两星 协议 解析 主要的信息是:功率检测信息和定位信息 不光有协议,还有C#测试代码

2012-04-28

C# 控制台 提取GPS信息

C# 控制台 提取GPS信息 自己写的 很实用 主要是提取精度和纬度

2012-04-24

深入理解linux内核(中文版)

深入理解linux内核(中文版) 好书啊,好书

2011-12-22

understanding the linux kernel (英文版)

understanding the linux kernel 英文版 深入理解linux内核 绝对值得下载哦

2011-12-22

stm32 protel 电路图

stm32 protel 电路图 全部手动布线 比较密集 原理图也有

2011-12-11

C# 电子棋盘 绘图

C# 电子棋盘 绘图 串口 规模自己可选

2011-12-11

短波通信 程序 C语言

短波通信 程序 C语言 多个线程 经过测试可以正确运行

2011-12-07

HHARM2440文件系统

HHARM2440 文件系统 /usr/etc/rc.** 已经修改过了

2011-12-07

红黑树,实现,视频

利用图示实现了红黑树 视频模拟 有助于理解红黑树的算法 自己转红黑树,发现一只有问题 这才找到了这个视频 跟大家分享了

2011-12-01

通信PC机终端(含modem协议的实现)

通信PC机终端(含modem协议的实现) 自己保存使用,他人下载了也没啥用

2011-11-20

自组织网络及其路由技术

自组织网络及其路由技术 对整体进行了概括 对经典的算法进行了简要的分析 不是很难看懂

2011-11-06

msp430+nrf905

主函数里到没什么 主要是头文件封装的比较全 开发的时候直接用,不需要自己整理了

2011-11-06

HHARM2440_tech_manual-v1.5.pdf

HHARM2440_tech_manual-v1.5.pdf 还是比较全德 arm11哦

2011-11-06

MyDesign.ddb

pcb 电路图 包含138 芯片 包含373芯片 还有光敏电阻

2011-11-06

LAMP(php apache libxml mysql)

包含4个包 php apache libxml mysql 经典的linux下的web服务器包

2011-11-06

php-5.3.6.tar.gz

php包,linux下使用 版本是:5.3.6 通过命令解压:tar zxvf 。。。

2011-11-06

mysql-5.0.33.tar.gz

mysql包,linux下使用 版本是5.0.33 解压可:tar zxvf 。。。

2011-11-06

libxml2-2.6.19.tar.gz

lamp的一部分 libxml 版本是l2-2.6.19 格式是压缩包 可以解压tar zxvf ...

2011-11-06

apache_1.3.36.tar.gz

apache服务器(linux) 版本是1.3.36 是压缩包

2011-11-06

利用串口自发自收棋盘显示接受坐标(C# windows form)

串口serialport 棋盘的GDI绘制 利用vs2008C#编写

2010-11-28

usb接口转串口驱动

不错的,usb转串口,多用于笔记本电脑,尤其是嵌入式开发,或者串口调试

2009-05-28

空空如也

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

TA关注的人

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