我有以下qustion:
如何将以下代码转换为Java 8 lambda样式?
List<String> tmpAdresses = new ArrayList<String>();
for (User user : users) {
tmpAdresses.add(user.getAdress());
}
Run Code Online (Sandbox Code Playgroud)
不知道并开始以下内容:
List<String> tmpAdresses = users.stream().map((User user) -> user.getAdress());
Run Code Online (Sandbox Code Playgroud) 目前我正在使用apache vfs2从sftp下载文件.对于身份验证,我使用用户名和密码.
有没有办法只使用vfs2与public-private-keys和没有密码?
我想我已经使用了这个功能,但是怎么样?将其设置为"是"?
SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(options, "no");
Run Code Online (Sandbox Code Playgroud)
这是我目前的代码(片段):
private boolean downloadFile(){
StandardFileSystemManager sysManager = new StandardFileSystemManager();
//download der Datei
try {
sysManager.init();
FileObject localFile = sysManager.resolveFile(localFilePath);
FileObject remoteFile = sysManager.resolveFile(createConnectionString(host, user, password, fileName, port),createDefaultOptions());
//Selectors.SELECT_FILES --> A FileSelector that selects only the base file/folder.
localFile.copyFrom(remoteFile, Selectors.SELECT_FILES);
} catch (Exception e) {
logger.error("Downloading file failed: " + e.toString());
return false;
}finally{
sysManager.close();
}
return true;
}
Run Code Online (Sandbox Code Playgroud)
和
private FileSystemOptions createDefaultOptions() throws FileSystemException{
//create options for sftp
FileSystemOptions options = new FileSystemOptions();
//ssh …Run Code Online (Sandbox Code Playgroud) 我有两个关于声纳的问题:
我看了一下声纳数据库.我想知道声纳存储每个测量结果的位置?
我只找到了表格measure_data,但是现场数据看起来像是有价值的.谁能告诉我声纳存储所有测量数据的位置?
是的我知道,最好使用REST API,我会这样做,但我也想知道,声纳本身如何使用数据库.
有没有办法使用API获取所有使用指标的完整列表?
我想通过Web服务请求(soap v2)在Magento中创建类别.我使用Magento 1.4.2.0,正如我所说的magent的肥皂api v2.
如果我发送请求,我会收到以下错误作为响应:
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>103</faultcode>
<faultstring>Attribute "include_in_menu" is required.</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Run Code Online (Sandbox Code Playgroud)
问题是,请求中没有xml标记"include_in_menu".如果我手动添加此标记,它将被忽略.
如果我不想使用soap v.1,我该怎么办?
问候LStrike
PS:这是我的要求:
<?xml version="1.0" encoding="UTF-8"?><?xe.source ../../../Common/Data/login_response.xml#Envelope?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" media-type="text/xml"></xsl:output>
<xsl:template match="/">
<soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:urn="urn:Magento" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header></soapenv:Header>
<soapenv:Body>
<urn:catalogCategoryCreate soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<sessionId xsi:type="xsd:string">
<xsl:value-of select="soapenv:Envelope/soapenv:Body/urn:loginResponse/loginReturn"></xsl:value-of>
</sessionId>
<parentId xsi:type="xsd:int">
<xsl:value-of select="'3'"></xsl:value-of>
</parentId>
<categoryData xsi:type="urn:catalogCategoryEntityCreate">
<!--You may enter the following 19 items in any order-->
<!--Optional:-->
<name xsi:type="xsd:string">
<xsl:value-of select="'TestKategorie'"></xsl:value-of>
</name>
<!--Optional:-->
<is_active xsi:type="xsd:int">
<xsl:value-of select="'1'"></xsl:value-of> …Run Code Online (Sandbox Code Playgroud) 我刚刚开始玩休眠搜索。我该如何解决以下问题。
我所有的 java 实体都是从超类继承的:
@SuppressWarnings("rawtypes")
@MappedSuperclass
@Indexed
public abstract class BaseEntity{
private Integer id;
private Integer jpaVersion;
private Date creaDate;
private Date modDate;
private String creaUser;
private String modUser;
@Id
@Column(name = "ID", unique = true, nullable = false, precision = 22, scale = 0)
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
.....
Run Code Online (Sandbox Code Playgroud)
例如我必须(还有更多)子类:
@Entity
@Indexed
@Table(name = "BASE_PERSON", schema = "MYSCHEMA")
public class Person extends extends BaseEntity{ …Run Code Online (Sandbox Code Playgroud) 如何在IBM Informix中执行此MySQL语句?
select type, channel, teilnr, starttime, endtime, usedtime, host
from online_time
where starttime < DATE_SUB(NOW(),INTERVAL 15 MINUTE)
order by starttime desc
Run Code Online (Sandbox Code Playgroud)
我在Informix中尝试了这个,但它给出了语法错误.
select type, channel, teilnr, starttime, endtime, usedtime, host
from online_time
where starttime < subdate(CURRENT, INTERVAL "15" MINUTES)
order by starttime desc
Run Code Online (Sandbox Code Playgroud) 我只是试验jt400.jar从一个接收系统信息AS400.
我想通过使用类SystemStatus和如何阅读如何连接以及如何接收值SystemValues.(只需找到这些值的解释,给我任何提示?)
任何人都可以告诉我,哪些功能SystemStatus可以让我使用RAM或者接收这些信息?
private static void getSystemStatus() throws AS400SecurityException, ErrorCompletingRequestException,
InterruptedException, IOException, ObjectDoesNotExistException, RequestNotSupportedException {
//Connect to AS400
AS400 as400 = new AS400("myAs400", "myUser", "myPassword");
//Reading SystemStatus like CPU usage and hdd usage
SystemStatus systemStatus = new SystemStatus(as400);
System.out.println(systemStatus.getPercentProcessingUnitUsed());
System.out.println(systemStatus.getActiveJobsInSystem());
//Reading SystemValues
SystemValueList sysValList = new SystemValueList(as400);
Vector<SystemValue> sysValVec = new Vector<SystemValue>();
sysValVec = sysValList.getGroup(SystemValueList.GROUP_ALL);
System.out.println("<<<< SystemValues >>>>");
for (SystemValue systemValue : sysValVec) {
String sysValName = systemValue.getName();
systemValue.getValue();
System.out.println("Value: …Run Code Online (Sandbox Code Playgroud)