boot

精尽 Spring Boot 源码分析 —— ServletWebServerApplicationContext

风格不统一 提交于 2019-12-13 12:48:07
精尽 Spring Boot 源码分析 —— ServletWebServerApplicationContext 1. 概述 在 《精尽 Spring Boot 源码分析 —— SpringApplication》 一文中,我们看到 SpringApplication#createApplicationContext() 方法,根据不同的 Web 应用类型,创建不同的 Spring 容器。代码如下: // SpringApplication.java /** * The class name of application context that will be used by default for non-web * environments. */ public static final String DEFAULT_CONTEXT_CLASS = "org.springframework.context." + "annotation.AnnotationConfigApplicationContext"; /** * The class name of application context that will be used by default for web * environments. */ public static final String DEFAULT

精尽 Spring Boot 源码分析 —— ReactiveWebServerApplicationContext

不打扰是莪最后的温柔 提交于 2019-12-13 12:47:50
精尽 Spring Boot 源码分析 —— ReactiveWebServerApplicationContext 1. 概述 本文接 《精尽 Spring Boot 源码分析 —— ServletWebServerApplicationContext》 一文,我们来分享 ReactiveWebServerApplicationContext 类,它提供 Reactive Web 环境的 Spring 容器。 AnnotationConfigReactiveWebServerApplicationContext 的类图关系如下: 相比来说,ReactiveWebServerApplicationContext 比 ServletWebServerApplicationContext 有更多的层级关系。不过没事,我们一点一点来看。 艿艿:Spring Webflux ,我自己目前没太使用过。看这块,就单纯好奇下,哈哈哈。 2. ReactiveWebApplicationContext org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext ,继承 ApplicationContext 接口,Reactive Web ApplicationContext 接口。代码如下: //

精尽 Spring Boot 源码分析 —— @ConfigurationProperties

为君一笑 提交于 2019-12-13 12:44:45
精尽 Spring Boot 源码分析 —— @ConfigurationProperties 1. 概述 本文我们来分享 @ConfigurationProperties 注解,如何将配置文件自动设置到被注解的类。代码如下: // ConfigurationProperties.java /** * Annotation for externalized configuration. Add this to a class definition or a * {@code @Bean} method in a {@code @Configuration} class if you want to bind and validate * some external Properties (e.g. from a .properties file). * <p> * Note that contrary to {@code @Value}, SpEL expressions are not evaluated since property * values are externalized. * * @author Dave Syer * @see ConfigurationPropertiesBindingPostProcessor * @see

R - Bootstrapped Confidence Interval - Obtain Parameters of Upper and Lower Bounds

。_饼干妹妹 提交于 2019-12-13 08:59:12
问题 I used bootstrapping to obtain confidence intervals of a Weibull distribution. Then I plotted the Confidence Bands in a plot. Code is below: set.seed(123) rw.small<-rweibull(100,shape=1.781096,scale=33.669511) xs <- seq(0,100, len=500) boot.pdf <- sapply(1:100, function(i) { xi <- sample(rw.small, size=length(rw.small), replace=TRUE) MLE.est <- suppressWarnings(fitdist(xi, distr="weibull",lower=0)) dweibull(xs, shape=MLE.est$estimate["shape"], scale = MLE.est$estimate["scale"]) }) par(bg=

What does Bios do after Booting

旧巷老猫 提交于 2019-12-13 08:10:24
问题 Does BIOS do something after booting? IO in BIOS mean input/output but isn`t bios used only when booting process? If BIOS is not used how can operating system interact with other hardware? 回答1: Read wikipage about BIOS & booting & firmware & UEFI With current operating systems (in particular Linux, for which you'll find a big lot of documentation & resources; notice that Linux & coreboot is free software, so you can study its source code), the BIOS is (nearly) only useful to load the boot

Run my Python script at login on linux

二次信任 提交于 2019-12-13 03:30:30
问题 I have a Python script, and I want it to be autostarted at every login. It's in a linux system. I followed a guide that explains that is enough to create a .desktop file in ~/.config/autostart/*.desktop and write: [Desktop Entry] Name=MyApp Type=Application Exec=python3 ~/.myapp/myapp Terminal=false I tried several times to reboot but the program doesn't execute, even if it seems to be active in the list of application of startup in my lxde environment. 回答1: Often things like the ~ (tilde)

When SystemUI loads in Android Boot

有些话、适合烂在心里 提交于 2019-12-13 02:12:51
问题 How to know when the system UI loads in Android boot process? Where exactly the status bar and navigation bar view draws? As SystemUI is a privileged app so is it loading before the start of a launcher app (Home screen)? I am not sure. Any suggestion is welcome. 回答1: Below is a chain of briefly explained steps that hopefully shed some light on the sequence of "loading" the system UI components at boot time. I'll demonstrate it on Android 4.2, although the sequence is quite similar for the

springboot与springcloud版本问题

烂漫一生 提交于 2019-12-13 00:40:48
spring-cloud: "Finchley.M2": "Spring Boot >=2.0.0.M3 and <2.0.0.M5", "Finchley.M3": "Spring Boot >=2.0.0.M5 and <=2.0.0.M5", "Finchley.M4": "Spring Boot >=2.0.0.M6 and <=2.0.0.M6", "Finchley.M5": "Spring Boot >=2.0.0.M7 and <=2.0.0.M7", "Finchley.M6": "Spring Boot >=2.0.0.RC1 and <=2.0.0.RC1", "Finchley.M7": "Spring Boot >=2.0.0.RC2 and <=2.0.0.RC2", "Finchley.M9": "Spring Boot >=2.0.0.RELEASE and <=2.0.0.RELEASE", "Finchley.RC1": "Spring Boot >=2.0.1.RELEASE and <2.0.2.RELEASE", "Finchley.RC2": "Spring Boot >=2.0.2.RELEASE and <2.0.3.RELEASE", "Finchley.SR4": "Spring Boot >=2.0.3.RELEASE and

在5分钟内将Spring Boot作为Windows服务启动

…衆ロ難τιáo~ 提交于 2019-12-12 18:40:01
分享优锐课学习笔记~来看一下如何使用Spring Boot创建Windows服务以及通过配置详细信息来快速启动并运行。 最近不得不将Spring Boot应用程序部署为Windows服务,感到惊讶的是使用winsw如此容易。 入门 Spring Boot文档的第59节是关于安装Spring Boot应用程序的,它指向GitHub页面。本示例使用该项目作为灵感。 项目 我将以Spring IO“服务Web内容”项目作为起点,因此请转到该网页并从GIT或ZIP文件中下载示例。 从命令行运行 Spring Boot 然后,我们可以看到我们的应用程序正在运行: Spring MVC 示例 包装为Windows服务 从GitHub下载winsw –记住要根据运行的.NET版本选择正确的版本 创建Windows服务目录并将EXE复制到此位置。 Windows 服务目录 我将 gs-serving-web-content-0.1.0.jar 重命名为 gs-serving-web-content.jar 将Winsw EXE从 WinSW.NET4.exe 重命名为gs-serving-web-content.exe 创建一个具有以下内容的名为gs-serving-web-content.xml的XML文件– <?xml version="1.0" encoding="UTF-8"?>

为什么说即便是新手,也应该学习微服务?

99封情书 提交于 2019-12-12 16:50:15
微服务是当下非常火的话题,出门遇见同行,不会点微服务你可能都不好意思跟别人打招呼,企业的招聘信息中也越来越多地出现对于微服务架构能力的要求,不会点微服务找工作别说有优势了,先被别人落下一大截。可以说微服务架构已经成为后端开发人员的必备技能。 01 什么是微服务 维基百科上给出的定义是:微服务(Microservices)是一种软件开发技术,是面向服务的架构(Service-Oriented Architecture,SOA)的变体,微服务架构将应用程序组成一系列松散耦合的服务集合。在微服务体系结构中,服务是细粒度的,协议是轻量级的。 传统开发模式下,绝大部分的 Web 应用都是采用单体架构的风格来进行构建的,这意味着 Web 应用是作为单个可部署的软件制品进行交付的,所有的接口、业务逻辑、持久层都被打包在一个 Web 应用中,并且部署在一台服务器上。这种开发模式会带来诸多不便,大多数情况下,一个应用程序是交由多个团队来协同开发的,每个开发团队负责各自不同的模块,并且会有自己的定制组件来服务对应的客户。 问题就出在这里,随着应用程序的规模和复杂度不断增长,多个团队协同开发一个单体应用程序会变得越来越困难、越来越复杂,假设某个团队需要修改接口,那么其他团队与之对应的代码也需要修改,同时整个应用程序都需要重新构建、测试、部署。 微服务架构就是为了解决上述问题而生的,它的本质在于分布式