小编alp*_*ogg的帖子

如何将角度ui网格单元格中的按钮居中?

我按如下方式定义一列:

{
  name: 'button', 
  displayName: '', 
  cellClass: 'ui-grid-vcenter',
  enableColumnMenu: false,
  enableFiltering: false,
  enableSorting: false,
  cellTemplate: '<div><button ng-click="grid.appScope.rowButtonHandler(row.entity.id)">clicky</button></div>'
}
Run Code Online (Sandbox Code Playgroud)

导致:

<div class="ui-grid-cell ng-scope ui-grid-coluiGrid-010 ui-grid-vcenter" ui-grid-cell="" ng-class="{ 'ui-grid-row-header-cell': col.isRowHeader }" ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name">
    <div class="ng-scope">
        <button ng-click="grid.appScope.rowButtonHandler(row.entity.id)"></button>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

我想垂直和水平居中这个按钮.水平,工作,但垂直,我似乎无法正确的CSS.这是我的通用镜头:

.ui-grid-vcenter div {
  text-align: center;
  vertical-align: middle !important;
  background-color: yellow !important;
}
Run Code Online (Sandbox Code Playgroud)

如何在这种AngularJS网格的单元格中居中?

css centering angular-ui-grid

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

用于 ANTLR 的 Perl 正则表达式语法

我需要为一个项目创建一个正则表达式解析器,我正在使用 ANTLR v3 来做到这一点。我试图找到一个最新的、类似于 Perl6 的正则表达式语法。有人有消息来源吗?由于某种原因,谷歌搜索一直很困难。

regex grammar parsing antlr

5
推荐指数
1
解决办法
1767
查看次数

处理DDD风格的ASP.Net MVC2 Web应用程序中的错误

在DDD设计的ASP.NET MVC2 Web应用程序中,有关错误处理的"最佳实践"是什么?例如,让我们采用Web应用程序最常见的方面,即登录:

  • UserController:显然协调一些域对象最终登录或拒绝用户,并根据需要重定向到Web界面的其他部分.在我的例子中,它是对IsLoggedIn()或LogIn()等不同UserTasks方法的一些调用,以及一些RedirectToAction.
  • UserTasks:协调相关域对象服务的工作,如SecurityService和较低域对象,如调用SecurityService.ValidateUser()或检查User.IsUserInactive().
  • SecurityService:显然协调身份验证/授权服务.类似于MembershipProvider,没有超重行李.
  • 用户:表示用户.没有贫血,因为它有各种特定于用户的方法,如IsuUserInactive(),它检查IsDeleted,IsLockedOut或用户是否在FromDt和ThruDt之间.

你如何冒泡错误,使他们提供信息,而不是对用户充满敌意?您是否使用异常丢弃代码然后只在Application_Error()中处理它们?例如,当密码为空时,ValidateUser()抛出一个ArgumentNullException(),当密码不正确时,抛出一个AuthenticationException(),或者返回一个bool = false?如果是后者,您如何告知用户导致验证失败的原因?

error-handling domain-driven-design asp.net-mvc-2

5
推荐指数
1
解决办法
451
查看次数

在IE中打开Excel文件会引发三个登录?

我有一个经典的ASP网站,该网站将表单发布到页面上,然后生成一个Excel文件并将其流式传输给用户。实际上,它是我发送的原始HTML表:

Response.AddHeader "Content-Disposition", "inline; filename=file.xls"
Response.AddHeader "Content-Type", "application/vnd.ms-excel"
Run Code Online (Sandbox Code Playgroud)

Intranet网站通过集成的Windows身份验证进行保护。没有检查其他访问模式。用户使用其网络密码登录,一切正常。

现在,当用户提交表单时,此操作将导致另外两个登录对话框。实际上,您可以取消两者并仍然打开文件。实际上,如果您输入凭据,则需要输入四次!如果选中“记住密码”,则不会影响登录的需要。此外,即使URL在IE的“受信任的站点”部分中列出,也会发生。

关于如何最大程度地减少这种情况的任何想法?

PS:不确定,但似乎是一个相对较新的问题,表示IE(7/8),Office(2007+)和或Windows(Vista / 7)的更新版本。

更新:使用Fiddler,我可以看到名为“ User-Agent:Microsoft-WebDAV-MiniRedir / 6.1.7600”的内容正在尝试连接,并获得401.2版本。IE是否将下载内容卸载到其他未正确验证的内容上?

UPDATE2:令人感兴趣的是,Firefox不执行任何操作。它正确接收和解释事物:

HTTP/1.1 200 OK
Date: Mon, 21 Feb 2011 19:25:26 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Content-Disposition: inline; filename="SavingsReport_4Q2010.xls"
Content-Type: application/vnd.ms-excel
Content-Length: 111851
Cache-control: private
Run Code Online (Sandbox Code Playgroud)

authentication excel internet-explorer login asp-classic

5
推荐指数
1
解决办法
1387
查看次数

ExtJS4网格不会更新远程数据库

出于某种原因,ExtJS4网格的这种配置不会更新.当您单击一个单元格,更改一个值时,它会命中创建URL,而不是代理中定义的更新URL,并在FF4中使用Firebug进行观察.奇怪的是,datachanged事件在页面启动时加载存储后触发,但在数据实际更改后不会触发.此外,网格将所有行发送到创建URL.

谁能告诉我我做错了什么?

Ext.onReady(function() {

    Ext.BLANK_IMAGE_URL = '/images/extjs4/s.gif';
    Ext.tip.QuickTipManager.init();
    //Ext.state.Manager.setProvider(Ext.create('Ext.state.CookieProvider'));

    Ext.define('VendorError', {
        extend: 'Ext.data.Model',
        fields: [
            {name: 'UnexpSrvID', type: 'int'},
            {name: 'VendorID', type: 'int'},
            {name: 'VendorName', type: 'string'},
            {name: 'VndActID', type: 'int'},
            {name: 'VndActNb', type: 'string'},
            {name: 'InvoiceID', type: 'int'},
            {name: 'VInvNb', type: 'string'},
            {name: 'VInvRcptDt', type: 'date', dateFormat: 'Y-m-d' },
            {name: 'InvDate', type: 'date', dateFormat: 'Y-m-d' },
            {name: 'CodeSpecifier', type: 'string'},
            {name: 'Recurrence', type: 'string'},
            {name: 'ClientID', type: 'int'},
            {name: 'ClientName', type: 'string'},
            {name: 'LocID', type: 'int'},
            {name: 'LocName', type: …
Run Code Online (Sandbox Code Playgroud)

grid extjs store extjs4

5
推荐指数
1
解决办法
5142
查看次数

这个正则表达式模式是否应该抛出异常?

这个正则表达式模式是否应该抛出异常?对我来说.

^\d{3}[a-z]
Run Code Online (Sandbox Code Playgroud)

错误是: parsing "^\d{3}[a" - Unterminated [] set.

我感到愚蠢.我没有得到错误.(我的RegexBuddy看起来没问题.)

更多的背景,我希望不会影响这个问题:

我正在为SQL Server中的CLR用户定义函数编写此函数:

[Microsoft.SqlServer.Server.SqlFunction(IsDeterministic=true)]
  public static SqlChars Match(
    SqlChars input,
    SqlString pattern,
    SqlInt32 matchNb,
    SqlString name,
    SqlBoolean compile,
    SqlBoolean ignoreCase,
    SqlBoolean multiline,
    SqlBoolean singleline
    )
  {
    if (input.IsNull || pattern.IsNull || matchNb.IsNull || name.IsNull)
      return SqlChars.Null; 

    RegexOptions options = RegexOptions.IgnorePatternWhitespace |
      (compile.Value ? RegexOptions.Compiled : 0) |
      (ignoreCase.Value ? RegexOptions.IgnoreCase : 0) |
      (multiline.Value ? RegexOptions.Multiline : 0) |
      (singleline.Value ? RegexOptions.Singleline : 0);

    Regex regex = new Regex(pattern.Value, options); …
Run Code Online (Sandbox Code Playgroud)

c# regex

5
推荐指数
1
解决办法
571
查看次数

csproj 文件中的项目顺序重要吗?

我想在整个团队的解决方案中以编程方式管理 VS2008 csproj 文件。我们偶尔会遇到合并问题(在 Hg 中),仅仅是因为两个开发人员在项目中添加了不同的新文件,但它们最终在 csproj 文件中的“相同位置”并触发了“解决冲突”的需要。有时,一个标签丢失并触发构建错误。

  • 我可以合并<ItemGroup>似乎只是列表或标签的 s 吗?
  • 我可以重新排序<Content><Compile>标记吗?或者,它们是否处于某种“智能”顺序?
  • 如果这在 VS2008 项目中没问题,我是否能够将其带到 VS2010/2012,或者是否有任何与此相关的更改?

xml build csproj visual-studio-2008

5
推荐指数
1
解决办法
831
查看次数

升级到nhibernate 3.1

我有一个使用NHibernate(2.2版)的项目.要升级到NHibernate 3.2,我该怎么办?

在dll之后我需要升级吗?

  1. NHibernate.Linq.dll
  2. Iesi.Collections.dll
  3. Castle.Core.dll
  4. Castle.DynamicProxy2.dll
  5. Log4net.dll

我需要升级hbm文件吗?我是否需要升级hibernate.cfg.xml文件?

nhibernate nhibernate-mapping

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

续集属于多

我使用了 Sequelize 并使用belongsToMany(). 但是,当我查询数据时,如下所示:

api.models.operator.find({ 
      where: { id: connection.params.id }, 
      include: [ 
        { model: api.models.permission, 
          include: [
            { model: api.models.activity }
          ]
        } 
      ]
    })
Run Code Online (Sandbox Code Playgroud)

我收到一个activity is not associated to permission!错误。为什么?是不是belongsToMany 通过Permission to Operator 连接Activity 意味着关联?

我的权限模型:

module.exports = function(sequelize, DataTypes) {

  return sequelize.define("permission", 
    {
      id: {
        type: DataTypes.BIGINT,
        allowNull: false,
        primaryKey: true,
        autoIncrement: true
      },
      operator_id: {
        type: DataTypes.BIGINT,
        allowNull: false,
        references: 'operator',
        referencesKey: 'id',
        comment: "The Operator in this Permission."
      },
      activity_id: {
        type: …
Run Code Online (Sandbox Code Playgroud)

many-to-many associations sequelize.js

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

NodeJS流和过早结束

假设NodeJS中的可读流和on('data', ...)与之关联的Data()事件处理程序相对较慢,是否有可能在最后一个数据处理程序完成之前触发End事件,如果是,它是否会过早地终止处理程序?或者,是否会调度并运行所有数据事件?

在我的情况下,我正在处理大文件,并希望每个数据块都提交到数据库.我担心如果在处理程序中的最后一次数据库调用实际完成之前触发了End,我可能会丢失最后一条或两条(或更多条).

events stream event-handling node.js

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