小编use*_*381的帖子

如何在没有GUI的情况下在后台运行wireshark?

我试图在Mac OS X上运行Wireshark,在后台运行.我确实安装了命令行实用程序,因此我可以使用命令行启动wireshark并捕获数据包.我现在唯一想要的就是在后台运行它,甚至没有任务栏上的X11图标,看到wireshark的窗口.我相信它是可能的,但在Wireshark的文档中找不到任何东西.

也许另一种方法是找到一个技巧来隐藏Mac OS X上的图标......

如果有人已经这样做或有想法......

谢谢

请原谅我的英语不完美

macos wireshark

6
推荐指数
1
解决办法
8867
查看次数

builder.parse((new StringReader(xml))返回DeferredDocumentImpl

我试图理解我可能犯的错误但无法找到解决方案.

public static Document getXMLFromString(String xml) {
        org.w3c.dom.Document doc = null;
        try {
            DocumentBuilderFactory factory = DocumentBuilderFactory
                    .newInstance();
            factory.setNamespaceAware(true);
            DocumentBuilder builder;
            builder = factory.newDocumentBuilder();
            doc = (org.w3c.dom.Document) builder.parse(new InputSource(
                    new StringReader(xml)));
        } catch (SAXException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ParserConfigurationException e) {
            e.printStackTrace();
        }
        return doc;
    }

我做了导入org.w3c.dom.Document

我在这里称这个方法:

private Node getAuthToken(SOAPMessage responseAuth) throws SOAPException,
            TransformerException, ParserConfigurationException, IOException,
            SAXException {
        String s = indentXML(responseAuth.getSOAPPart().getContent());
        Document doc = getXMLFromString(s);
        NodeList authTokenNodeList = doc.getElementsByTagName("authToken");
        return authTokenNodeList.item(0); …

java

5
推荐指数
1
解决办法
1万
查看次数

Java - 以ms和ns为基准对算法进行基准测试时的结果差异很大

我在算法上执行了一些测试性能并发现了一些奇怪的东西.也许我在这里遗漏了一些东西.

我首先用milliseconde测量时间:

long startTime = System.currentTimeMillis();
x.sort(sortStringInput);
long endTime = System.currentTimeMillis();
Run Code Online (Sandbox Code Playgroud)

然后在nanoseconde:

long startTime = System.nanoTime();
x.sort(sortStringInput);
long endTime = System.nanoTime();
Run Code Online (Sandbox Code Playgroud)

结果是437ms和26366ns.

我正在调用相同的方法,因此如何才能在ns中获得小于ms中的结果的结果.我知道1 ms是1 000 000 ns所以26366甚至小于1 ms ......

谢谢,

java

1
推荐指数
1
解决办法
376
查看次数

标签 统计

java ×2

macos ×1

wireshark ×1