小编tva*_*son的帖子

Cocoa框架是如何得名的?

我想知道Cocoa Framework是如何得名的.我知道这个名字来自可可豆,但我需要了解更多细节,我正在编写一些小教程.这是一个非常不寻常的框架名称,我想知道为什么选择这个名称.

cocoa

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

设计者生成的表适配器如何处理连接

表适配器如何利用连接?

为了说明这一点,他们会自动打开和关闭连接,还是在调用tableadapter方法之前我已经打开了连接,他们会使用它并保持打开状态吗?

问候

.net database-connection tableadapter

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

将绝对定位的网页更改为居中的网页

所以我有这个模板设计,目前绝对定位,但我试图让它在任何宽屏浏览器中居中.我已经尝试在容器的左侧和右侧设置宽度自动,但它仍然与左侧对齐.


CSS

  .JosephSettin_png
  {
   position: absolute;
   left:0px;
   top:0px;
   width:216px; 
   height:40px;
   background: url("JosephSettin.png") no-repeat;
  }
  .home_png
  {
   position: absolute;
   left:472px;
   top:16px;
   width:48px; 
   height:16px;
  }
  .discography_png
  {
   position: absolute;
   left:528px;
   top:16px;
   width:80px; 
   height:24px;
  }
  .purchase_png
  {
   position: absolute;
   left:608px;
   top:16px;
   width:88px; 
   height:24px;
  }
  .about_png
  {
   position: absolute;
   left:696px;
   top:16px;
   width:48px; 
   height:24px;
  }
  .contact_png
  {
   position: absolute;
   left:744px;
   top:16px;
   width:56px; 
   height:24px;
  }
  .main__pic_png
  {
   position: absolute;
   left:0px;
   top:56px;
   width:264px; 
   height:264px;
   background: url("main_pic.png") no-repeat;
  }
  .footer__lines_png
  {
   position: absolute;
   left:0px;
   top:512px;
   width:800px; 
   height:24px;
   background: …
Run Code Online (Sandbox Code Playgroud)

html css center absolute

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

C#单元测试代码问题

我们开始使用C#内置单元测试功能.我有VisualStudio 2008为我创建的单元测试代码.我在生成的代码上面几乎没有问题.以下是我从生成的文件中复制的代码:

  #region Additional test attributes
  // 
  //You can use the following additional attributes as you write your tests:
  //
  //Use ClassInitialize to run code before running the first test in the class
  //[ClassInitialize()]
  //public static void MyClassInitialize(TestContext testContext)
  //{
  //}
  //
  //Use ClassCleanup to run code after all tests in a class have run
  //[ClassCleanup()]
  //public static void MyClassCleanup()
  //{
  //}
  //
  //Use TestInitialize to run code before running each test
  //[TestInitialize()]
  //public void MyTestInitialize()
  //{
  //}
  //
  //Use …
Run Code Online (Sandbox Code Playgroud)

c# unit-testing

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

Flex中的正确方法是使透明面板响应rollOver()事件

我在Flex应用程序中有一个Canvas,其中包含的项目仅覆盖主画布区域的约50%.

我希望画布响应rollOver整个区域的事件,而不仅仅是内部项目所覆盖的区域.

我一直在设置以下属性来实现这一目标:

<mx:Canvas backgroundColor="white"
backgroundAlpha=".01"
rollOver="rollOver(event)">...
Run Code Online (Sandbox Code Playgroud)

这会导致整个画布响应rollOver事件.它运作得很好 - 我对此并不满意,并认为必须有更好的方法来实现它.

有没有办法强制鼠标事件作用于UIComponent的整个区域?

apache-flex rollover

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

这种流动结构控制是否良好实践?

我想重写一个有太多嵌套if语句的方法.

我提出了这种方法,并希望你的意见:

public void MyMethod()
{
   bool hasFailed = false;

   try
   {
      GetNewOrders(out hasFailed);

      if(!hasFailed)
          CheckInventory(out hasFailed);

      if(!hasFailed)
          PreOrder(out hasFailed);              

      // etc
   }
   catch(Exception ex)
   {
   }
   finally
   {
      if(hasFailed)
      {
           // do something
      }
   }
}
Run Code Online (Sandbox Code Playgroud)

refactoring control-flow

2
推荐指数
3
解决办法
431
查看次数

c#:tryparse vs convert

今天我读了一篇文章,其中写道我们应该总是使用TryParse(字符串,输出MMM)进行转换而不是Convert.ToMMM().

我同意文章,但之后我陷入了一个场景?

当字符串总是有一些有效值时,我们也可以使用Convert.ToMMM(),因为我们没有从Covert.ToMMM()中获得任何异常.

我想知道的是:当我们使用TryParse时是否有任何性能影响因为当我知道out参数总是有效时我们可以使用Convert.ToMMM()而不是TryParse(字符串,输出MMM)

你怎么看?

c# parsing

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

CSS文件未在子目录中链接

这是我的目录结构:

-根

--docs

--- doc1.php

--includes

---的header.php

--- footer.php

--- css.css

--index.php

在我的标题中,我链接到我的CSS文件,如下所示:

<link href="includes/styling.css" type="text/css" rel="stylesheet" />
Run Code Online (Sandbox Code Playgroud)

这适用于index.php,因为它是正确的路径(root/includes/css.css).

但是对于doc1.php来说,这不是正确的道路.(根/文档/包括/ css.css).

如何在保留一个包含该行代码的header.php文件的同时修复此问题?有没有办法强制路径在根目录中启动?

html css

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

插入参数,C#,T-Sql

我试图通过文本框通过aspx页面插入参数.我设置了我的参数,但是evertime I executenonquery,@ Username显示在数据库中而不是实际值.以下是我的代码.任何人都可以有点洞察力吗?

这是完整的代码:

protected void btn_SubmitUserInfo_Click(object sender, EventArgs e)
    {
        SqlConnection conn = new SqlConnection();
        conn = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=c:\\Documents and Settings\\xm\\My Documents\\Visual Studio 2010\\Projects\\CreateUser\\CreateUser\\App_Data\\UserInformation.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True; Integrated Security=SSPI");

        //Open the connection outside of the try statement
        conn.Open();

        try
        {
            //Create a command for the stored procedure and tie it into the connection
            SqlCommand cmd = new SqlCommand("InsertUserValues", conn);

            //Set the command type so it know to execute the stored proc
            cmd.CommandType = CommandType.StoredProcedure;

            //Declare Parameters


            SqlParameter …
Run Code Online (Sandbox Code Playgroud)

c# t-sql

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

在 Selenium 中发送密钥的替代方法

我想textbox使用 Selenium向 a 发送一个字符串,但我发现这sendKeys对我来说太慢了。如果我有一个字符串“abcde”,有没有办法将该字符串作为一个块发送,而不是通过“a”然后“b”然后“c”等通过输入sendKeys

selenium

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