这是我的设置:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
span {
padding-left: 25px;
background: red;
}Run Code Online (Sandbox Code Playgroud)
<span></span>Run Code Online (Sandbox Code Playgroud)
我有设置为box-sizing:border-box和的 span 标签padding-left:25px。当这个span标签中没有任何值时,它的height和width是0。所以我希望span标签不会显示在网页上。但是,它仍然存在,我认为这是因为 padding-left 的原因。但我只设置了padding-left所以它仍然没有高度可显示。但是正如你在jsfiddle中看到的,padding显示在网页上......
为什么会发生这种情况?
我有一些关于 PostGIS 中的几何和地理的问题。
我目前正在使用 PostGIS 和 Postgresql。
我的大部分空间数据来自韩国,基本上是纬度和经度。
为了进行测试,我创建了两个具有相同纬度和经度数据但数据类型不同的表,一个用于 SRID 4326 的地理,另一个用于 SRID 5186 的几何。
create table geometry_stores
(
id serial primary key,
location geometry(POINT, 5186) not null
);
create table geography_stores
(
id serial primary key,
location geography(POINT, 4326) not null
);
Run Code Online (Sandbox Code Playgroud)
您可以在此链接上找到 EPSG 5186 的更多详细信息https://epsg.io/5186
这是我收到的问题清单:
PostGIS有这个方法
ST_DWithin(geometry g1, geometry g2, double precision distance_of_srid);
是distance_of_sridEPSG的单位吗?有什么方法可以将米(例如 1 公里)转换为distance_of_sridEPSG 5186 吗?
据我所知,地理计算将点之间的距离测量为球体上的真实路径,而几何计算将点之间的距离测量为笛卡尔平面上的真实路径。那么,如果我给以下查询提供完全相同的距离,它们应该产生不同的结果还是相同的结果?因为我的理解是,SRID 5186 的几何图形已经在地球变形的情况下进行投影,那么它们应该产生相同的结果?
select *
from geography_stores
where st_dwithin(location, st_setsrid(st_point(126.970769, 37.555479), 4326), same_distance_meter)
Run Code Online (Sandbox Code Playgroud)
select …Run Code Online (Sandbox Code Playgroud)我正在使用 Hibernate 在 Spring Boot 中开发 REST API。
我的控制器中有这个功能
@PostMapping("/profile")
public ResponseEntity<String> saveProfile(@Valid @RequestBody SaveProfileVM saveProfileVM,
BindingResult bindingResult)
throws JsonProcessingException {
if (bindingResult.hasErrors()) return super.fieldExceptionResponse(bindingResult);
Profile profile;
boolean optimisticLockException = true;
int retryCount = 0;
do {
try {
profile = accountService.saveProfile(saveProfileVM.getAccountId(),
saveProfileVM.getName(),
saveProfileVM.getEmail());
optimisticLockException = false;
retryCount++;
} catch (ObjectOptimisticLockingFailureException exception) {
retryCount++;
System.out.println(exception.getMessage());
}
} while (optimisticLockException && retryCount < MAX_OPTIMISTIC_LOCK_EXCEPTION_RETRY_COUNT);
return ResponseEntity.status(HttpStatus.OK).body(objectMapper.writeValueAsString(profile));
}
Run Code Online (Sandbox Code Playgroud)
并且MAX_OPTIMISTIC_LOCK_EXCEPTION_RETRY_COUNT是 3
我不想do..while and try..catch blocks在需要检查的每个方法中复制ObjectOptimisticLockingFailureException
do {
try{} …Run Code Online (Sandbox Code Playgroud) controller ×1
css ×1
function ×1
hibernate ×1
html ×1
lambda ×1
postgis ×1
postgresql ×1
spring-boot ×1