网站价值排行对内部网站建设的意见和建议

bicheng/2025/10/15 18:20:35/文章来源:
网站价值排行,对内部网站建设的意见和建议,最容易做流量的网站,怎么在虚拟主机安装wordpress导语 在Java开发领域#xff0c;Spring Framework无疑是一个里程碑式的存在。它提供了全面的编程和配置模型#xff0c;帮助开发者解决企业级应用开发的复杂性。本文将引导读者深入了解Spring Framework的核心概念、主要特性和使用方法#xff0c;并通过示例代码展示其在实际… 导语  在Java开发领域Spring Framework无疑是一个里程碑式的存在。它提供了全面的编程和配置模型帮助开发者解决企业级应用开发的复杂性。本文将引导读者深入了解Spring Framework的核心概念、主要特性和使用方法并通过示例代码展示其在实际项目中的应用。 一、Spring IoCInversion of Control控制反转 Spring IoCInversion of Control控制反转是一种设计原则它帮助我们构建松耦合的应用程序。在传统的编程模式下对象通常负责管理和创建它的依赖对象。但在IoC模式下对象不再自行创建和管理依赖对象而是由容器如Spring IoC容器来负责创建和维护对象之间的依赖关系。 以下是一个简单示例展示Spring IoC如何通过XML配置和注解配置两种方式进行依赖注入Dependency InjectionDI XML 配置方式 1.定义一个接口和其实现类 public interface MessageService {String getMessage(); }public class SimpleMessageService implements MessageService {Overridepublic String getMessage() {return Hello from SimpleMessageService!;} }2.创建一个依赖于MessageService的WelcomeController public class WelcomeController {private MessageService service;public void setMessageService(MessageService service) {this.service service;}public String printMessage() {return this.service.getMessage();} }3.使用Spring XML配置文件进行Bean定义和依赖注入 !-- spring-config.xml -- beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 定义MessageService Bean --bean idmessageService classcom.example.SimpleMessageService/!-- 定义WelcomeController Bean并注入MessageService依赖 --bean idwelcomeController classcom.example.WelcomeControllerproperty namemessageService refmessageService//bean /beans4.使用Spring容器读取配置并获取Bean import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;public class MainApp {public static void main(String[] args) {ApplicationContext context new ClassPathXmlApplicationContext(spring-config.xml);WelcomeController controller context.getBean(WelcomeController.class);System.out.println(controller.printMessage()); // 输出Hello from SimpleMessageService!} }注解配置方式 同样定义MessageService接口和SimpleMessageService实现类。使用Autowired注解进行自动注入 import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component;Component public class WelcomeController {private final MessageService service;Autowiredpublic WelcomeController(MessageService service) {this.service service;}public String printMessage() {return this.service.getMessage();} }使用ComponentScan注解开启自动扫描并在主类中创建Spring应用上下文 import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext;SpringBootApplication ComponentScan(basePackages com.example) // 替换为你自己的包名 public class MainApp {public static void main(String[] args) {ApplicationContext context SpringApplication.run(MainApp.class, args);WelcomeController controller context.getBean(WelcomeController.class);System.out.println(controller.printMessage()); // 输出Hello from SimpleMessageService!} }通过以上示例可以看到无论是XML配置还是注解配置WelcomeController都不再直接创建MessageService对象而是由Spring IoC容器自动注入所需的服务对象实现了控制反转。这样做的好处在于降低耦合度提高代码的可测试性和可维护性。 二、Spring Core Container Spring Core Container是Spring框架的核心部分它负责创建、配置、组装和管理Bean即Java对象。这部分主要包括BeanFactory和ApplicationContext两大核心接口以及它们的实现。 BeanFactory BeanFactory是Spring IoC容器的基本实现它负责读取配置元数据如XML、注解或Java配置类根据这些元数据创建Bean并管理Bean的生命周期。 由于BeanFactory的使用已经逐渐被功能更强大的ApplicationContext所替代这里不做具体示例仅做概念上的介绍。 ApplicationContext ApplicationContext是BeanFactory的超集提供了更多的高级特性如AOP支持、事件发布、国际化资源访问等。常见的ApplicationContext实现有ClassPathXmlApplicationContext、AnnotationConfigApplicationContext等。 XML配置示例 // applicationContext.xml beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 定义一个Bean --bean idmyBean classcom.example.MyBean!-- 设置属性 --property namesomeProperty valuesomeValue//bean/beans// Java代码 import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;public class MainApp {public static void main(String[] args) {// 加载并初始化ApplicationContextApplicationContext context new ClassPathXmlApplicationContext(applicationContext.xml);// 从容器中获取BeanMyBean myBean context.getBean(MyBean.class);System.out.println(myBean.getSomeProperty()); // 输出someValue} }// MyBean.java package com.example;public class MyBean {private String someProperty;public void setSomeProperty(String someProperty) {this.someProperty someProperty;}public String getSomeProperty() {return someProperty;} }注解配置示例 // 使用Configuration标注的配置类 import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;Configuration public class AppConfig {// 使用Bean注解定义一个BeanBeanpublic MyBean myBean() {MyBean bean new MyBean();bean.setSomeProperty(configured using annotation);return bean;} }// 主类 import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import com.example.MyBean;public class MainApp {public static void main(String[] args) {// 初始化AnnotationConfigApplicationContext并注册配置类AnnotationConfigApplicationContext context new AnnotationConfigApplicationContext(AppConfig.class);// 从容器中获取BeanMyBean myBean context.getBean(MyBean.class);System.out.println(myBean.getSomeProperty()); // 输出configured using annotation} }// MyBean.java 保持不变在上述示例中Spring Core Container负责解析配置信息并据此创建Bean。当从容器中获取Bean时若Bean尚未创建则会按需实例化并注入所需的依赖。此外Spring容器还会管理Bean的生命周期如初始化回调方法如PostConstruct和销毁回调方法如PreDestroy。 三、Spring AOPAspect Oriented Programming面向切面编程 Spring AOP面向切面编程允许开发者将横切关注点如日志记录、事务管理、性能监控等与业务逻辑分离通过预定义的“切面”来统一处理这些通用功能。下面是一个简单的Spring AOP使用示例我们将创建一个日志切面来记录方法的执行时间。 首先定义一个自定义的切面注解 import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target;Target(ElementType.METHOD) Retention(RetentionPolicy.RUNTIME) public interface LogExecutionTime { }接下来创建一个切面类该类包含一个通知advice即在方法执行前后进行操作的逻辑 import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.springframework.stereotype.Component;Aspect Component public class LoggingAspect {Around(annotation(LogExecutionTime))public Object logExecutionTime(ProceedingJoinPoint joinPoint) throws Throwable {long start System.currentTimeMillis();// 执行原方法Object result joinPoint.proceed();long executionTime System.currentTimeMillis() - start;// 打印方法执行时间System.out.println(joinPoint.getSignature() executed in executionTime ms);return result;} }然后在业务类中使用自定义注解 import org.springframework.stereotype.Service;Service public class BusinessService {LogExecutionTimepublic void doSomethingTimeConsuming() {// 假设这是耗时的操作try {Thread.sleep(1000);} catch (InterruptedException e) {Thread.currentThread().interrupt();}} }最后确保在Spring配置中启用了AOP代理如果是Spring Boot项目则默认已启用AOP如果不是可以通过XML或Java配置启用 !-- spring-context.xml -- aop:aspectj-autoproxy /或 // JavaConfig EnableAspectJAutoProxy public class AppConfig {}现在每次调用BusinessService的doSomethingTimeConsuming方法时LoggingAspect切面中的logExecutionTime方法都会在其前后执行打印出方法的执行时间。 通过这种方式我们无需修改业务类本身的代码就可以为其添加日志记录这一横切关注点。这就是Spring AOP的工作原理它通过代理机制在方法执行的前后插入额外逻辑实现功能的解耦和复用。 四、Spring MVC Spring MVC是Spring框架的一部分用于构建web应用程序它遵循模型-视图-控制器MVC设计模式。下面是一个简化的Spring MVC示例包括控制器(Controller)、模型(Model)和视图(View)的配置和使用。 1. 创建Controller类 import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping;Controller public class HelloWorldController {GetMapping(/hello)public String helloWorld(Model model) {// 设置模型数据model.addAttribute(message, Hello, World!);// 返回视图名称Spring MVC将会查找对应的视图解析策略来渲染视图return hello; // 这里假设有一个名为hello的jsp/html模板} }在这个例子中我们创建了一个名为HelloWorldController的控制器类使用Controller注解标识为一个Spring MVC控制器。helloWorld方法通过GetMapping(/hello)注解映射到/hello这个HTTP GET请求路径上。当用户访问http://example.com/hello时这个方法会被调用。它将字符串Hello, World!放入模型对象中并返回视图名称hello表示需要渲染名为hello的视图。 2. 创建视图模板HTML/JSP 假设在src/main/resources/templates目录下有一个名为hello.html或hello.jsp的视图文件 !-- hello.html 或 hello.jsp -- !DOCTYPE html html langen headmeta charsetUTF-8titleHello World Example/title /head bodyh1${message}/h1 /body /html在这个视图模板中${message}是Thymeleaf或JSP EL表达式它会从模型对象中取出之前设置的message值并显示出来。 3. 配置Spring MVC 对于Spring Boot项目通常不需要手动配置Spring MVC因为它已经内嵌了自动配置功能。但如果不是Spring Boot项目你需要在XML配置文件中配置DispatcherServlet和其他相关bean。 !-- servlet-context.xml -- beans xmlnshttp://www.springframework.org/schema/beansxmlns:mvchttp://www.springframework.org/schema/mvcxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/mvchttp://www.springframework.org/schema/mvc/spring-mvc.xsd!-- 自动扫描Controller注解的类 --context:component-scan base-packagecom.example.controller /!-- 视图解析器配置 --bean classorg.springframework.web.servlet.view.InternalResourceViewResolverproperty nameprefix value/WEB-INF/views/ /property namesuffix value.jsp //bean/beans在这个配置中context:component-scan标签告诉Spring扫描指定包下标记为Controller的类将其注册为Spring MVC控制器。同时配置了一个InternalResourceViewResolver设置前缀和后缀使得Spring MVC能够根据Controller返回的视图名称找到对应的视图资源。 综上所述当用户发送GET请求到/hello时Spring MVC会调度HelloWorldController的helloWorld方法处理请求将结果存入模型并根据返回的视图名称hello结合视图解析器的配置找到并渲染对应的视图文件最终将渲染后的HTML页面返回给浏览器。 五、Spring Data Access Spring Data Access是Spring框架的一个重要组成部分它为简化数据访问层的开发提供了多种解决方案包括但不限于对JDBC、JPA、Hibernate、MyBatis等多种持久化技术的支持。下面以使用Spring Data JPA为例演示如何通过Spring Data访问数据库。 示例代码Spring Data JPA实体类 import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id;Entity public class User {IdGeneratedValue(strategy GenerationType.AUTO)private Long id;private String username;private String password;// getters and setters// ... }示例代码Spring Data JPA Repository接口 import org.springframework.data.jpa.repository.JpaRepository;public interface UserRepository extends JpaRepositoryUser, Long {// Spring Data JPA可以自动生成基本CRUD操作// 如findAll(), findById(), save(), deleteById()// 也可以自定义查询方法ListUser findByUsername(String username); }示例代码配置Spring Data JPA // application.properties spring.datasource.urljdbc:mysql://localhost:3306/mydb spring.datasource.usernameroot spring.datasource.passwordyourpassword spring.jpa.hibernate.ddl-autoupdate spring.jpa.show-sqltrue// Spring Boot主启动类配置 import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.data.jpa.repository.config.EnableJpaRepositories;SpringBootApplication EnableJpaRepositories(basePackageClasses UserRepository.class) // 激活JPA仓库 public class Application {public static void main(String[] args) {SpringApplication.run(Application.class, args);} }使用示例 import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;Service public class UserService {private final UserRepository userRepository;Autowiredpublic UserService(UserRepository userRepository) {this.userRepository userRepository;}public User createUser(String username, String password) {User user new User();user.setUsername(username);user.setPassword(password);return userRepository.save(user);}public User getUserByUsername(String username) {return userRepository.findByUsername(username).orElse(null);} }在这个例子中我们首先定义了一个JPA实体类User其中Entity注解表明这是一个数据库表的映射实体Id和GeneratedValue标明了主键生成策略。 然后我们定义了一个继承自JpaRepository的接口UserRepositorySpring Data JPA可以根据这个接口自动生成一系列的CRUD操作如保存、删除、查找等。同时我们也定义了一个自定义的查询方法findByUsername。 在配置方面我们在application.properties中配置了数据库连接信息并在Spring Boot主启动类中激活了JPA仓库。 最后我们创建了一个服务类UserService它依赖注入了UserRepository并通过这个repository完成对数据库的增删查改操作。 六、Spring Test Spring Test模块提供了对Spring应用的集成测试支持使得开发者可以在模拟Spring环境例如模拟ApplicationContext中对组件进行测试。以下是一个使用Spring Boot和JUnit5进行单元测试和集成测试的示例代码和详细讲解 单元测试针对单个服务类的方法 import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest;SpringBootTest(classes YourApplication.class) class UserServiceTest {Autowiredprivate UserService userService;Testvoid testFindUserById() {// 假设我们有一个找寻用户的findById方法User mockUser new User(1L, username, password);// 可以通过Mockito等工具模拟数据源行为when(userRepository.findById(1L)).thenReturn(Optional.of(mockUser));// 调用待测试方法OptionalUser foundUser userService.findById(1L);// 断言验证assertTrue(foundUser.isPresent());assertEquals(username, foundUser.get().getUsername());} }在上述单元测试示例中我们使用SpringBootTest注解加载整个Spring Boot应用上下文以便测试类可以注入实际服务类的实例。我们通过模拟数据源行为来测试UserService的findById方法。 集成测试针对多个组件协作 import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.test.annotation.Rollback; import org.springframework.transaction.annotation.Transactional;DataJpaTest AutoConfigureTestDatabase(replace AutoConfigureTestDatabase.Replace.NONE) // 使用真实数据库 class UserAndRoleIntegrationTest {Autowiredprivate UserRepository userRepository;Autowiredprivate RoleRepository roleRepository;Autowiredprivate UserService userService;TestTransactionalRollback(false) // 不回滚事务测试后保留数据变化void testAssignRoleToUser() {// 创建用户和角色User user new User(test-user);Role role new Role(test-role);roleRepository.save(role);userRepository.save(user);// 测试方法userService.assignRoleToUser(user.getId(), role.getId());// 验证用户是否成功分配了角色User fetchedUser userRepository.findById(user.getId()).orElseThrow();SetRole roles fetchedUser.getRoles();assertTrue(roles.contains(role));} }在集成测试示例中我们使用DataJpaTest注解只加载JPA相关的组件如EntityManagerFactory、DataSource等这样可以专注于数据库相关的集成测试。通过Transactional和Rollback注解来控制事务的行为便于在测试结束后检查数据库的实际状态。 总结起来Spring Test模块通过各种注解和配置使开发者能够在接近生产环境的情况下对应用程序的不同层次进行单元测试和集成测试从而保证代码质量。 七、Spring WebFlux反应式编程 Spring WebFlux是Spring Framework 5引入的新模块它支持非阻塞、反应式编程模型特别适合处理高并发场景。WebFlux主要基于Reactor项目使用Flux和Mono作为响应式序列类型用于处理0至N个元素或者0至1个元素的数据流。 以下是一个简单的Spring WebFlux控制器示例及其详细讲解 import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono;import java.time.Duration; import java.util.stream.IntStream;RestController public class ReactiveController {GetMapping(/stream)public FluxInteger streamNumbers() {// 生成一个无限序列每秒输出一个数字直到客户端取消请求return Flux.interval(Duration.ofSeconds(1)).map(l - IntStream.rangeClosed(1, l.intValue()).findFirst().orElse(0));}GetMapping(/single)public MonoString getSingleValue() {// 返回Mono代表可能产生0个或1个值return Mono.just(Hello, WebFlux!);}GetMapping(/async-processing)public MonoString asyncProcessing() {// 异步处理模拟耗时操作return Mono.fromCallable(() - {Thread.sleep(2000); // 模拟耗时操作return Processed Asynchronously!;});} }详细讲解 1.streamNumbers方法 使用Flux.interval()生成一个按照指定间隔这里是每秒发出整数序列的Flux。这可以用来模拟实时更新的数据流比如股票价格变化、消息队列消费等。map操作符用于转换每个发出的Long值为范围内的整数序列。 2.getSingleValue方法 返回的是Mono类型表示预期最多有一个值。在这里我们立即发出一个字符串常量。 3.asyncProcessing方法 使用Mono.fromCallable()包装一个耗时的计算任务使其异步执行。当客户端发起请求时不会阻塞线程而是立刻返回一个Mono实例客户端收到的是一个未完成的任务表示只有当任务完成后客户端才会接收到实际的结果。 通过这样的方式Spring WebFlux利用Reactor提供的背压Backpressure机制可以有效地处理大量并发请求而不会因为同步阻塞导致线程资源浪费。并且WebFlux完全兼容非阻塞IONIO可以充分利用现代操作系统和服务器硬件的能力。 八、Spring Security Spring Security是Spring框架中提供身份验证Authentication和授权Authorization的模块。下面是一个简单的Spring Security示例展示如何配置一个基础的登录认证流程并保护REST API资源。 首先我们需要配置Spring Security的入口点entry point和用户详情服务UserDetailsService import org.springframework.context.annotation.Bean; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter {Overrideprotected void configure(HttpSecurity http) throws Exception {http.authorizeRequests()// 允许任何人访问主页.antMatchers(/, /home).permitAll()// 所有其他API需要经过身份验证.anyRequest().authenticated().and()// 登录表单配置.formLogin().loginPage(/login).permitAll().and()// 登出功能配置.logout().permitAll();}Overrideprotected void configure(AuthenticationManagerBuilder auth) throws Exception {auth.inMemoryAuthentication().withUser(user).password(passwordEncoder().encode(password)).roles(USER).and().withUser(admin).password(passwordEncoder().encode(adminPass)).roles(USER, ADMIN);}Beanpublic PasswordEncoder passwordEncoder() {return new BCryptPasswordEncoder();}// 如果你想从数据库加载用户信息需要实现UserDetailsService接口/*Beanpublic UserDetailsService userDetailsService() {return new CustomUserDetailsService(); // 自定义的UserDetailsService实现}*/ }在上述代码中 configure(HttpSecurity http) 方法用于配置Spring Security对HTTP请求的处理规则包括哪些URL需要身份验证、哪些可以公开访问以及如何处理登录和登出请求。configure(AuthenticationManagerBuilder auth) 方法用于配置身份验证管理器这里我们使用内存中的用户存储创建两个用户user和admin并使用BCryptPasswordEncoder加密他们的密码。passwordEncoder() 方法返回一个PasswordEncoder实例用于密码的加密处理。 如果你想从数据库加载用户信息可以注释掉内存用户配置的部分改为注入一个实现了UserDetailsService接口的自定义服务类该类从数据库加载用户信息并验证用户凭据。 接下来如果你想要处理登录和登出请求还需要在应用中创建相应的登录表单页面和处理登录请求的控制器方法。 例如登录表单可能会提交到 /login URLSpring Security会自动处理登录过程如果用户名和密码匹配就会创建一个代表已认证用户的SecurityContext并在后续请求中维护这个上下文。 要保护特定的REST API资源只需在configure(HttpSecurity http)方法中进一步细化规则例如 http.authorizeRequests().antMatchers(/api/**).hasRole(USER).antMatchers(/admin/api/**).hasRole(ADMIN);这段配置意味着所有以/api/开头的请求需要拥有USER角色而以/admin/api/开头的请求则需要拥有ADMIN角色。 总结 通过上面的示例我们了解了Spring Framework在Web开发中的应用。当然Spring的功能远不止于此它还提供了丰富的扩展和集成方案如Spring Boot、Spring Cloud等。掌握Spring Framework对于Java开发者来说是非常有价值的它能够帮助我们构建高效、稳定的企业级应用。希望本文能为您的Spring学习之旅提供帮助。

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

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

相关文章

网站建设公司知名网站建设有哪些公司

优化nginx进程个数的策略 在高并发、高访问量的web服务场景,需要事先启动好更多的nginx进程,以保证快速响应并处理大量并发用户的请求。worker_processes 1;一般调整到与CPU的颗数相同查看LInux可查看CPU个数及总核数grep processor /proc/cpuinfo|wc …

自己做网站挣钱不4米高挡土墙模板加固

拼多多,作为中国电商市场的巨头之一,自成立以来一直保持着高速的发展态势。其API的开放为开发者提供了无限的可能性和创新空间,使得更多的商业逻辑和功能得以实现。本文将深入探讨拼多多API的未来发展,以及它所具备的无限可能性和…

家用电脑做网站后台制作游戏编辑器app

Dubbo配置开发环境 很多小伙伴在使用docker部署Dubbo-Admin会出现浏览器无法访问问题,但是虚拟机防火墙都是关着的,那么这可能是镜像源出现问题了,可以按照如下方法操作: 先将现有的镜像和容器全部删除(配置完镜像源需…

网站开发人员岗位怎么做网页链接文章

题目描述 输入一个整数n。 1、判断它是否为素数,是输出“Y,不是输出“N”. 2、输出这个数的各位数字之和。 3、求出这个数所有约数的和。 4、求出1到n的和。 5、输出这个数的倒序数(不包含前导0)。 输入格式 一行一个整数。 输出格式 五…

wordpress建站多用户东莞智通人才最新招聘

需求是有两个笔记本,一个笔记本闲置,另一个笔记本是主力本。想将另一个闲置的笔记本连接到主力本上作为拓展屏使用。网上搜了好久,有一些人提到了,也有一些视频但是文章比较少。简单总结一下吧 上述需求有两种方式 第一种&#x…

诸城网站建设费用电商网站设计目的

文章目录 区块链的基础概念什么是区块链?区块链的核心原理1. 分布式账本2. 区块3. 加密技术4. 共识机制 区块链的工作原理区块链的交易过程区块链的安全性共识机制的作用 区块链的应用领域1. 金融服务2. 供应链管理3. 物联网4. 医疗保健5. 政府与公共服务 区块链的未…

展示型网站可以做推广的吗wordpress禁止国外用户注册

判断题 1.Ability是系统调度应用的最小单元,是能够完成一个独立功能的组件。一个应用可以包含一个或多个Ability。 正确(True) 2.所有使用Component修饰的自定义组件都支持onPageShow,onBackPress和onPageHide生命周期函数。 错误(False) 3.每调用一次router.pushUrl()方法,…

django做网站效率高吗网站建设价格一览表

1.服务器配置 服务器系统:Centos7.9 x64 显卡:RTX3090 (24G) 2.安装环境 2.1 检查conda是否安装 输入命令:conda -V 如果显示conda 4.7.12,说明已经有不需要安装 2.2 安装Miniconda 在家目录建一个mi…

上海网站建设找摩彼深圳软件开发招聘信息

计算机网络 目录​​​​​​​ 一、计算机网络概述 (一)计算机网络基本概念 1、计算机网络的定义、组成与功能 2、计算机网络的分类 3、计算机网络主要性能指标 (二)计算机网络体系结构 1、计算机网络分层结构 2、计算机网络协议、接口、服务等概念 3、I…

大型网站建设价格装修公司做网站有用吗

反射是Java框架的核心,无论是Tomcat,SpringMVC,SpringIOC,SpringAOP,动态代理,都使用了反射 那么什么是反射?-------------反射就是获取类信息的能力 Java有两种创建对象的方式:①…

优秀的定制网站建设南宁房地产最新消息

目录 准备工作 安装必需的软件 安装appium 安装XCode 下载WDA工程 配置WDA工程 搭建appiumwda自动化环境 第一步:启动通过xcodebuild命令启动wda服务 分享一下如何在mac电脑上搭建一个完整的appium自动化测试环境 准备工作 前期需要准备的设备和账号&…

微信小程序商城收费吗sem和seo是什么职业岗位

SpringCloud之Nacos注册中心 Nacos注册中心nacos启动服务注册到Nacosnacos服务分级模型NacosRule负载均衡策略根据集群负载均衡加权负载均衡Nacos环境隔离-namespace Nacos与eureka的对比临时实例与非临时实例设置 Nacos配置管理统一配置管理微服务配置拉取配置自动刷新远端配置…

有哪些单页网站百度推广网页制作

在上一章中ASP.NET Core 认证与授权[5]:初识授权,详细介绍了 ASP.NET Core 中的授权策略,在需要授权时,只需要在对应的Controler或者Action上面打上[Authorize]特性,并指定要执行的策略名称即可,但是,授权策…

邢台提供网站建设公司电话成都成仁路网站建设

第3章 系统分析 用户的需求以及与本系统相似的在市场上存在的其它系统可以作为系统分析中参考的资料,分析人员可以根据这些信息确定出本系统具备的功能,分析出本系统具备的性能等内容。 3.1可行性分析 尽管系统是根据用户的要求进行制作,但是…

网站建设 软件开发的公司排名免费网站制作在线

SSH是运维和开发人员接触比较多的工具,一般用SSH来连接远程服务器,这个是我的一些免费客户和企业客户经常使用的场景,当然SSH除了远程连接之外,还有很多额外的用途,比如SSH本身是具备代理功能的,我们也有一…

网站建设的空间是什么意思手机优化不到80怎么办

在开启Python系列学习之后,我们就大概讲了数字类型及数学函数的基础语法。这一篇博客,我们就将详细介绍Python中的数字类型、数学函数、随机数函数、三角函数以及数学常量,同时,为大家提供一些示例代码帮助大家更好地理解它们的用…

不同企业的网络营销网站深圳 网站设计

目录 引言一、环境准备二、安装sqoop下载sqoop包解压文件 三、配置Sqoop下载mysql驱动拷贝hive的归档文件配置环境变量修改sqoop-env.sh配置文件替换版本的commons-lang的jar包 验证Sqoop安装查看Sqoop版本测试Sqoop连接MySQL数据库是否成功查看数据库查看数据表去除警告信息 四…

网站流量10g专业的高端网站制作公司

选自towardsdatascience作者:Farhad Malik机器之心编译编辑:陈萍近日,Python 3.9 发布,并开发了一些新特性,包括字典合并与更新、新的解析器、新的字符串函数等。Python 3.9 已于 10 月 5 日发布,新版本的特…

专注徐州网站开发廊坊排名推广

在一般的互联网应用中限流是一个比较常见的场景,也有很多常见的方式可以实现对应用的限流比如通过令牌桶通过滑动窗口等等方式都可以实现,也可以在整个请求流程中进行限流比如客户端限流就是在客户端通过随机数直接返回成功失败来决定是否发起请求。也可…