- 博客(32)
- 资源 (2)
- 收藏
- 关注
原创 Centos调试Core文件
Centos调试Core文件配置生成core文件[root@hadoop3 build]# ulimit -c0[root@hadoop3 build]# ulimit -c unlimited安装调试工具修改/etc/yum.repos.d/CentOS-Debuginfo.repo文件enable=1安装 debuginfo-install glibc-2.17-323.el7_9.x86_64调试命令[root@hadoop3 build]# gdb ./zero_array_
2021-04-08 17:18:42
695
原创 linux使用cmake编译文件
linux使用cmake编译.c文件gcc安装[root@hadoop3 ~]# yum install -y gcc gcc-c++ make automake cmake安装[root@hadoop3 ~]# yum search cmakeLoaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mir
2021-04-08 10:56:41
279
原创 设计模式之命令模式
命令模式The command pattern encapsulates a request as an object, thereby letting us parameterize other objects with different requests, queue or log requests, and support undoable operations.定义:命令模式将请求(命令)封装为一个对象,这样可以使用不同的请求参数化其他对象(将不同请求依赖注入到其他对象),并且能够支持请求(命
2021-03-26 10:21:02
216
1
原创 设计模式之享元模式(下)
享元模式享元模式在 Java Integer 中的应用public static void main(String[] args) { Integer i1 = 56; Integer i2 = 56; Integer i3 = 129; Integer i4 = 129; System.out.println(i1 == i2); System.out.println(i1.equals(i2)); System.out.println(i3
2021-03-25 13:44:44
99
原创 设计模式之享元模式(上)
享元模式flyweight design pattern enables use sharing of objects to support large numbers of fine-grained objects efficiently. A flyweight is a shared object that can be used in multiple contexts simultaneously. The flyweight acts as an independent object in e
2021-03-25 10:16:15
125
原创 设计模式之组合模式
组合模式Compose objects into tree structure to represent part-whole hierarchies. Composite lets client treat individual objects and compositions of objects uniformly.定义:将一组对象组织(Compose)成树形结构,以表示一种“部分 - 整体”的层次结构。组合让客户端(在很多设计模式书籍中,“客户端”代指代码的使用者)可以统一单个对象和组合对象的处
2021-03-23 10:24:51
140
原创 设计模式之门面模式
门面模式Provide a unified interface to a set of interfaces in a subsystem. Facade Pattern defines a higher-level interface that makes the subsystem easier to use.定义:门面模式为子系统提供一组统一的接口,定义一组高层接口让子系统更易用。 如A系统设计时,按照接口复用原则,划分接口A1, A2,A3。B系统需要多次调用A接口A1,A2,A3完成相应功
2021-03-22 10:25:05
115
原创 设计模式之适配器模式
适配器模式定义:An adapter allows two incompatible interfaces to work together. This is the real-world definition for an adapter. Interfaces may be incompatible, but the inner functionality should suit the need. The adapter design pattern allows otherwise incompa
2021-03-19 17:16:14
115
原创 设计模式之策略模式
策略模式定义: Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it定义一族算法类,将每个算法分别封装起来,让它们可以互相替换。策略模式可以使算法的变化独立于使用它们的客户端(这里的客户端代指使用算法的代码)。策略模式被广泛使用(1)如redis
2021-03-12 13:57:34
106
原创 设计模式之责任链模式
责任链模式Avoid coupling the sender of a request to its receiver by giving more than oneobject a chance to handle the request. Chain the receiving objects and pass therequest along the chain until an object handles it.定义将请求的发送和接收解耦,让多个接收对象都有机会处理这个请求。将这些接收对
2021-03-09 14:55:59
121
原创 设计模式之工厂模式
设计模式之工厂模式工厂模式分为三种更加细分的类型:简单工厂、工厂方法和抽象工厂。简单工厂模式案例:根据不同文件类型,解析配置文件,源代码如下:public RuleConfig load(String ruleConfigFilePath) { String ruleConfigFileExtension = getFileExtension(ruleConfigFilePath); IRuleConfigParser parser = null; parser = cre
2021-03-04 21:44:16
206
2
原创 设计模式之单例模式2
设计模式之单例模式2单例模式存在的问题单例对 OOP 特性的支持不友好单例会隐藏类之间的依赖关系单例对代码的扩展性不友好单例对代码的可测试性不友好单例不支持有参数的构造函数如何解决构造参数问题第一种解决思路是:创建完实例之后,再调用 init() 函数传递参数 。确保init函数调用,否则抛出系统异常。package com.hero.designpatten.singleton;/** * @description: Singleton * @date: 2021/3
2021-03-04 21:42:21
157
1
原创 设计模式之单例模式
设计模式之单例模式11.单例的定义单例设计模式(Singleton Design Pattern)理解起来非常简单。一个类只允许创建一个对象(或者叫实例),那这个类就是一个单例类,这种设计模式就叫作单例设计模式,简称单例模式。2.单例的用处从业务概念上,有些数据在系统中只应该保存一份,就比较适合设计为单例类。比如,系统的配置信息类。除此之外,我们还可以使用单例解决资源访问冲突的问题。3.单例的实现单例有下面几种经典的实现方式。饿汉式饿汉式的实现方式,在类加载的期间,就已经将 ins
2021-03-04 21:40:37
114
1
翻译 Java常用系统属性
Java常用系统属性官方文档: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.htmlKeyMeaning"file.separator"Character that separates components of a file path. This is “/” on UNIX and “\” on Windows."java.class.path"Path used to fi
2021-03-04 17:16:09
177
1
原创 log4j2 日志配置
log4j2滚动日志设置参考:https://www.cnblogs.com/yeyang/p/7944899.htmllog4j2.xml配置参数说明<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss,SSS}] [%p] - [%t] - %l - %m%n"/>日志打印参数:%p:日志级别%t:线程名称%c:日志消息所在类名%m:消息内容%M:输出执行方法%d:日期,%d{yyyy-MM-dd HH:mm:ss,SSS},输出
2021-02-23 13:52:53
916
原创 spark安装
spark安装1 安装scala安装scala 2.11.8版本,spark-2.3.2版本,分别解压到该目录下,并重命名[root@hadoop1 examples]# cd /usr/local/[root@hadoop1 local]# lsbin games hbase include lib64 nginx Python-3.8.0 sbin scala-2.11.8.tgz spark sqoop
2021-02-06 16:42:16
513
原创 spark安装
spark安装和使用1 安装scala安装scala 2.11.8版本,spark-2.3.2版本,分别解压到该目录下,并重命名[root@hadoop1 examples]# cd /usr/local/[root@hadoop1 local]# lsbin games hbase include lib64 nginx Python-3.8.0 sbin scala-2.11.8.tgz spark sqoo
2021-02-02 11:36:36
168
原创 hadoop fs使用
Hadoop FS使用1 Hadoop Shell命令FS ShellcatchgrpchmodchowncopyFromLocalcopyToLocalcpdudusexpungegetgetmergelslsrmkdirmovefromLocalmvputrmrmrsetrepstattailtesttexttouchz2 集群环境操作#启动hadoop[root@hadoop1 ~]# start-all.shStarting
2021-01-27 10:52:40
316
原创 centos7安装大数据平台
centos7安装大数据实验平台1 网络配置配置静态Ip[root@hadoop1 network-scripts]# cat ifcfg-ens160TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=noneDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noIPV6_
2021-01-26 00:06:08
873
原创 mybatis自定义类型转换器
###mybatis自定义类型转换器在开发权限系统时,需要存储某个角色对应的权限信息,权限信息通过,分割,填入权限的键值。例如数据库存储如下:类型转换器代码如下:import com.google.common.base.Strings;import org.apache.ibatis.type.BaseTypeHandler;import org.apache.ibatis.type.JdbcType;import org.apache.ibatis.type.MappedJdbcTypes
2020-12-31 13:46:16
702
原创 mybatis实现分页功能
###分页结果封装package com.maccura.upgrade.core.page;import java.util.List;public class PageResult { private int pageNumber; private int pageSize; private long totalSize; private int totalPages; private List<?> content; public int getPageNumber()
2020-12-31 13:45:18
146
原创 springboot restful统一响应请求格式
###restful接口统一返回值使用JsonResult返回请求接口,使用泛型填充返回数据结构。code代表返回值,既可以设置为Integer,也可以设置为String,取决于项目需要。通常,系统复杂可以使用String类型,标识出错的模块名称以及错误类型。系统简单直接使用Integer标识错误码即可。此处,封装两个函数,success和error。//JsonResult作为返回值public class JsonResult<T> { private Integer cod
2020-12-31 13:44:01
425
原创 linux c时间编程
嵌入式linux c时间编程时间类型Calendar Time 日历时间 从一个标准时间(1900年1月1日0点)到此时经过的秒数。 UTC/GMT UTC(Coordinated Universal Time)世界标准时间 即 GMT(Greenwich Mean Time)格林威治标准时间。常用时间函数(1) time ...
2018-06-01 08:52:22
1055
原创 linux c文件编程
嵌入式linux c文件编程(1)文件的打开操作,获取文件大小1.1 文件的打开可以使用fopen函数,该函数为:FILE *fopen(const char *path, const char *mode); 1.2 获取文件的大小获取文件的大小需要使用fseek定位文件位置指针到文件末尾,ftell 用于得到文件位置指针当前位置相对于文件首的偏移字节数,rewin...
2018-05-31 22:18:49
201
原创 shell中数组的简单使用
shell中数组的简单使用#!/bin/shfunction array_test(){ local array[0]=10 local array[1]="hello" echo "${array[0]}" echo "${array[@]}" echo "${#array[@]}"}function print_array(){ ...
2018-03-15 19:37:43
456
原创 C++ STL的使用(vector)
STL作为一种动态数组,常用的函数类成员函数如下:clear() 移除vector中所有数据,容器大小设置为0empty() vector是否为空,为空则返回truesize() 返回vector中元素的个数begin() 返回vector中第一个元素的迭代器end() 返回vector中最后一个元素的下一个e
2017-04-09 22:44:56
235
音视频开发进阶指南:基于android与ios平台
2018-12-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人