我是IntelliJ IDEA的新手,我想使用它运行一个简单的Maven Quickstart项目.
我按照所有说明操作,项目成功完成.但是当我尝试编译并运行它时,Run按钮不会被激活.
看起来IntelliJ IDEA无法弄清楚主类的位置.
这是项目层次结构的图片.
问题是什么 ?我该如何解决?
谢谢 !
我有两个活动(A和B)和一个片段F片段F包含在活动B中我想将字符串从活动A发送到片段F怎么能这样做?谢谢!
我正在为Android设备开发一个Radio应用程序,它应该从Shoutcast服务器获得流媒体.
声音工作正常,但我也要检索MetaData,这样我就可以显示当前播放的歌曲的标题,艺术家以及专辑图片.
我使用了MediaMetaDataRetriever但它似乎根本不起作用!
这是我使用的代码:
public class MainActivity extends FragmentActivity {
private ImageView bannerView;
private int[] pub = {R.drawable.banner, R.drawable.pubnautic, R.drawable.pubquad};
private int i = 0;
private ImageView play;
private ImageView pause;
private TextView title;
private MediaPlayer mediaPlayer;
private MediaMetadataRetriever retriever;
private String out;
private String url = "http://streamplus8.leonex.de:14910";
//adele-someonelikeyou
//Accordossie
//http://support.k-designed.net/test-z/music/adele-someonelikeyou.mp3
private ImageView albumpic;
private byte[] image;
private boolean paused = false;
private ImageView exit;
private ImageView wish;
private ImageView reservation;
private ImageView contact;
private ImageView facebook;
private ImageView twitter; …Run Code Online (Sandbox Code Playgroud) 我在Eclipse中有这个Java代码,我想调试.
这是代码:
public Double repulsion(Node n1, Node n2) {
Double rep = 0.0;
rep = Math.pow(K, 2) / distEuc(n1, n2);
System.out.println("Répulsion : " + rep);
listForcesRep.add(rep);
return rep;
}
private Double distEuc(Node n1, Node n2) {
Double d = 0.0;
Object[] n1Attributes = n1.getAttribute("xy");
Double x1 = (Double) n1Attributes[0];
Double y1 = (Double) n1Attributes[1];
Object[] n2Attributes = n2.getAttribute("xy");
Double x2 = (Double) n2Attributes[0];
Double y2 = (Double) n2Attributes[1];
d = Math.sqrt((Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2)));
return …Run Code Online (Sandbox Code Playgroud) 我必须使用Jsoup从网页中提取一些数据.
我很容易提取标签中包含的数据,但我仍然需要一些未标记的数据.
这是HTML源代码的示例:
<a id="aId" href="aLink" style="aStyle">
<span id="spanId1">
<b>Caldan Therapeutics</b>
Announces Key Appointments And A Collaboration With
<b>Sygnature Discovery</b>
</span>
<span id="spanId2" style="spanStyle2">
5/17/2016
</span>
</a>
Run Code Online (Sandbox Code Playgroud)
我已经提取了<b>标签中包含的数据以及日期,但我现在想要的是提取句子Announces Key Appointments And A Collaboration With.
如您所见,这句话没有标签.
我该怎么做才能提取它?
我已经完成了我的研究,我所能找到的就是如何剥离所有标签.
谢谢你的帮助!
我有一个用Java读取的XML文件,如下所示:
<Author AffiliationIDS="Aff1" PresentAffiliationID="Aff2">
<AuthorName DisplayOrder="Western">
<GivenName>Kun-Jing</GivenName>
<FamilyName>Lee</FamilyName>
</AuthorName>
</Author>
<Author AffiliationIDS="Aff1" PresentAffiliationID="Aff2">
<AuthorName DisplayOrder="Western">
<GivenName>John</GivenName>
<FamilyName>Smith</FamilyName>
</AuthorName>
</Author>
Run Code Online (Sandbox Code Playgroud)
一开始一切都很好,然后出现这样的事情
<Author AffiliationIDS="Aff1">
<AuthorName DisplayOrder="Western">
<GivenName>Z.</GivenName>
<GivenName>C.</GivenName>
<FamilyName>Huang</FamilyName>
</AuthorName>
</Author>
<Author AffiliationIDS="Aff1" PresentAffiliationID="Aff3">
<AuthorName DisplayOrder="Western">
<GivenName>J.</GivenName>
<GivenName>C.</GivenName>
<FamilyName>Chen</FamilyName>
</AuthorName>
</Author>
Run Code Online (Sandbox Code Playgroud)
如您所见,<GivenName>标记在同一个块中被提及两次,因此,当我从中调用该值时<GivenName>,仅显示第一个.
这是读取XML文件的Java代码:
package com.mkyong.seo;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.Element;
import java.io.File;
public class ReadXMLFile {
public static void main(String argv[]) {
try {
File fXmlFile = new File("/fileaddress/test-1.xml");
DocumentBuilderFactory dbFactory …Run Code Online (Sandbox Code Playgroud)