自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

比不揪的编程世界

自小刺头深草里,而今渐觉出蓬蒿。时人不识凌云木,直待凌云始道高。

  • 博客(32)
  • 收藏
  • 关注

原创 mysql备份与恢复之mysqldump

测试环境,数据库名称为test1mysql> use test1;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> sho...

2018-08-24 15:56:36 167

原创 mysql8.0源码安装

本次安装系统环境为centos7.4,root用户 一、编译环境准备yum -y install wget cmake gcc gcc-c++ ncurses ncurses-devel libaio-devel openssl openssl-devel二、编译wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql...

2018-08-22 13:50:45 3133

原创 mysql8.0在多实例环境下配置主从复制

本次是在上一篇文章的多实例环境下进行安装的,系统环境为centos7.4,多实例启动后ps -ef|grep mysqroot 26606 1 0 Aug17 ? 00:00:00 /bin/sh /usr/local/mysql8/bin/mysqld_safe --defaults-file=/data/mysqldata/3307/my.cnf --u...

2018-08-20 15:24:30 1009

原创 centos7.4下mysql8.0多实例安装

mysql8.0的多实例安装与mysql5多实例安装是有一些差别的,网络上也没有相应的文章,我综合网上的方案进行了多实例的安装,本次安装的环境为centos7.4,root账号 一、从我的上一篇文章中,二进制方式安装好mysql8 二、准备多实例环境,这里只说一个实例的安装,多实例做相应的改动即可.mkdir -p /data/mysqldata/{3307/{data,tmp,binlo...

2018-08-17 14:52:34 3201 1

原创 centos7.4下二进制方式安装mysql8.0

使用root账号安装 一、预安装环境 yum install gcc gcc-c++ openssl openssl-devel libaio libaio-devel ncurses ncurses-deve yum -y install numactl二、准备mysql相关安装文件、环境 下载 wget https://cdn.mysql.com//Downloads/MyS...

2018-08-16 19:47:34 2020 1

原创 centos7.4下yum方式安装mysql8.0

安装环境为centos7.4 首先下载yum安装的镜像 wget https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm 安装 rpm -Uvh mysql80-community-release-el7-1.noarch.rpm yum install -y mysql-community-server ...

2018-08-15 14:30:33 788

原创 设计模式-目录

设计模式-目录 创建型设计模式 1、简单工厂 2、工厂方法 3、抽象工厂方法 4、单例 5、建造者结构型设计模式 6、原型 7、适配器 8、组合 9、外观 10、装饰 11、享元 12、代理行为型设计模式 13、策略 14、命令 15、解释器 16、责任链 17、迭代器 18、备忘录 19、中介者 20、状态 21、观察者 22、模板 23、...

2018-08-15 13:12:02 190

原创 设计模式之访问者模式

import java.util.ArrayList;import java.util.List;/** * 访问者模式 */public class Main { public static void main(String[] args) { Visitor visitor = new ConcreteVisitor(); List resu...

2018-08-15 11:27:59 135

原创 设计模式之模板模式

/** * 模板模式 */public class Main { public static void main(String[] args) { Template template = new TemplateContent(); template.printN(10); }}public abstract class Templ...

2018-08-15 11:19:18 134

原创 设计模式之状态模式

/** * 状态模式 */public class Main { public static void main(String[] args) { IState stateA = new StateA("A"); IState stateB = new StateB("B"); IState stateB1 = new StateB(...

2018-08-15 11:08:56 111

原创 设计模式之观察者模式

public class Main { public static void main(String[] args) { IntegerObjectObservable integerObjectObservable = new IntegerObjectObservable(); IntegerObjectObserver integerObjectO...

2018-08-15 10:51:10 104

原创 设计模式之中介者模式

/** * 中介者模式 */public class Main { public static void main(String[] args) { Mediator mediator = new Mediator(); mediator.notice("ObjectA"); mediator.notice("ObjectB"); ...

2018-08-15 10:38:07 116

原创 设计模式之备忘录模式

/** * 中介者模式 * @param <T> */public static void main(String[] args) { Map<String,String> stateA = new HashMap<String,String>(); stateA.put("a","1&quo

2018-08-15 10:24:20 103

原创 设计模式之迭代器模式

/** * 迭代器模式 */public class Main { public static void main(String[] args) { Integer[] a = {1,2,3,4,5}; ArrayIterator<Integer> dataIterator = new ArrayIterator<Integer&g...

2018-08-15 10:07:05 123

原创 设计模式之责任链

/** * 责任链 */public class Main { public static void main(String[] args) { Request request = new Request("hello"); RequestHandleA requestHandleA = new RequestHandleA(); R...

2018-08-14 11:35:46 106

原创 设计模式之解释器模式

/** * 解释器 */public class Main { public static void main(String[] args) { String context = "context"; AdvanceExpression advanceExpression = new AdvanceExpression(); Simpl...

2018-08-14 11:28:40 242

原创 设计模式之命令模式

/** * 命令模式 */public class Main { public static void main(String[] args) { CatReceiver catReceiver = new CatReceiver(); RunCommand runCommand = new RunCommand(catReceiver); ...

2018-08-14 11:00:12 447

原创 设计模式之策略模式

/** * 策略模式 */public class Main{ public static void main(String[] args) { Context ctx = new Context(new StrategyA()); ctx.doMethod(); ctx = new Context(new StrategyB())...

2018-08-14 09:05:24 110

原创 C语言之函数指针

今天写JAVA的设计模式文章时,想到C语言的函数指针可以复习一下,于是打开IDE,随手写一写。 函数指针其实就是直接定位了函数的内存地址,然后就可以调用了。 函数指针也可以作为参数进行传递,通常用于回调函数。#include <stdio.h> void hello(); void callback(void (*f)());int main(void) { ...

2018-08-11 16:53:10 151

原创 设计模式之代理模式

import java.lang.reflect.InvocationHandler;import java.lang.reflect.Method;import java.lang.reflect.Proxy;/** * 代理模式 */public class Main { public static void main(String[] args) { S...

2018-08-11 11:28:04 132

原创 设计模式之享元模式

/** * 享元模式 */public class Main { public static void main(String[] args) { ICat cat1 = FlyweighFactory.getFlyweight("cat1"); ICat cat2 = FlyweighFactory.getFlyweight("cat2"); ...

2018-08-11 10:22:11 116

原创 设计模式之装饰模式

/** * 装饰模式 */public class Main { public static void main(String[] args) { Cat cat = new Cat(); cat.run(); System.out.println("--------------------"); CatDecorat...

2018-08-11 10:12:30 155

原创 设计模式之外观模式

/** * 装饰模式 */public class Facade { private IServiceA serviceA; private IServiceB serviceB; private IServiceC serviceC; public Facade(){ serviceA = new ServiceA(); ...

2018-08-11 09:39:12 99

原创 设计模式之组合模式

/** * 组合模式 */public class Main { public static void main(String[] args) { Cat catParent = new Cat("cat0"); Cat catChild1 = new Cat("cat1");

2018-08-11 09:29:52 112

原创 设计模式之适配器模式

这个设计模式我们平时用的太多了,很多时候用到了都不知道,先看代码/** * 适配器 * 一个服务如果现有的方法不适应新的需求,可以写一个类进行适配,利用现有的服务进行扩展 */public class Main { public static void main(String[] args) { Animal animal = new Animal(); ...

2018-08-09 19:57:46 83

原创 设计模式之原型模式

其实这个设计模式就是我们通常说的对象拷贝,直接看代码吧/** * 原型设计模式 * 把一个有状态的对象复制出多个这种状态的对象 */public class Main { public static void main(String[] args) { Prototype prototype1 = new Prototype(); protot...

2018-08-09 19:53:40 99

原创 设计模式之建造者模式

如果我们创建一个实体类的时候,需要设置数据库环境,设置系统变量环境,设置用户自定义变量等多个步骤,可以在构造函数中去完成这些过程,但是如果把这些步骤全部都塞到一个构造函数中,有些不大好,比如有的子类可能只要其中的几个步骤,这样的话最理想的情况是这些设置步骤可选,怎么做呢,上代码了/** * 建造者设计模式 * 如果一个类的构建需要很多步骤,应该将步骤拆分开进行解耦 */public c...

2018-08-09 19:45:46 124

原创 设计模式之单例模式

在编程中,有时候只需要生成一个对象实例,比如你手机里的某个APP,如果已经打开,再点击并不会打开一个新的,而是把已经打开的那个窗口显示出来,这就是单例的精神。 好了,上代码/** * 单例模式 * 生成唯一模式 */public class Main { public static void main(String[] args) { //生成第一个实例 ...

2018-08-09 19:13:36 101

原创 设计模式之抽象工厂方法

如果看了前两篇文章,这个设计模式一样很简单,上代码/** * 抽象工厂方法 * 在工厂方法的基础上,每个工厂实例里不止一个接口方法,而是多个 * 这样做体现了产品簇的意义,将相关的产品放在同一个工厂里 */public class Main { public static void main(String[] args) { IAnimalFactor...

2018-08-08 16:42:53 133

原创 设计模式之工厂方法

还是太简单了,上代码/** * 工厂方法 * 在简单工厂上的基础上对工厂本身进行了封装,与简单工厂的区别就在于工厂是多态指定的 */public class Main { public static void main(String[] args) { IAnimalFactory blackAnimalFactory = new BlackAnimal...

2018-08-08 16:20:47 100

原创 设计模式之简单工厂

简单工厂设计模式太简单,直接上代码 “ /** * 简单工厂 * 简单工厂就是利用条件判断,生成需要的实例 */ public class Main {public static void main(String[] args) { ICat blackCat = SimpleFactory.create("BlackCat"); blackCat.eat(...

2018-08-08 16:09:09 118

原创 centos7 trac安装

测试

2018-08-07 17:23:08 526

空空如也

空空如也

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

TA关注的人

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