小编Omu*_*Omu的帖子

如何使jQuery UI对话框不可调整大小

有谁知道如何使jQuery对话框不可调整大小?目前,我称之为:

var elem = $("#mydiv");
elem.dialog({
  modal: true,
  title: 'title',
  buttons: {
     Ok: function() {
        $(this).dialog('close');
     } // end function for Ok button
  } // end buttons
}); // end dialog
elem.dialog('open')
Run Code Online (Sandbox Code Playgroud)

jquery jquery-ui jquery-ui-dialog

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

IoC.Resolve与构造函数注入

我听到很多人说使用IoC.Resolve()是一种不好的做法,但我从来没有听说过一个很好的理由(如果它只是测试而不是你可以嘲笑容器,那么你已经完成了).

现在使用Resolve而不是Constructor Injection的优点是你不需要在构造函数中创建具有5个参数的类,并且无论何时你要创建该类的实例,你都不需要提供它.什么

.net ioc-container inversion-of-control

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

在EF4中为表|列名指定不同的名称

我在CodeFirst中使用EF4

public class People : DbContext
{
    public DbSet<Human> Humans { get; set; }
    public DbSet<Child> Children { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

目前,EF在数据库中查找该Human表.我该如何指定它来寻找Humans呢?

entity-framework entity-framework-4

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

java的线程安全映射

我需要一个线程安全的地图,我有这样的东西:(我对java很新)

 public static class Manager
        {
        static 
        {
//something wrong here, doesn't compile
           list = new java.util.Collections
          .synchronizedMap(new Map<String, Client>());
        }

       static Map<String,Client> list;

        public static void AddClient(Client client)
        {
        // thread safe add client to the list
        }

        public static void RemoveClient(Client client)
        {
        // thread safe remove client to the list
        }

        }
Run Code Online (Sandbox Code Playgroud)

java

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

使用Guid作为PK与EF4 Code First

我有这个班级和表格:

public class Foo
{
public Guid Id {get;set;}
public string Name {get;set;}   
}
Run Code Online (Sandbox Code Playgroud)
create table Foo
(
id uniqueidentifier primary KEY DEFAULT (newsequentialid()),
name nvarchar(255)
)
Run Code Online (Sandbox Code Playgroud)

问题是,当我尝试保存新的foo时,第一个使用了0000-000-00 ... id和第二个也是,所以我得到了约束异常

有谁知道修复?

code-first entity-framework-4 ef4-code-only entity-framework-ctp5

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

在事务中的select语句和在它之外的select语句之间是否存在差异

默认的READ COMMITTED隔离级别是否以某种方式使select语句在事务内部的行为与不在事务中的行为不同?

我正在使用MSSQL.

sql sql-server select transactions

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

如何仅在ASP.NET中的调试模式下执行代码

我有一个ASP.NET Web应用程序,我有一些代码,我只想在调试版本中执行.这该怎么做?

c# asp.net debugging

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

在Bootstrapper中配置Automapper违反了开放封闭原则?

我在引导程序配置Automapper和我打电话Bootstrap()Application_Start(),我一直在说,这是错误的,因为我要修改我的Bootstrapper每一次我必须添加一个新的映射类,所以我违反了开闭原则.

你觉得怎么样,我真的违反了这个原则吗?

public static class Bootstrapper
{
    public static void BootStrap()
    {
        ModelBinders.Binders.DefaultBinder = new MyModelBinder();
        InputBuilder.BootStrap();
        ConfigureAutoMapper();
    }

    public static void ConfigureAutoMapper()
    {
        Mapper.CreateMap<User, UserDisplay>()
            .ForMember(o => o.UserRolesDescription,
                       opt => opt.ResolveUsing<RoleValueResolver>());
        Mapper.CreateMap<Organisation, OrganisationDisplay>();
        Mapper.CreateMap<Organisation, OrganisationOpenDisplay>();
        Mapper.CreateMap<OrganisationAddress, OrganisationAddressDisplay>();
    }    
}
Run Code Online (Sandbox Code Playgroud)

.net bootstrapping automapper open-closed-principle solid-principles

35
推荐指数
1
解决办法
9710
查看次数

eclipse magic:...语法错误,只有当源级别为1.5或更高时,varargs才可用

昨天我在eclipse中创建了一个项目,它正在工作,编译.我使用Eclipse Galileo for Java EE.今天我打开eclipse并看到很多错误,说明这些东西不可用,并且仅在源级别为1.5时才可用.

该怎么办?

java eclipse

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

IIS7无法授予最低权限请求

我在使用FileHelpers.dll时出现此错误,但我的IIS设置为完全信任级别,所以不应该这样

这是完整的堆栈跟踪:

    [PolicyException: Required permissions cannot be acquired.]
       System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +10238142
       System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +97

    [FileLoadException: Could not load file or assembly 'FileHelpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=3e0c08d59cc3d657' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
       System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
       System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence …
Run Code Online (Sandbox Code Playgroud)

iis permissions

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