很明显,泛型HashSet<T>类的搜索性能高于泛型List<T>类.只需将基于散列的密钥与线性方法进行比较即可List<T>.
但是,计算散列键本身可能需要一些CPU周期,因此对于少量项目,线性搜索可以是一个真正的替代HashSet<T>.
我的问题:收支平衡在哪里?
为了简化场景(并且公平),我们假设List<T>该类使用元素的Equals()方法来标识项目.
SQL Server 2005/2008 Express版每个数据库的限制为4 GB.据我所知,数据库引擎仅考虑数据,因此不包括日志文件,未使用的空间和索引大小.
获取MDF文件的长度不应在SQL Server限制方面提供正确的数据库大小.我的问题是如何获得数据库大小?
执行某些静态finallization的正确方法是什么?
没有静态析构函数.AppDomain.DomainUnload默认域中不会引发该事件.该AppDomain.ProcessExit事件共享所有事件处理程序之间的三秒(默认设置)的总时间,因此它实际上不可用.
使用嵌套类对常量进行分组有什么问题?
像这样:
public static class Constants
{
public static class CategoryA
{
public const string ValueX = "CatA_X";
public const string ValueY = "CatA_Y";
}
public static class CategoryB
{
public const string ValueX = "CatB_X";
public const string ValueY = "CatB_Y";
}
}
Run Code Online (Sandbox Code Playgroud)
像这样使用:
Console.WriteLine(Constants.CategoryA.ValueY);
Console.WriteLine(Constants.CategoryB.ValueX);
Run Code Online (Sandbox Code Playgroud)
你也可以使"常数" - 类偏...
我们的团队希望从Visual SourceSafe(VSS)迁移到Team Foundation Server(TFS).我知道TFS不仅仅是一个版本控制系统,但我第一次想以这种方式使用它.
目前,我们的项目是在由共享部分(公共库)和许多客户项目组成的单一解决方案中组织的.
是否有某种迁移指南可以描述这样的挑战?或者TFS强制执行自己的使用场景(项目,版本等的版本控制)?
有没有人遇到过InsufficientExecutionStackException?MSDN并没有说太多.
是什么之间的差异InsufficientExecutionStackException和StackOverflowException?
据我所知,该DateTime类型的差异运算符考虑了闰年:所以
new DateTime(2008, 3, 1) - new DateTime(2008, 2, 1) // should return 29 days
new DateTime(2009, 3, 1) - new DateTime(2009, 2, 1) // should return 28 days
Run Code Online (Sandbox Code Playgroud)
但是夏令时呢?
MSI存储将来卸载任务的安装目录.
使用INSTALLPROPERTY_INSTALLLOCATION属性(即"InstallLocation")只有安装程序ARPINSTALLLOCATION在安装期间设置了属性.但是这个属性是可选的,几乎没有人使用它.
我怎样才能检索安装目录?
要检索我使用的打印机列表:
new LocalPrintServer().GetPrintQueues(new[] { EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Connections })
Run Code Online (Sandbox Code Playgroud)
如何确定哪些打印机是默认打印机?
注意:使用System.Printing.dll组件.
作为.NET开发人员,我问的是JBoss替代品是否更适合作为企业应用程序平台"更适合.NET开发".
请不要提出任何建议,例如"让JBoss公开WebServices"......
.net ×6
c# ×2
class-design ×1
clr ×1
collections ×1
constants ×1
datetime ×1
deployment ×1
destructor ×1
dst ×1
exception ×1
finalizer ×1
hash ×1
installer ×1
jboss ×1
list ×1
middleware ×1
nested-class ×1
performance ×1
printing ×1
sql-server ×1
static ×1
t-sql ×1
tfs ×1
windows ×1
wpf ×1