问题列表 - 第14523页

Python有像Perl的-c这样的"仅编译"开关吗?

Perl可以在-c不运行代码的情况下编译代码.这对于调试Perl中的编译错误很方便.

Python有类似的开关吗?

python compiler-construction

14
推荐指数
2
解决办法
4663
查看次数

Oracle 10.2表现得很奇怪.或者是我

请查看以下查询.SQL没有它看起来那么糟糕.基本上,我们有一个事实表和一些简单的连接到一些维度表.然后我们有一个派生表的连接,给定别名ACCOUNTS-DIM-DEP

  SELECT dw_mgr.fa_trans_fct.period,
         dw_mgr.fa_trans_fct.asset_cost_company_code,
         dw_mgr.fa_trans_fct.asset_cost_center_id,
         dw_mgr.fa_trans_fct.depreciation_account_id,
         accounts_dim_dep.description, 
         dw_mgr.projects_dim.project_num,
         dw_mgr.projects_dim.project_name,
         ROUND (dw_mgr.fa_trans_fct.activity_deprn_amount_us, 2),
         organizations_cost.major_geography,
         organizations_cost.business_unit || organizations_cost.bu_desc,
         organizations_cost.industry_sector_num
              ||organizations_cost.industry_sector_desc,
         hyperion_organizations.hyperion_num,
         hyperion_organizations.hyperion_desc,
         hyperion_organizations.hyperion_reporting
    FROM dw_mgr.fa_trans_fct,
         (SELECT DISTINCT flex_value account_id, description
                     FROM rf_fnd_flex_values_det
                    WHERE flex_value_set_id = '1002363' 
                      AND summary_flag = 'N') accounts_dim_dep,
         dw_mgr.projects_dim,
         dw_mgr.organizations organizations_cost,
         dw_mgr.organizations hyperion_organizations
   WHERE 
         --Fact to Org on Company Code / Cost Center
         (dw_mgr.fa_trans_fct.asset_cost_center_id   
                                     = organizations_cost.cost_center_id)
     AND (dw_mgr.fa_trans_fct.asset_cost_company_code 
                                     = organizations_cost.company_code)
     --Fact to Projects Dim on Proj Num
     AND (dw_mgr.projects_dim.project_num = dw_mgr.fa_trans_fct.project_num)
     --Fact to Accounts_Dim_Dep on Account ID
     --convert account_ID …
Run Code Online (Sandbox Code Playgroud)

sql oracle distributed-transactions oracle10g ora-01722

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

Hibernate条件查询不同对象的不同属性

假设我有以下课程:

class A {
 B getB();
 C getC();
}

class B {
 String getFoo();
}

class C {
 int getBar();
}
Run Code Online (Sandbox Code Playgroud)

我想在A上过滤标准,在不同的子类属性上有两个过滤器,例如:

Criteria criteriaA = session.createCriteria(A.class);
Criteria criteriaB = criteriaA.createCriteria("b").add(Restrictions.eq("foo", "Something"));
Criteria criteriaC = criteriaA.createCriteria("c").add(Restrictions.eq("bar", 0));
Run Code Online (Sandbox Code Playgroud)

我想要做的是使用"或"子句组合criteriaB和criteriaC,如:

//this does not work
criteriaA.add(Restrictions.disjunction().add(criteriaB).add(criteriaC));
Run Code Online (Sandbox Code Playgroud)

我怎么能做到这一点?我在这里绊倒了一些API.

java hibernate criteria

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

启用了浮点异常的浮点堆栈处理

我遇到了在Visual Studio 2005中打开浮点异常的问题.如果我有这样的代码:

  double d = 0.0;
  double d2 = 3.0;
  double d3 = d2/d;
Run Code Online (Sandbox Code Playgroud)

如果我注册一个SEH处理程序例程,那么我可以轻松地将div-by-zero转换为C++异常并捕获它.到现在为止还挺好.

但是,当我这样做时,第一个操作数(上例中的0.0)留在FPU寄存器堆栈上.如果我这样做了8次,那么从那时起我将开始从每个浮点操作获得一个浮点堆栈检查异常.

我可以使用__asm块来处理这个来执行FSTP,从而将杂散值从堆栈中弹出,一切都很好.

然而,这让我很担心,因为我没有在任何地方看到这个问题.我怎么能确定我应该弹出的值的数量?在异常时弹出堆栈中的所有内容是否安全?这个领域有推荐的最佳实践吗?

谢谢!

c++ floating-point exception visual-c++

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

在自定义控件中隐藏不需要的属性

这是隐藏派生控件中属性的方法吗?

public class NewButton : Button

...

[Browsable ( false )]
public new ContentAlignment TextAlign { get; set; }
Run Code Online (Sandbox Code Playgroud)

此外,这会在设计器的"属性"窗口中隐藏属性,但是如何在代码中隐藏属性?

.net c# gdi+ winforms

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

如何扩展词法转换以支持枚举类型?

我有以下函数将字符串转换为数字数据类型:

template <typename T>
bool ConvertString(const std::string& theString, T& theResult)
{
    std::istringstream iss(theString);
    return !(iss >> theResult).fail();
}
Run Code Online (Sandbox Code Playgroud)

但这不适用于枚举类型,所以我做了类似这样的事情:

template <typename T>
bool ConvertStringToEnum(const std::string& theString, T& theResult)
{
    std::istringstream iss(theString);
    unsigned int temp;
    const bool isValid = !(iss >> temp).fail();
    theResult = static_cast<T>(temp);
    return isValid;
}
Run Code Online (Sandbox Code Playgroud)

(我假设theString具有枚举类型的有效值;我主要用于简单序列化)

有没有办法创建一个结合这两者的单一功能?

我已经使用了模板参数,但没有提出任何建议; 如果不必为枚举类型调用一个函数而为其他所有函数调用另一个函数,那就太好了.

谢谢

c++ enums serialization casting lexical-cast

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

-S使用sqlcmd时的未知选项

当我从带有SQL Server 2008的Windows XP中的DOS窗口执行以下命令时出现错误.-S是指定服务器名称的选项.

错误:Sqlcmd:' - S':未知选项.

sqlcmd -S localhost -d databasename -i C:\ files\somefile.sql -E

sqlcmd sql-server-2008

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

Symbol.WPAN.Bluetooth传输数据的示例

我正在尝试使用符号设备的EMDK附带的Symbol.WPAN.Bluetooth.

有没有人碰巧有一个传输数据的工作示例?

Symbol的示例只是将设备配对.(他们显然认为在个人区域网络示例中并不真正需要传输数据.)

无论如何,我知道这是一个很长的镜头,但如果有人让这个工作,我很乐意看到一些代码.

这就是我尝试过的.我有一个设备按下按钮1和另一个设备按下按钮2.读取值始终为零长度字节数组.

using System.Text;
using System.Windows.Forms;
using Symbol.WPAN;
using Symbol.WPAN.Bluetooth;

namespace SmartDeviceProject1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Bluetooth bluetooth = new Bluetooth();
            if (bluetooth.IsEnabled != true)
            {
                bluetooth.Enable();
                bluetooth.RadioMode = BTH_RADIO_MODE.BTH_DISCOVERABLE_AND_CONNECTABLE;
            }

            RemoteDevice connectedDevice = null;
            foreach (RemoteDevice remoteDevice in MakeEnumerable(bluetooth.RemoteDevices))
            {
                if ((remoteDevice.Name == "WM_Dan")  && (remoteDevice.IsPaired == false))
                {
                    remoteDevice.Pair();
                    connectedDevice = remoteDevice;
                }
            }

            string test;
            test = "Testing …
Run Code Online (Sandbox Code Playgroud)

c# bluetooth visual-studio motorola-emdk

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

使用JIRA(或其他工具)跟踪多个项目的需求

我的公司一直使用JIRA作为需求跟踪工具以及错误跟踪器,而且我们一直在一个项目上工作时工作得非常好.

我们现在有一个场景,我们有三个不同的项目提案,其要求部分重叠(例如,要求1适用于项目A和B,要求2适用于项目B和C等).我希望能够为每个要求输入一个JIRA问题,但这似乎不可能,因为JIRA问题和项目具有一对一的关系.

有没有人在JIRA中找到了这样做的方法,或者可能还有其他一些与JIRA集成的工具?

project-management bug-tracking jira

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

如何检查参数是否为符号?

问题出在标题中.

我的参数可以是字符串或符号,具体取决于我想要执行不同的操作.有没有办法在Ruby中检查这个?

ruby

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