当前位置: 首页 > 编程日记 > 正文

Spring Boot启动过程(二)

书接上篇

该说refreshContext(context)了,首先是判断context是否是AbstractApplicationContext派生类的实例,之后调用了强转为AbstractApplicationContext类型并调用它的refresh方法。由于AnnotationConfigEmbeddedWebApplicationContext继承自EmbeddedWebApplicationContext,所以会执行EmbeddedWebApplicationContext的refresh方法,继而执行其中的super.refresh。这个refresh也就是AbstractApplicationContext的refresh方法了,它内部是一个synchronized锁全局的代码块,同样的加锁方法还有这个类里的close和registerShutdownHook方法。

同步代码块中第一个方法prepareRefresh,首先会执行AnnotationConfigEmbeddedWebApplicationContext的prepareRefresh方法:

    protected void prepareRefresh() {this.scanner.clearCache();super.prepareRefresh();}

这个super也就是AbstractApplicationContext,它的prepareRefresh方法逻辑是:生成启动时间;设置closed状态为false;active状态为true;initPropertySources方法主要是调用了AbstractEnvironment的getPropertySources方法获取了之前SpringApplication的prepareEnvironment方法中getOrCreateEnvironment方法准备的各种环境变量及配置并用于初始化ServletPropertySources。具体的servletContextInitParams这些是在环境对象初始化时由各集成级别Environment的customizePropertySources方法中初始化的。

接着的getEnvironment().validateRequiredProperties()方法实际执行了AbstractEnvironment中的this.propertyResolver.validateRequiredProperties(),主要是验证了被占位的key如果是required的值不能为null。prepareRefresh的最后是初始化this.earlyApplicationEvents = new LinkedHashSet<ApplicationEvent>()。*****

只够是获取BeanFactory实例的方法obtainFreshBeanFactory(),首先在refreshBeanFactory方法中用原子布尔类型判断是否刷新过,BeanFactory实例是在createApplicationContext创建Context实例时被创建的,如果没有刷新则设置一个用于序列化的id,id是ContextIdApplicationContextInitializer初始化设置的(如未配置该初始化器,是有一个默认ObjectUtils.identityToString(this)生成的),这个id的生成规则是spring.config.name截取的+":"+server.port的占位截取。设置序列化id时,同时保存了一个id和弱引用DefaultListableBeanFactory实例映射。

得到了beanFactory后就是prepareBeanFactory(beanFactory)了,逻辑是注册了BeanClassLoader用于注入的bean实例的创建;StandardBeanExpressionResolver用于EL表达式,比如配置文件或者@Value("#{...}")等使用;用ResourceEditorRegistrar注册属性转换器,比如xml配置的bean属性都是用的字符串配置的要转成真正的属性类型;addBeanPostProcessor(new ApplicationContextAwareProcessor(this))注册ApplicationContextAwareProcessor,它的invokeAwareInterfaces方法会对实现指定接口的bean调用指定的set方法;ignoreDependencyInterface忽略对这些接口的自动装配,比如Aware这些是要做独立处理的,不适合通用的方法;然后是有几个类型直接手动注册,比如BeanFactory,这个很好理解;接着注册一个后置处理器ApplicationListenerDetector的实例,addBeanPostProcessor注册的会按照注册先后顺序执行;这个方法的最后判断了特定的4个bean名字,如果存在会做相应注册,包括loadTimeWeaver、environment、systemProperties和systemEnvironment。补充一点,在最开始创建实例的时候还执行过ignoreDependencyInterface(BeanNameAware.class);ignoreDependencyInterface(BeanFactoryAware.class);ignoreDependencyInterface(BeanClassLoaderAware.class)。

    protected void prepareBeanFactory(ConfigurableListableBeanFactory beanFactory) {// Tell the internal bean factory to use the context's class loader etc.
        beanFactory.setBeanClassLoader(getClassLoader());beanFactory.setBeanExpressionResolver(new StandardBeanExpressionResolver(beanFactory.getBeanClassLoader()));beanFactory.addPropertyEditorRegistrar(new ResourceEditorRegistrar(this, getEnvironment()));// Configure the bean factory with context callbacks.beanFactory.addBeanPostProcessor(new ApplicationContextAwareProcessor(this));beanFactory.ignoreDependencyInterface(EnvironmentAware.class);beanFactory.ignoreDependencyInterface(EmbeddedValueResolverAware.class);beanFactory.ignoreDependencyInterface(ResourceLoaderAware.class);beanFactory.ignoreDependencyInterface(ApplicationEventPublisherAware.class);beanFactory.ignoreDependencyInterface(MessageSourceAware.class);beanFactory.ignoreDependencyInterface(ApplicationContextAware.class);// BeanFactory interface not registered as resolvable type in a plain factory.// MessageSource registered (and found for autowiring) as a bean.beanFactory.registerResolvableDependency(BeanFactory.class, beanFactory);beanFactory.registerResolvableDependency(ResourceLoader.class, this);beanFactory.registerResolvableDependency(ApplicationEventPublisher.class, this);beanFactory.registerResolvableDependency(ApplicationContext.class, this);// Register early post-processor for detecting inner beans as ApplicationListeners.beanFactory.addBeanPostProcessor(new ApplicationListenerDetector(this));// Detect a LoadTimeWeaver and prepare for weaving, if found.if (beanFactory.containsBean(LOAD_TIME_WEAVER_BEAN_NAME)) {beanFactory.addBeanPostProcessor(new LoadTimeWeaverAwareProcessor(beanFactory));// Set a temporary ClassLoader for type matching.beanFactory.setTempClassLoader(new ContextTypeMatchClassLoader(beanFactory.getBeanClassLoader()));}// Register default environment beans.if (!beanFactory.containsLocalBean(ENVIRONMENT_BEAN_NAME)) {beanFactory.registerSingleton(ENVIRONMENT_BEAN_NAME, getEnvironment());}if (!beanFactory.containsLocalBean(SYSTEM_PROPERTIES_BEAN_NAME)) {beanFactory.registerSingleton(SYSTEM_PROPERTIES_BEAN_NAME, getEnvironment().getSystemProperties());}if (!beanFactory.containsLocalBean(SYSTEM_ENVIRONMENT_BEAN_NAME)) {beanFactory.registerSingleton(SYSTEM_ENVIRONMENT_BEAN_NAME, getEnvironment().getSystemEnvironment());}}

之后到了refresh的postProcessBeanFactory方法,首先是会走到AnnotationConfigEmbeddedWebApplicationContext的Override,需要注意的一点是,这是web环境,如果不是是不会加载这个上下文的,也就不会这么走。它重写的第一步是先走super也就是EmbeddedWebApplicationContext的postProcessBeanFactory,这里又注册了个后置处理器WebApplicationContextServletContextAwareProcessor的实例,构造参数是this,也就是当前上下文,同时忽略ServletContextAware接口,这个接口是用于获取ServletContext的,为什么要忽略呢,我猜应该是因为我们既然有了web应用并且内嵌servlet的上下文实例,还要ServletContext的实现就没什么用了,还有可能出现冲突的问题,有空我再确认下。然后是配置的basePackages和annotatedClasses:

    @Overrideprotected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {super.postProcessBeanFactory(beanFactory);if (this.basePackages != null && this.basePackages.length > 0) {this.scanner.scan(this.basePackages);}if (this.annotatedClasses != null && this.annotatedClasses.length > 0) {this.reader.register(this.annotatedClasses);}}

到了invokeBeanFactoryPostProcessors方法,这个方法就是执行之前注册的BeanFactory后置处理器的地方。代码一目了然,PostProcessorRegistrationDelegate的invokeBeanFactoryPostProcessors中只是有些排序的逻辑,我就不说了:

    /*** Instantiate and invoke all registered BeanFactoryPostProcessor beans,* respecting explicit order if given.* <p>Must be called before singleton instantiation.*/protected void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory) {PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(beanFactory, getBeanFactoryPostProcessors());// Detect a LoadTimeWeaver and prepare for weaving, if found in the meantime// (e.g. through an @Bean method registered by ConfigurationClassPostProcessor)if (beanFactory.getTempClassLoader() == null && beanFactory.containsBean(LOAD_TIME_WEAVER_BEAN_NAME)) {beanFactory.addBeanPostProcessor(new LoadTimeWeaverAwareProcessor(beanFactory));beanFactory.setTempClassLoader(new ContextTypeMatchClassLoader(beanFactory.getBeanClassLoader()));}}

BeanFactory后置处理器执行之后是注册Bean的后置处理器方法registerBeanPostProcessors。例如new BeanPostProcessorChecker(beanFactory, beanProcessorTargetCount)会在Bean没有合适的后置处理器时记条info级日志。ApplicationListenerDetector也注册了一个。

initMessageSource这个方法在我这没什么用,都说是国际化的,随便百度一下一堆一堆的,而且其实严格来说这篇多数不属于spring boot的部分,这方法我就不细写了。

initApplicationEventMulticaster方法主要也就是初始化并注册applicationEventMulticaster的这两句代码:

            this.applicationEventMulticaster = new SimpleApplicationEventMulticaster(beanFactory);beanFactory.registerSingleton(APPLICATION_EVENT_MULTICASTER_BEAN_NAME, this.applicationEventMulticaster);

onRefresh也是根据环境不同加载的上下文不同而不同的,用于支持子类扩展出来的上下文特定的逻辑的。EmbeddedWebApplicationContext的onRefresh首先依然是super.onRefresh,逻辑就是初始化了主题;createEmbeddedServletContainer方法名我就不翻译了,一般情况下是使用getBeanFactory .getBeanNamesForType方法找到EmbeddedServletContainerFactory类型的实例,这也就是我之前那个问题解决过程中,为什么只要排除掉tomcat引用,引入jetty引用就可以自动换成jetty的原因。创建容器的过程中初始化方法selfInitialize注册了filter和MappingForUrlPatterns等,代码在AbstractFilterRegistrationBean等onStartup,这里就不细说了,如果能抽出时间说说之前查问题的时候查的容器代码再说。然后初始化PropertySources,servletContextInitParams和servletConfigInitParams:

    public static void initServletPropertySources(MutablePropertySources propertySources, ServletContext servletContext, ServletConfig servletConfig) {Assert.notNull(propertySources, "'propertySources' must not be null");if (servletContext != null && propertySources.contains(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME) &&propertySources.get(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME) instanceof StubPropertySource) {propertySources.replace(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME,new ServletContextPropertySource(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME, servletContext));}if (servletConfig != null && propertySources.contains(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME) &&propertySources.get(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME) instanceof StubPropertySource) {propertySources.replace(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME,new ServletConfigPropertySource(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME, servletConfig));}}

registerListeners首先注册静态监听:

    @Overridepublic void addApplicationListener(ApplicationListener<?> listener) {synchronized (this.retrievalMutex) {this.defaultRetriever.applicationListeners.add(listener);this.retrieverCache.clear();}}

接着是:

registerListeners的最后,初始化过的earlyApplicationEvents如果有事件,这时候会被发布。

finishBeanFactoryInitialization结束BeanFactory的初始化并初始化所有非延迟加载的单例。事实上我们自定义的单例Bean都是在这里getBean方法初始化的,所以如果注册的Bean特别多的话,这个过程就是启动过程中最慢的。初始化开始前先设置configurationFrozen为true,并this.frozenBeanDefinitionNames = StringUtils.toStringArray ( this. beanDefinitionNames )。如果有bean实例实现了SmartInitializingSingleton会有后置处理触发,不包括延迟加载的。例如:org.springframework.context.event. internalEventListenerProcessor会触发EventListenerMethodProcessor的afterSingletonsInstantiated方法对所有对象(Object的子类)处理。

finishRefresh:Refresh的最后一步,发布相应事件。同样先执行EmbeddedWebApplicationContext中对应方法的super(EmbeddedWebApplicationContext)的对应方法:

    /*** Finish the refresh of this context, invoking the LifecycleProcessor's* onRefresh() method and publishing the* {@link org.springframework.context.event.ContextRefreshedEvent}.*/protected void finishRefresh() {// Initialize lifecycle processor for this context.
        initLifecycleProcessor();// Propagate refresh to lifecycle processor first.
        getLifecycleProcessor().onRefresh();// Publish the final event.publishEvent(new ContextRefreshedEvent(this));// Participate in LiveBeansView MBean, if active.LiveBeansView.registerApplicationContext(this);}

初始化生命周期处理器,逻辑是判断beanFactory中是否已经注册了lifecycleProcessor,没有就new一个DefaultLifecycleProcessor并setBeanFactory(beanFactory),然后将它赋值给私有LifecycleProcessor类型的this变量。然后执行生命周期处理器的onRefresh,其中先startBeans,被start的beans是通过getBeanNamesForType(Lifecycle.class, false, false)从beanFactory中取出来的,例如endpointMBeanExporter和lifecycleProcessor,会去调用bean的start方法,endpointMBeanExporter的start中执行 locateAndRegisterEndpoints方法并设置running属性为true,这个过程加了ReentrantLock锁。bean都启动完会设置处理器的running为true。刷新完会发布ContextRefreshedEvent事件,这个事件除了都有的记录时间还执行了ConfigurationPropertiesBindingPostProcessor的freeLocalValidator方法,我这的逻辑是实际上执行了ValidatorFactoryImpl的close方法。这个逻辑的最后会检查一个配置spring.liveBeansView.mbeanDomain是否存在,有就会创建一个MBeanServer:

    static void registerApplicationContext(ConfigurableApplicationContext applicationContext) {String mbeanDomain = applicationContext.getEnvironment().getProperty(MBEAN_DOMAIN_PROPERTY_NAME);if (mbeanDomain != null) {synchronized (applicationContexts) {if (applicationContexts.isEmpty()) {try {MBeanServer server = ManagementFactory.getPlatformMBeanServer();applicationName = applicationContext.getApplicationName();server.registerMBean(new LiveBeansView(),new ObjectName(mbeanDomain, MBEAN_APPLICATION_KEY, applicationName));}catch (Throwable ex) {throw new ApplicationContextException("Failed to register LiveBeansView MBean", ex);}}applicationContexts.add(applicationContext);}}}

finishRefresh最后会启动前面创建的内嵌容器,并发布EmbeddedServletContainerInitializedEvent事件,启动这一部分算是容器的逻辑了,有机会整理容器逻辑再细写,我这里是Tomcat的:

@Overridepublic void start() throws EmbeddedServletContainerException {try {addPreviouslyRemovedConnectors();Connector connector = this.tomcat.getConnector();if (connector != null && this.autoStart) {startConnector(connector);}checkThatConnectorsHaveStarted();TomcatEmbeddedServletContainer.logger.info("Tomcat started on port(s): " + getPortsDescription(true));}catch (ConnectorStartFailedException ex) {stopSilently();throw ex;}catch (Exception ex) {throw new EmbeddedServletContainerException("Unable to start embedded Tomcat servlet container", ex);}finally {Context context = findContext();ContextBindings.unbindClassLoader(context, getNamingToken(context),getClass().getClassLoader());}}

然后是resetCommonCaches:

    /*** Reset Spring's common core caches, in particular the {@link ReflectionUtils},* {@link ResolvableType} and {@link CachedIntrospectionResults} caches.* @since 4.2* @see ReflectionUtils#clearCache()* @see ResolvableType#clearCache()* @see CachedIntrospectionResults#clearClassLoader(ClassLoader)*/protected void resetCommonCaches() {ReflectionUtils.clearCache();ResolvableType.clearCache();CachedIntrospectionResults.clearClassLoader(getClassLoader());}

refreshContext的最后是注册shutdown的钩子:

        if (this.registerShutdownHook) {try {context.registerShutdownHook();}catch (AccessControlException ex) {// Not allowed in some environments.
            }}/*** Register a shutdown hook with the JVM runtime, closing this context* on JVM shutdown unless it has already been closed at that time.* <p>Delegates to {@code doClose()} for the actual closing procedure.* @see Runtime#addShutdownHook* @see #close()* @see #doClose()*/@Overridepublic void registerShutdownHook() {if (this.shutdownHook == null) {// No shutdown hook registered yet.this.shutdownHook = new Thread() {@Overridepublic void run() {synchronized (startupShutdownMonitor) {doClose();}}};Runtime.getRuntime().addShutdownHook(this.shutdownHook);}}

==========================================================

咱最近用的github:https://github.com/saaavsaaa

微信公众号:

转载于:https://www.cnblogs.com/saaav/p/6292524.html

相关文章:

dom vue 加载完 执行_前端面试题——Vue

前言前几天整理了一些 html css JavaScript 常见的面试题(https://segmentfault.com/u/youdangde_5c8b208a23f95/articles)&#xff0c;然后现在也是找了一些在 Vue 方面经常出现的面试题&#xff0c;留给自己查看消化&#xff0c;也分享给有需要的小伙伴。如果文章中有出现纰…

查看某个存储过程

show create procedure 存储过程的名称; ##主从同步是会同步存储过程的 转载于:https://www.cnblogs.com/yangxiaochu/p/9397108.html

java中的分页 效率考虑_面试官:数据量很大,分页查询很慢,有什么优化方案?...

当需要从数据库查询的表有上万条记录的时候&#xff0c;一次性查询所有结果会变得很慢&#xff0c;特别是随着数据量的增加特别明显&#xff0c;这时需要使用分页查询。对于数据库分页查询&#xff0c;也有很多种方法和优化的点。下面简单说一下我知道的一些方法。准备工作为了…

dede 后台 mysql_织梦dedecms使用Mysql8.0无法登录后台的解决办法

1//只允许用户名和密码用0-9,a-z,A-Z,,_,.,-这些字符2$this->userName preg_replace("/[^0-9a-zA-Z_!\.-]/", , $username);3$this->userPwd preg_replace("/[^0-9a-zA-Z_!\.-]/", , $userpwd);4$pwd substr(md5($this->userPwd), 5, 20);56$d…

怎样对拍、如何对拍、对拍模板

我写了一个对拍模板&#xff0c;套上直接可以用&#xff0c;还有使用说明在里面&#xff0c;这里附上github网站。 对拍全套模板 转载于:https://www.cnblogs.com/yichuan-sun/p/9624162.html

二叉树线索化示意图_103-线索化二叉树思路图解

2.网上数据结构和算法的课程不少&#xff0c;但存在两个问题&#xff1a;1)授课方式单一&#xff0c;大多是照着代码念一遍&#xff0c;数据结构和算法本身就比较难理解&#xff0c;对基础好的学员来说&#xff0c;还好一点&#xff0c;对基础不好的学生来说&#xff0c;基本上…

linux环境下搭建osm_web服务器一(Postgresql配置及osm2pgsql原始数据导入):

Postgresql配置及osm2pgsql原始数据导入 2012年&#xff0c;Ubuntu 12.04LTS发布&#xff0c;又一个长效支持版&#xff0c;我们又该更新OpenStreetMap服务器了&#xff0c;这次&#xff0c;将详细在博客中记录配置过程。关于前面对OpenStreetMap的介绍&#xff0c;参考我的博文…

Java开发买低压本还是标压本_标压和低压,笔记本怎么选才最香?

华为最近发布了新款 MateBook 13/14 2020 锐龙版笔记本电脑&#xff0c;与之前的产品相比&#xff0c;它们都采用了 AMD 锐龙标压处理器。在体验这两款产品的同时&#xff0c;我一直在思考两个问题&#xff1a;它们与低压处理器相比强在哪里&#xff0c;以及是否值得购买。按照…

php mysql 备注_php,mysql备注信息1

/*---------------------------------------------------------------------------------------如何彻底地删除表?如果你不需要一个表了,你可以使用DROP.语法如下:DROP TABLE tablename例如:DROP TABLE employee_dataQuery OK,0 rows affected(0.01 sec);--------------------…

JSP和Servlet学习笔记1 - 访问配置

1. 访问 WebContent 目录下的 JSP 文件 在 WebContent 目录下的文件可以直接在浏览器中访问。新建一个 test.jsp 文件 <% page language"java" contentType"text/html; charsetISO-8859-1"pageEncoding"ISO-8859-1"%> <!DOCTYPE htm…

unity人物旋转移动代码_Unity3D研究院之脚本实现模型的平移与旋转(六)

123 说&#xff1a;雨松大大&#xff0c;有个问题想请教一下&#xff0c;我用UNET构建了个小场景&#xff0c;在电脑上可以客户端可以连接到服务器&#xff0c;Windows和Linux都可以&#xff0c;发布到安卓缺连不了&#xff0c;这是问什么呢说&#xff1a;求教一下&#xff0c;…

博客园的第一篇博文

以后所有技术相关的文章都记录在博客园啦&#xff0c;加油&#xff01;转载于:https://www.cnblogs.com/dabenniu/p/6337549.html

java后台分页插件怎么写_Java分页技术(从后台传json到前台解析显示)

0 这是一篇我在初学习过程中&#xff0c;遇到的动态数据分页显示的问题&#xff0c;前台采用Ajax传给后台&#xff0c;后台在访问数据库取出分页数据再转换为json格式传递给前台&#xff0c;前台再解析显示到表格中。在此写出我在做的过程中遇到的问题&#xff0c;可以让其他人…

c 应用程序mysql_MySQL C 语言应用程序接口开发教程

从数据库中取回数据在这个实例中我们从表中取回数据。步骤&#xff1a;(1)创建连接(2)执行查询(3)获取结果集(4)提取所有可用的记录(5)释放结果集实例程序打印 writers 表中所有的记录(姓名)。#include #include int main(int argc, char * argv[]){MYSQL * conn;MYSQL_RES * r…

GreenPlum学习笔记:基础知识

一、介绍 GreenPlum分布式数据仓库&#xff0c;大规模并行计算技术。 无共享/MPP核心架构Greenplum数据库软件将数据平均分布到系统的所有节点服务器上&#xff0c;所以节点存储每张表或表分区的部分行&#xff0c;所有数据加载和查询都是自动在各个节点服务器上并行运行&…

java 套接字关联的通道_Java 通道教程 – NIO 2.0

# Java 通道教程 – NIO 2.0> 原文&#xff1a; [https://howtodoinjava.com/java7/nio/java-nio-2-0-channels/](https://howtodoinjava.com/java7/nio/java-nio-2-0-channels/)通道是继[**缓冲区**](//howtodoinjava.com/java-7/nio/java-nio-2-0-working-with-buffers/ &…

虚拟机ubuntu14.04系统设置静态ip

ubuntu14.04 设置静态ip vim /etc/network/interfaces 原来只有 auto lo iface lo inet loopback 修改成如下&#xff1a; auto lo iface lo inet loopbackauto eth0 iface eth0 inet static #静态ip address 192.168.1.6 #要设置的ip gateway 192.168.1.1 #这…

高职信息安全比赛攻防思路_30.LNGZ2020-30:2020年辽宁省职业院校技能大赛(高职组)“信息安全管理与评估”赛项规程...

12020年辽宁省职业院校技能大赛(高职组)信息安全管理与评估赛项规程一、赛项名称赛项编号&#xff1a;LNGZ2020-30赛项名称&#xff1a;信息安全管理与评估英文名称&#xff1a;Information Security Management and Evaluation赛项组别&#xff1a;高职组赛项归属&#xff1a;…

oracle rac对心跳要求_关于心跳网络引起的Oracle RAC的节点驱逐(不是实例驱逐)...

关于心跳网络引起的Oracle RAC的节点驱逐(不是实例驱逐)问&#xff1a;假设如下场景&#xff1a;4个节点rac&#xff0c;心跳线走的是千m网络交换机&#xff0c;若是该千M网络交换机断电&#xff0c;我想知道crs的驱逐节点的算法是怎么样的&#xff1f;Oracle 大连 GCS 答复&am…

php 字符串数组转数组对象_php怎么将数组转成对象?

php将数组转成对象的方法&#xff1a;1、使用数据类型转换&#xff0c;在数组变量前添加“(Object)”来将数组转成对象。2、先使用json_encode()函数将数组转换为json字符串&#xff1b;然后使用json_decode()函数将json字符串转换成对象。php将数组转成对象有时候数组要转为对…

如何在Win7电脑上增加新磁盘分区?

我们在重装好系统Win7系统后有时会碰到需要新建磁盘分区的情况&#xff0c;这时我们再重装系统进行磁盘分区就有些过于麻烦了&#xff0c;其实我们可以利用Win7系统自身的磁盘管理功能来新建一个磁盘分区。下面好系统重装助手就来介绍一下好系统Win7系统电脑磁盘新建分区的方法…

WIn7下Ubuntu 14.04 安装

1. 在Windows下下载Ubuntu14.04的ISO镜像&#xff0c;解压 2. 打开wubi.exe&#xff0c;填写用户名&#xff0c;密码等相关信息&#xff0c;在这里需要注意的是&#xff0c;磁盘空间最好选到最大&#xff08;30G&#xff09;&#xff0c;执行安装 3. 按照提示&#xff0c;重启系…

cimiss数据_CIMISS,你太优秀了!

原标题&#xff1a;CIMISS&#xff0c;你太优秀了&#xff01;本周二的时候小据给大家带来了一位新朋友那便是CIMISS你真的了解它吗&#xff1f;一文读懂CIMISS(戳上面的链接进行回顾)今天我们继续了解一起探讨它能够为我们带来哪些好处天气业务“一站式”数据供给自2014年8月以…

python3 tkinter电子书_python3 tkinter实现添加图片和文本

本文在前面文章基础上介绍tkinter添加图片和文本&#xff0c;在这之前&#xff0c;我们需要安装一个图片库&#xff0c;叫Pillow&#xff0c;这个需要下载exe文件&#xff0c;根据下面图片下载和安装。下载完后直接双击安装exe&#xff0c;默认点击下一步&#xff0c;直到安装完…

序列化和反序列化实现

1. 什么是序列化&#xff1f; 程序员在编写应用程序的时候往往需要将程序的某些数据存储在内存中&#xff0c;然后将其写入文件或是将其传输到网络中的另一台计算机上以实现通讯。这个将程序数据转换成能被存储并传输的格式的过程被称为序列化&#xff08;serialization&#x…

linux source命令

source filename 与 sh filename 及./filename执行脚本的区别在那里呢&#xff1f;1.当shell脚本具有可执行权限时&#xff0c;用sh filename与./filename执行脚本是没有区别得。./filename是因为当前目录没有在PATH中&#xff0c;所有"."是用来表示当前目录的。2.sh…

centos7 nginx配置php7,centos7安装并配置nginx+php,centos7nginx

centos7安装并配置nginxphp&#xff0c;centos7nginxcentos7安装并配置nginxphp安装nginxyum install nginx设置nginx开启起动systemctl start nginx测试访问http://你的域名或IP/查看nginx安装位置whereis nginxnginx: /usr/sbin/nginx /etc/nginx /usr/share/nginx /usr/shar…

host ntrip 千寻rtk_什么是千寻知寸cors账号?它提供的定位服务精度如何?使用时需要注意哪些问题?...

千寻知寸cors账号FindCM&#xff1a;基于RTK技术的厘米级差分数据播发服务&#xff0c;终端设备收到差分数据后&#xff0c;结合自己的卫星观测数据进行高精度定位解算&#xff0c;在观测环境良好的情况下&#xff0c;统计精度可以达到水平2~5厘米&#xff0c;高程2~8厘米。由于…

python创建图片对应的csv格式_Python:如何从csv文件创建图形节点和边?

你可以用另一个COLATIC和COLATIC来建立一个COLATIC/COLATIC。然后将图“投影”到datetime节点上—如果两个datetime都链接到ColA/ColC节点&#xff0c;则在它们之间创建一个链接。在下面的代码展示了一种创建无向图的方法。我不明白你的例子里的指示是什么意思。在import csvim…

卡尺测量的最小范围_工厂车间里常用的测量仪器使用方法介绍,你都会用吗?...

一、测量器具的分类 测量器具是一种具有固定形态、用以复现或提供一个或多个已知量值的器具。按用途的不同量具可分为以下几类&#xff1a;1. 单值量具只能体现一个单一量值的量具。可用来校对和调整其它测量器具或作为标准量与被测量直接进行比较&#xff0c;如量块、角度量块…