小编mar*_*ark的帖子

是否有命令行实用程序来提取证书指纹?

我创建了一个机器证书.它出现在证书(本地计算机)\ Personal\Certificates证书存储库文件夹中.现在我希望使用命令行实用程序提取其指纹.

不幸的是,我能找到的最接近的是本文.

我需要能够在任何从XP开始的Windows操作系统上执行此过程.

谢谢.

windows security certificate

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

如何在用户之间共享Eclipse项目首选项?

我们团队中有几个开发人员,源代码使用Mercurial DVCS进行管理.

.metadata文件夹不在源代码管理下.

问题是,当我配置项目依赖项(jar,用户库,源代码路径等等)时,它们存储在.metadata文件夹中,即.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.jdt.core.prefs

由于此文件不是由DVCS管理的,因此所有开发人员都需要重新重复项目配置过程.对于团队中的新开发者而言,这是一个主要的头痛.

我的问题是有一个合理的程序来共享这种配置数据?我是Java和Eclipse世界的新手,所以也许我错过了一些非常基本的东西.

编辑

问题是我一直在使用User Libraries,它是全局定义的,因此不共享.使用External Jars解决了问题,因为这些都记录在.classpath项目目录中的文件中.

java eclipse configuration

8
推荐指数
2
解决办法
4837
查看次数

如何将BOOST_FOREACH与仅支持const_iterator的容器一起使用?

我有这个容器:

class /*final*/ Row
{
public:
  typedef FieldIterator const_iterator;
  typedef FieldIterator iterator;
  FieldIterator begin() const;
  FieldIterator end() const;
  FieldIterator begin();
  FieldIterator end();
  ...
};
Run Code Online (Sandbox Code Playgroud)

鉴于此,以下代码编译得很好:

BOOST_FOREACH(Field field, row)
{
}
Run Code Online (Sandbox Code Playgroud)

但是,Row该类不应该具有可变迭代器,因此我通过删除可变访问来更改Row类:

class /*final*/ Row
{
public:
  typedef FieldIterator const_iterator;
  FieldIterator begin() const;
  FieldIterator end() const;
  ...
};
Run Code Online (Sandbox Code Playgroud)

但是现在相同的foreach循环无法编译:

1>o:\c\boost_1_48_0\boost\foreach.hpp(364): error C2039: 'type' : is not a member of 'boost::mpl::eval_if<C,F1,F2>'
1>          with
1>          [
1>              C=boost::mpl::false_,
1>              F1=boost::range_const_iterator<sqlserver::Row>,
1>              F2=boost::range_mutable_iterator<sqlserver::Row>
1>          ]
1>          c:\dev\internal\playmssqlce\playmssqlce.cpp(29) : see reference to class …
Run Code Online (Sandbox Code Playgroud)

c++ boost boost-foreach

8
推荐指数
2
解决办法
2630
查看次数

为什么Maven报告"校验和验证失败,存储库中没有可用的校验和"?

我正在尝试使用此处描述的3个步骤创建自定义Maven存储库 - http://www.javaworld.com/community/node/3968.所以,我遵循了所有步骤,在这里我有了存储库:

D:\maven2>dir /s/b
D:\maven2\com
D:\maven2\org
D:\maven2\web.config
D:\maven2\com\safenet
D:\maven2\com\safenet\hasp
D:\maven2\com\safenet\hasp\1
D:\maven2\com\safenet\hasp\maven-metadata.xml
D:\maven2\com\safenet\hasp\maven-metadata.xml.md5
D:\maven2\com\safenet\hasp\maven-metadata.xml.sha1
D:\maven2\com\safenet\hasp\1\hasp-1.jar
D:\maven2\com\safenet\hasp\1\hasp-1.pom
D:\maven2\com\safenet\hasp\1\_maven.repositories
D:\maven2\org\jnetpcap
D:\maven2\org\jnetpcap\jnetcap
D:\maven2\org\jnetpcap\jnetcap\1.3
D:\maven2\org\jnetpcap\jnetcap\maven-metadata.xml
D:\maven2\org\jnetpcap\jnetcap\maven-metadata.xml.md5
D:\maven2\org\jnetpcap\jnetcap\maven-metadata.xml.sha1
D:\maven2\org\jnetpcap\jnetcap\1.3\jnetcap-1.3.jar
D:\maven2\org\jnetpcap\jnetcap\1.3\jnetcap-1.3.pom
D:\maven2\org\jnetpcap\jnetcap\1.3\_maven.repositories

D:\maven2>type com\safenet\hasp\maven-metadata.xml
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>com.safenet</groupId>
  <artifactId>hasp</artifactId>
  <versioning>
    <release>1</release>
    <versions>
      <version>1</version>
    </versions>
    <lastUpdated>20130108125547</lastUpdated>
  </versioning>
</metadata>

D:\maven2>type org\jnetpcap\jnetcap\maven-metadata.xml.md5
297455697088aad6bdbe256d48fb0676 *maven-metadata.xml

D:\maven2>type org\jnetpcap\jnetcap\maven-metadata.xml.sha1
f86d93727a76525f42f1b67997020e1a9a41b948 *maven-metadata.xml

D:\maven2>type org\jnetpcap\jnetcap\1.3\jnetcap-1.3.pom
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.jnetpcap</groupId>
  <artifactId>jnetcap</artifactId>
  <version>1.3</version>
  <description>POM was created from install:install-file</description>
</project>

D:\maven2>
Run Code Online (Sandbox Code Playgroud)

现在我试图在像这样的pom文件中使用hasp工件:

<dependency>
  <groupId>com.safenet</groupId>
  <artifactId>hasp</artifactId>
  <version>1</version>
  <scope>provided</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)

并且存储库的引用如下: …

repository maven

8
推荐指数
2
解决办法
4万
查看次数

调用基于异步任务的WCF方法是否利用I/O完成端口或线程池线程来调用延续?

我有以下WCF合同:

[ServiceContract(Namespace = "http://abc/Services/AdminService")]
public interface IAdminService
{
    [OperationContract]
    string GetServiceVersion();

    // More methods here
}
Run Code Online (Sandbox Code Playgroud)

GetServiceVersion是一个返回一些字符串的简单方法.它用作ping来检查服务是否可访问.

现在我想异步调用它,认为它比使用.NET线程在后台调用它更有效.

所以,我为此提出了以下接口:

[ServiceContract(Namespace = "http://abc/Services/AdminService")]
public interface IMiniAdminService
{
    [OperationContract(Action = "http://abc/Services/AdminService/IAdminService/GetServiceVersion", ReplyAction = "http://abc/Services/AdminService/IAdminService/GetServiceVersionResponse")]
    Task<string> GetServiceVersionAsync();
}
Run Code Online (Sandbox Code Playgroud)

这使得可以GetServiceVersion异步调用API:

var tmp = new ChannelFactory<IAdminService>("AdminServiceClientEndpoint");
var channelFactory = new ChannelFactory<IMiniAdminService>(tmp.Endpoint.Binding, tmp.Endpoint.Address);
var miniAdminService = channelFactory.CreateChannel();
return miniAdminService.GetServiceVersionAsync().ContinueWith(t =>
{
    if (t.Exception != null)
    {
        // The Admin Service seems to be unavailable
    }
    else
    {
        // The Admin Service is …
Run Code Online (Sandbox Code Playgroud)

c# wcf asynchronous task-parallel-library

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

为什么OAuth 2拥有资源所有者密码凭据授予?

为什么有人会将OAuth 2用于此类拨款?我的意思是,如果客户端已经拥有资源所有者的名称和密码,为什么不使用资源服务器使用的任何身份验证工具作为资源所有者进行身份验证?

我不明白这里的理由.有人可以解释一下吗?

oauth

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

是否可以在Kibana中运行elasticsearch聚合查询?

我想在Kibana中运行以下聚合查询:

GET _search
{
  "size": 0,
  "aggs": {
    "group_by_host": {
      "terms": {
        "field": "host",
        "size": 20
      }
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

我可以在Sense - Kibana中运行它,但我想在Kibana中运行它.很难搞清楚.

elasticsearch kibana

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

msbuild.exe 命令行带有 /p:BuildInParallel=true 和 /m 参数 - 不同组合之间有什么区别?

阅读https://www.hanselman.com/blog/FasterBuildsWithMSBuildUsingParallelBuildsAndMulticoreCPUs.aspx后发布此内容。要么这就像泥巴一样清晰,要么我就是纯粹的愚蠢。

我总是在命令行上运行 msbuild.exe,但/m不带任何节点/p:BuildInParallel=true,它总是生成预期数量的 msbuild 节点(我的台式机上有 12 个,我的笔记本电脑上有 4 个),并构建了相应并发程度(12 或 4)的解决方案项目大部分时间都在某个时间)。

另一方面,当我MSBuild从目标文件中调用任务并将其传递给多个项目(或解决方案文件)时,我始终设置BuildInParallelMSBuild 任务的属性。因为这就是使用 MSBuild 任务并行构建项目的方式,对吗?

请注意,这是任务的属性,而不是传入的MSBuild构建属性(如) 。ConfigurationMSBuild.Properties

这篇文章表明实际上有一个同名的构建属性 -BuildInParallel并且它补充了这个/m开关,这对我来说是完全新闻。我搜索了 * c:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild*下的所有 *.targets 文件,唯一提到它的是在以下上下文中:

  1. 如果属性值为nil,则将其设置为true
  2. 将其值传递给MSBuild.BuildInParallel属性。
  3. 构建 Silverlight 项目时的硬编码过程false。(我们仍然有这些,我可以同意 - 它们总是按顺序构建的:-()

我的结论 - 这篇文章在传递到 msbuild.exe 方面具有误导性BuildInParallel,因为它没有任何意义,除非我们传递false到那里。这也不需要,只是不通过/m

但我总是有可能在这里遗漏一些东西,所以我的问题是——如果没有 ,我会失去msbuild.exe /m什么/p:BuildInParallel=true

(我想我知道答案——绝对不知道,但以防万一)

msbuild concurrency

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

协议缓冲区是否支持使用共享引用对象图的序列化?

请观察以下简单程序(基于protobuf-net项目v1 wiki的示例):

using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using ProtoBuf;

namespace HelloProtoBuf
{
  [ProtoContract]
  class Person
  {
    [ProtoMember(1)]
    public int Id { get; set; }
    [ProtoMember(2)]
    public string Name { get; set; }
    [ProtoMember(3)]
    public Address Address { get; set; }
  }
  [ProtoContract]
  class Address
  {
    [ProtoMember(1)]
    public string Line1 { get; set; }
    [ProtoMember(2)]
    public string Line2 { get; set; }
  }


  class Program
  {
    static void Main(string[] args)
    {
      var person = new Person
      {
        Id = 12345, …
Run Code Online (Sandbox Code Playgroud)

protocol-buffers protobuf-net

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

可以将Notepad ++配置为识别编译器错误消息并跳转到相应位置吗?

我在没有IDE的机器上构建一些相当大的代码,但是使用Notepad ++.

编译结果被重定向到一个文件,有时会有错误消息,它们满足一个定义良好的正则表达式.

我想知道NPP是否有一个插件,它会解析日志文件,识别错误/警告消息并让我在相应的错误/警告位置之间导航.

编辑

以下是输出的典型示例(由make运行MSVC cl.exe编译器生成):

/cygdrive/c/vs2010/VC/Bin/cl   -Zi -nologo -MD /D _STATIC_CPPLIB  -FdC:/openjdk/OUTPUT~1/tmp/sun/sun.awt/awt/obj/Win32SurfaceData.pdb -FmC:/openjdk/OUTPUT~1/tmp/sun/sun.awt/awt/obj/Win32SurfaceData.map -W3 -DD3D_OVERLOADS  -DUNICODE -D_UNICODE  -DWIN32 -DIAL -D_LITTLE_ENDIAN -DWIN32 -D_X86_ -Dx86  -DWIN32_LEAN_AND_MEAN -I. -IC:/openjdk/OUTPUT~1/tmp/sun/sun.awt/awt/CClassHeaders -I../../../src/windows/javavm/export -I../../../src/share/javavm/export -I../../../src/share/javavm/include -I../../../src/windows/javavm/include -I../../../src/share/native/common -I../../../src/windows/native/common -I../../../src/share/native/sun/awt -I../../../src/windows/native/sun/awt -IC:/openjdk/OUTPUT~1/tmp/sun/sun.awt/awt/CClassHeaders/../../java/jvm -IC:/openjdk/OUTPUT~1/tmp/sun/sun.awt/awt/obj -I../../../src/share/native/common -I../../../src/windows/native/sun/windows -IC:/PROGRA~2/MICROS~1/Include -I../../../src/share/native/sun/awt/image/cvutils -I../../../src/share/native/sun/awt/image -I../../../src/share/native/sun/java2d/loops -I../../../src/share/native/sun/java2d -I../../../src/windows/native/sun/java2d -I../../../src/share/native/sun/java2d/opengl -I../../../src/windows/native/sun/java2d/d3d -I../../../src/windows/native/sun/java2d/opengl -I../../../src/windows/native/sun/java2d/windows -I../../../src/share/native/sun/font -I../../../src/share/native/sun/java2d/pipe -I../../../src/share/native/sun/dc/path -I../../../src/share/native/sun/dc/doe -I../../../src/share/native/sun/awt/debug -I../../../src/windows/native/sun/awt  -I../../../src/share/native/sun/awt/medialib   -DINTERNAL_BUILD  -c -FoC:/openjdk/OUTPUT~1/tmp/sun/sun.awt/awt/obj/Win32SurfaceData.obj  ../../../src/windows/native/sun/awt/../java2d/windows/Win32SurfaceData.cpp
Win32SurfaceData.cpp
../../../src/windows/native/sun/awt/../java2d/windows/Win32SurfaceData.cpp(478) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
/cygdrive/c/vs2010/VC/Bin/cl   -Zi …
Run Code Online (Sandbox Code Playgroud)

ide notepad++

7
推荐指数
2
解决办法
3562
查看次数