我正在 azure devops 代理上运行一些 API 测试并收到此警告错误消息
2021-05-21T13:42:29.0650201Z ##[error]DiscoveryMessage : Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Testhost process exited with error: Cannot use file stream for [C:\a\r1\a\_Automation-Build\drop\TestAutomation.UI.PageObject\bin\Debug\netcoreapp3.1\testhost.deps.json]: No such file or directory
2021-05-21T13:42:29.0661479Z ##[debug]Processed: ##vso[task.logissue type=error;]DiscoveryMessage : Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Testhost process exited with error: Cannot use file stream for [C:\a\r1\a\_Automation-Build\drop\TestAutomation.UI.PageObject\bin\Debug\netcoreapp3.1\testhost.deps.json]: No such file or directory
2021-05-21T13:42:29.0663114Z A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet'.
2021-05-21T13:42:29.0663661Z Failed to run as a self-contained app.
2021-05-21T13:42:29.0664305Z - The application …Run Code Online (Sandbox Code Playgroud) 我正在尝试生成位于半径为5公里的圆内的随机坐标(纬度,长度),其中心点位于某个坐标(x,y)处.我试图用红宝石编码,我正在使用该方法但不知何故,我得到的结果不在指定的5公里范围内.
def location(lat, lng, max_dist_meters)
max_radius = Math.sqrt((max_dist_meters ** 2) / 2.0)
lat_offset = rand(10 ** (Math.log10(max_radius / 1.11)-5))
lng_offset = rand(10 ** (Math.log10(max_radius / 1.11)-5))
lat += [1,-1].sample * lat_offset
lng += [1,-1].sample * lng_offset
lat = [[-90, lat].max, 90].min
lng = [[-180, lng].max, 180].min
[lat, lng]
end
Run Code Online (Sandbox Code Playgroud) 我在JSON中得到了一个响应,需要确保我在signal_events中只得到一个'信号'.我正在使用Ruby和rspec.
"signal_events": [
{
"id": "587e9ae969702d10bd5a0000",
"created_at": 1484692201,
"geo": {
"type": "Point",
"coordinates": [
-153.45703125,
59.67773438
]
},
"expires_at": 1484778601,
"geohashes": [
"bddg",
"bdeh"
],
"signal": {
"id": "587e9ae969702d0911060000",
"created_at": 1484692201.24,
"expires_at": 1484778601.24,
"signal_at": 1484691607,
"source": "usgs",
"updated_at": 1484692144,
"magnitude": 2,
"radius": 6.36107901750268,
"event_name": "earthquake",
"tsunami": "no"
},
"signal_type": "earthquake",
"centroid": {
"type": "Point",
"coordinates": [
-153.45703125,
59.67773438
]
},
"location": {
"country": "United States",
"country_code": "US",
"city": "Kenai Peninsula Borough",
"region": "Kenai Peninsula Borough",
"region_code": "AK"
}
},
Run Code Online (Sandbox Code Playgroud) 我正在尝试设置 SonarQube 7.8 版本。一旦我启动 sonar.sh 文件,它就会运行,但声纳停止后。
root@automation:/opt/sonarqube-7.8/bin/linux-x86-64# ./sonar.sh start
Starting SonarQube...
Started SonarQube.
root@automation:/opt/sonarqube-7.8/bin/linux-x86-64# ./sonar.sh status
SonarQube is not running.
Run Code Online (Sandbox Code Playgroud)
我检查了日志,这就是我得到的:
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2019.10.15 21:01:37 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube-7.8/temp
2019.10.15 21:01:37 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2019.10.15 21:01:37 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube-7.8/elasticsearch]: /opt/sonarqube-7.8/elasticsearch/bin/elasticsearch
2019.10.15 21:01:37 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up …Run Code Online (Sandbox Code Playgroud) 我有一系列哈希:
array = [
{:created_at => 1520913341, :event_id => '111', :album_id => '123'},
{:created_at => 1520740541, :event_id => '234', :album_id => '999'},
{:created_at => 1520654141, :event_id => '111', :album_id => '777'},
{:created_at => 1520394941, :event_id => '233', :album_id => '444'},
{:created_at => 1520049341, :event_id => '890', :album_id => '765'}
]
Run Code Online (Sandbox Code Playgroud)
我需要保持所有的哈希,:event_id如果:event_id是重复保持最早的:created_at那个.我怎么能在红宝石中做到这一点?
我希望得到以下答复:
[
{:created_at => 1520740541, :event_id => '234', :album_id => '999'},
{:created_at => 1520654141, :event_id => '111', :album_id => '777'},
{:created_at => 1520394941, …Run Code Online (Sandbox Code Playgroud)