问题列表 - 第4172页

Css布局帮助 - 3列页脚

我试图让我的网站中的页脚看起来像这样:

Wilgrove Baptist Church             Home | About | Ministries            1234 S. Main st.
John G. Smith, Sr. Pastor              Contact Us | Site Map           somwhere, ID 55555

我的问题是它被列入3列.有什么建议?

谢谢!

css

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

Selenium或Watir for Rails中的Javascript测试

我们在Rails应用程序中使用RSpec和Cucumber,效果很好.Webrat非常适合非AJAX交互,但我们已准备好重新编写Javascript测试.

Webrat内置了Selenium支持,之前我们使用过Selenium,但我很好奇是否有人使用Watir和Cucumber取得了良好的效果以及Watir与Selenium的优缺点.

javascript testing ajax selenium ruby-on-rails

15
推荐指数
1
解决办法
7931
查看次数

将BCD转换为二进制的最有效方法

我有下面的代码将32位BCD值(以两个uint half提供)转换为uint二进制值.

提供的值最大为0x9999,最大值为0x99999999.

是否有更好(即更快)的方法来实现这一目标?

    /// <summary>
    /// Convert two PLC words in BCD format (forming 8 digit number) into single binary integer.
    /// e.g. If Lower = 0x5678 and Upper = 0x1234, then Return is 12345678 decimal, or 0xbc614e.
    /// </summary>
    /// <param name="lower">Least significant 16 bits.</param>
    /// <param name="upper">Most significant 16 bits.</param>
    /// <returns>32 bit unsigned integer.</returns>
    /// <remarks>If the parameters supplied are invalid, returns zero.</remarks>
    private static uint BCD2ToBin(uint lower, uint upper)
    {
        uint binVal = 0;

        if …
Run Code Online (Sandbox Code Playgroud)

c# binary bcd

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

Git提交范围中双点".."和三点"..."之间有什么区别?

一些Git命令采用提交范围,一个有效语法是用两个点分隔两个提交名称..,另一个语法使用三个点....

两者有什么不同?

git git-diff git-log

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

Lua - if语句中的语法错误

刚尝试执行一个小的Lua脚本,但不幸的是我做错了.我没有更多的想法可能是错误.

function checkPrime( n )
    for i = 2, n-1, 1 do
        if n % i == 0 then
            return false
        end
    end
    return true
end
Run Code Online (Sandbox Code Playgroud)

口译员说:

lua: /home/sebastian/luatest/test.lua:3: `then' expected near `%'
Run Code Online (Sandbox Code Playgroud)

我认为这不是一件大事,也许很清楚是什么问题.但不知怎的,我现在看不到它.

syntax lua

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

通过使用ASP.NET构建的网站流式传输视频的最佳方式是什么?

我正在寻找每个人对从使用ASP.NET构建的网站流式传输视频的最佳方式的看法.一些值得注意的项目包括:

  • 流式传输.avi,.mpg和可能的.wmv文件的能力
  • 某人可以将视频直接上传到共享服务器并使其无需任何额外工作即可进行流式处理(无需压缩等)

我认为Silverlight可能是一个很好的方式,但我会非常感谢其他人的意见(如果可以,请包括优点/缺点).

谢谢!

vb.net asp.net video video-streaming

0
推荐指数
1
解决办法
1312
查看次数

Graphics.DrawRectangle(Pen,RectangleF)

http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawrectangle.aspx

FillRectangle,DrawRectangle,FillElipse和DrawEllipse都可以采用4个浮点(或"单个")参数:x,y,width,height.但是DrawRectangle是唯一不会使用RectangleF的.

我想知道是否有人知道这是为什么.看起来他们似乎只是忘了超负荷.

.net graphics drawing overloading rectangles

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

当我将子元素设置为"width:80%"时,为什么<td>会缩小?

我有一个表,当我将嵌套元素的样式设置为宽度时,其中一个左列收缩:80%.该列缩小并截断右边的输入元素.您可以通过从input元素中删除样式来查看我正在谈论的内容.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
</head>
<body>
    <table width="100%" border="1">
        <tr>
            <td>
                <input type="text" style="width: 80%;" />
            </td>
            <td>
                Lots of text to make the right cell expand.
                Lots of text to make the right cell expand.
                Lots of text to make the right cell expand.
                Lots of text to make the right cell expand.
                Lots of text to make the right cell expand.
                Lots of text to make the …
Run Code Online (Sandbox Code Playgroud)

html css html-table

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

实体框架 - 使用分离实体问题

好的,所以在这个例子中我有一个名为Template的父实体.模板始终具有类型.类型是很可能已经存在的FK.创建新模板并向其添加类型时会出现问题.添加类型后,如果要添加模板,则会收到错误.您收到的错误取决于方法.有谁知道如何处理这种情况?

public static void AddTemplate(Template template)
    {
        using (TheEntities context = new TheEntities())
        {
            //if (template.TemplateType.EntityKey != null)
            //{
            //    context.Attach(template.TemplateType);
            //}

            context.AddToTemplates(template);
            context.SaveChanges();

            context.RemoveTracking(template);
        }
    }
Run Code Online (Sandbox Code Playgroud)

我试过尝试附加现有密钥而不是.底部对RemoveTracking的调用只是在模板和可能已加载的任何子实体上调用detach的扩展.

这是单元测试.

[TestMethod]
    public void CanAddAndDeleteATemplate()
    {
        Template template = new Template();
        template.Name = "Test";
        template.Description = "Test";

        TemplateType type = TemplateManager.FindTemplateTypeByName("Round");

        if (type == null)
        {
            type = new TemplateType();
            type.Name = "Round";
        }

        template.TemplateType = type;

        TemplateManager.AddTemplate(template);

        template = TemplateManager.FindTemplateByID(template.TemplateID);

        Assert.IsNotNull(template);

        TemplateManager.DeleteTemplate(template);

        template = TemplateManager.FindTemplateByID(template.TemplateID);

        Assert.IsNull(template);
    }
Run Code Online (Sandbox Code Playgroud)

单元测试完美地假设模板类型"Round"尚不存在.我开始怀疑这种东西在独立的环境中是否可行.

UPDATE

好的,我将AddTemplate的代码更改为此,现在它可以正常工作..

public …
Run Code Online (Sandbox Code Playgroud)

c# entity-framework

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

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