小编Luk*_*vin的帖子

SQL事件探查器中"持续时间"列的度量单位

SQL事件探查器中"持续时间"列的单位是多少?我认为这是毫秒,但在下面的Profiler行中,我发现它与开始和结束时间相矛盾:

spid=163    
duration=11310646
starttime=2010-04-06 17:45:24.480
endtime=2010-04-06 17:45:35.790
reads=152
writes=2
cpu=16
eventclass=12
textdata= DELETE FROM dbo.[Icon] WHERE Id = 20087 
Run Code Online (Sandbox Code Playgroud)

仅供参考,我使用的是SQL Server 2008.

sql-server sql-server-profiler

32
推荐指数
1
解决办法
6万
查看次数

如果已经在window.open中打开,则将窗口置于前面?

如果您打开一个窗口,如:

window.open ("url","winName","location=0,width=300,height=214");
Run Code Online (Sandbox Code Playgroud)

如果winName已经打开,则只更改窗口中的URL.这没关系,但如果那个窗口在当前窗口后面,大多数用户都不会意识到这一点,并认为它只是没有打开.

有没有办法,如果窗口已经打开,它会把它带到前面?

javascript

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

Emacs问题 - 哈希键

我有一台Mac笔记本电脑,我正在连接到运行Linux的服务器.由于Alt + 3已经在EMACS中绑定到命令,因此我无法在文件中插入哈希符号.我尝试过在网上找到的以下解决方案:

(global-unset-key (kbd "C-3"))
(global-set-key (kbd "C-3") '(lambda() (interactive) (insert-string
"#")))      //I know that C is for CTRL not Alt - I have tried with
M-3 instead as well
Run Code Online (Sandbox Code Playgroud)

还有其他一些,但似乎都没有用.你能告诉我任何其他方式我可以在文件中输入井号(#).

麻生太郎尝试过(没用):

(fset 'insertPound "#")
(global-set-key (kbd "M-3") 'insertPound)
Run Code Online (Sandbox Code Playgroud)

谢谢!

macos emacs

32
推荐指数
4
解决办法
1万
查看次数

如何仅从日期时间值比较日期部分

我有两个变量

date1 = Mon Nov 25 2013 00:00:00 GMT+0530 (IST)
date2 = Mon Nov 25 2013 14:13:55 GMT+0530 (IST)
Run Code Online (Sandbox Code Playgroud)

当我比较我得到的两个日期date2更大,我需要的是正确的.但我不想查看我所拥有的两个日期的时间部分.如何从这两个日期单独获取日期部分并进行比较?

var today = new Date();     //Mon Nov 25 2013 14:13:55 GMT+0530 (IST) 
d = new Date(my_value);     //Mon Nov 25 2013 00:00:00 GMT+0530 (IST) 
if(d>=today){               //I need to check the date parts alone.
    alert(d is greater than or equal to current date);
}
Run Code Online (Sandbox Code Playgroud)

javascript jquery

32
推荐指数
3
解决办法
6万
查看次数

OWIN中间件中的全局异常处理

我正在尝试在构建于OWIN中间件(使用Owin.Host.SystemWeb的IIS HOST)之上的ASP.NET Web API 2.1项目中创建统一的错误处理/报告.目前我使用了一个自定义异常记录器,它继承System.Web.Http.ExceptionHandling.ExceptionLogger并使用NLog记录所有异常,如下面的代码所示:

public class NLogExceptionLogger : ExceptionLogger
{

    private static readonly Logger Nlog = LogManager.GetCurrentClassLogger();
    public override void Log(ExceptionLoggerContext context)
    {
       //Log using NLog
    } 
}
Run Code Online (Sandbox Code Playgroud)

我想将所有API异常的响应主体更改为友好的统一响应,该响应使用System.Web.Http.ExceptionHandling.ExceptionHandler以下代码隐藏所有异常详细信息:

public class ContentNegotiatedExceptionHandler : ExceptionHandler
{
    public override void Handle(ExceptionHandlerContext context)
    {
        var errorDataModel = new ErrorDataModel
        {
            Message = "Internal server error occurred, error has been reported!",
            Details = context.Exception.Message,
            ErrorReference = context.Exception.Data["ErrorReference"] != null ? context.Exception.Data["ErrorReference"].ToString() : string.Empty,
            DateTime = DateTime.UtcNow
        };

        var response …
Run Code Online (Sandbox Code Playgroud)

asp.net-web-api owin katana asp.net-web-api2 owin-middleware

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

Emacs shell有问题

我使用Ubuntu8.10和emacs-snapshot.在emacs上运行shell模式并输入"ls"显示转义码:

截图http://lh3.ggpht.com/_os_zrveP8Ns/SdMmohKNjmI/AAAAAAAADB4/VlKpr5H_7ZA/s512/screen.png

如何获得我期望的输出?

emacs

31
推荐指数
2
解决办法
9606
查看次数

rsync打印"跳过非常规文件",显示为常规目录

我使用rsync备份我的文件.在同步之后,我运行它期望什么也看不到,但它看起来像是在跳过目录.我(显然)改名了,但我相信我仍然掌握了所有可能的信息.这里发生了什么事?

$ ls -l /source/backup/myfiles
drwxr-xr-x 2 me me  4096 2010-10-03 14:00 foo
drwxr-xr-x 2 me me  4096 2011-08-03 23:49 bar
drwxr-xr-x 2 me me  4096 2011-08-18 18:58 baz

$ ls -l /destination/backup/myfiles
drwxr-xr-x 2 me me  4096 2010-10-03 14:00 foo
drwxr-xr-x 2 me me  4096 2011-08-03 23:49 bar
drwxr-xr-x 2 me me  4096 2011-08-18 18:58 baz

$ file /source/backup/myfiles/foo
/source/backup/myfiles/foo/: directory
Run Code Online (Sandbox Code Playgroud)

然后我同步(期待没有变化):

$ rsync -rtvp /source/backup /destination
sending incremental file list
backup/myfiles
skipping non-regular file "backup/myfiles/foo"
skipping non-regular file …
Run Code Online (Sandbox Code Playgroud)

unix linux directory backup rsync

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

升级到Visual Studio 2015后,Strange Build错误想要复制pagefile.sys

在解决方案中构建MVC项目时出现此错误.在我的解决方案中根本不存在对这些文件的引用.

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4105,5): error MSB3030: Could not copy the file "D:\bootmgr" because it was not found.
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4105,5): error MSB3030: Could not copy the file "D:\BOOTNXT" because it was not found.
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4105,5): error MSB3030: Could not copy the file "D:\pagefile.sys" because it was not found.
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4105,5): error MSB3030: Could not copy the file "D:\swapfile.sys" because it was not found.
Run Code Online (Sandbox Code Playgroud)

我的同事可以毫无错误地建立.

msbuild visual-studio-2015

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

名称"nameof"在当前上下文中不存在

我正在使用VS 2013和.Net Framework 4.6.我想使用新的C#6功能(例如nameof).但是我找不到它.

在此输入图像描述

我应该使用VS 2015吗?或者更高的.Net框架?

c# visual-studio visual-studio-2013

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

为变量赋值的SELECT语句不能与数据检索操作结合使用

这个陈述有什么问题?

ALTER Function [InvestmentReturn].[getSecurityMinLowForPeriod](@securityid int,
    @start datetime,
    @end datetime)
returns xml
begin

declare @results varchar(500)
declare @low int
declare @adjustedLow int
declare @day varchar(10)

if @end is null
begin
    set @end = getdate()
end
set @adjustedLow = (select min(adjLow) 
                        from (
                            select Low * [InvestmentReturn].[fn_getCorporateActionSplitFactor](isq.securityid, @start, convert(varchar,day, 111)) as adjLow 
                            from 
                                securityquote isq
                            where isq.securityid = @securityid and isq.day >= convert(varchar(10), @start, 111) and convert(varchar(10), @end, 111) >= isq.day
                            and low != -1 
                            ) as x)
select 
    top 1 @low …
Run Code Online (Sandbox Code Playgroud)

sql-server sql-server-2008

30
推荐指数
2
解决办法
15万
查看次数