类:继承-1

#include <iostream> //类的三大特点:封装,继承,多态 class Player { public: int hp; }; class Moster1 { public: int id; int hp; int mp; int attack; void Attack(Player* player) { player->hp -= 10; } }; class Moster2 { public: int id; int hp; int mp; i
分类: 其他 发布时间: 11-10 23:53 阅读次数: 0

类:继承-2-访问权限

继承访问权限 #include <iostream> class A { public: int a; protected: int b; private: int c; public: int& GetC() { return c; } }; class B : public A { public: void f() { a = 1;//子类可以访问父类pulbic成员 b = 1;//子类可以访问父类protected成员 //c = 1;//不能直接
分类: 其他 发布时间: 11-10 23:53 阅读次数: 0

类:继承-3-访问冲突

#include <iostream> //命名冲突: int a;//全局变量a class O { void t() { a = 0;//全局变量a } }; class A { public: int a;//自己成员变量a void h() { this->a = 0;//访问自己成员变量a a = 0;//访问自己成员变量a ::a = 1;//访问全局变量a } void i(int a) { a = 0;//访问形参a this->
分类: 其他 发布时间: 11-10 23:52 阅读次数: 0

类:继承-4-静态成员

#include <iostream> // class A { public: static int a;//静态成员变量只有唯一一份 int b; }; int A::a = 0; class B : public A { public: int c; void f() { A::a = 1; } }; void main() { std::cout<<sizeof(A) <<std::endl;//4 std::cout<<sizeof(B) <<std::en
分类: 其他 发布时间: 11-10 23:52 阅读次数: 0

类:继承-5-继承方式

#include <iostream> // class A { public://访问权限 int a; protected://访问权限 int b; private://访问权限 int c; }; //继承方式 public继承 protected继承 private继承 //父类public成员 变为子类public 变为子类protected 变为子类private //父类protected成员 变为子类protected 变为子类prote
分类: 其他 发布时间: 11-10 23:52 阅读次数: 0

类:队列

#include <iostream> class Queue : private LinkList { public: void Enter(DATA data) { push_back(data); } void Quit() { erase(0); } DATA* GetHead() { return Get(0); } int Length() { return LinkList::Length(); } void Clear() {
分类: 其他 发布时间: 11-10 23:52 阅读次数: 0

类:继承-构造和析构的顺序

#include <iostream> //在继承体系下: //创建对象时:先调父类构造,再调子类构造 //销毁对象时:先调子类析构,再调父类析构 class A { int* p; public: A() { p = new int[10]; std::cout<<"父类构造\n"; } ~A() { delete [] p; std::cout<<"父类析构\n"; } }; class B : public A { int* b; public:
分类: 其他 发布时间: 11-10 23:51 阅读次数: 0

类:继承-父类有带参构造

#include <iostream> class A { int a; public: A(int a) { std::cout<<"父类构造\n"; } ~A() { std::cout<<"父类析构\n"; } }; class B : public A { public: //当父类只有带参构造的时候,子类必须写构造函数,并且用 //成员初始化列表为父类传参,告诉编译器调用父类的什么构造 B() : A(3) { std::cout<<"子类构造\
分类: 其他 发布时间: 11-10 23:51 阅读次数: 0

类:两个练习题

class A {public: unsigned short a; unsigned short b; void f() { std::cout<< std::hex<<//十六 a<<","<< b;} }; class B {public: unsigned int b; B(int bb):b(bb){} void f() {std::cout<< std::hex<< b;} }; void main() { B b(0x12
分类: 其他 发布时间: 11-10 23:51 阅读次数: 0

[LeetCode] 611. Valid Triangle Number

Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle. Example 1: Input: [2,2,3,4] Output: 3 Explanation: Valid c
分类: 其他 发布时间: 11-10 23:51 阅读次数: 0

JavaConcurrent

Concurrent Concurrent概述 java.util.concurrent包是JDK5开始提供的一套并发编程包,其中包含了大量和多线程开发相关的工具类,大大简化了Java的多线程开发,在高并发分布式场景下应用广泛。 要求: 掌握BlockingQueue、ConcurrentMap、CountDownLatch、ExecutorService、Lock; 了解CyclicBarrier、Exchanger、Semaphore、Atmoic。 BlockingQueue 本身是一种
分类: 其他 发布时间: 11-10 23:51 阅读次数: 0

django框架的基础知识点《陆》

==============================GenericAPIView+***Mixin============================ 对于数据的处理方式:5种: 查询多个====>list 查询一个====>retrieve 创建========>create 修改========>update 删除========>destroy heros==> list create listcreate hero===> retrieve==>1 update====>2
分类: 其他 发布时间: 11-10 23:51 阅读次数: 0

pagehelper调用mybatis报错java.lang.NoSuchMethodError:org.apache.ibatis.reflection.MetaObject.forObject

最近在升新的基础框架到spring cloud,启动时pagehelper报错,如下: java.lang.NoSuchMethodError:org.apache.ibatis.reflection.MetaObject.forObject(Ljava/lang/Object;Lorg/apache/ibatis/reflection/factory/ObjectFactory;Lorg/apache/ibatis/reflection/wrapper/ObjectWrapperFactor
分类: 其他 发布时间: 11-10 23:51 阅读次数: 0

Django安装遇到的问题

因为mac一般自带的有python解释器,如果重新安装了新的解释器,并且想默认使用的话,需要配置一下环境变量。 在使用python解释器的时候,可以用命令:which python 来确定当前使用的时那一个解释器。 在安装Django的时候,可以制定Django的版本:pip install django==1.11.4
分类: 其他 发布时间: 11-10 23:51 阅读次数: 0

hadoop 二次排序的一些思考

先说一下mr的二次排序需求: 假如文件有两列分别为name、score,需求是先按照name排序,name相同按照score排序 数据如下: jx 20 gj 30 jx 10 gj 15 输出结果要求: gj 15 gj 30 jx 10 jx 20 我们常见的实现思路是: 1. 自定义类,重写compare()比较逻辑(先比较name,name相同比较score),这样可以保证无论map端,还是reduce端的排序规则是我们需求的 当然,就这道题来说可以使用组合key,name_s
分类: 其他 发布时间: 11-10 23:51 阅读次数: 0

6、nginx的反向代理及缓存功能

ngx_http_proxy_module模块: server { listen server_name location / { proxy_pass http://192.16.3.7:80/; } } 格式: location /uri { rewrite proxy_pass http://back_server:port/newuri; } /uri --> /newuri http://www.magedu.com http://mysql.magedu.com proxy_con
分类: 其他 发布时间: 11-10 23:51 阅读次数: 0

编码转换,基础,copy

阅读目录 编码转换 基础补充 深浅拷贝 文件操作 一,编码转换   1. ASCII : 最早的编码. ⾥⾯有英⽂⼤写字⺟, ⼩写字⺟, 数字, ⼀些特殊字符.    没有中⽂, 8个01代码, 8个bit, 1个byte   2. GBK: 中⽂国标码, ⾥⾯包含了ASCII编码和中⽂常⽤编码. 16个bit, 2个byte   3. UNICODE: 万国码, ⾥⾯包含了全世界所有国家⽂字的编码. 32个bit, 4个byte, 包含了 ASCII   4. UTF-8: 可变⻓度的万国码
分类: 其他 发布时间: 11-10 23:51 阅读次数: 0

Django--URL(路由层)

一、django 静态文件配置 在配置文件中settings.py STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR,'static') ] /templates/timer.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <
分类: 其他 发布时间: 11-10 23:51 阅读次数: 0

又从头开始

做了个标,出了趟差,忘差不多了,重新重头开始,这次一定要一鼓作气连续看完。
分类: 其他 发布时间: 11-10 23:51 阅读次数: 0

ZOJ 4067 - Books - [贪心][2018 ACM-ICPC Asia Qingdao Regional Problem J]

题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4067 题意: 给出 $n$ 本书(编号 $1 \sim n$),第 $i$ 本书的价格为 $a_i$ 元。我现在手上有若干元钱,我买书的策略为从 $1 \sim n$ 依次买书,若遇到价格不超过我手上钱数的,我就买下,否则就跳过。 现在已知我买了 $m$ 本书,请求出我手上最多有多少元钱。 Sample Input 4 4 2 1 2 4 8 4 0 100
分类: 其他 发布时间: 11-10 23:51 阅读次数: 0