我正在尝试使用可从此处https://developer.atlassian.com/server/jira/platform/rest-apis/获得的jira rest api,并且正在尝试弄清楚如何获取特定问题的描述在我的项目中。
当我执行以下查询时:
curl -D- -u用户:密码-X GET -H“内容类型:application / json”“ http:// localhost / jira / rest / api / 2 / issue / ISSUE_NUMBER_1 ”
我确实得到了整个问题的回应。它包含了许多领域,例如"avatarUrls",displayName但它也含有body。我只想获得后者。如何限制查询以使其仅返回body?我试过了:
curl -D- -u用户:密码-X GET -H“内容类型:application / json”“ http:// localhost / jira / rest / api / 2 / issue / ISSUE_NUMBER_1?fields = body ”
但这不起作用。这是什么问题
我正在使用http://jqueryvalidation.org/中的插件来验证我的表单.HTML代码很简单:
<form id="myform">
<input type="text" name="field1" /> <br/>
<textarea maxlength="140" style="resize:none" class="textoxarea" placeholder="zbzbzxcbcx" name="field2"></textarea>
<input type="checkbox" name="terms" />x
<input type="submit" />
</form>
Run Code Online (Sandbox Code Playgroud)
而javascript是:
$(document).ready(function() {
$('#myform').validate({ // initialize the plugin
errorElement: 'div',
rules: {
field1: {
required: true,
email: true
},
field2: {
required: true,
minlength: 5
},
terms: {
required: true,
maxlength: 2
}
},
submitHandler: function(form) { // for demo
alert('valid form submitted'); // for demo
return false; // for demo
}
});
});
Run Code Online (Sandbox Code Playgroud)
正如你在我的小提琴中 …
我想在我的网页上放置两个图标(链接到app store和android store).我从谷歌网页和苹果页面下载了示例代码,并提供了如何使用它的建议,并将其放在html代码中:
<section class="download" id="download">
<div class="container">
<div class="row">
<div class="col-md-12 text-center wp4">
<h1>Seen Enough?</h1>
<a href="#todo">
<img alt="Android app on Google Play"
src="https://developer.android.com/images/brand/en_app_rgb_wo_45.png" />
</a>
<a href="#todo" target="itunes_store" style="display:inline-block;overflow:hidden;background:url(img/apple.svg) no-repeat;width:165px;height:40px;@media only screen{background-image:url(img/apple.svg);}"></a>
<!--<a href="http://tympanus.net/codrops/?p=22554" class="download-btn">Download! <i class="fa fa-download"></i></a> -->
</div>
</div>
</div>
</section>
Run Code Online (Sandbox Code Playgroud)
并且这部分是css代码:
.download {
padding: 120px 0;
background-color: #3f6184;
}
.download h1 {
margin: 0 0 15px 0;
color: #fff;
font-weight: 400;
font-size: 40px;
}
Run Code Online (Sandbox Code Playgroud)
但是,在这之后,我得到以下结果:

它们没有完美对齐,正如您所看到的 - 苹果应用程序商店图标作为超链接工作,但覆盖的空间比自己的图像更多.我该如何解决这个问题?谢谢.
我有一个树形图:
private Map<String, Integer> dataMap = new TreeMap<String, Integer>();
Run Code Online (Sandbox Code Playgroud)
后来在代码中我有以下部分:
for (String item : data) {
JSONObject itemJson = new JSONObject(item);
System.out.println("-- before " + itemJson.getString("dataLabel") + " " + itemJson.getInt("dataValue"));
dataMap.put(itemJson.getString("dataLabel"), itemJson.getInt("dataValue"));
}
for(String data : dataMap.keySet()) {
System.out.println("-- after " + data);
}
Run Code Online (Sandbox Code Playgroud)
第一个循环显示已排序的元素,例如:
-- before January 1
-- before February 2
-- before March 3
-- before April 4
.
.
.
Run Code Online (Sandbox Code Playgroud)
但第二个循环混合顺序:
-- after April
-- after February
-- after January
-- after March
.
. …Run Code Online (Sandbox Code Playgroud) 在我的代码中,我有一个size(MyData)返回数据大小的方法 - 它可以是 0 或更大。我也有一个标志exclude可以是true或false。我的算法的重点是根据数据的大小和标志的值对数据进行一些操作。
如果大小大于0,我想对数据进行操作。
如果大小为 0,那么我需要检查 flag 的值excluded。在这种情况下,如果标志excluded设置为 true,我不想对数据进行操作。但是如果标志设置为false,我需要对数据进行操作。
到目前为止,这是我的算法:
int numberOfKids = size(MyData); //this can be 0 or greater
if (numberOfKids != 0) {
//do operation
}
else {
if (!exclude) {
//do operation
}
}
Run Code Online (Sandbox Code Playgroud)
有没有更好的方法来编写这个算法?谢谢!
css ×2
html ×2
java ×2
curl ×1
hashmap ×1
if-statement ×1
javascript ×1
jira ×1
jquery ×1
treemap ×1