自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Q_PROPERTY

Q_PROPERTY(type name           (READ getFunction [WRITE setFunction] |            MEMBER memberName [(READ getFunction | WRITE setFunction)])           [RESET resetFunction]           [NOTIFY

2015-07-16 17:50:22 377

原创 moc简介

moc介绍Meta Object Compiler简称moc,是 QT元对象的灵魂。moc在qmake阶段调用,生成moc_***.cpp,可以在makefile的链接。/****************************************************************************** Meta object code from reading

2015-07-16 17:26:39 1489

原创 qtobject简介

1.#define Q_OBJECT \public: \    Q_OBJECT_CHECK \    static const QMetaObject staticMetaObject; \作用:定义静态元对象staticMetaObject    virtual const QMetaObject *metaObject() const; \作用:重载QOBJECT类定义的虚

2015-07-16 14:05:52 346

原创 QtLog

#include "mainwindow.h"#include #include #include #define LOG_FILE_PATH "D:\\QtLog\\log.txt"static FILE* g_log_fp=0;static void closLogFile(){ fclose(g_log_fp);//main函数退出关闭日志文档}static

2015-07-11 00:30:52 1004

原创 求最大子数组

求一组数列的最大字数组,并求出位置,遍历一遍即可。#include #include #include using namespace std;const int numCount=20;int numArray[numCount]={11,3,-3,2,45,-6,5,-75,75,-1,-21,-77,-8,-2,-72,-14345,-3245,-55,-28,1111

2015-06-30 17:49:47 348

原创 升级用户聊天室

新增:用户注册,用户发言表情和字体颜色,在线用户统计,注销用户。主要有4个界面,代码如下:登陆界面:uesr loginfunction nameGetFocus(){ // alert("please input your password");document.frmLogin.user_name.focus();}function CheckValid(

2015-06-30 16:00:04 265

原创 简单的网络聊天室

分为三块:登陆界面,主界面,刷新界面,发送界面。(1)登陆界面uesr login welcom to chatting room input your nickname (2)主界面<?phpsession_start();// $user_name=$_SESSION["user_name"]=$_POST[

2015-06-29 21:14:55 386

原创 (leetcode)Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo

2015-06-29 21:12:18 265

原创 分治法进行排序

#include #include using namespace std; std::vector v1;std::vector v2;int numArray[5]={8,21,66,158,15};void merge(int * num,int begin,int mid,int end){// 对两个分治的数组进行何合并 int temp1=begin;

2015-06-22 22:04:13 293

原创 求1-n中数字出现的次数

求1~n 中数字出现的次数,如1-852  中1出现的次数,符合条件的有,1,,1,1,12,13,14,。。。。。。参考《编程之美》,略有修改,扩展到可以求任意数字出现的次数,也可以求出现0的次数。直接上代码:#include  using namespace std; const int needCountNum=9;int countNum1(int num){ int

2015-06-22 19:15:13 468

原创 leetcode(2)add two numbers

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link

2015-06-22 00:32:34 229

原创 重载全局new/delete具体实现内存检测

按照上面转载的文章的思路,只是小小的实现了一下。还有很多不足,等到有想法的时候再修改。#include #include using namespace std;template class smartPtr{public: smartPtr(T *ptr):_ptr(ptr),useCountPtr(new int(1)){ } smartPtr(const sm

2015-06-21 23:13:48 283

转载 重载全局new/delete实现内存检测

原文地址:http://blog.csdn.net/hzyong_c/article/details/5949314下面介绍用重载new/delete运算符的方式来实现一个简单的内存泄露检测工具,基本思想是重载全局new/delete运算符,被检测代码调用new和delete运算符时就会调用重载过的operator new和operator delete,在重载的operator ne

2015-06-21 23:11:59 343 1

原创 智能指针的简单实现

智能指针:它的一种通用实现方法是采用引用计数的方法。智能指针将一个计数器与类指向的对象相关联,引用计数跟踪共有多少个类对象共享同一指针。有两种实现方法,本例简单的实现了智能指针。#include #include using namespace std;template class smartPtr{public: smartPtr(T *ptr):_ptr(ptr),useCoun

2015-06-21 14:59:31 248

原创 插入排序

使用for循环,写的#include using namespace std;const int arrayNum=10;int myNums[arrayNum]={3,24,4,1,4,5,667,3,3,9};void insertSort(int *nums){for (int i = 1; i < arrayNum; ++i){ int tempNum=nums[i]

2015-06-20 23:32:49 285

原创 全排列实现

实现任意数组的全排列,可重复。#include #include using namespace std;int numArray[4]={1,1,0,1}; void permutation(int *nums,int start,int end){ if (start==end) { /* code */ for (int i = 0; i < 4; ++i

2015-06-19 22:54:12 229

原创 leecode(1)Two Sum

Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, whe

2015-06-19 18:27:57 256

原创 遍历网格

1,11,22,1 2,23,13,3从(1,1)到达(3,3),下面为解决方法,使用了递归的方法,也可以使用栈的方法。类似,只不过需要掌握好进出栈就可以了。#include #include using namespace std;const int rowCount=3;//行数和列数const int colomCount=1;int stepCount=-1;//路径数目

2015-06-19 18:22:16 2015

原创 网络编程基础(1)

1.TCP/IP:四层协议,链路层(底层硬件设备,网卡,驱动程序),网络层(ip协议),运输层(TCP/UDP,两台主机之间通信),应用层(FTP/SMTP)。   UDP面向无连接,传输速率较快。TCP 面向有链接,传输安全。C/S模型面向可靠连接,双方必须使用各自IP和端口进行通信。客户端和服务端可随意指定。服务端在特定的端口侦听客户端的连接请求。http协议端口为80,FTP端口协议

2015-04-24 15:26:48 264

空空如也

空空如也

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

TA关注的人

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