问题列表 - 第9260页

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

我可以在脚本或存储过程中创建一次性使用函数吗?

在SQL Server 2005中,是否存在在SQL脚本或存储过程中声明的一次性使用或本地函数的概念?我想在我正在编写的脚本中抽象出一些复杂性,但它需要能够声明一个函数.

只是好奇.

sql t-sql sql-server scripting sql-server-2005

98
推荐指数
5
解决办法
9万
查看次数

C++的替换语言?

在处理爱好项目时,我真的很喜欢用低级语言编程(从某种意义上说C和C++是低级的).我不想使用带有垃圾收集的托管语言,以及带来所有乐趣的东西(是的,我们都是不同的;-)).

通常我将C++用于这些类型的项目.C++相当复杂,不那么优雅,所以我一直在寻找一种替代它的语言.有谁能给我建议?

偏好(不是要求):

  • 应该是低级的(比如C和C++)
  • 编译为本机代码(从上面的类型,但没有明确的伤害)
  • 最好是目标win32/win64
  • 面向对象
  • 静态打字

我看过Objective C,但我不喜欢它.

programming-languages low-level

6
推荐指数
3
解决办法
1453
查看次数

WCF超时异常详细调查

我们有一个应用程序,它具有在IIS7上运行的WCF服务(*.svc)以及查询该服务的各种客户端.服务器正在运行Win 2008 Server.客户端正在运行Windows 2008 Server或Windows 2003服务器.我得到以下异常,我看到它实际上可能与大量潜在的WCF问题有关.

System.TimeoutException: The request channel timed out while waiting for a reply after 00:00:59.9320000. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout. ---> System.TimeoutException: The HTTP request to 'http://www.domain.com/WebServices/myservice.svc/gzip' has exceeded the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer …
Run Code Online (Sandbox Code Playgroud)

wcf timeout timeoutexception

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

通过C#启动的PowerPoint不会退出

嘿,我是从C#WinForms应用程序自动化PowerPoint和Excel; 我所做的是从PowerPoint中读取幻灯片并将其保存在Excel中,然后退出这两个应用程序.Excel已成功退出,但PowerPoints未退出.问题是,当我第一次转换它不退出时,但当我再次转换时它确实.

这是我的代码

try
{
    PowerPoint.Application ppApp;
    PowerPoint.Presentation ppPres;
    List<Company> companies = new List<Company>();

    ppApp = new PowerPoint.Application();
    ppApp.Visible = Microsoft.Office.Core.MsoTriState.msoTrue;
    ppApp.WindowState = Microsoft.Office.Interop.PowerPoint.PpWindowState.ppWindowMinimized;

    ppPres = ppApp.Presentations.Open(fileTxtBox.Text,
                                      Microsoft.Office.Core.MsoTriState.msoFalse,
                                      Microsoft.Office.Core.MsoTriState.msoFalse,
                                      Microsoft.Office.Core.MsoTriState.msoTrue);

    int slides = ppPres.Slides.Count;

    for (int slide = 1; slide <= slides; slide++)
    {
        int rows = 1;
        PowerPoint.Cell cell;
        int shape = 1;

        for (; shape < ppPres.Slides[slide].Shapes.Count; shape++)
        {
            if (ppPres.Slides[slide].Shapes[shape].HasTable == Microsoft.Office.Core.MsoTriState.msoTrue)
            {
                cell = ppPres.Slides[slide].Shapes[shape].Table.Cell(1, 1);

                if (cell.Shape.TextFrame.TextRange.Text.Trim().ToLower().Contains("realized"))
                {
                    rows = ppPres.Slides[slide].Shapes[shape].Table.Rows.Count;
                    break;
                }
            }
        } …
Run Code Online (Sandbox Code Playgroud)

c# com powerpoint

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

Java的虚拟机的Endianness

Java在其虚拟机中使用了什么字节顺序?我记得在哪里读取它取决于它运行的物理机器,然后我读到的其他地方,我相信它始终是大端.哪个是对的?

java virtual-machine endianness

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

相同的函数,类层次结构的不同返回类型

我们有一个类层次结构,看起来像这样:

class base
{
};

class derived1 : protected base
{
private:
    float m_price;
    int m_quantity;
    float m_value;
public:
//  float calculateValue();
};

class derived2 : protected base
{
private:
    double m_price;
    long m_quantity;
    double m_value;
public:
//  double calculateValue();
};
Run Code Online (Sandbox Code Playgroud)

现在我们需要编写一个函数,通过乘以价格和数量来计算价值.目的是尽可能简单地在将来添加新类.您可能知道,这并不简单,因为这些字段的数据类型对于不同的类是不同的.实际上,我们有这些函数在概念上做同样的事情,但在编程术语中它们是不同的操作.

为了最大限度地减少所需的剪切和粘贴量,我能想到的解决方案是使用模板函数:

template <class A, B, C>
A calculate_value(B price, C quantity)
{
    A result;
    // Some code to do the multiplication, not sure if template specialisation is needed
    return result;
};

class derived1 : protected base
{
private: …
Run Code Online (Sandbox Code Playgroud)

c++ templates overriding function

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

C#:没有从Class <Child>到Class <Base>的转换

以下代码片段无法编译.出现以下错误:

无法将类型'Container <ChildClass>'隐式转换为'Container <BaseClass>'

class BaseClass {}
class ChildClass : BaseClass {}
class Container<T> where T : BaseClass {}
class Program {
    static void Main() {
        // why doesn't this work?
        Container<BaseClass> obj = new Container<ChildClass>(); 
    }
}
Run Code Online (Sandbox Code Playgroud)

这是设计的吗?如果是,那是什么原因?

c# generics inheritance language-features language-design

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

ASP.Net注销代码块

我需要为asp.net提供一个很好的注销代码块.当前注销后,您可以点击后退按钮继续使用该站点.

membership asp.net asp.net-membership

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

在<TD>中设置最大长度

我有一个列,其中一些用户没有输入空格(即:.................................... .....)它正在拉伸我的TD专栏.

有没有办法用简单的选项强制html中的换行符?如果没有,我想我将不得不打破自己的阵容,这不是最佳的,因为我必须确定打破一条线的最佳位置,我不想那样做.

我正在寻找可以在3个主要浏览器中工作的东西(即/ firefox/safari)

这是我的代码:

<td valign="top">
    <br>
    <strong><?php echo $common->stripHtml($row['one_liner']); ?></strong>
    <br>
    <hr>
    <?php
        if (strlen($row['self_description']) > 240)
        {
            echo substr($common->stripHtml($row['self_description']), 0, 240)."... <a href='viewprofile.php?i=".$row['user_id']."'>more</a>";
        }
        else
        {
            echo $common->stripHtml($row['self_description']);
        }
    ?>
</td>
Run Code Online (Sandbox Code Playgroud)

html php

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