- 博客(26)
- 资源 (25)
- 收藏
- 关注
原创 C++ 可变参数模板
C++ 可变参数模板flyfishC++98版本不支持 ,C++11版本以上支持 Arguments 是参数包(Parameter pack) 类 classname 可以接受可变参数个数template<typename... arg> class custom_tuple {};custom_tuple<> c1;custom_tuple<int> c2;custom_tuple<fl
2017-07-29 10:31:02 405
原创 TensorFlow - 求导
函数flyfish定义域是关于输入的上域是关于输出的值域实际上是上域的一个子集上域是可能输出的集合值域则是实际输出的集合.[a, b] 这种形式表示的区间我们称作闭区间. (a, b) 这种形式表示的区间称作开区间. (a, b] 包括 b, 但不包括 a.像这样的区间称作半开区间. 反函数 函数f 的反函数, 并写作 f -1 如果 f (x) = y, 那么 f -1 (y) = x
2017-07-27 17:32:27 3193
原创 《编程之美》学而思 - 斐波那契数列(Fibonacci sequence)通项公式
《编程之美》学而思 - 斐波那契数列(Fibonacci sequence)通项公式flyfish等比数列通项公式 斐波那契等比数列公式推导 求一元二次方程 公比相等的两个等比数列各项各自相加之后,(a+b)不等于0,公比不变q1和q2 已知求a,b的值,求解二元一次方程组
2017-07-26 17:24:29 828
原创 外观模式(Facade Pattern)
外观模式(Facade Pattern)flyfish Provide a unified interface to a set of interfaces in a subsystem.Facade defines a higher - level interface that makes the subsystem easier to use. Wrap a complicate
2017-07-25 18:56:43 317
原创 迪米特法则(Law of Demeter)
迪米特法则(Law of Demeter)flyfish第一个例子 Dont Confuse Your Dog “If you want your dog to run, do you talk to your dog or to each leg? The moral : Change the state of a contained object only through the
2017-07-25 10:23:42 916
原创 MFC RichEdit
MFC RichEditflyfish资源窗体 增加Rich Edit 2.0 Control初始化BOOL CMFCApplicationApp::InitInstance(){//TODO: call AfxInitRichEdit2() to initialize richedit2 library.AfxInitRichEdit2();}头文件内容//控件绑定变量 CRich
2017-07-24 19:24:38 1158
原创 《编程之美》学而思 - 斐波那契数列(Fibonacci sequence)
《编程之美》学而思 - 斐波那契数列(Fibonacci sequence)flyfish另一个篇 利用矩阵求斐波那契数列int FibonacciRecursion(int n)//递归{ if (n > 2) return (FibonacciRecursion(n - 1) + FibonacciRecursion(n - 2)); else if (n==2)
2017-07-22 11:44:03 1191
原创 软件设计原则概述
软件设计原则概述flyfishDesign Principles(SOLID) Single Responsibility Principle(单一职责原则) Open Close Principle(开闭原则) Liskov’s Substitution Principle(Liskov替换原则) Interface Segregation Principle(接口隔离原则) Depen
2017-07-20 17:46:01 563
原创 里氏替换原则(Liskov's Substitution Principle)
里氏替换原则(Liskov’s Substitution Principle)flyfish解释 All the time we design a program module and we create some class hierarchies.Then we extend some classes creating some derived classes.We must m
2017-07-20 11:53:28 2231
原创 依赖倒置原则 (Dependency Inversion Principle)
依赖倒置原则 (Dependency Inversion Principle)flyfishA. High-level modules should not depend on low-level modules. Both should depend on abstractions. B. Abstractions should not depend on details. Details sh
2017-07-19 20:45:50 1075
原创 接口隔离原则(Interface segregation principle)
接口隔离原则(Interface segregation principle)flyfish一些对接口隔离原则的描述 Clients should not be forced to depend upon interfaces that they don’t use.Client不应该被迫依赖他们不使用的接口 Many client specific interfaces are bett
2017-07-19 19:35:17 1408
原创 策略模式(Strategy Pattern)
策略模式flyfish#include "stdafx.h"#include <iostream>#include <map>using namespace std;typedef enum StrategyType{ StrategyA, StrategyB, StrategyC}STRATEGYTYPE;class Strategy{public:
2017-07-19 14:55:01 489
原创 开闭原则(Open - Closed Principle)
开闭原则(Open - Closed Principle)C++ 描述 开闭原则坏的示例,,增加图形的时候GraphicEditor需要变化class Shape {public: int m_type;};class Rectangle :public Shape{ Rectangle() { Shape::m_type = 1; }}
2017-07-18 18:05:48 931
原创 CEF JS调用C++代码
CEF JS调用C++代码flyfishCEF supports the creation of JS functions with native implementations. Functions are created using the CefV8Value::CreateFunction() static method that accepts name and CefV8Handler
2017-07-18 11:54:15 2788 1
原创 单一职责原则(Single Responsibility Principle)
单一职责原则(Single Responsibility Principle)flyfish原文地址动机 在此背景中,一个职责是考虑因一个原因而改变,如果一个类,改变它有两个原因。我们应该根据功能性分成两个类。每个类处理一个职责 在未来当我们需要做出某种改变时,只需要修改该类就可以了。当我们去改变一个具有多个职责的类时,这个变动可能会影响该类的相关职责的其他功能单一职责是简单直观的原则,但是在实
2017-07-17 12:44:30 502
原创 《编程之美》学而思 - 最大公约数问题
《编程之美》学而思 - 最大公约数问题flyfishgreatest common divisor 最大公约数 Euclidean algorithm, or Euclid’s algorithm 欧几里德算法 common divisor 公约数 divisor 除数; 因子;主要方法 列举法:各自列出约数,再找出最大的公约数。 质因数分解法:两数各作素因数分解,然后取出共有的项乘起来。
2017-07-15 10:49:13 1054
原创 if else语句的优化
if else语句的优化flyfish假设假设类A的成员函数Process处理的type比较多,if else语句就比较多void A::Process(int type, std::string s){ if (type == 1) { Function1(s); } else if (type == 2) { Functio
2017-07-13 17:43:48 1284 1
原创 《编程之美》学而思 - 小飞的电梯调度算法
《编程之美》学而思 - 小飞的电梯调度算法flyifsh书中题目 亚洲微软研究院所在的希格玛大厦一共有6部电梯。在高峰时间,每层都有人上下,电梯每层都停。实习生小飞常常会被 每层都停的电梯弄的很不耐烦,于是他提出了这样一个办法: 由于楼层并不算太高,那么在繁忙的上下班时间,每次电梯从一层往上走时,我们只允许电梯停在其中的某一层。所有乘 客从一楼上电梯,到达某层后,电梯停下来,所
2017-07-12 16:25:11 1670
原创 《编程之美》学而思 - 金刚坐飞机 问题2的解法
《编程之美》学而思 - 金刚坐飞机 问题2的解法flyfish非书上解法 问题是乘客做到自己位置的概率 假设有1个人,1个金刚 ,2个座位 金刚做到自己位置的概率是 1 / 2,因为2个座位任他选假设有2个人,1个金刚, 3个座位 金刚做到自己位置的概率是 1 / 3 ,因为3个座位任他选假设有3个人,1个金刚, 4个座位 金刚做到自己位置的概率是 1 / 4, 因为4个座位任他选假设有n
2017-07-11 17:57:05 1093
翻译 成为更好开发者的10种方法
成为更好开发者的10种方法 10 Ways to Become a Better Developer翻译:flyfish原文地址1保持开放的思维(Keep an open mind)当你想完成一个伟大的事情,你必须意识到你不知道的事情。很多程序员带着“我想我知道的更好“的态度上路了,那是错误的。你必须在你的领域保持空杯思维,你就能在你的项目中学习到新的东西,从经验中学习,这样你会变得更好。否则你会
2017-07-08 17:50:13 445
原创 快速排序
快速排序flyfish#include "stdafx.h"#include <iostream>using namespace std;void Exchange(int &a, int &b){ int t = a; a = b; b = t;}int Partition(int A[], int p, int r){ int t = A[r];//
2017-07-08 15:48:20 314
原创 选择排序
选择排序flyfish#include "stdafx.h"#include <iostream>using namespace std;void SelectionSort(int A[], int len){ for (int i = 0; i < (len - 1); i++) { int subscript = i; int minimu
2017-07-07 13:50:29 269
原创 插入排序
插入排序flyfish#include "stdafx.h"#include <iostream> using namespace std;void InsertionSorting(int A[], int len){ for (int i = 1; i < len; i++) { int t = A[i]; int j = 0;
2017-07-07 13:49:23 258
原创 TensorFlow - 使用Protocol Buffers
VC下使用protobufflyfish1根据定义格式文件生成C++的头文件和生成文件E:\lib\protobuf\VS\Debug\protoc.exe为了路径简化,将addressbook.proto拷贝到E:\test 执行命令 protoc -I=E:\test –cpp_out=E:\test E:\test\addressbook.proto生成两个文件 addressbook.p
2017-07-03 14:15:32 1394
原创 TensorFlow - 编译Protocol Buffers
Windows下编译Protocol Buffersflyfish环境 CMake,Visual Studio 20131 CMake配置如图 支持xpCMAKE_INSTALL_PREFIX=../../../../install执行Config,General 最后生成如下 2 执行E:\lib\protobuf\VS 目录里的extract_includes.bat所需头文件会拷贝到此文
2017-07-03 10:42:49 593
C++ 开发SOAP服务端和SOAP客户端
2012-05-14
List Control 可编辑任意item文本,设置行高
2010-11-22
single-producer, single-consumer lock-free queue
2023-06-29
grpc编译安装所需文件
2018-07-31
Agg在Windows下的编译 字符集 Unicode
2017-12-27
一个曾经商业化的MFC library Ultimate Grid 现在免费提供
2017-10-17
TensorFlow inception-2015-12-05.tgz
2017-09-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人