如何计算距标记 A 给定距离(以米为单位)和给定角度(以度为单位)处的新点(标记 B)?
Google API 有这个,但我在 Leaflet 中找不到它:
var pointA = new google.maps.LatLng(25.48, -71.26);
var radiusInKm = 10;
var pointB = pointA.destinationPoint(90, radiusInKm);
Run Code Online (Sandbox Code Playgroud)
我尝试将Springboot 1.xy(Brussels-SR12)迁移到我使用的2.xy FeignClients
我更改Maven配置:
<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
Run Code Online (Sandbox Code Playgroud)
所以
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-openfeign</artifactId>
<version>2.0.0.RELEASE</version>
Run Code Online (Sandbox Code Playgroud)
我更改所有导入:
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.feign.FeignClient;
Run Code Online (Sandbox Code Playgroud)
至
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
Run Code Online (Sandbox Code Playgroud)
我使用此接口:
@FeignClient(value = "COMPANY", fallbackFactory = CompanyClientFallbackFactory.class, configuration = FeignConfiguration.class)
public interface CompanyClient extends CompanyApi {
}
Run Code Online (Sandbox Code Playgroud)
当我运行JUnit测试(使用spring上下文)时,我现在遇到此错误(不在Springboot 1.xy和旧的netflix包中):
The bean 'COMPANY.FeignClientSpecification', defined in null, could not be registered. A bean with that name has already been defined in null and overriding is disabled.
Run Code Online (Sandbox Code Playgroud)
完整跟踪:
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:125)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:108)
at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.postProcessFields(MockitoTestExecutionListener.java:99)
at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.injectFields(MockitoTestExecutionListener.java:79)
at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.prepareTestInstance(MockitoTestExecutionListener.java:54)
at …Run Code Online (Sandbox Code Playgroud) 我ngx-timepicker-field的在MatDialog。当我的时间选择器显示时,他在MatDialog模态弹出窗口的后面。
constructor(public dialog: MatDialog) { }
const dialogRef = this.dialog.open(PopupComponent, {
data: {
...
},
position: {
top: '50px'
}
});
Run Code Online (Sandbox Code Playgroud)
弹出组件:
@ViewChild('sendAlertHour', {static: false} ) sendAlertHour: NgxTimepickerFieldComponent;
<div>
<ngx-timepicker-field #sendAlertHour></ngx-timepicker-field>
</div>
Run Code Online (Sandbox Code Playgroud)
这是一个场景,一个用注释的控制器@RestController和一个需要验证参数的PUT方法@RequestBody。我@Valid在参数和 上使用注释@NotNull,@Min对 bean 字段使用注释,但它们不起作用。
代码在这里:
豆:
public class PurchaseWrapper {
@DecimalMin(value = "0.00",message = "discount must be positive")
@NotNull
private BigDecimal discount;
@NotNull
private Long merchandiseId;
@NotNull
private Long addressId;
@Min(1)
@NotNull
private Integer count;
}
Run Code Online (Sandbox Code Playgroud)
控制器
@RestController
@RequestMapping("merchandises")
public class MerchandiseController {
@RequestMapping(value = "purchase",method = RequestMethod.PUT)
public ResponseEntity<RestEntity> purchase(@Valid @Validated @RequestBody PurchaseWrapper purchaseWrapper,
@RequestParam String token){
return new ResponseEntity<>(merchandiseService.purchase(purchaseWrapper,token),HttpStatus.OK);
}
@Autowired
PurchaseWrapperValidator purchaseWrapperValidator;
@InitBinder(value = "purchaseWrapper") …Run Code Online (Sandbox Code Playgroud) 我使用一个variable.scss文件来自定义我的按钮。我的问题是NOT USE CSS but SCSS ONLY。
我从更改原色 (#66cccc) 和字体 (RobotoSlab) 开始:
$primary: #66cccc;
$font-family-base: RobotoSlab;
Run Code Online (Sandbox Code Playgroud)
但我想要白色的文字(见屏幕截图)但我的字体是黑色的
bootstrap 根据原色计算黑色/白色(如果它很暗或很亮)
我将 Chrome 和 chromewebdriver 更新到版本 77。在此之后,unable to set cookie当我addCookie.
System.setProperty("cookie", "auth=ok,path=/");
int indexValue = cookieStr.indexOf('=');
int indexPath = cookieStr.indexOf(",path=");
String cookieName = cookieStr.substring(0, indexValue);
String cookieValue = cookieStr.substring(indexValue + 1, indexPath);
String cookieDomain = new URI("http://localhost").getHost().replaceAll("self.", "");
String cookiePath = cookieStr.substring(indexPath + 6);
Cookie authCookie= new Cookie.Builder(cookieName, cookieValue).domain(cookieDomain).path(cookiePath).expiresOn(new SimpleDateFormat("dd/MM/yyyy").parse("31/12/2020")).build();
System.out.println("A");
driver.navigate().to("http://localhost:8000/unprotected");
System.out.println("B");
driver.get("http://localhost:8000/404");
System.out.println("C");
System.out.println("[" + driver.getPageSource()+"]");
Options b = a.manage();
System.out.println("Domain: " + cookie.getDomain());
System.out.println("Name: " + cookie.getName());
System.out.println("Path: " + cookie.getPath());
System.out.println("Value: " + …Run Code Online (Sandbox Code Playgroud) 我想隐藏我的材料按钮,但它不起作用。
我的按钮是灰色的(OK):
<button mat-raised-button class="mat-primary" (click)="deleteClick()" [disabled]="data.createMode">
<mat-icon>delete_forever</mat-icon>DELETE
</button>
Run Code Online (Sandbox Code Playgroud)
显示我的按钮(确定未隐藏):
<button mat-raised-button class="mat-primary" (click)="deleteClick()" [hidden]="data.createMode">
<mat-icon>delete_forever</mat-icon>DELETE
</button>
Run Code Online (Sandbox Code Playgroud) 有人知道如何在 Python 3.6 中禁用 chrome webdriver 中的调试器/日志记录吗?
我正在尝试以下代码,但它不起作用。
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--disable-infobars")
chrome_options.add_argument("--disable-logging")
chrome_options.add_argument("--disable-login-animations")
chrome_options.add_argument("--disable-notifications")
chrome_options.add_argument("--disable-default-apps")
driver = webdriver.Chrome(chrome_options=chrome_options, service_log_path='NUL', service_args=["--verbose", r"--log-path=D:\qc1.log"])
Run Code Online (Sandbox Code Playgroud)
Python 版本:3.6.1
Chrome 浏览器版本:62.0.3202.94(64 位)
网络驱动程序版本:2.33
操作系统:Win10(64位)
我想要增量值(如果存在),否则添加元素。
+-----------------------+
| id | iteration | data |
+-----------------------+
| 10 | 1 | foo1 |
| 11 | 1 | foo2 |
| 12 | 2 | foo3 |
+-----------------------+
Run Code Online (Sandbox Code Playgroud)
我的代码:
var AWS = require('aws-sdk');
var documentClient = new AWS.DynamoDB.DocumentClient({'region': 'eu-west-1'});
exports.handler = function(event, context, callback) {
var params = {
Item: {
id: uuid,
iteration: 1,
data: body.data
},
TableName: "my-table"
};
documentClient.put(params, function(err, data) {
if (err) {
console.log("Error", err);
const errResponse = {
statusCode: 500, …Run Code Online (Sandbox Code Playgroud) 我想在所有阶段添加一个条件:
pipeline {
agent { label 'unix' }
options {
buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '5'))
}
when {branch 'master' }
stages {
}
}
Run Code Online (Sandbox Code Playgroud)
我找到了添加when每个选项的任何解决方法steps,但我正在寻找一种只有一个的解决方案when
stage('master-branch-stuff') {
when {
branch 'master'
}
steps {
echo 'run this stage - ony if the branch = master branch'
}
}
Run Code Online (Sandbox Code Playgroud) java ×3
angular ×2
selenium ×2
spring ×2
spring-boot ×2
aws-lambda ×1
debugging ×1
javascript ×1
leaflet ×1
material-ui ×1
node.js ×1
python ×1
sass ×1
validation ×1
webdriver ×1