自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(70)
  • 资源 (9)
  • 收藏
  • 关注

原创 std::thread 的并发测试

std::thread 的并发测试,测试两方面的性能:1 并发同步锁的最优位置2 并发最优线程数量直接上代码:void Ticket::Sell(const int tickets){ this->tickes = tickets; clock_t start, end; start = clock(); vector<std::thread> threadLst; for (int i = 0; i < 36; ++i) { threadLs

2021-01-12 11:41:06 270

原创 QMap 之 swap 特性

QMap<int, int> mp1; mp1.insert(1,2); mp1.insert(2,3); QMap<int, int> mp2; mp2.swap(mp1); qDebug()<<mp1.size(); mp2.clear(); qDebug()<<mp1.si...

2019-08-30 09:53:04 2023 1

原创 Android抽奖实现

第一章:实现简易抽奖1.1 实现步骤1.2 程序示例第一步:TextView lotteryNumberTv = findViewById(R.id.lotteryView);第二步:Random random = new Random();第三步:int n = random.nextInt(100);第四步: lotteryNumberT...

2018-10-17 16:57:27 1111

原创 Android 实践一 hello world

  activity_main.xml :&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="ht...

2018-08-21 12:15:10 177

原创 初识Android第一坑,预览不可见

&lt;resources&gt; &lt;!-- Base application theme. --&gt; &lt;style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar"&gt; &lt;!-- Customize your theme here. --&gt; ...

2018-08-20 18:18:45 222

原创 vs 汇编输出到控制台

 代码写到一定量,了解下汇编先.386.model flat, stdcalloption casemap :noneincludelib kernel32.libincludelib masm32.libExitProcess PROTO STDCALL:DWORDStdOut PROTO STDCALL:DWORD.dataHelloWorld db "Hello...

2018-08-07 20:55:33 1424

原创 KMeans算法实现

闲得,自己琢磨了KMeans算法,记录下。原理网络一大把,不再累述# -*- coding: utf-8 -*-"""Created on Wed May 16 23:02:51 2018@author: mz"""import mathimport randomfrom sklearn import datasetsimport numpy as npimport copy...

2018-05-31 23:55:08 358

原创 Python 解析器模式

# -*- coding: utf-8 -*-"""Created on Thu Mar 29 19:26:13 2018@author: mz"""class Context(object): def SetContect(self, rhs): self.context = rhs def GetContext(self): ret...

2018-03-29 19:58:14 390

原创 Python 访问者模式

# -*- coding: utf-8 -*-"""Created on Thu Mar 29 16:52:56 2018@author: mz"""class Aggregate(object): def __init__(self): self._elmlst = [] def Attach(self, elm): sel...

2018-03-29 19:25:27 203

原创 Python 迭代模式

# -*- coding: utf-8 -*-"""Created on Thu Mar 29 11:43:05 2018@author: mz"""class Iterator(object): def Next(self): pass def HasNext(self): pass def First(self): ...

2018-03-29 15:28:31 382

原创 Python 建造者模式

# -*- coding: utf-8 -*-"""Created on Thu Mar 29 10:19:38 2018@author: mz"""class Director(object): def Build(self, builder): builder.BuildFloor() builder.BuildWindow...

2018-03-29 11:00:20 306

原创 Python 享元模式

# -*- coding: utf-8 -*-"""Created on Wed Mar 28 20:41:17 2018@author: mz"""class Share(object): def __init__(self): self.d = {} def Attach(self, key, value): if key...

2018-03-28 20:55:32 168

原创 Python 原型模式

# -*- coding: utf-8 -*-"""Created on Wed Mar 28 19:41:57 2018@author: mz"""from copy import copy, deepcopyclass Prototype(object): def Clone(self): pass def DeepClone(sel...

2018-03-28 20:33:21 212

原创 Python 观察者模式

# -*- coding: utf-8 -*-"""Created on Wed Mar 28 18:50:47 2018@author: mz"""#observerclass Boss(object): def __init__(self): self.obj = []; def Attach(self, employee): ...

2018-03-28 19:40:11 166

原创 Python 模板方法

# -*- coding: utf-8 -*-"""Created on Tue Mar 27 17:08:14 2018@author: mz"""class Template(object): def Excute(self): self.ReadyRead() self.ReadyWrite() def Read...

2018-03-27 17:14:49 293

原创 Python 外观模式

# -*- coding: utf-8 -*-"""Created on Tue Mar 27 16:56:43 2018@author: mz"""class Facade(object): def TradeWar(self): a = ASubject() b = BSubject() c = CSubject() ...

2018-03-27 17:06:48 210

原创 Python 单例模式

# -*- coding: utf-8 -*-"""Created on Mon Mar 26 19:40:24 2018@author: mz"""import threadingclass Singleton(object): _instance_lock = threading.Lock() def __init__(self): pass...

2018-03-27 11:54:44 969

原创 Python 代理模式

# -*- coding: utf-8 -*-"""Created on Mon Mar 26 19:17:20 2018@author: mz"""class Person(object): def ShowLove(self): passclass Girl(Person): def ShowLove(self): pass...

2018-03-26 19:34:49 128

原创 Python 命令模式

# -*- coding: utf-8 -*-"""Created on Mon Mar 26 17:17:02 2018@author: mz"""class ICommand(object): def __init__(self, rhs): self.rcv = rhs def Excute(self): passc...

2018-03-26 18:51:23 329

原创 Python 备忘录模式

Created on Sun Mar 18 00:30:51 2018@author: mz"""class Original(object): def save(self, state): print("save status: %s" %(state)) self.__status = state def get(se...

2018-03-18 00:49:07 263

原创 Python 适配器模式

# -*- coding: utf-8 -*-"""Created on Sun Mar 18 00:08:14 2018@author: mz"""class Target(object): def charge(self, adaptor): print("110V charge on 220V-&gt;") adaptor...

2018-03-18 00:14:35 250

原创 Python 抽象工厂

# -*- coding: utf-8 -*-"""Created on Sat Mar 3 21:56:58 2018@author: mz"""class IFactory(object): def ProduceB(self): pass def ProduceA(self): pass class...

2018-03-18 00:07:24 223

原创 Python 桥接模式

# -*- coding: utf-8 -*-"""Created on Thu Mar 15 12:01:02 2018@author: mz"""class Phone(object): def setGame(self, rhs): self.game = rhs class IOSPhone(Phone): def playGa...

2018-03-18 00:05:57 149

原创 Python 中介模式

# -*- coding: utf-8 -*-"""Created on Thu Mar 15 15:26:07 2018@author: mz"""class Mediator(object): def declare(self, msg, owner): self.__receiver.receive(msg) def ...

2018-03-18 00:04:16 287

原创 Python 之工厂方法

# -*- coding: utf-8 -*-"""Created on Sat Mar 3 21:42:27 2018@author: mz"""class IFactory(object): def Product(self): pass class IMethod(object): def DoAsIMean(self): ...

2018-03-03 21:55:14 1354

原创 QT 一信号对应多个槽函数

网络上搜索,大部分都废话连篇,直接上码测试此功能,结果显示OK。分别创建三个类,A,B,C。信号和槽绑定关系如下,一个信号绑定两个槽函数:A::A(QObject *parent) : QObject(parent){ B* b = new B(); C* c = new C(); connect(this, SIGNAL(Greet()), b, SLOT(Respo...

2018-02-26 23:48:58 13082 1

原创 Python 状态模式

# -*- coding: utf-8 -*-"""Created on Mon Feb 26 20:45:13 2018@author: mz"""class Status(object): def Handle(self, rhs): pass class AStatus(Status): def Handle(self, rhs): ...

2018-02-26 21:38:55 150

原创 Python 责任链模式实现

# -*- coding: utf-8 -*-"""Created on Mon Feb 26 11:45:46 2018@author: mz"""class Handler(object): def __init__(self): self.handler = None def Handle(self): pass ...

2018-02-26 14:15:52 233

原创 Python 装饰器模式

# -*- coding: utf-8 -*-"""Created on Sat Feb 24 11:37:17 2018@author: mz"""class Warrior: def __init__(self): self.attrack = 100 self.defend = 200 de...

2018-02-24 16:37:40 234

原创 Python 组合模式

# -*- coding: utf-8 -*-"""Created on Mon Feb 12 16:30:45 2018@author: mz"""class Component(object): def __init__(self, name): self.name = name self.child = [] ...

2018-02-12 17:28:52 285

原创 Python 策略模式

简单的用策略模式熟悉Python编程# -*- coding: utf-8 -*-"""Created on Mon Feb 12 15:48:29 2018@author: mz"""class Strategy(object): def action(self): pass class ConcreteStrategyA(Strategy...

2018-02-12 17:01:49 148

原创 外观模式C++实现

外观模式用于接口对接处理,为执行一个功能,需要不同的子系统分别执行对应功能。 外观类: #include "StdAfx.h"#include "Facade.h"#include "SubSystemA.h"#include "SubSystemB.h"#include "SubSystemC.h"#include "SubSystemD.

2018-02-12 09:14:55 123

原创 访问者模式C++实现

解释器模式,可理解的场景有,五线谱解读为哆啦咪发唆西多,翻译,名词解释等。可交叉解析,也可用一种解析器解析。待解析内容:  #pragma once#include &lt;iostream&gt;using namespace std;class InterContext{public:    InterContext(void);    ~InterContext(void);    Inte...

2018-02-11 15:05:38 219

原创 访问者C++实现

访问者用于数据结构稳定,访问者变化的情况。如游客访问景区,游客为变动的状态,各个景点是固定的数据结构。景点结构聚类Structure:Structure.h #pragma once#include "Element.h"using namespace std;#include &lt;vector&gt;class Structure{public:    Structure(void);   ...

2018-02-11 15:03:48 118

原创 迭代模式C++实现

迭代器用于遍历聚类,而不通过直接访问聚类方式获取聚类中的信息。聚类接口Aggregate.h: #pragma once#include "IIterator.h"class Aggregate{public:    Aggregate(void);    virtual ~Aggregate(void);    virtual IIterator* CreateIterator(void) = ...

2018-02-11 15:01:45 2444

原创 建造者模式C++实现

 建造者模式用于实现复杂的构建过程。由方法论+ 具体实施者产生最终产品。 比如导演导演电影,导演电影有一套方法论。然后由各不同的演员演绎,各演员能演绎出不同的风格,最终产出一部电影。导演类: #include "StdAfx.h"#include "Director.h"Director::Director(void){}Director::~Director(void){}void Direct...

2018-02-11 14:59:51 121

原创 享元模式C++实现

 享元模式主要用于节约内存开销。可看成工厂+单例模式的结合。享元类: #pragma onceclass Share{public:    Share(void);    virtual ~Share(void);        virtual void Operation(void) = 0;}; 具体共享类: #include "StdAfx.h"#include "ConcreteShare...

2018-02-11 14:57:48 313

原创 原型模式C++实现

原型模式就是对本身进行克隆。克隆完成后,各自独立,互不影响。 原型类: #include "StdAfx.h"#include "Prototype.h"Prototype::Prototype(void)    : m_age(0){}Prototype::~Prototype(void){}Prototype* Prototype::C...

2018-02-11 14:54:42 112

原创 模板方法C++实现

模板方法提供了固定方式的实现模板,内部真实实现进行封装,提供统一的外部接口给外部调用。外部不需要知道其真实实现方式。 模板方法就是方法论,方法论类: #pragma onceclass AbstractClass{public:    AbstractClass(void);    virtual ~AbstractClass(void);    virtual void Operation1(v...

2018-02-11 14:46:50 843

原创 观察者模式C++实现

   观察者模式用于当一方发生变化,触发多个同类型的事物同事发生变化的情况。如领导进出入办公室,各同事的不同反应。股市上涨,不同年龄、性别的操作者的买卖习惯等。 观察者类: #pragma onceusing namespace std;#include &lt;vector&gt;#include "MyObject.h"class Ob...

2018-02-11 14:41:56 169

std::thread 并发测试

测试多并发的性能及同步

2021-01-12

VTK+VS2017 安装配置.docx

VTK+VS2017+ CMAKE 安装配置本资料为VTK用Cmake进行编译,并生成工程的Demo文档,新手入门可参考

2020-05-08

opencv_3rdparty-ippicv-master_20191018.zip

本资源为OpenCV4.3.0 CMAKE所需用的ippicv文件。亲测可用。将对应的文件放到编译日志需要的路径即可

2020-05-08

汇编实例总结

自学过程很痛苦,入门级文档,共勉。 实例均经MASM编译通过

2015-10-22

VC++和Matlab混编源码

前段时间上传了VC++和Matlab混编的技术文档,现在再共享下代码,在本机运行成功的。 在调试代码前,务必先配置好VC++的 include files 和library files 的Matlab相应路径

2012-11-03

VC++和matlab混编的两种方法

VC++和Matlab混编,用于图像处理和数据分析,都是编译运行成功后的总结的文档。采用了两种方式,COM组建混编和Matlab引擎混编。第二种是网上的实例,直接拷贝过来,编译成功,一并总结了。大家共勉

2012-10-29

VC++ CFormView 界面入门

本人刚开始学习VC++,属于菜鸟级别,所以此文档适合刚刚学习VC++,大家共勉了

2012-10-29

SVN代码管理

SVN+TortoiseSVN 实现局域网代码管理

2012-10-29

SQL查询解析XML

采用SQL常规语句查询解析XML获取数据信息

2012-07-27

空空如也

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

TA关注的人

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