我刚开始用WildFly 8.2开发JAVA EE.我的第一个问题是如何将默认端口8080更改为其他内容?
我发现很多xml文件包含在下面的行.
<socket-binding name="http" port="${jboss.http.port:8080}"/>
Run Code Online (Sandbox Code Playgroud)
但我想我不必改变所有这些?!
要并行或异步运行一些东西我可以使用ExecutorService:<T> Future<T> submit(Runnable task, T result);
或CompletableFuture Api :( static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier, Executor executor);
假设我在两种情况下使用相同的Executor)
除了返回类型Future
与CompletableFuture
存在任何显着差异.或何时使用什么?
如果我使用CompletableFuture
默认的API Executor
(没有执行程序的方法)有什么区别?
我刚开始用__CODE__
,想安装一些插件,但我无法找到日食市场在Android SDK中.
这部分是android sdk已经或者必须安装吗?
我只是试着用我的gwt 2.4应用程序从helios转移到maven.所以我开始按照此处的步骤操作:http: //code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven
但在第3步 - 安装功能"m2e连接器为build-helper-maven-plugin"我从Eclipse得到一个错误:
Cannot complete the install because one or more required items could not be found.
Software being installed: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper.feature.feature.group 0.15.0.201109290002)
Missing requirement: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper 0.15.0.201109290002) requires 'bundle org.eclipse.m2e.jdt [1.1.0,1.2.0)' but it could not be found
Cannot satisfy dependency:
From: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper.feature.feature.group 0.15.0.201109290002)
To: org.sonatype.m2e.buildhelper [0.15.0.201109290002]
Run Code Online (Sandbox Code Playgroud)
是否有解决方法或我做错了什么?
我根据教程创建了一个相机应用程序.我使用的预览类来自api-Demos"CameraPreview".我从这里添加了一个修改(预览总是旋转90°).这就是我设置预览大小的方法:
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
// Now that the size is known, set up the camera parameters and begin
// the preview.
Camera.Parameters parameters = mCamera.getParameters();
Display display = ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
if (display.getRotation() == Surface.ROTATION_0) {
parameters.setPreviewSize(mPreviewSize.height, mPreviewSize.width);
mCamera.setDisplayOrientation(90);
}
if (display.getRotation() == Surface.ROTATION_90) {
parameters.setPreviewSize(mPreviewSize.width, mPreviewSize.height);
}
if (display.getRotation() == Surface.ROTATION_180) {
parameters.setPreviewSize(mPreviewSize.height, mPreviewSize.width);
}
if (display.getRotation() == Surface.ROTATION_270) {
parameters.setPreviewSize(mPreviewSize.width, mPreviewSize.height);
mCamera.setDisplayOrientation(180);
}
parameters.setPreviewSize(mPreviewSize.width, mPreviewSize.height);
requestLayout();
mCamera.setParameters(parameters);
mCamera.startPreview();
} …
Run Code Online (Sandbox Code Playgroud) 我的应用程序可以通过普通耳机控制.它只是覆盖"onKeyDown".但是没有捕获蓝牙耳机的关键事件 - 为什么?或者如何捕获蓝牙键事件?
如果我按下耳机上的按钮,"log cat"会显示以下内容:
Bluetooth AT recv(3043): AT+VGS=15
AudioPolicyManagerBase(13654): FM radio recording off
AudioService(2261): sendVolumeUpdate, isKeyguardLocked...Not to update Volume Panel.
VolumePanel(2261): change volume by MSG_VOLUME_CHANGED
VolumePanel(2261): onVolumeChanged(streamType: 6, flags: 0)
VolumePanel(2261): Call setChangeSeekbarColor(false)
Run Code Online (Sandbox Code Playgroud)
我也尝试处理媒体按钮操作,但这不起作用.我的想法是一个免费的可配置键映射:用户选择"设置键"我的应用程序听到所有键(硬件,媒体按钮,蓝牙耳机),然后用户按下一个键,事件/密钥代码存储在配置中.
总结不工作的答案: 音量按钮必须由"VOLUME_CHANGED_ACTION"捕获.问题是这个意图被广播到其他应用程序并且abortBroadcast()不起作用(它仅适用于"有序"广播).另一个问题是有线耳机和手机上的按键触发onReceive()两次(为什么?)蓝牙耳机会触发一次.下一个问题是蓝牙耳机上的第3个键.它触发语音命令(s-s在s3上启动),我试图捕获许多不同的意图,但我不能"接收"这个按钮按下而不知道为什么.最后,我希望捕获各种按钮,并且不希望它们由其他应用程序处理(例如使用onKeyDown并返回true).
我需要通过maven属性设置一个URL(每个配置文件要替换).问题是这个URL包含一些&
而maven不喜欢这个(如果URL包含&_program):
"对实体的引用"_program"必须以';'结尾 分隔符".此行上的pom发生错误.
那么如何逃避这个角色或如何逃避可能包含一些"特殊"角色的洞线.(属性值中禁止使用哪些其他字符?)
我需要在eclipse中看到文件系统中的文件夹(svn)(是否有文件探索功能).怎么实现呢?
我不希望文件夹嵌套在项目中.在最好的情况下,eclipse将该文件夹链接到svn存储库,就像所有其他项目一样.
我试图通过antrun插件复制我的maven多模块项目中的文件.该文件位于父项目的根目录中:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<inherited>false</inherited>
<executions>
<execution>
<inherited>false</inherited>
<id>copy</id>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="copy and rename file">
<copy file="${basedir}/portal-ext.properties" tofile="${liferay.auto.deploy.dir}/../portal-ext.properties" />
</target>
</configuration>
</execution>
</executions>
Run Code Online (Sandbox Code Playgroud)
我通过mvn antrun:run
问题运行这个问题是我在父级和每个模块上得到"没有定义蚂蚁目标 - 跳过".我需要它只在父母身上运行,思想<inherited>false</inherited>
会有所帮助,但我没有.但为什么"没有定义蚂蚁目标"?
我刚开始使用Apache Storm.我阅读了教程并查看了示例我的问题是所有示例都使用非常简单的元组(通常一个字符串存档).元组是内联创建的(使用新值(...)).在我的情况下,我有许多字段的元组(5..100).所以我的问题是如何为每个字段实现名称和类型(所有原始)的这样的元组?
有什么例子吗?(我认为直接实施"元组"并不是一个好主意)
谢谢