运行已经过数字签名的可执行文件时,我得到了一个非常奇怪的结果.
可执行文件使用signtool.exe使用适当的2级代码签名证书(非自生成)进行签名.
在Windows 7计算机上进行测试,如果我启动已签名的可执行文件,我会收到Windows警告对话框,说明Publisher Unknown(即未签名).
但是,如果我然后取消并右键单击可执行文件并转到属性 - >数字签名,签名列表将显示签名证书,然后我可以单击该选项并选择"详细信息"以查看签名的详细信息,显示为"数字签名正常".
此时,如果我启动可执行文件,现在所有突然的窗口都正确识别出exectuable已签名并报告正确的"已验证的发布者".
似乎Windows可能没有在线检查证书,直到我从可执行文件的属性对话框中查看实际的证书详细信息(请注意,启动可执行文件后它不仅仅是一个延迟,我等待的时间不长或者我启动它多少次,它将它视为未签名,直到我进入文件的属性/数字签名).
这是我用于测试的通用Windows 7安装 - 它没有以任何方式进行修改或调整.
这种行为似乎打破了Windows上代码签名的主要目的 - 除非用户知道进入右键单击属性并挖掘证书,否则可执行文件被视为无符号.
有什么我想念的吗?某些方法将可执行文件标记为Windows应该主动检查执行时的证书?
任何人都知道我在哪里可以找到封闭编辑器的好插件.到目前为止我只发现:
https://github.com/yinhm/google-closure-editor-image
和
http://github.com/shripadk/google-closure-image-plugin
图像,视频,HTML编辑,表格插件会很有用.另一个有趣的插件是让一个工具栏编辑多个字段的插件.(http://groups.google.com/group/closure-library-discuss/browse_thread/thread/6fd6d412406d40/113aca2e17b28d54)
理想的解决方案是编辑器的预编译版本,可以直接包含在页面中,只需要一些小配置(一厢情愿).
谢谢!
我这里有一些代码
private void Run()
{
MyClass c = new MyClass();
c.Load(somepath1);
using (StreamReader sr = new StreamReader(filepath))
{
string line = string.Empty;
while ((line = sr.ReadLine()) != null)
{
using (Bitmap B = new Bitmap(line))
{
Point p = SomeMethod(ref c, new Point());
using (MemoryStream ms = new MemoryStream())
{
B.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
using (Bitmap T = new Bitmap(new Bitmap(Image.FromStream(ms))))
using (Graphics g = Graphics.FromImage(T))
{
g.DrawEllipse(new Pen(Brushes.Red, 4), p.X - 5, p.Y - 5, 10, 10);
FileInfo fi = new …Run Code Online (Sandbox Code Playgroud) 当测试在maven中失败时,surefire测试报告xml文件target/surefire-reports/TEST-<test-name>.xml仅显示标准输出System.output或标准错误System.err
当我使用jdk时,java.util.logging.Logger所有日志记录都显示在标准错误中<system-err> tag,但是当我使用log4j时它没有显示.
log4j的日志记录通过FileAppender和ConsoleAppender正常工作.它显示在完整的控制台输出中,但不显示在各个测试报告文件中.
System.out以便在surefire rerports中显示吗?假设您有以下内容:
//Note the original example I posted didn't reproduce the problem so
//I created an clean example
type
IParent = interface(IInterface)
['{85A340FA-D5E5-4F37-ABDD-A75A7B3B494C}']
procedure DoSomething;
end;
IChild = interface(IParent)
['{15927C56-8CDA-4122-8ECB-920948027015}']
procedure DoSomethingElse;
end;
TGrandParent = class(TInterfacedObject)
end;
TParent = class(TGrandParent)
end;
TChild = class(TParent, IChild)
private
FChildDelegate: IChild;
public
property ChildDelegate:IChild read FChildDelegate implements IChild;
end;
TChildDelegate = class(TInterfacedObject, IChild)
public
procedure DoSomething;
procedure DoSomethingElse;
end;
Run Code Online (Sandbox Code Playgroud)
我认为这可以让你打电话,DoSomething但似乎并非如此:
procedure CallDoSomething(Parent: TParent);
begin
if Parent is TChild then
TChild(Parent).DoSomething;
end;
Run Code Online (Sandbox Code Playgroud)
很明显,编译器正在强制执行接口继承,因为除非实现了成员,否则这两个类都不会编译 …
我相信它在不久前工作但现在xpath返回null.有人可以帮我在下面的代码中找到我的愚蠢错误吗?
或者我甚至必须在setNamespaceAware(false)之后提供NamespaceContext?
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
domFactory.setNamespaceAware(false);
domFactory.setIgnoringComments(true);
domFactory.setIgnoringElementContentWhitespace(true);
try {
Document doc = domFactory.newDocumentBuilder().parse(new File("E:/Temp/test.xml"));
XPath xp = XPathFactory.newInstance().newXPath();
NodeList nl = (NodeList) xp.evaluate("//class", doc, XPathConstants.NODESET);
System.out.println(nl.getLength());
}catch (Exception e){
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
XML文档在这里:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://www.example.com/schema">
<class />
<class />
</root>
Run Code Online (Sandbox Code Playgroud) 我知道类名的PEP-8约定是ClassName.但是我们经常使用小类作为伪命名空间,枚举等.换句话说,不是你要实例化的真正的类.我们选择了这种"类"的小写命名约定,因为它们实际上是命名空间/枚举名称.
有没有其他人有这种内部风格,或其他方式来实现同样的事情?
一个例子:
import urllib2
class config: # pseudo-namespace for module-level config variables
api_url = 'http://example.com/api'
timeout = 1.5
debug = True
class countries: # pseudo-enum
new_zealand = 1
united_states = 2
def func():
if config.debug:
print 'Calling func()'
return urllib2.urlopen(config.api_url)
Run Code Online (Sandbox Code Playgroud) 假设我在RepoX中有两个分支,叫做BranchA和BranchB.RepoX还有一个名为SubmoduleY的子模块.
BranchA在版本'abc'处具有SubmoduleY,BranchB在版本'def'处具有SubmoduleY.
假设我想将BranchA合并到BranchB中,但我想让BranchB的SubmoduleY指向其原始版本的'def'.我看到了几种方法:
方法1:
方法2:
与方法1相同,但不是执行步骤6,而是从第3步中重新定义并删除额外的子模块提交.
两者似乎都有令人讨厌的缺点:
方法1将两个额外的提交放入历史记录中.
方法2忘记了对子模块修订所做的任何更改,因为这些提交会被删除.因此,稍后的任何合并将不得不再次处理一些问题.
有没有更好的办法?
我正在寻找一些完整的wix项目示例,参考.NET dll(完整的wix VS项目,.net dll VS项目,以及编译的.net dll).
我正在尝试运行SampleAskKeyNet并且经常出现错误"此Windows Installer程序包存在问题.无法运行此安装所需的DLL.请联系您的支持人员或程序包供应商,我正在尝试查找我做错了什么.
我在VS中创建了wix项目,在VS中创建了.net dll项目,编译了dll项目,将CheckPidPackage.dll复制到wix VS项目目录并编译wix项目.然后我运行它,我得到这个错误.
我一直在和Clojure-CLR一起玩.我的REPL正在工作,我可以从Clojure调用.NET类,但我无法弄清楚从C#类调用编译的Clojure dll.
我从示例顶部删除了:name行,因为它导致"Duplicate key :: name"错误.没有":name"行,代码编译得很好,我可以在Visual Studio中添加引用,但我似乎无法弄清楚如何使用代码.我尝试了各种"使用"语句,但到目前为止还没有任何效果.任何人都可以对此提供一点见解吗?这是我试图使用的Clojure代码.
(ns code.clojure.example.hello
(:gen-class
:methods [#^{:static true} [output [int int] int]]))
(defn output [a b]
(+ a b))
(defn -output
[a b]
(output a b))
Run Code Online (Sandbox Code Playgroud) .net ×2
authenticode ×1
c# ×1
clojure ×1
clojureclr ×1
codesign ×1
coding-style ×1
delphi ×1
delphi-2009 ×1
git ×1
inheritance ×1
interface ×1
java ×1
log4j ×1
maven ×1
memory ×1
merge ×1
python ×1
surefire ×1
windows ×1
wix ×1
xpath ×1