如何在批处理文件中获得两次差异?因为我想在HTML文件中打印它.
我认为这是可能的,但事实并非如此.
Set "tijd=%time%"
echo %tijd%
echo %time%-%tijd%
Run Code Online (Sandbox Code Playgroud)
结果:
11:07:48,85
11:16:58,99-11:07:48,85
Run Code Online (Sandbox Code Playgroud)
但我想要的是:
00:09:10,14
Run Code Online (Sandbox Code Playgroud)
或9分10秒或550秒
今天我搜索了很多关于这个主题的文章.但我找不到它,如何将JSONArray添加到JSONObject?
因为每次我这样做我都会收到此错误:Stackoverflow
JSONObject fillBadkamerFormaatFromContentlet(Structure structure, String formaat) {
JSONObject jsonObject = new JSONObject();
JSONArray arr = new JSONArray();
BadkamerFormaat badkamerFormaat = new BadkamerFormaat();
BadkamerTegel badkamerTegel;
List<Contentlet> contentlets = getContentletsByStructure(structure);
badkamerFormaat.formaat = formaat;
badkamerFormaat.tegels = new ArrayList<BadkamerTegel>();
try {
jsonObject.put("formaat", formaat);
} catch (JSONException e1) {
throw new RuntimeException(e1);
}
for(Contentlet contentlet : contentlets) {
badkamerTegel = new BadkamerTegel();
badkamerTegel.naam = contentlet.getStringProperty(ParameterNames.toolBetegelVeldNaam);
try {
badkamerTegel.afbeeldingTegel = contentlet.getBinary(ParameterNames.toolBetegelVeldTegelAfbeelding).getPath();
badkamerTegel.afbeeldingBadkamer = contentlet.getBinary(ParameterNames.toolBetegelVeldBadkamerAfbeelding).getCanonicalPath();
arr.put(badkamerTegel.toJSON());
} catch (IOException e) {
throw new RuntimeException(e);
}
} …Run Code Online (Sandbox Code Playgroud) 当我与互联网连接时,eclipse内部浏览器打开该页面,当我没有连接互联网时,它无法显示网页.我希望在我的计算机上本地安装网页,这样我就不必担心互联网连接.
我正在附加我想要离线的帮助的快照.
我不知道是否可能,但我希望看到我的.bat文件在Java中的响应.
或者我可以看到一切进展顺利的布尔值!如果有一些错误,我可以看到Java中的错误.
谢谢
我正在尝试创建一个Listener(或类似的东西?),它将在数据库行的日期字段与当前时间相同时启动特定事件.当然,我可以触发每一秒来检查日期/时间是否与当前相同,但我认为这是非常广泛的.应该有更好的选择..
我想要做的是以下内容:我在我的数据库中安排了几个(例如橄榄球)比赛.在比赛开始的特定时间,我将在我的Java应用程序中启动一个事件.这可能是当时的一场或多场比赛.
如果您已经知道集合不为null,那么对性能有什么好处.使用!collection.isEmpty()或CollectionUtils.isNotEmpty(collection)来自Apache Commons lib?
或者没有任何性能差异?
我想存档我的程序的工件,但是当构建失败时,他不会保存工件.为什么是这样?
因为我只想在作业失败时读取工件!
感谢您的答复!
-
总是当工作失败时,我没有得到工件.我在非常小的工作中测试它:
空批处理文件+工件文件,结果:Job Succesfull,Artifact:succesfull
在批处理文件中退出1 +工件文件,结果:作业失败,工件:没有做任何事情
该作业的config.xml文件:
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers class="vector"/>
<concurrentBuild>false</concurrentBuild>
<customWorkspace>C:\test\</customWorkspace>
<builders>
<hudson.tasks.BatchFile>
<command>exit 1</command>
</hudson.tasks.BatchFile>
</builders>
<publishers>
<hudson.tasks.ArtifactArchiver>
<artifacts>tomcat\logs\tomcat.log</artifacts>
<latestOnly>false</latestOnly>
</hudson.tasks.ArtifactArchiver>
</publishers>
<buildWrappers/>
</project>
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用一些参数进行表单提交(POST),并根据我想要填充数据表的参数.但我对Javascript(我的语言是Java)不是很了解,所以我试图用Ajax调用来做.但它对我不起作用.一切都适合我,除了用servlet参数POST.数据表总是自动填充,但应在表单提交后填充.
有人知道我的案例吗?我在这里阅读了很多表格帖子和教程,但没有这种情况(?).
我的代码现在如下,这对我有用.除了我不能在此表中排序或搜索.缺什么?
谢谢.
<script type="text/javascript" language="javascript" src="/global/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" language="javascript" src="/global/js/jquery.dataTables.min.js"></script>
<form name="myform" id="myform" action="" method="POST">
<label for="season">Season:</label>
<input type="text" name="season" id="season" value=""/> <br />
<label for="type">Type:</label>
<input type="text" name="type" id="type" value=""/> <br/>
<input type="button" id="btnSubmit" name="btnSubmit" value="Search">
</form>
<table class="display" id="example">
<thead>
<tr>
<th>Name</th>
<th>NationId</th>
<th>RegionId</th>
<th>Attendance</th>
</tr>
</thead>
<tbody>
<!-- data goes here -->
</tbody>
</table>
<script>
$("#btnSubmit").click( function() {
var formData = "season=" + $("input#season").val() + "&type=" + $("input#type").val();
$('#example').dataTable( {
"bJQueryUI": true,
"bProcessing": true,
"bDestroy": …Run Code Online (Sandbox Code Playgroud) 我制作了一段批处理代码,我认为这样可行.我在想这个代码在做什么?我有一些插件,我想测试部署是否正确.所以我从plugins.txt获得了pluginlink.然后我从SVN获得带有java句子的插件.我部署了插件并在test1.txt中获得反馈.然后我在该文件中执行findStr并搜索"BUILD SUCCESSFUL"如果它在那里我想添加句子Build Gelukt如果它失败我想添加Build Fout.但是我总是得到Build Gelukt的答案,而正如你在图像中看到的那样,他发回的是构建失败.
这段代码怎么了?
for /f "tokens=* delims= " %%a in (plugins.txt) do (
echo %%a
cd "C:\dotCMS Automatic Install"
java -cp .;"C:\dotCMS Automatic Install\svnkit.jar" Test %%a
cd %dotcms_home%
call ant deploy-plugins > test1.txt
FindStr "SUCCESSFUL" test1.txt
if %ERRORLEVEL% ==1 (echo ^<tr BGCOLOR=\"#FFFFFF\"^>^<td^>%%a^</td^>^<td^>Build Fout^</td^>^</tr^> >> C:\dotCMSResults\goedje.html ) else (echo ^<tr BGCOLOR=\"#00FF00\"^>^<td^>%%a^</td^>^<td^>Build Gelukt^</td^>^</tr^> >> C:\dotCMSResults\goedje.html)
del test1.txt
rem call ant undeploy-plugins >> test.txt
)
Run Code Online (Sandbox Code Playgroud)

XSTREAM
当我有以下XML代码时:
<xml>
<version>1.1</version>
<url>http://www.google.nl</url>
</xml>
Run Code Online (Sandbox Code Playgroud)
我用我的Java代码读到这一切一切正常,但是当XML发生变化时,例如:
<xml>
<test>test</test>
<version>1.1</version>
<url>http://www.google.nl</url>
</xml>
Run Code Online (Sandbox Code Playgroud)
我收到错误,但我希望程序不会停止,并且不要使用现场测试.有没有办法处理这个异常而不停止程序?
Exception in thread "main" com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$UnknownFieldExce ption: No such field Version.iets
---- Debugging information ----
field : iets
class : Version
required-type : Version
converter-type : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path : /Version/iets
line number : 1
version : null
-------------------------------
Run Code Online (Sandbox Code Playgroud) java ×6
batch-file ×3
shell ×2
api ×1
arrays ×1
collections ×1
datatables ×1
eclipse ×1
findstr ×1
html ×1
javascript ×1
jquery ×1
json ×1
listener ×1
performance ×1
time ×1
windows ×1
xml ×1
xstream ×1