标签: identity

处理"Insert Into TABLE Values()"语句中的标识列?

在SQL Server 2000或更高版本中,当使用如下语句时,无论如何都要处理自动生成的主键(标识)列?

Insert Into TableName Values(?, ?, ?)
Run Code Online (Sandbox Code Playgroud)

我的目标是根本不使用列名.

sql t-sql database sql-server identity

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

R中身份函数的实际用途是什么?

Base R定义了一个identity函数,一个返回其参数的普通身份函数(引用自?identity).

它被定义为:

identity <- function (x){x}
Run Code Online (Sandbox Code Playgroud)

为什么这样一个微不足道的功能会有用呢?为什么它会包含在基础R中?

identity functional-programming r

33
推荐指数
4
解决办法
6278
查看次数

Asp.net身份密码哈希

新的ASP.net Identity项目为网站安全带来了一些有用的代码和接口.要使用接口实现自定义系统(而不是使用MVC 5模板中包含的标准Entity Framework实现),IPasswordHasher则需要使用.

IPasswordHasher ASP.net身份中的接口

namespace Microsoft.AspNet.Identity
{
    public interface IPasswordHasher
    {
         string HashPassword(string password);
         PasswordVerificationResult VerifyHashedPassword(string hashedPassword, string providedPassword);
    }
}
Run Code Online (Sandbox Code Playgroud)

是否可以使用密码salting在ASP.net身份中通过此接口进行更安全的加密?

asp.net security identity asp.net-identity

33
推荐指数
3
解决办法
7万
查看次数

Python设置"in"运算符:使用相等或身份?

class A(object):
    def __cmp__(self):
        print '__cmp__'
        return object.__cmp__(self)

    def __eq__(self, rhs):
        print '__eq__'
        return True
a1 = A()
a2 = A()
print a1 in set([a1])
print a1 in set([a2])
Run Code Online (Sandbox Code Playgroud)

为什么第一行打印为True,但第二行打印为False?既不进入运营商eq

我使用的是Python 2.6

python identity equality set operator-keyword

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

如何在Dart中生成唯一ID

我写websocket聊天.如何为用户生成唯一ID?

现在我用这个代码:

id = new DateTime.now().millisecondsSinceEpoch;
Run Code Online (Sandbox Code Playgroud)

有没有更整洁的解决方案?

uuid identity unique uniqueidentifier dart

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

newid()vs newsequentialid()有什么区别/利弊?

在所有主键都是GUID的数据库中,使用newid()与newsequentialid()作为"默认值或绑定"的差异/含义和/或利弊是什么.

我所知道的唯一区别是newid()创建一个新的随机GUID而不是newsequentialid()以递增的方式基于表中的最后一个GUID创建一个新的GUID.

identity sql-server-2005 primary-key

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

在MVC Identity(2.0.1)中的regenerateIdentity/validateInterval持续时间后忽略ExpireTimeSpan

整天都在这个问题上摸不着头脑.我正在尝试在MVC Identity 2.0.1中设置"非常长"的登录会话.(30天).

我使用以下cookie启动:

      app.UseCookieAuthentication(new CookieAuthenticationOptions
        {

            SlidingExpiration = true,
            ExpireTimeSpan = System.TimeSpan.FromDays(30),
            AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
            LoginPath = new PathString("/My/Login"),
            CookieName = "MyLoginCookie",
            Provider = new CookieAuthenticationProvider
            {                           
                OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
                    validateInterval: TimeSpan.FromMinutes(30),

                    regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
            }
        });
Run Code Online (Sandbox Code Playgroud)

总的来说,工作正常.因此,cookie设置为30天,所有看起来都很好.

如果我关闭浏览器并在"validateInterval"持续时间过去之后回来(这里30分钟)我仍然登录,但是现在cookie仅作为"会话"重新发布(仍然是正确的cookie名称)!30天的到期消失了.

如果我现在关闭浏览器/再次重新打开,我将不再登录.

我已经测试了删除"提供者"并且所有工作都按预期进行,我可以在几个小时后回来并且我仍然可以正常登录.我读到最好使用邮票重新验证,所以我不确定如何继续.

asp.net-mvc identity asp.net-identity

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

如何使用ASP.NET Identity for ASP.NET MVC 5.0实现密码重置?

微软正在推出一个名为ASP.NET Identity新会员系统(也是ASP.NET MVC 5中的默认系统).我找到了示例项目,但是没有实现密码重置.

在密码重置主题上找到了这篇文章:使用一个ASP.NET身份实现用户确认和密码重置 - 痛苦或愉快,对我没有帮助,因为不使用内置密码恢复.

当我查看选项时,我认为我们需要生成一个重置令牌,我将发送给用户.用户可以使用令牌设置新密码,覆盖旧密码.

我找到了IdentityManager.Passwords.GenerateResetPasswordToken/ IdentityManager.Passwords.GenerateResetPasswordTokenAsync(string tokenId, string userName, validUntilUtc),但我无法弄清楚它可能意味着什么tokenId参数.

如何使用MVC 5.0在ASP.NET中实现密码重置?

.net c# asp.net-mvc identity password-recovery

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

为什么CPython中的id({})== id({})和id([])== id([])?

为什么CPython(没有关于其他Python实现的线索)有以下行为?

tuple1 = ()
tuple2 = ()                                                                                                   
dict1 = {}
dict2 = {}
list1 = []
list2 = []
# makes sense, tuples are immutable
assert(id(tuple1) == id(tuple2))
# also makes sense dicts are mutable
assert(id(dict1) != id(dict2))
# lists are mutable too
assert(id(list1) != id(list2))
assert(id(()) == id(()))
# why no assertion error on this?
assert(id({}) == id({}))
# or this?
assert(id([]) == id([]))
Run Code Online (Sandbox Code Playgroud)

我有一些想法可能,但找不到具体原因.

编辑

进一步证明格伦和托马斯的观点:

[1] id([])
4330909912
[2] x = []
[3] …
Run Code Online (Sandbox Code Playgroud)

python identity cpython python-internals

26
推荐指数
2
解决办法
1787
查看次数

FSharp.Core中`id`函数的用途是什么?

来自Operators.id <'T>功能(F#):

身份功能.

参数:x类型:'T(输入值)

返回值:相同的值

F#核心库版本,支持:2.0,4.0,Portable

为什么有一个返回其输入的函数?

.net f# identity

26
推荐指数
2
解决办法
1898
查看次数