自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

基础不牢,地动山摇!

  • 博客(65)
  • 资源 (39)
  • 收藏
  • 关注

原创 设计模式之二十三:解释器模式

解释器模式: 给定一个语言,定义了它的文法的一种表示,并定义了一个解释器,这个解释器使用该表示来解释语言中的句子。 Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in th

2015-06-30 16:28:46 889

原创 设计模式之二十二:享元模式(FlyWeight)

享元模式: 使用共享技术有效地支持大量细粒度的对象。 Use sharing to support large numbers of fine-grained objects efficiently. 这个设计模式和它的名字一样核心是为了共享代码。UML图: 主要包括:FlyWeight:声明了一个接口,通过这个接口所有的FlyWeight能够接受并作用于外部的状态。ConcreteFl

2015-06-30 10:37:44 1105

原创 LeetCode122:Best Time to Buy and Sell Stock II

Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one and

2015-06-30 09:01:15 781

原创 LeetCode15:3Sum

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: Elements in a triplet (a,b,c) must be i

2015-06-29 17:10:28 612

原创 设计模式之二十一:中介者模式(Mediator)

中介者模式:定义了一个对象,用来封装一系列对象的交互。中介者模式通过使对象之间不必显式引用降低了对象之间的耦合,并且允许你独立改变它们之间的交互。中介者模式就是将对象之间的交互封装在了一个独立的对象中,这个独立的对象用来控制对象之间的交互行为,所以这个对象还是蛮复杂的。UML类图: 主要包括:Mediator:定义了一个Colleague对象之间交互的接口。ConcreteMediator:实

2015-06-28 13:25:36 1310

原创 设计模式之二十:责任链模式(Chain of Responsibility)

感觉这个设计模式和组合模式一样是一种很巧妙的设计模式,在需要使用它的地方如果不使用这种设计模式代码会变的很复杂,但是这种设计模式的基本原理又是很简单的。责任链模式: 通过使多个对象都有机会来处理请求的方式避免了请求的发送者和接收者之间的耦合。将接收者组织成链式的结构这样可以将请求沿着这条链进行传递,直到有接收者对它进行处理。UML类图: 主要包括:Handler:定义了一个处理请求的接口,实现

2015-06-27 16:06:57 939

原创 设计模式之十九:命令模式(Command)

命令模式:将一个请求封装成一个对象,从而允许用不同的请求参数化客户,对请求进行排序或记录日志,并且支持撤销操作。UML图: 主要包括:Command:声明了一个操作的接口ConcreteCommand:绑定了一个Receiver和一个行为,通过相关联的Receiver对象实现了了execute方法。Client:创建一个ConcreteCommand对象并且设置了它的Receiver。in

2015-06-27 15:02:39 919

原创 LeetCode228:Summary Ranges

Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return [“0->2”,”4->5”,”7”].Credits: Special thanks to @jianchao.li.fighter for addin

2015-06-26 16:08:43 865

原创 LeetCode204:Count Primes

Description:Count the number of prime numbers less than a non-negative number, n.计算小于n的非负整数中素数的个数。 素数又称质数,是指只能被1和它自身相除的自然数。需要注意的是1既不是素数也不是合数。2是最小的素数。使用判断一个数是否是素数的函数,那么这个函数需要进行一轮循环,在给定的小于n中又要进行一轮循环。所以时

2015-06-25 17:00:20 737

原创 LeetCode95:Unique Binary Search Trees II

Given n, generate all structurally unique BST’s (binary search trees) that store values 1…n.For example, Given n = 3, your program should return all 5 unique BST’s shown below. confused what “{1,#,

2015-06-25 00:11:41 1720

原创 设计模式之十八:桥接模式(Bridge)

桥接模式: 将抽象部分和它的实现部分相分离开来,以使它们可以单独地变化。UML图: 主要包括:Abstraction:定义了抽象部分的接口,操作一个实现部分对象的引用。RefinedAbstraction:继承自抽象部分的类。Implementor:实现部分的接口。ConcreteImplementor:实现了Implementor定义的接口的具体类。C++代码如下:#include

2015-06-24 22:38:16 978

原创 LeetCode96:Unique Binary Search Trees

Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's. 1 3 3 2 1 \

2015-06-24 15:56:10 3290

原创 LeetCode120:Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle The minimum path sum from top to

2015-06-24 13:13:09 777

原创 LeetCode226:Invert Binary Tree

nvert a binary tree. Trivia: This problem was inspired by this original tweet by Max Howell: Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on

2015-06-23 23:47:35 960

原创 LeetCode64:Minimum Path Sum

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or right at any

2015-06-23 23:11:21 733

原创 LeetCode152: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 produ

2015-06-23 22:19:47 702

原创 LeetCode77:Combinations

Given two integers n and k, return all possible combinations of k numbers out of 1 … n.For example, If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4], ]

2015-06-23 21:45:27 823

原创 LeetCode53:Maximum Subarray

Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4],the contiguous subarray [4,−1,2,1] ha

2015-06-23 11:01:49 618

原创 LeetCode221:Maximal Square

Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following matrix:1 0 1 0 01 0 1 1 11 1 1 1 11 0 0 1 0

2015-06-18 22:53:12 3570 3

原创 LeetCode91:Decode Ways

A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the total nu

2015-06-18 18:17:39 2664

原创 LeetCode188:Best Time to Buy and Sell Stock IV

Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete at most k transactions.Note:You may no

2015-06-16 15:59:17 1517

原创 LeetCode123:Best Time to Buy and Sell Stock III

Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete at most two transactions.Note:You ma

2015-06-16 09:54:29 3233

原创 设计模式之十七:单例模式(Singleton)

单例模式:确保一个类只有一个实例化的对象并且提供了一个访问这个对象的方法。UML图:主要包括:Singleton(LoadBalancer):定义了一个操作唯一的对象的方法;负责创建和操作这个唯一的对象。C++中实现单例模式是通过静态成员变量和静态方法来实现。#include class Singleton{ public: /

2015-06-15 17:04:46 753

原创 LeetCode121:Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),

2015-06-15 10:47:40 666

原创 LeetCode70: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?设到第i台阶有A[i]那么到第1台阶有A[1]=

2015-06-14 23:12:43 862

原创 LeetCode213:House Robber II

Note: This is an extension of House Robber.After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This time

2015-06-13 11:14:36 2438

原创 LeetCode192: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

2015-06-13 09:20:18 824

原创 LeetCode63:Unique Paths II

Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively in the

2015-06-12 16:05:00 1215

原创 LeetCode62: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

2015-06-12 11:33:21 832

原创 LeetCode153:Find Minimum in Rotated Sorted Array

Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum element.You may assume no duplicate exists in

2015-06-11 17:03:29 597

原创 LeetCode36:Valid Sudoku

Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character '.'.A partially fille

2015-06-11 16:41:13 886

原创 string对象操作

标准string对象支持长度可变的字符串操作。使用它需要包含头文件,它位于std命名空间下。1.string对象的定义和初始化string s1; //默认构造函数,s1为空串string s2(s1); //将s2初始为s1的一个副本string s3("value"); //将s3初始为一个字符串字面值的副本string s4(n,'c'); //将s4初始为字符串'c'的n个副本需要注意

2015-06-11 13:26:37 773

原创 LeetCode179:Largest Number

Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.Note: The result may be very large,

2015-06-11 12:46:52 672

原创 LeetCode223:Rectangle Area

Find the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corner and top right corner as shown in the figure. Rectangle Area Assume that t

2015-06-10 23:39:40 1040

原创 LeetCode86:Partition List

Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the nodes in each of the

2015-06-10 16:19:57 605

原创 设计模式之十六:迭代器模式(Iterator)

迭代器模式: 提供了一种在不暴漏对象底层细节的情况下顺序访问聚合对象的方法。 Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.其实这个设计模式用的很多,但是设计的很少。因为stl中的迭代器就是这个模式的应用

2015-06-09 21:04:52 892

原创 设计模式之十五:组合模式(Composite)

组合模式: 将对象组合成树形结构来表示部分与整体的关系。组合模式让客户能将单个对象和组合对象统一对待。 Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objec

2015-06-09 19:16:16 841

原创 设计模式之十四:备忘录模式(Memento)

备忘录模式: 在不破换封装性的前提下,捕获一个对象的内部状态并将这个状态保存到对象外部,这样这个对象之后可以恢复到保存的状态。 Without violating encapsulation, capture and externalize an object’s internal state so that the object can be restored to this state la

2015-06-09 16:28:54 801

原创 LeetCode51:N-Queens

The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.![这里写图片描述](http://img.blog.csdn.net/20150609105847270)Given an integer n, return

2015-06-09 11:05:22 1115

原创 LeetCode31:Next Permutation

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible ord

2015-06-09 10:20:07 644

聊天室工程文件

基于完成端口实现的聊天室程序的工程文件,实现多个客户端之间的通讯。

2015-09-04

聊天室可执行程序

使用完成端口模型实现的聊天室可执行文件。可以支持多个客户端连接并通信。

2015-09-04

socket工程文件完成端口版本

socket通信的客户端和服务器端的工程程序,基于完成端口技术,实现了多个客户端向服务器端持续发送数据

2015-09-03

socket通信可执行程序完成端口版本

socket通信的客户端和服务器端的可执行程序,基于完成端口技术,实现了多个客户端向服务器端持续发送数据

2015-09-03

socket工程文件重叠IO完成例程

socket通信的客户端和服务器端的工程文件,基于重叠IO完成例程技术,实现了多个客户端向服务器端持续发送数据

2015-09-03

socket工程文件阻塞版本

socket通信的客户端和服务器端的工程文件,这个是阻塞的版本,实现了客户端向服务器端持续发送数据,但是只能一个客户端发送。

2015-09-01

socket通信

socket通信的客户端和服务器端的可执行程序,这个是阻塞的版本,实现了客户端向服务器端持续发送数据,但是只能一个客户端发送。

2015-09-01

socket通信基本版本

socket通信的客户端和服务器端的工程文件,这个是最基本的版本,实现了客户端向服务器端发送一次数据,然后接收数据再断开连接。

2015-09-01

socket可执行程序

socket通信的客户端和服务器端的可执行程序,这个是最基本的版本,实现了客户端向服务器端发送一次数据,然后接收数据再断开连接。

2015-09-01

FilesRenameSource.rar

对文件进行批量更改后缀名的工具,使用MFC进行开发,源代码

2015-08-21

FileRename.rar

对文件进行批量更改后缀名的工具,使用MFC进行开发

2015-08-21

AddContacts

批量添加联系人,对于有很多联系人需要添加时会很有用

2015-08-18

WordFrequency源码

词频统计的程序,可以根据url查询该网页中出现次数最多的前N个单词。

2015-08-18

WordFrequency

词频统计的可执行程序。可以统计一个网页中出现次数最多的前N个单词

2015-08-18

四则运算C++实现

使用逆波兰式的方式进行表达式求值。在控制台下可进行多组数据的输入处理。

2015-08-13

matrixModelView_mac.zip

模式视图变换的测试程序,可以通过在界面上调整参数直接预览结果

2015-07-28

matrixProjection

投影变换的例子,可以通过在界面上调整参数直接预览结果。

2015-07-28

matrixModelView.zip

模式视图变换的测试代码,可以在界面上调整参数预览结果。

2015-07-28

vim教程.pdf

vim中自带的教程,将它制作成了pdf格式,方便查看

2015-01-28

计算机图形学算法

计算机图形学课程中的算法实现,包括二维和三维图形中平移,旋转,缩放的实现,DDA,中点画线法,Bressenhanm算法绘制直线,多边形扫描算法和种子扫描线算法绘制多边形,还有一个使用opengl实现漫游的程序。

2014-09-05

TestCameraEye.rar

osg中获取漫游器操作场景时任一时刻相机的位置。博客地址:http://blog.csdn.net/u012501459/article/details/36895495

2014-07-04

GenerateBMP.rar

根据给定像素点的RGB值生成bmp位图。博客地址:http://blog.csdn.net/u012501459/article/details/36699735

2014-07-03

PixelColor.rar

读取图片中所有像素处的RGB值,输出到文件中。博客地址:http://blog.csdn.net/u012501459/article/details/36698033

2014-07-03

TestPng.rar

osg使用png或gif格式的图片实现透明效果。博客地址:http://blog.csdn.net/u012501459/article/details/36695977

2014-07-03

TestCone.rar

osg中圆锥的使用,包括一些参数设置。博客地址:http://blog.csdn.net/u012501459/article/details/36672487

2014-07-03

TestCamera

osg中相机参数设置无效的解决办法,原文博客地址:http://blog.csdn.net/u012501459/article/details/36666305

2014-07-03

MFCCompositeViewer.rar

MFC中使用多窗口的例子。OSG自带的例子有使用MFC的,也有使用多窗口的,但是将两者简单结合在一起会出现问题,这个是解决了问题的代码。

2014-01-06

log4plus_x64_vs2008.rar

自己编译的64位的可以在VisualStudio 2008中使用的log4cplus的bin,lib,include文件。

2013-12-31

log4cplus_x86_vs2008.rar

自己编译的32位的可以在VisualStudio 2008中使用的log4cplus的bin,lib,include文件。

2013-12-31

glaux.h glaux.lib gluax.dll

glaux库的.h,.lib,.dll文件

2013-12-02

重构_改善既有代码的设计

2010版的《重构 改善既有代码的设计》,清晰度还可以。

2013-10-29

实现列表控件控制的属性页

实现列表控件控制的属性页,效果图见http://blog.csdn.net/u012501459/article/details/12994013

2013-10-24

socket工程文件重叠IO事件通知版本

socket通信的客户端和服务器端的工程文件,基于重叠IO事件通知技术,实现了多个客户端向服务器端持续发送数据

2015-09-02

socket通信可执行程序重叠IO事件通知版本

socket通信的客户端和服务器端的可执行程序,基于重叠IO事件通知技术,实现了多个客户端向服务器端持续发送数据

2015-09-02

socket通信可执行程序select版本

socket通信的客户端和服务器端的可执行程序,基于select的多路复用技术,实现了多个客户端向服务器端持续发送数据

2015-09-01

socket工程文件select版本

socket通信的客户端和服务器端的可执行程序,基于select的多路复用技术,实现了多个客户端向服务器端持续发送数据

2015-09-01

socket工程文件多线程版本

socket通信的客户端和服务器端的工程文件,这个是多线程版本的,实现了多个客户端向服务器端持续发送数据

2015-09-01

socket多线程版本

socket通信的客户端和服务器端的可执行程序,这个是多线程版本的,实现了多个客户端向服务器端持续发送数据

2015-09-01

空空如也

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

TA关注的人

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