SpringBoot整合SpringBatch实用简例

SpringBatch主要是一个轻量级的大数据量的并行处理(批处理)的框架。

作用和Hadoop很相似,不过Hadoop是基于重量级的分布式环境(处理巨量数据),而SpringBatch是基于轻量的应用框架(处理中小数据)。

这里使用SpringBatch做了一个能跑的最简单例子,进行描述SpringBatch的基本作用。

如果需要进行深入学习,请详细参考阅读 https://docs.spring.io/spring-batch/4.0.x/reference/html/index.html ;英文不好的同学,请和我一样右键(翻译成中文查看)。

简单的技术栈 : SpringBoot + SpringBatch + JPA , 完整demo的项目地址 : https://github.com/EalenXie/springboot-batch

1 . 新建项目springboot-batch,基本的pom.xml依赖 : 

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>name.ealen</groupId><artifactId>springboot-batch</artifactId><version>1.0</version><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.0.1.RELEASE</version></parent><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-batch</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-jpa</artifactId></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><scope>runtime</scope></dependency></dependencies>
</project>

2 . 你需要在数据库中建立springbatch的相关元数据表,所以你需要在数据库中执行如下来自官方元数据模式的脚本。

-- do not edit this file
-- BATCH JOB 实例表 包含与aJobInstance相关的所有信息
-- JOB ID由batch_job_seq分配
-- JOB 名称,与spring配置一致
-- JOB KEY 对job参数的MD5编码,正因为有这个字段的存在,同一个job如果第一次运行成功,第二次再运行会抛出JobInstanceAlreadyCompleteException异常。
CREATE TABLE BATCH_JOB_INSTANCE  (JOB_INSTANCE_ID BIGINT  NOT NULL PRIMARY KEY ,VERSION BIGINT ,JOB_NAME VARCHAR(100) NOT NULL,JOB_KEY VARCHAR(32) NOT NULL,constraint JOB_INST_UN unique (JOB_NAME, JOB_KEY)
) ENGINE=InnoDB;
-- 该BATCH_JOB_EXECUTION表包含与该JobExecution对象相关的所有信息
CREATE TABLE BATCH_JOB_EXECUTION  (JOB_EXECUTION_ID BIGINT  NOT NULL PRIMARY KEY ,VERSION BIGINT  ,JOB_INSTANCE_ID BIGINT NOT NULL,CREATE_TIME DATETIME NOT NULL,START_TIME DATETIME DEFAULT NULL ,END_TIME DATETIME DEFAULT NULL ,STATUS VARCHAR(10) ,EXIT_CODE VARCHAR(2500) ,EXIT_MESSAGE VARCHAR(2500) ,LAST_UPDATED DATETIME,JOB_CONFIGURATION_LOCATION VARCHAR(2500) NULL,constraint JOB_INST_EXEC_FK foreign key (JOB_INSTANCE_ID)references BATCH_JOB_INSTANCE(JOB_INSTANCE_ID)
) ENGINE=InnoDB;
-- 该表包含与该JobParameters对象相关的所有信息
CREATE TABLE BATCH_JOB_EXECUTION_PARAMS  (JOB_EXECUTION_ID BIGINT NOT NULL ,TYPE_CD VARCHAR(6) NOT NULL ,KEY_NAME VARCHAR(100) NOT NULL ,STRING_VAL VARCHAR(250) ,DATE_VAL DATETIME DEFAULT NULL ,LONG_VAL BIGINT ,DOUBLE_VAL DOUBLE PRECISION ,IDENTIFYING CHAR(1) NOT NULL ,constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID)references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
) ENGINE=InnoDB;
-- 该表包含与该StepExecution 对象相关的所有信息
CREATE TABLE BATCH_STEP_EXECUTION  (STEP_EXECUTION_ID BIGINT  NOT NULL PRIMARY KEY ,VERSION BIGINT NOT NULL,STEP_NAME VARCHAR(100) NOT NULL,JOB_EXECUTION_ID BIGINT NOT NULL,START_TIME DATETIME NOT NULL ,END_TIME DATETIME DEFAULT NULL ,STATUS VARCHAR(10) ,COMMIT_COUNT BIGINT ,READ_COUNT BIGINT ,FILTER_COUNT BIGINT ,WRITE_COUNT BIGINT ,READ_SKIP_COUNT BIGINT ,WRITE_SKIP_COUNT BIGINT ,PROCESS_SKIP_COUNT BIGINT ,ROLLBACK_COUNT BIGINT ,EXIT_CODE VARCHAR(2500) ,EXIT_MESSAGE VARCHAR(2500) ,LAST_UPDATED DATETIME,constraint JOB_EXEC_STEP_FK foreign key (JOB_EXECUTION_ID)references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
) ENGINE=InnoDB;
-- 该BATCH_STEP_EXECUTION_CONTEXT表包含ExecutionContext与Step相关的所有信息
CREATE TABLE BATCH_STEP_EXECUTION_CONTEXT  (STEP_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,SHORT_CONTEXT VARCHAR(2500) NOT NULL,SERIALIZED_CONTEXT TEXT ,constraint STEP_EXEC_CTX_FK foreign key (STEP_EXECUTION_ID)references BATCH_STEP_EXECUTION(STEP_EXECUTION_ID)
) ENGINE=InnoDB;
-- 该表包含ExecutionContext与Job相关的所有信息
CREATE TABLE BATCH_JOB_EXECUTION_CONTEXT  (JOB_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,SHORT_CONTEXT VARCHAR(2500) NOT NULL,SERIALIZED_CONTEXT TEXT ,constraint JOB_EXEC_CTX_FK foreign key (JOB_EXECUTION_ID)references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
) ENGINE=InnoDB;
CREATE TABLE BATCH_STEP_EXECUTION_SEQ (ID BIGINT NOT NULL,UNIQUE_KEY CHAR(1) NOT NULL,constraint UNIQUE_KEY_UN unique (UNIQUE_KEY)
) ENGINE=InnoDB;
INSERT INTO BATCH_STEP_EXECUTION_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_STEP_EXECUTION_SEQ);
CREATE TABLE BATCH_JOB_EXECUTION_SEQ (ID BIGINT NOT NULL,UNIQUE_KEY CHAR(1) NOT NULL,constraint UNIQUE_KEY_UN unique (UNIQUE_KEY)
) ENGINE=InnoDB;
INSERT INTO BATCH_JOB_EXECUTION_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_JOB_EXECUTION_SEQ);
CREATE TABLE BATCH_JOB_SEQ (ID BIGINT NOT NULL,UNIQUE_KEY CHAR(1) NOT NULL,constraint UNIQUE_KEY_UN unique (UNIQUE_KEY)
) ENGINE=InnoDB;
INSERT INTO BATCH_JOB_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_JOB_SEQ);

3 . 测试数据的实体类 : Access.java

package name.ealen.model;import javax.persistence.*;
/*** Created by EalenXie on 2018/9/10 16:17.*/
@Entity
@Table
public class Access {@Id@GeneratedValue(strategy = GenerationType.AUTO)private Integer id;private String username;private String shopName;private String categoryName;private String brandName;private String shopId;private String omit;private String updateTime;private boolean deleteStatus;private String createTime;private String description;public Integer getId() {return id;}public void setId(Integer id) {this.id = id;}public String getUsername() {return username;}public void setUsername(String username) {this.username = username;}public String getShopName() {return shopName;}public void setShopName(String shopName) {this.shopName = shopName;}public String getCategoryName() {return categoryName;}public void setCategoryName(String categoryName) {this.categoryName = categoryName;}public String getBrandName() {return brandName;}public void setBrandName(String brandName) {this.brandName = brandName;}public String getShopId() {return shopId;}public void setShopId(String shopId) {this.shopId = shopId;}public String getOmit() {return omit;}public void setOmit(String omit) {this.omit = omit;}public String getUpdateTime() {return updateTime;}public void setUpdateTime(String updateTime) {this.updateTime = updateTime;}public boolean isDeleteStatus() {return deleteStatus;}public void setDeleteStatus(boolean deleteStatus) {this.deleteStatus = deleteStatus;}public String getCreateTime() {return createTime;}public void setCreateTime(String createTime) {this.createTime = createTime;}public String getDescription() {return description;}public void setDescription(String description) {this.description = description;}@Overridepublic String toString() {return "Access{" +"id=" + id +", username='" + username + '\'' +", shopName='" + shopName + '\'' +", categoryName='" + categoryName + '\'' +", brandName='" + brandName + '\'' +", shopId='" + shopId + '\'' +", omit='" + omit + '\'' +", updateTime='" + updateTime + '\'' +", deleteStatus=" + deleteStatus +", createTime='" + createTime + '\'' +", description='" + description + '\'' +'}';}
}

4 . 配置一个最简单的Job 之前,准备一些基本配置,例如为Job添加一个监听器 : 

  配置TaskExecutor,ExecutorConfiguration.java

package name.ealen.config;import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;/*** 配置TaskExecutor*/
@Configuration
public class ExecutorConfiguration {@Beanpublic ThreadPoolTaskExecutor threadPoolTaskExecutor() {ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();threadPoolTaskExecutor.setCorePoolSize(50);threadPoolTaskExecutor.setMaxPoolSize(200);threadPoolTaskExecutor.setQueueCapacity(1000);threadPoolTaskExecutor.setThreadNamePrefix("Data-Job");return threadPoolTaskExecutor;}
}

  为Job准备一个简单的监听器 ,实现JobExecutionListener即可 : 

package name.ealen.listener;import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobExecutionListener;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;import javax.annotation.Resource;/*** Created by EalenXie on 2018/9/10 15:09.* 一个简单的JOB listener*/
@Component
public class JobListener implements JobExecutionListener {private static final Logger log = LoggerFactory.getLogger(JobListener.class);@Resourceprivate ThreadPoolTaskExecutor threadPoolTaskExecutor;private long startTime;@Overridepublic void beforeJob(JobExecution jobExecution) {startTime = System.currentTimeMillis();log.info("job before " + jobExecution.getJobParameters());}@Overridepublic void afterJob(JobExecution jobExecution) {log.info("JOB STATUS : {}", jobExecution.getStatus());if (jobExecution.getStatus() == BatchStatus.COMPLETED) {log.info("JOB FINISHED");threadPoolTaskExecutor.destroy();} else if (jobExecution.getStatus() == BatchStatus.FAILED) {log.info("JOB FAILED");}log.info("Job Cost Time : {}ms" , (System.currentTimeMillis() - startTime));}
}

5 . 配置一个最基本的Job : 一个Job 通常由一个或多个Step组成(基本就像是一个工作流);一个Step通常由三部分组成(读入数据 ItemReader,处理数据 ItemProcessor,写入数据 ItemWriter)

package name.ealen.batch;import name.ealen.listener.JobListener;
import name.ealen.model.Access;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
import org.springframework.batch.core.launch.support.RunIdIncrementer;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.item.database.JpaPagingItemReader;
import org.springframework.batch.item.database.orm.JpaNativeQueryProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;import javax.annotation.Resource;
import javax.persistence.EntityManagerFactory;/*** Created by EalenXie on 2018/9/10 14:50.* :@EnableBatchProcessing提供用于构建批处理作业的基本配置*/
@Configuration
@EnableBatchProcessing
public class DataBatchConfiguration {private static final Logger log = LoggerFactory.getLogger(DataBatchConfiguration.class);@Resourceprivate JobBuilderFactory jobBuilderFactory;    //用于构建JOB
@Resourceprivate StepBuilderFactory stepBuilderFactory;  //用于构建Step
@Resourceprivate EntityManagerFactory emf;           //注入实例化Factory 访问数据
@Resourceprivate JobListener jobListener;            //简单的JOB listener/*** 一个简单基础的Job通常由一个或者多个Step组成*/@Beanpublic Job dataHandleJob() {return jobBuilderFactory.get("dataHandleJob").incrementer(new RunIdIncrementer()).start(handleDataStep()).    //start是JOB执行的第一个step
//                next(xxxStep()).
//                next(xxxStep()).
//                ...listener(jobListener).      //设置了一个简单JobListener
                build();}/*** 一个简单基础的Step主要分为三个部分* ItemReader : 用于读取数据* ItemProcessor : 用于处理数据* ItemWriter : 用于写数据*/@Beanpublic Step handleDataStep() {return stepBuilderFactory.get("getData").<Access, Access>chunk(100).        // <输入,输出> 。chunk通俗的讲类似于SQL的commit; 这里表示处理(processor)100条后写入(writer)一次。faultTolerant().retryLimit(3).retry(Exception.class).skipLimit(100).skip(Exception.class). //捕捉到异常就重试,重试100次还是异常,JOB就停止并标志失败reader(getDataReader()).         //指定ItemReaderprocessor(getDataProcessor()).   //指定ItemProcessorwriter(getDataWriter()).         //指定ItemWriter
                build();}@Beanpublic ItemReader<? extends Access> getDataReader() {//读取数据,这里可以用JPA,JDBC,JMS 等方式 读入数据JpaPagingItemReader<Access> reader = new JpaPagingItemReader<>();//这里选择JPA方式读数据 一个简单的 native SQLString sqlQuery = "SELECT * FROM access";try {JpaNativeQueryProvider<Access> queryProvider = new JpaNativeQueryProvider<>();queryProvider.setSqlQuery(sqlQuery);queryProvider.setEntityClass(Access.class);queryProvider.afterPropertiesSet();reader.setEntityManagerFactory(emf);reader.setPageSize(3);reader.setQueryProvider(queryProvider);reader.afterPropertiesSet();//所有ItemReader和ItemWriter实现都会在ExecutionContext提交之前将其当前状态存储在其中,如果不希望这样做,可以设置setSaveState(false)reader.setSaveState(true);} catch (Exception e) {e.printStackTrace();}return reader;}@Beanpublic ItemProcessor<Access, Access> getDataProcessor() {return new ItemProcessor<Access, Access>() {@Overridepublic Access process(Access access) throws Exception {log.info("processor data : " + access.toString());  //模拟  假装处理数据,这里处理就是打印一下return access;}};
//        lambda也可以写为:
//        return access -> {
//            log.info("processor data : " + access.toString());
//            return access;
//        };
    }@Beanpublic ItemWriter<Access> getDataWriter() {return list -> {for (Access access : list) {log.info("write data : " + access); //模拟 假装写数据 ,这里写真正写入数据的逻辑
            }};}
}

6 . 配置好基本的Job之后,为Access表导入一些基本的数据(git上面有demo数据,access.sql),写一个SpringBoot的启动类进行测试。

  注意 : Job中的各个组件请使用@Bean注解声明,这样在元数据中才会有相应的正常操作记录 : 

package name.ealen;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;/*** Created by EalenXie on 2018/9/10 14:41.*/
@SpringBootApplication
public class SpringBatchApplication {public static void main(String[] args) {SpringApplication.run(SpringBatchApplication.class, args);}
}

7 . 运行可以看到基本数据处理效果,这里是模拟处理,和模拟写入 : 

8 . 从元数据等表中查看验证JOB的执行情况 : 

  

这里提一下,之前写过一篇SpringBoot+Quartz的整合, 大家应该想到些什么了吧。SpringBatch像是一个天然的Job,Quartz是完全可以做为它运作的调度器。两者结合,效果很不错。

感谢各位提出意见和支持。

 

转载于:https://www.cnblogs.com/ealenxie/p/9647703.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/265995.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

安卓APP_ Fragment(1)—— Fragment概念、基础用法、动态变换、管理栈

摘自&#xff1a;安卓APP_ Fragment&#xff08;1&#xff09;—— Fragment概念、基础用法、动态变换、管理栈 作者&#xff1a;丶PURSUING 发布时间&#xff1a; 2021-04-15 23:32:31 网址&#xff1a;https://blog.csdn.net/weixin_44742824/article/details/115716359 目录…

谷歌五笔输入法电脑版_“五笔输入法”打字速度更快,为什么却没啥人用?

现如今&#xff0c;随着国内经济水平的不断发展&#xff0c;电脑和手机都已经不再是稀罕玩意&#xff0c;因为现在国内有很多的厂家都在生产手机和电脑&#xff0c;导致这些电子产品的价格下降&#xff0c;所以我们很轻易就能够买得起这样的产品。而在手机、电脑普及之后&#…

安卓APP_ Fragment(2)—— Activity与Fragment的通信

摘自&#xff1a;安卓APP_ Fragment&#xff08;2&#xff09;—— Activity与Fragment的通信 作者&#xff1a;丶PURSUING 发布时间&#xff1a; 2021-04-16 17:23:44 网址&#xff1a;https://blog.csdn.net/weixin_44742824/article/details/115743009 目录 Activity与Fragm…

java socket 判断Socket连接失效

要判断socket连接链路是否可用时&#xff0c;不能通过socket.isClosed() 和 socket.isConnected() 方法判断&#xff0c;要通过心跳包 socket.sendUrgentData(0xFF) 。 当第一次连接成功后&#xff0c; socket.isClosed() false, socket.isConnected()true&#xff0c;只有在自…

安卓APP_ Fragment(3)—— Fragment的生命周期

摘自&#xff1a;安卓APP_ Fragment&#xff08;3&#xff09;—— Fragment的生命周期 作者&#xff1a;丶PURSUING 发布时间&#xff1a; 2021-04-16 22:32:12 网址&#xff1a;https://blog.csdn.net/weixin_44742824/article/details/115768202 目录 Fragment生命周期函数一…

安卓APP_ 布局(8) —— 基于 RecyclerView 的 ViewPager2翻页

摘自&#xff1a;安卓APP_ 布局&#xff08;8) —— 基于 RecyclerView 的 ViewPager2翻页 作者&#xff1a;丶PURSUING 发布时间&#xff1a; 2021-04-20 15:37:54 网址&#xff1a;https://blog.csdn.net/weixin_44742824/article/details/115803077 viewpager2 是对Recycler…

安卓APP_ Fragment(4)—— Fragment + ViewPager2 模拟微信首页 (1)两者联动实现翻页

摘自&#xff1a;安卓APP_ Fragment&#xff08;4&#xff09;—— Fragment ViewPager2 模拟微信首页 &#xff08;1&#xff09;两者联动实现翻页 作者&#xff1a;丶PURSUING 发布时间&#xff1a; 2021-04-20 17:46:59 网址&#xff1a;https://blog.csdn.net/weixin_4474…

Linux网络编程(Socket)

目录网络编程&#xff08;Socket&#xff09;概述引入网络编程通识扫盲socket套接字套接字描述符字节序socket编程步骤Linux提供的API简析创建套接字即连接协议[socket]&#xff08;服、客&#xff09;绑定IP和端口[bind]&#xff08;服&#xff09;地址转换api字节序转换api监…

嵌入式开发概述(树莓派介绍)

目录嵌入式定义嵌入式芯片选型ARM架构ARM树莓派嵌入式定义 国内普遍认同的嵌入式系统的定义是以应用为中心&#xff0c;以计算机技术为基础&#xff0c;软硬件可裁剪&#xff0c;适应应用系统对功耗、可靠性、成本、体积、功耗等严格要求的专用计算机系统。 嵌入式系统是软件和…

ubuntu 16gcc g++版本降级

打算在ubuntu16上编译linux3.4.66内核&#xff0c;但是遇到 In file included from include/linux/compiler.h:48:0, from include/linux/stddef.h:4, from include/linux/posix_types.h:4, from include/linux/types.h:17, from include/linux/page-flags.h:8, from kern…

android 系统gpu 调试_【资讯】高通公布首批可OTA更新GPU驱动手机:谷歌Pixel 4/三星S10在列...

文章转载自&#xff1a;iT之家原文链接&#xff1a;https://www.ithome.com/0/479/483.htm(IT之家3月25日消息) 谷歌今天宣布了一系列面向游戏开发者的新工具&#xff1a;Google Play Asset Delivery、Android性能调节器&#xff0c;Android GPU检查器和Cloud Firestore等&…

cURL库

一、cURL库可以做什么 1.cURL是一个文件传输工具&#xff0c;支持很多协议 二、cURL库的用法 1.初始化 $urlcurl_init() 2.设置选项 curl_setopt($url,CURLOPT_URL&#xff0c;"http://www.baidu.com") curl_setopt($url,string option,mixed value) 3.执行cURL会话 …

树莓派刷机

目录准备刷机重刷准备 SD卡&#xff08;一般16G以上&#xff0c;这里我用的8G&#xff09; 读卡器 Win32DiskImager&#xff08;将镜像烧到SD卡的软件&#xff09;&#xff0c;在这里下载&#xff1a;https://download.csdn.net/download/zhuguanlin121/18329615?spm1001.201…

linux3.4.2移植总结(s3c2440)

环境&#xff1a;Linux version 3.5.0-23-generic (builddkomainu) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) ubuntu12 目标板&#xff1a;JZ2440 待移植内核&#xff1a;3.4.2 交叉编译器&#xff1a;arm-linux-gcc-4.3.2 1. make s3c2410_defconfig //使…

判断图有无环_浅谈什么是图拓扑排序

1 引言 在工程实践中,一个工程项目往往由若干个子项目组成。这些子项目间往往有两种关系:  (1) 先后关系&#xff0c;即必须在某个项完成后才能开始实施另一个子项目。  (2) 子项目间无关系&#xff0c;即两个子项目可以同时进行,互不影响。例如&#xff1a;在工厂里产品的…

Source Insight 4.0安装教程(PS:附安装包及卸载重新安装等注意事项)

目录一、Source Insight 4.0安装包二、删除配置文件&#xff08;初次安装忽略此步骤&#xff09;1、清除注册表信息&#xff1a;2、删除全局配置信息&#xff1a;三、安装步骤1、解压2、安装3、替换4、破解5、安装提示unable to open or create...解决方案一、Source Insight 4…

通过远程(vnc)无法打开qtcreator

最近打算移植qt程序到板子上于是&#xff0c;在ubuntu物理机上装了qt开发环境&#xff0c;通过远程桌面链接上去写qt。 但是远程老是点不开qtcreator。于是通过命令行启动 出了报错信息&#xff0c;应该和xserver 服务有关&#xff0c;没有深入了解错误 下面是我的解决方案&a…

iOS开发UI篇—使用xib自定义UItableviewcell实现一个简单的团购应用界面布局

iOS开发UI篇—使用xib自定义UItableviewcell实现一个简单的团购应用界面布局 iOS开发UI篇—使用xib自定义UItableviewcell实现一个简单的团购应用界面布局 一、项目文件结构和plist文件 二、实现效果 三、代码示例 1.没有使用配套的类&#xff0c;而是直接使用xib文件控件tag值…

硬件模块化开发的例子:LD3320语音模块与Source Insight的使用

目录硬件模块化开发的行情LD3320语音模块使用手册介绍&#xff1a;语音模块验货测试硬件连接效果图测试结果良好Source Insight代码查看器创建工程修改字体配色方案中文乱码关联代码语音识别模块代码分析语音识别模块二次开发硬件模块化开发的行情 LD3320语音模块使用手册介绍&…

ubuntu 远程桌面及Qt安装

环境&#xff1a; ubunut14 x64 目标&#xff1a;通过vnc远程桌面&#xff0c;在ubuntu 上编写qt程序 1.安装远程桌面 apt-get install xrdp vnc4server xbase-clients dconf-editor #安装xrdp&#xff0c;vnc4server apt-get install gnome-panel gnome-settings-daemon m…