我在Android中设计用户界面时相当新(同时也是Android开发的新手).我目前正在开发一个Android应用程序,它看起来很像Google +的"All Circles"页面,以及Facebook的用户主页,在那里您可以看到朋友分享的内容.
为了使事情更清楚,请查看以下截图,该截图来自Google +的Android应用程序:

正如你所看到的,Paul Harper的帖子在一个小框架中,"Android和我"的帖子在另一个帖子中.向下滚动越多,您将看到的共享内容越多,每个都在自己的"框架"中.
我真的不确定如何实现这个结果(我确定它涉及一个ListView组件),所以有人可以告诉我有关我应该使用的UI组件吗?
万分感谢.
我打算在 Windows 窗体应用程序中使用 .Net 4.0 中引入的强大缓存库。到目前为止,MemoryCache除了将其内容保存到文件之外,我已经完成了我需要的一切。我想要做的是将缓存保存到应用程序退出时的文件中,然后当应用程序再次打开时,我应该能够从文件写入并将其内容放入MemoryCache. 我知道我可以简单地将实例序列化为磁盘上的二进制文件,但话又说回来,我不知道如何将其转换回*MemoryCache*.
非常感谢您的帮助。
我正在开发一个与Web服务通信的.Net应用程序来获取一些数据..Net应用程序和Web服务之间的连接是通过HTTPS完成的.当我从.Net应用程序调用Web服务时,我得到以下堆栈跟踪:
System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at …Run Code Online (Sandbox Code Playgroud) 我已经使用ElasticSearch的_plugin / head接口成功创建了查询。该查询旨在返回特定位置的特定设备的最新时间戳。该查询如下所示:
{
"query":{
"bool":{
"must":[
{
"term":{
"deviceevent.location.id":"1"
}
},
{
"term":{
"deviceevent.deviceId":"AHE1LDD01"
}
}
]
}
},
"from":0,
"size":1,
"sort":{
"timestamp":{
"order":"desc"
}
}
}
Run Code Online (Sandbox Code Playgroud)
上面的查询按预期工作。现在使用Spring-Boot和Spring-Data-ElasticSearch,我定义了自己的ElasticSearchRepository外观,如下所示:
package com.repository.elasticsearch;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import com.domain.DeviceEvent;
public interface DeviceEventRepository extends ElasticsearchRepository<DeviceEvent, String>
{
@Query("{\"bool\":{\"must\":[{\"term\":{\"deviceevent.location.id\": \"?0\"}},{\"term\":{\"deviceevent.deviceId\": \"?1\"}}]}},\"from\": 0,\"size\": 1,\"sort\":{\"timestamp\":{\"order\":\"desc\"}}")
DeviceEvent findLatestCheckInAtLocation(Long locationId, String deviceId);
}
Run Code Online (Sandbox Code Playgroud)
上面的代码之所以中断,主要是因为我希望它返回一个DeviceEvent,但实际上它返回的是带有count = 10(默认页面大小)的设备事件。似乎时间戳也没有按降序对结果进行排序。好像查询的size和order部分没有被拾取。
我在这里做错了什么?
elasticsearch elasticsearch-plugin spring-boot spring-data-elasticsearch
任何人都可以请教我如何实现我自己的行过滤器和行分类器应用于Jtable,同时请记住我正在使用Java 1.4?或者,如果有一些可用的课程可以达到这个目的?
问候.
这可能听起来像一个愚蠢的问题,但我需要知道如何在其旁边的其他按钮仍然不可见的情况下自动更改按钮的位置.我需要在Visual Studio 2005中实现这一点(我正在使用C#).
为了进一步说明这一点,假设我在我创建的表单的左上角有三个按钮.从右到左的按钮是:1-后退2-打印3-下一步
最初,当表单首次启动时,只有Next按钮应该是可见的,它应该占据屏幕的右上角.稍后,当用户在屏幕上触发某些事件时,应该出现"打印"和"返回"按钮,但它们也应该出现在表单的右上角,这将实现与上面提到的相同的顺序.同样的按钮序列是我需要实现的要求.
我在这里先向您的帮助表示感谢.
我试图通过添加一个jboss-deployment-structure.xml文件来排除我的jboss AS 7.1.1中的webservices子系统,该文件如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclude-subsystems>
<subsystem name="webservices" />
</exclude-subsystems>
</deployment>
</jboss-deployment-structure>
Run Code Online (Sandbox Code Playgroud)
在Eclipse中,我在上述文件中收到错误,该错误将"部署"标记为无效元素.如果我忽略错误并运行我的项目,我会收到以下错误:
19:40:15,531 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."CXF.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."CXF.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "CXF.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Error loading jboss-structure.xml from C:\jboss-as-7.1.1.Final\jboss-as-7.1.1.Final\standalone\deployments\CXF.war\WEB-INF\jboss-deployment-structure.xml
at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:277) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:249) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:134) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at …Run Code Online (Sandbox Code Playgroud) 我正在试验Junit 4现在已经有一段时间了.我的单元测试的一部分需要部署一个暴露一些Web服务的war应用程序.我正在使用Eclipse Helios,我在项目的构建路径中添加了两个不同的jar:1- jetty-all-8.1.3.v20120416.jar 2- servlet-api-3.0.jar
现在在我的测试类中,我正在运行以下代码以启动jetty并为了部署包含我公开的Web服务的axis2.war webapp:
System.out.println("Initializing server");
Server server = new Server(8181);
System.out.println("Server initialized");
WebAppContext webapp = new WebAppContext();
webapp.setContextPath("/");
webapp.setParentLoaderPriority(true);
webapp.setWar("C:\\axis2.war")
server.setHandler(webapp);
System.out.println("Starting server");
server.start();
System.out.println("Joining server");
server.join();
System.out.println("Finished starting Jetty...");
Run Code Online (Sandbox Code Playgroud)
上面代码的输出如下:
Server initialized
Starting server
Joining server
Run Code Online (Sandbox Code Playgroud)
尝试加入服务器是无限期运行的,它不会抛出任何异常.
在另一次尝试中,我在我的机器上下载了jetty 8.1.3 Web服务器,并将axis.war放在webapps目录下,然后使用命令行中的start.jar启动了jetty.它从那里完美运行,我能够实现我暴露的Web服务方法.
但是,我需要能够以编程方式启动和停止jetty,并以编程方式部署我的Web应用程序.谁能告诉我这个问题到底是什么?
提前致谢.