是否有人使用iPython与emacs 23?emacs wiki上的文档有点混乱,我有兴趣听到任何使用emacs进行Python开发的人.你使用下载python-mode和ipython.el吗?您有什么推荐的吗?
有没有办法获得WCF连接的远程IP地址?
我想它没有内置到WCF框架中的原因是WCF可以使用非TCP/IP绑定,因此IP地址并不总是有意义的.
但是,这些信息对于所有广泛使用的绑定都是有意义的(据我所知:BasicHttp,DualHttp,WSHttp和NetTcp).
IP地址可能是使用反射访问的,但我宁愿找到一种记录的方法来获取它而不是入侵框架类.
我已经在Google上搜索了这个问题,似乎很多人在没有找到合适的解决方案的情况下遇到过这种情况(通常的答案是依赖于邮件头,但这意味着信任客户端提供其真实的IP地址,如果您出于安全原因要记录IP地址,则不能选择此选项)
在我的应用程序中,我有相当数量的实体,其中的字段通过反射设置其值.(在这种情况下,NHibernate正在设置它们).我想摆脱"x永远不会被分配并且将始终具有其默认值0"的警告,因此我可以更容易地找出其他警告.我意识到你可以用pragma指令包围它们,但AFAIK你必须为每个指令执行此操作.有没有项目范围或解决方案,我能做到这一点?
我一直在玩emacs lisp,我想编写一个小函数来进行正则表达式搜索和替换.我有一段时间让正则表达式正常工作,因为我没有意识到在编写lisp代码时需要对所有特殊字符进行双重转义(但在交互式使用query-replace-regexp时则不行!).
因此,例如,交互式使用query-replace-regexp即可使用
^\(.*\)[\t]-.*$
Run Code Online (Sandbox Code Playgroud)
但是在编写elisp代码时,你需要双重转义所有内容:
^\\(.*\\)[\t]-.*$
Run Code Online (Sandbox Code Playgroud)
我终于在Steve Yegge的文章中找到了对此的引用,但我想知道是否有人知道这是为什么?
我正在尝试连接到用Java编写的Web服务,但有些东西我无法弄清楚.
使用WCF和customBinding,几乎所有内容似乎都很好,除了SOAP消息的一部分,因为它缺少Nonce和Created部分节点.显然我错过了一些东西,所以如果你能指出我正确的方向,那就非常感激了.
这是自定义绑定:
<binding name="CustomHTTPBinding">
<security includeTimestamp="false" authenticationMode="UserNameOverTransport" defaultAlgorithmSuite="Basic256" requireDerivedKeys="True"
messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
</security>
<textMessageEncoding maxReadPoolSize="211" maxWritePoolSize="2132" messageVersion="Soap11"
writeEncoding="utf-8"/>
<httpsTransport />
</binding>
Run Code Online (Sandbox Code Playgroud)
这是消息的相关部分:
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<o:UsernameToken u:Id="uuid-c306efd1-e84c-410e-a2ad-1046b368582e-1">
<o:Username>
<!-- Removed-->
</o:Username>
<o:Password>
<!-- Removed-->
</o:Password>
</o:UsernameToken>
</o:Security>
Run Code Online (Sandbox Code Playgroud)
这就是它的外观:
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-25763165">
<wsse:Username>..</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">..</wsse:Password>
<wsse:Nonce>6ApOnLn5Aq9KSH46pzzcZA==</wsse:Nonce>
<wsu:Created>2009-05-13T18:59:23.309Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
Run Code Online (Sandbox Code Playgroud)
所以问题是:我如何在安全部分中引入Nonce和Created元素?
我有一个繁重的流量aspx页面根据每个用户的请求调用Web服务,如下所示.
string uri = "Path.asmx";
string soap = "soap xml string";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.Headers.Add("SOAPAction", "\"http://xxxxxx"");
request.ContentType = "text/xml;charset=\"utf-8\"";
request.Accept = "text/xml";
request.Method = "POST";
using (Stream stm = request.GetRequestStream())
{
using (StreamWriter stmw = new StreamWriter(stm))
{
stmw.Write(soap);
}
}
WebResponse response = request.GetResponse();
response.close();
Run Code Online (Sandbox Code Playgroud)
一切都很好,但有时我得到以下错误.
远程服务器返回错误:(500)内部服务器错误.在System.Net.HttpWebRequest.GetResponse()
有没有人对这个错误有任何想法,或者有人告诉我,如果我做错了.
我真的很困惑于需要返回具有最大值的顶部N行的查询.
例如,如果行N-1, N, N + 1具有相同的值.我必须返回just top N或top N + 1行.
是否有在VB.NET中命名私有字段的官方约定?例如,如果我有一个名为'Foo'的属性,我通常会调用私有字段'_Foo'.这似乎在官方指南中不赞成:
"不要为字段名称使用前缀.例如,不要使用g_或s_来区分静态字段和非静态字段."
在C#中,您可以调用私有字段'foo',属性'Foo',并在构造函数中将私有字段称为'this.foo'.由于VB.NET不区分大小写,你不能这样做 - 任何建议?
我正在编写我的第一个WCF服务.我决定将服务作为一个DLL开始编写,然后将WCF的内容展开,这就是我现在所处的位置.
建筑师告诉我,我应该坚持使用我已经完成的消息对象的特定格式.但是我在我的消息对象中使用了Interfaces,复杂类型和列表.我要添加属性,我有点困惑.
这是我的代码的示例.
[ServiceContract]
public interface MyServiceContract
{
[OperationContract]
MyMethodResponseMessage MyMethod(MyMethodRequestMessage request);
}
public class MyService : MyServiceContract
{
public MyMethodResponseMessage MyMethod(MyMethodRequestMessage request)
{
//Do things
}
}
//Messages
[MessageContract]
public class MyMethodResponseMessage
{
[MessageBodyMember]
public MyMethodResponse Body { get; set; }
}
[DataContract]
public class MyMethodResponse
{
[DataMember]
public IMyComplexTypeItem { get; set; }
[DataMember]
public List<IMyComplexType> Items { get; set; }
[DataMember]
public bool Success { get; set; }
}
//DTO
public interface IMyComplexType
{
[DataMember]
string Identity …Run Code Online (Sandbox Code Playgroud) 我在SQL过程中生成raise错误:
RAISERROR('Already exist',-10,-10)
但我无法在C#中使用以下代码捕获它
catch (SqlException ex)
{
bResult = false;
if (ex.Errors[0].Number == -10)
{
CommonTools.vAddToLog("bInsertNewUser", "ManageUsers", ex.Message);
if ((savePoint != null))
savePoint.Rollback();
}
}
Run Code Online (Sandbox Code Playgroud)
如何捕获C#中引发的错误?
c# ×5
wcf ×3
.net ×2
emacs ×2
web-services ×2
architecture ×1
asp.net ×1
convention ×1
elisp ×1
emacs23 ×1
ipython ×1
max ×1
mysql ×1
python ×1
raiserror ×1
regex ×1
sql-server ×1
suppress ×1
vb.net ×1
wcf-binding ×1