首页
学习
活动
专区
工具
TVP
发布

产品优化

专栏作者
132
文章
149165
阅读量
27
订阅数
【ES三周年】+数据资源目录总体架构中的ES
三年前负责的数据资源目录项目按照“一平台、组件化、微应用”原则,采用“自主研发”的方式进行构建。基于国网SG-UAP3.0平台开发,技术架构如下图所示:
数媒派
2023-02-15
5601
Spring Validation
Spring 为了给开发者提供便捷,对 hibernate validation 进行了二次封装,显示校验 validated bean 时,可以使用 spring validation 或者 hibernate validation。
数媒派
2022-12-01
3960
Spring Boot
Spring Boot 的角色:Spring Framework -> Spring Boot -> Spring Cloud。
数媒派
2022-12-01
8900
Spring·JPA
JPA 即 Java 持久化 API(Java Persistence API),是一个用于映射 Java 对象和关系型数据库表的规范。此规范使得开发者可以不依赖特定数据库,也能很好地 CRUD(创建、读取、更新、删除)。
数媒派
2022-12-01
3.3K0
Spring·Mybatis 逆向代码生成
resources/generator/generatorConfig.xml 文件如下:
数媒派
2022-12-01
2790
Vue Tips
目的是在不刷新页面的情况下更新路由,实现类似 location.reload() 的功能,区别是只更新路由而不是刷新整个页面。关于这个问题的讨论可以查看 Github Issues [Feature] A reload method like location.reload()。
数媒派
2022-12-01
7260
Vue 引入 SCSS
使用 vue init webpack 生成的 vue 模板项目中引入 scss 步骤:
数媒派
2022-12-01
9340
Vue 一键导出 PDF
生成 PDF 基本思路大多一致,先用 html2canvas 将 DOM 元素转换为 canvas,再利用 canvas 的 toDataURL 方法输出为图片,最后使用 jsPDF 添加图片生成 PDF 实现一键下载。
数媒派
2022-12-01
1.6K0
Vue·动态可响应对象
Vue.observable(object) 让一个对象可响应。Vue 内部会用它来处理 data 函数返回的对象。返回的对象可以直接用于渲染函数和计算属性内,并且会在发生变更时触发相应的更新。也可以作为最小化的跨组件状态存储器,用于简单的场景
数媒派
2022-12-01
5810
Vue 项目引入 SVG 图标
SVG 是一种可缩放矢量图形(Scalable Vector Graphics,SVG)是基于可扩展标记语言(XML),用于描述二维矢量图形的图形格式。SVG 由 W3C 制定,是一个开放标准。
数媒派
2022-12-01
1.9K0
Spring Boot 跨域解决方式
要解释跨域,先要了解同源策略,所谓同源策略就是在浏览器端出于安全考量,向服务端发起请求必须满足:协议相同、Host(ip)相同、端口相同,否则访问将被禁止,该访问也就被称为跨域访问。
数媒派
2022-12-01
5690
Spring 异步请求
With the above in mind, the following is the sequence of events for async request processing with a Callable:
数媒派
2022-12-01
7710
Spring·JWT
JWT 是 JSON WEB TOKEN 的缩写,它是基于 RFC 7519 标准定义的一种可以安全传输的的 JSON 对象,由于使用了数字签名,所以是可信任和安全的。
数媒派
2022-12-01
5870
Spring Boot 定时任务
首先在 SpringBoot 启动类加上 @EnableScheduling 启用定时任务。
数媒派
2022-12-01
2520
Spring Security oAuth2
oAuth 协议为用户资源的授权提供了一个安全的、开放而又简易的标准。Spring Security 实现了 oAuth 协议。
数媒派
2022-12-01
6710
Spring Data
工具类:获取 Connection,关闭 Connection、Statement、ResultSet。
数媒派
2022-12-01
1.7K0
Vue 构建项目写入配置文件
新建一个 client.js 脚本文件,将读取到的命令行参数写入 setting.js 文件:
数媒派
2022-12-01
3490
Python数据分析(中英对照)·Introduction to Matplotlib and Pyplot-Matplotlib 和 Pyplot 介绍
Matplotlib is a Python plotting library that produces publication-quality figures. Matplotlib是一个Python绘图库,用于生成出版物质量的图形。 It can be used both in Python scripts and when using Python’s interactive mode. 它既可以在Python脚本中使用,也可以在使用Python的交互模式时使用。 Matplotlib is a very large library, and getting to know it well takes time. Matplotlib是一个非常大的库,了解它需要时间。 But often we don’t need the full matplotlib library in our programs,and this is where Pyplot comes in handy. 但是我们的程序中通常不需要完整的matplotlib库,这就是Pyplot的用武之地。 Pyplot is a collection of functions that make matplotlib work like Matlab,which you may be familiar with. Pyplot是一组函数,使matplotlib像Matlab一样工作,您可能熟悉这些函数。 Pyplot is especially useful for interactive work,for example, when you’d like to explore a dataset or visually examine your simulation results. Pyplot对于交互式工作尤其有用,例如,当您希望浏览数据集或直观地检查模拟结果时。 We’ll be using Pyplot in all our data visualizations. 我们将在所有数据可视化中使用Pyplot。 Pyplot provides what is sometimes called a state machine interface to matplotlib library. Pyplot为matplotlib库提供了有时称为状态机的接口。 You can loosely think of it as a process where you create figures one at a time,and all commands affect the current figure and the current plot. 您可以粗略地将其视为一个一次创建一个地物的过程,所有命令都会影响当前地物和当前绘图。 We will mostly use NumPy arrays for storing the data that we’d like to plot, but we’ll occasionally use other types of data objects such as built-in lists. 我们将主要使用NumPy数组来存储要绘制的数据,但偶尔也会使用其他类型的数据对象,如内置列表。 As you may have realized, saying matplotlib.pyplot is kind of a mouthful, and it’s a lot to type too. 正如您可能已经意识到的那样,说matplotlib.pyplot有点口齿不清,而且打字也很费劲。 That’s why virtually everyone who uses the library imports it as plt, which is a lot shorter. 这就是为什么几乎所有使用该库的人都将其作为plt导入,而plt要短得多。 So to import the library, we will type the following– import matplotlib.pyplot as plt. 因此,要导入库,我们将键入以下内容–import matplotlib.pyplot as plt。 Now we are ready to start our plotting. 现在我们准备开始我们的阴谋。 A basis but very useful command is the plt plot function, which can be used to plot lines and markers. plt plot函数是一个基本
数媒派
2022-12-01
4300
Python数据分析(中英对照)·Simulating Randomness 模拟随机性
Many processes in nature involve randomness in one form or another. 自然界中的许多过程都以这样或那样的形式涉及随机性。 Whether we investigate the motions of microscopic molecules or study the popularity of electoral candidates,we see randomness, or at least apparent randomness, almost everywhere. 无论我们研究微观分子的运动,还是研究候选人的受欢迎程度,我们几乎处处都能看到随机性,或者至少是明显的随机性。 In addition to phenomena that are genuinely random,we often use randomness when modeling complicated systems 除了真正随机的现象外,我们在建模复杂系统时经常使用随机性 to abstract away those aspects of the phenomenon for which we do not have useful simple models. 将我们没有有用的简单模型的现象的那些方面抽象出来。 In other words, we try to model those parts of a process that we can explain in relatively simple terms,and we assume, true or not, that the rest is noise. 换句话说,我们试图对过程中那些我们可以用相对简单的术语解释的部分进行建模,并且我们假设,不管是真是假,其余部分都是噪音。 To put this differently, we model what we can,and whatever it happens to be left out, we attribute to randomness. 换一种说法,我们对我们能做的事情进行建模,不管发生什么,我们都将其归因于随机性。 These are just some of the reasons why it’s important to understand how to simulate random numbers and random processes using Python. 这些只是理解如何使用Python模拟随机数和随机进程很重要的一些原因。 We have already seen the random module. 我们已经看到了随机模块。 We will be using that to simulate simple random processes,but we’ll also take a look at some other tools the Python has to generate random numbers. 我们将使用它来模拟简单的随机过程,但我们还将看看Python生成随机数的其他一些工具。 Let’s see how we can use the random choice function to carry out perhaps the simplest random process – the flip of a single coin. 让我们看看如何使用随机选择函数来执行可能是最简单的随机过程——抛一枚硬币。 I’m first going to import the random library. 我首先要导入随机库。 So I type import random. 所以我输入import random。 Then we’ll use the random choice function. 然后我们将使用随机选择函数。 We first need parentheses. 我们首先需要括号。 And in this case, we need some type of a sequence, here a list,to contain the elements of the sequence. 在这种情况下,我们需要某种类型的序列,这里是一个列表,来包含序列的元素。 I’m going to go with two strings, H for heads and T for tails. 我要用两根弦,H代表正面,T代表反面。 If I now run this code, Python will pick one of the
数媒派
2022-12-01
4060
Python数据分析(中英对照)·Classes and Object-Oriented Programming类和面向对象编程
Our emphasis has been and will be on functions and functional programming,but it’s also helpful to know at least something about classes and object-oriented programming. 我们的重点一直是函数和函数编程,但至少了解一些类和面向对象编程也是很有帮助的。 In general, an object consists of both internal data and methods that perform operations on the data. 通常,对象由内部数据和对数据执行操作的方法组成。 We have actually been using objects and methods all along,such as when working with building types like lists and dictionaries. 事实上,我们一直在使用对象和方法,例如在处理列表和字典之类的构建类型时。 You may find at some point that an existing object type doesn’t fully suit your needs, in which case you can create a new type of object known as a class. 在某些情况下,您可能会发现现有的对象类型并不完全满足您的需要,在这种情况下,您可以创建一种称为类的新对象类型。 Often it is the case that even if you need to create a new object type,it is likely that this new object type resembles,in some way, an existing one. 通常情况下,即使需要创建新的对象类型,该新对象类型也可能在某种程度上类似于现有对象类型。 This brings us to inheritance, which is a fundamental aspect of object-oriented programming. 这就引出了继承,这是面向对象编程的一个基本方面。 Inheritance means that you can define a new object type, a new class, that inherits properties from an existing object type. 继承意味着您可以定义一个新的对象类型,一个新的类,它继承现有对象类型的属性。 For example, you could define a class that does everything that Python’s built-in lists do, and then add an additional method or methods based on your needs. 例如,您可以定义一个类来完成Python内置列表所做的一切,然后根据需要添加一个或多个附加方法。 As a quick reminder of how we’ve been using methods so far,let’s define a list, ml, which consists of a sequence of numbers. 为了快速提醒我们到目前为止是如何使用方法的,让我们定义一个列表ml,它由一系列数字组成。 If I wanted to sort this list, I can use the sort method which is provided by the ml object, a list. 如果我想对这个列表进行排序,我可以使用由ml对象(列表)提供的排序方法。 If I now look at the contents of the list,we can see that the values have been sorted. 如果我现在查看列表的内容,我们可以看到这些值已被排序。 Let’s look at an example of how to create a new class,essentially a new type of Python object. 让我们看一个如何创建一个新类的示例,本质上是一个新类型的Python对象。 A class is defined using the class statement. 类是使用class语句定义的。 Class,
数媒派
2022-12-01
2550
点击加载更多
社区活动
腾讯技术创作狂欢月
“码”上创作 21 天,分 10000 元奖品池!
Python精品学习库
代码在线跑,知识轻松学
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档