在阅读" LINQ的Java等价物是什么? "后,我想知道,是(小写)语言集成查询 - 换句话说,是使用简洁语法在对象集合或外部存储上执行查询的能力 -成为大多数通用语言的未来之路?或者LINQ是一项有趣的技术,仍将局限于微软的语言?介于两者之间?
编辑:我不知道其他语言,但正如我所知,LINQ既不是史无前例也不是唯一的.LINQ中的想法 - lambdas和查询 - 存在于其他语言中,并且这些想法似乎正在传播.
我需要采用标准的传入URL并重写它们以将其重定向到单个页面上的特定锚点(传入的html页面名称成为锚点名称).例如,规则是这样的:
RewriteRule ^files/([a-zA-Z0-9\-_]+)\.html$ /test.html#$1 [R]
Run Code Online (Sandbox Code Playgroud)
所以这个网址:
http://foo.com/files/bar.html
Run Code Online (Sandbox Code Playgroud)
...会成为:
http://foo.com/test.html#bar
Run Code Online (Sandbox Code Playgroud)
规则本身工作正常,但#字符在浏览器地址栏中编码为:
http://foo.com/test.html%23bar
Run Code Online (Sandbox Code Playgroud)
这当然不能作为锚点正常工作.是否有一种方法在.htaccess中强制它不对哈希进行编码?我也试过逃避它,\#但这没有任何区别.
此问题与 如何在Visual C++ 2008中显示命令行生成选项有关
但除了显示编译器命令行之外,我还想查看链接器命令行.
我在链接器选项中"取消设置"/ nologo选项.
alt text http://i29.tinypic.com/oi4wns.jpg
但我仍然没有在输出窗口中获取命令行.我需要做什么?这可能吗?
我是一名C#程序员,所以我无法利用VB中的酷XML语法.
Dim itemList1 = From item In rss.<rss>.<channel>.<item> _
Where item.<description>.Value.Contains("LINQ") Or _
item.<title>.Value.Contains("LINQ")
Run Code Online (Sandbox Code Playgroud)
使用C#,我发现XPath比使用LINQ to XML执行多嵌套选择更容易思考,更容易编码,更容易理解.看看这个语法,它看起来像希腊语发誓:
var waypoints = from waypoint in gpxDoc.Descendants(gpx + "wpt")
select new
{
Latitude = waypoint.Attribute("lat").Value,
Longitude = waypoint.Attribute("lon").Value,
Elevation = waypoint.Element(gpx + "ele") != null ?
waypoint.Element(gpx + "ele").Value : null,
Name = waypoint.Element(gpx + "name") != null ?
waypoint.Element(gpx + "name").Value : null,
Dt = waypoint.Element(gpx + "cmt") != null ?
waypoint.Element(gpx + "cmt").Value : null
};
Run Code Online (Sandbox Code Playgroud)
所有的演员,沉重的语法,NullPointerExceptions的可能性.XPath不会发生这种情况. …
有两个progid的.我见过两个都用过.
任何人都有任何见解,我应该何时使用一个,而不是另一个?
我有一个WCF服务.它使用Linq-to-objects从Dictionary中进行选择.对象类型很简单:
public class User
{
public Guid Id;
public String Name;
}
Run Code Online (Sandbox Code Playgroud)
有一个存储在一个集合Dictionary<Guid,User>.
我想有一个OperationContract像这样的WCF 方法:
public IEnumerable<Guid> GetAllUsers()
{
var selection = from user in list.Values
select user.Id;
return selection;
}
Run Code Online (Sandbox Code Playgroud)
编译很好,但是当我运行它时,我得到:
服务器遇到处理请求的错误.异常消息是'无法序列化类型的参数'System.Linq.Enumerable + WhereSelectEnumerableIterator
2[Cheeso.Samples.Webservices._2010.Jan.User,System.Guid]' (for operation 'GetAllUsers', contract 'IJsonService') because it is not the exact type 'System.Collections.Generic.IEnumerable1 [System.Guid]'在方法签名中,并且不在已知类型集合中.为了序列化参数,请使用ServiceKnownTypeAttribute将类型添加到操作的已知类型集合中.请参阅服务器日志以获取更多详
我如何强制选择成为一个IEnumerable<Guid>?
编辑
如果我修改代码来做到这一点,它运作良好 - 良好的互操作性.
public List<Guid> GetAllUsers()
{
var selection = from user in list.Values
select user.Id;
return new List<Guid>(selection);
}
Run Code Online (Sandbox Code Playgroud)
有没有办法让我避免创建/实例化 …
我有MS-Excel 2010"简化版" - 它捆绑在预制PC中.
此版本是否支持VBA宏?我不能说.
我搜查了,我仍然不清楚这一点.
我认为是一些非常基本的CSS,它在FF4和IE8中表现不同.
有问题的CSS是这样的:
div.showme {
border: 1px dotted blue;
position: absolute;
top :10px;
bottom :10px;
left: 1%;
right: 33%;
overflow: auto;
padding: 0.8em 1em 0.8em 1em;
line-height:1.75em;
}
div.showme a {
padding: 0em 5px 0em 5px;
margin: 0;
white-space: nowrap;
color: #FF00FF;
background-color:#E6E6FA;
border: 1px solid grey;
padding: 0em 4px 0em 4px; }
div.showme a:link { color: blue; }
div.showme a:visited { color: #1E90FF; }
div.showme a:active { color: red; }
Run Code Online (Sandbox Code Playgroud)
相关的HTML如下所示:
<div class='showme'>
<a href='one'>one</a>
<a href='two'>two</a>
...
</div>
Run Code Online (Sandbox Code Playgroud)
问题是,在IE8中,填充不一致地显示. …
我有以下xml作为字符串:
<cfdi:Comprobante version="3.0"
xsi:schemaLocation="http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv3.xsd"
serie="A"
folio="6"
fecha="2011-07-22T13:51:42"
formaDePago="Pago en una sola exhibición"
sello="XlSJYAxauwYbI"
noCertificado="00001000000101242210"
certificado="YtEQOHw02OGx6E="
condicionesDePago="Paguese a mas tardar el 21/08/2011."
subTotal="123"
Moneda="MXN"
total="123"
tipoDeComprobante="ingreso">
<cfdi:Complemento>
<tfd:TimbreFiscalDigital FechaTimbrado="2011-07-22T13:51:47"
UUID="41C8A54F-4956-1BAD-F2CB-48E8343918FD"
noCertificadoSAT="00001000000102616613"
selloCFD="wrwerewe"
version="1.0"
xsi:schemaLocation="http://www.sat.gob.mx/TimbreFiscalDigital http://www.sat.gob.mx/sitio_internet/timbrefiscaldigital/TimbreFiscalDigital.xsd"/>
</cfdi:Complemento>
</cfdi:Comprobante>
Run Code Online (Sandbox Code Playgroud)
我想读取节点tfd中的属性UUID:TimbreFiscalDigital所以我想知道如何使用c#来做这个,这可能很傻但请理解我是c#中的新手.
注:此XML字符串中,而不是在一个文件中(我们的供应商的web服务返回的XML字符串,是不是我们的错)
注2:我可以使用Linq或任何其他库,这不是一个概率
谢谢!!
假设我有一个字符串列表,如下所示:
var candidates = new List<String> { "Peter", "Chris", "Maggie", "Virginia" };
Run Code Online (Sandbox Code Playgroud)
现在,我想验证另一个List<String>,让我们称之为list1,只包含每个候选人一次.我怎么能这样做,简单?我想我可以用Intersect().我也希望找到失踪的候选人.
private bool ContainsAllCandidatesOnce(List<String> list1)
{
????
}
private IEnumerable<String> MissingCandidates(List<String> list1)
{
????
}
Run Code Online (Sandbox Code Playgroud)
订单无关紧要.
linq ×4
.net ×3
c# ×2
ajax ×1
asp.net ×1
css ×1
encoding ×1
excel ×1
excel-2010 ×1
excel-vba ×1
java ×1
javascript ×1
json ×1
linker ×1
linq-to-xml ×1
mod-rewrite ×1
python ×1
vba ×1
visual-c++ ×1
wcf ×1
xml ×1
xpath ×1