我有一个对象,Person
它有两个属性Name
和Status
.从对象列表中我希望过滤掉Person
状态为的对象In Progress
.这是我的代码:
personList.stream().filter(
t -> t.getStatus().equalsIgnoreCase(
"In Progress")).collect(Collectors.toList());
Run Code Online (Sandbox Code Playgroud)
但是代码抛出了一个nullpointerexception
错误.当我检查时,我看到一些In Progress
状态为的对象具有空值.我们如何在lambda中处理这个问题?
如何在路标点对象中传递纬度和经度数组,然后将其传递给directionservice对象以绘制路线?
如果我想传递一个纬度,我们将如下传递它
waypoints:
[{
location:new google.maps.LatLng(42.496403,-124.413128),
stopover:false
}],
Run Code Online (Sandbox Code Playgroud)
但是我如何通过一系列纬度和经度?
请找到我尝试过的代码(它会抛出脚本错误):
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Lat long way points (LatLng)</title>
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var directionDisplay;
var directionsService = new google.maps.DirectionsService();
var map;
function initialize() {
directionsDisplay = new google.maps.DirectionsRenderer();
var chicago = new google.maps.LatLng(41.850033, -87.6500523);
var myOptions = {
zoom: 6,
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: …
Run Code Online (Sandbox Code Playgroud) 执行时出错 sonar:sonar goal on maven project
尝试使用sonar-maven-plugin
版本2.7.1
和5.0
错误:
Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project XXX:
Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar failed: Unable to load the mojo 'sonar'
in the plugin 'org.codehaus.mojo:sonar-maven-plugin:2.7.1'.
A required class is missing: Lorg/apache/maven/rtinfo/RuntimeInformation;
Run Code Online (Sandbox Code Playgroud) 我有一个部分,我必须分页记录.现在的问题是数字被添加但我想删除prev数字
我目前有以下内容:
上一页1 2 3下一页
当我点击下一个4添加后,它变为上一个1 2 3 4下一个
当我再次点击下一步时,会添加5并且它变为上一个1 2 3 4 5下一个
我想做什么,应该做什么
上一页1 2 3下一页
当我点击下一个4添加它应该成为上一个2 3 4下一个
当我再次点击下一步时,会添加5并且它将变为上一个3 4 5下一个
当我点击Previous Now时,它应该是Prev 2 3 4 Next
请在下面找到我的可运行代码:
$('ul.pagination').on('click', 'a', function() { // listen for click on pagination link
if($(this).hasClass('active')) return false;
var active_elm = $('ul.pagination a.active');
if(this.id == 'next'){
var _next = active_elm.parent().next().children('a');
if($(_next).attr('id') == 'next') {
// appending next button if reach end
var num = parseInt($('a.active').text())+1;
active_elm.removeClass('active');
$('<li><a class="active" href="#">'+num+'</a></li>').insertBefore($('#next').parent());
return;
}
_next.addClass('active');
} …
Run Code Online (Sandbox Code Playgroud)我有一个要求,当我选择时,我必须在两个标记之间画一条路线.我已在Google MAPS API上成功上传了KML文件,因此标记在Google MAPS API上清晰可见.
当我选择两个标记点击时,应该在所选标记之间绘制一条路线.我能够在两点之间绘制一条静态路线,但是被绘制的线路并没有跟随路线.请指导.另请查找我尝试过的代码.提前致谢.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Transit layer</title>
<style>
html,body,#map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
</style>
<link href="/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://geoxml3.googlecode.com/svn/branches/polys/geoxml3.js"></script>
<script> function initialize()
{
var myLatlng = new google.maps.LatLng(0, -180);
var mapOptions =
{
zoom: 13,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var transitLayer = new google.maps.TransitLayer();
transitLayer.setMap(map);
var geoXml = new geoXML3.parser({map: map, singleInfoWindow: …
Run Code Online (Sandbox Code Playgroud) 如何在DB2中拆分字符串值?
例如,给定值:
CHG-FFH.
Run Code Online (Sandbox Code Playgroud)
我想拆分破折号( - ),这将产生两个值:
CHG
FFH.
Run Code Online (Sandbox Code Playgroud)
我尝试使用split函数,但它不是DB2中的函数.
任何帮助将不胜感激.
当访问方法指令a.doAnother(account.getId);
使用visitMethodInsn()
时ASM
.我需要从方法参数获取帐户account.getId()
类型,帐户类型是Account
.但是我得到的返回类型account.getId()
是long
.如何获得Account
此处的帐户类型?
我需要显示一个非英语语言的警告框,我正在使用应用程序资源属性文件来使用bean消息.用JSP编写的代码在Firefox中运行完美,但在IE中字符混乱,我在警告框内得到所有的盒子标志.同样的问题也出现在ToolTips中.有解决方案吗
firefox alert tooltip internationalization internet-explorer-8
运行以下代码时,我得到了例外
jcifs.smb.SmbException:系统找不到指定的文件
码:
public void m1(String b) throws IOException {
// TODO Auto-generated method**strong text** stub
BufferedReader br=null;
String urlToBackUpFile = "smb://" +b +"/" + "c$/Program Files/Office/Config/OfficeSyncData.ini";
String cp="smb://" +b +"/" + "c$/Program Files/Office/Config/OfficeSyncData.txt";
System.out.println("smb folder of source file" + urlToBackUpFile);
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, "usrname", "passwd");
SmbFile dir = new SmbFile(cp, auth);
SmbFileInputStream in = new SmbFileInputStream( dir );
// br = new BufferedReader(new InputStreamReader(in));
System.out.println(dir.getDate());
SmbFile dest = new SmbFile (urlToBackUpFile,auth);
//count.copyTo(dest);
dir.copyTo(dest);
}
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
我可以使用任何特殊字符作为表列的别名吗?
例如:select id as #,first_name,last_name from student;