问题列表 - 第18588页

Web2Py工作目录

好吧,我想使用WEb2Py,因为它非常好..我只需要将工作目录更改为我所有模块/库/应用程序所在的目录,以便我可以使用它们.我希望能够在使用web2py接口/应用程序时导入我的真实程序.我需要这样做,而不是把我的所有应用程序和东西放在Web2Py文件夹中...我试图给我的程序一个Web前端而不将程序放在Web2Py文件夹中...抱歉,如果这很难理解.

python directory web2py

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

C嵌套开关:内部开关内的外部开关盒

我正在为我正在写的翻译添加协程支持,我想做类似以下的事情:

typedef enum {
    bar_stuff,
    bar_other
    } Bar;

typedef enum {
    foo_error=-1,
    foo_none=0,
    foo_again
    } Foo_state;

Foo_state do_foo(Bar bar,Foo_state foo)
    {
    switch(foo)
        {
        case foo_none: //start
        switch(bar)
            {
            case bar_stuff:
                //do stuff
                return foo_none;
            case bar_other:
                //do other stuff
                return foo_again;
                case foo_again: //!! this doesn't work
                    /* edit: this is supposed to be a case of
                     *     switch(foo), not switch(bar)
                     */
                //do more other stuff
                return foo_none;
            default:
                //stuff
                return foo_none;
            }
        default:
            //fail
            return foo_error;
        }
    }
Run Code Online (Sandbox Code Playgroud)

显然这不起作用(我得到重复的案例值,替代可能是未定义的行为/段错误).我可以将switch(bar)写为if/else …

c interpreter language-design coroutine

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

有没有办法告诉程序使用什么语言?

我有一个下载并安装的桌面程序.它从.exe文件运行.

是否有一些来自.exe文件的方法来告诉用什么编程语言来编写程序?

有没有工具可以帮助解决这个问题?

可以确定哪些语言,哪些语言不能?


好的,这是我正在寻找的两种东西:

  1. 确定应用程序是否以Delphi编写的提示

  2. 这种"IsDelphi"节目布鲁斯·麦基会发现德尔福,德尔福建成面向.NET或C++ Builder是你的硬盘上的所有应用程序.

windows delphi executable programming-languages reverse-engineering

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

Android 上的 SoundTouch?

嘿,我正在尝试更改 android 应用程序中音频文件的音高。

我在网上找到了一个开源库“SoundTouch”(http://www.surina.net/soundtouch),你认为我可以在安卓应用程序中使用这个库吗?

我一直在谷歌搜索“Java 中的 SoundTouch”并找到了这个数据(http://www.alu.ch/classdoc/jaw/ch/alu/jaw/SoundTouch.html)。

可能我可以使用这个库,或者我可以使用任何其他库或过程的任何想法来改变 android 上音频文件的音高?我还研究了 Android 不支持它们的 Java Sound API。:/

谢谢亚当

java audio android

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

如何在C#中显示引用的实际值

我正在学习更多关于C#的知识,并且想知道如何显示引用的实际值或结构的地址.我正在寻找类似于以下C代码的东西:

    int i; 
    printf("int i resides at memory location %x",&i);
Run Code Online (Sandbox Code Playgroud)

c#

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

强迫自己掌握Emacs

假设存在肤浅的知识,那么如何强制掌握Emacs呢?

还假设所述人目前使用的是Aquamacs,但经常使用Mac OS X- isms.这个人很认真(这次肯定),需要一些建议.

macos emacs

12
推荐指数
3
解决办法
3972
查看次数

关于NUnit的问题

我是一名大学生,用c#在这里和那里制作他的节目,主要是科学模拟.学习NUnit有什么用吗?我一直在听人们谈论它,但我并没有完全掌握它是什么.这是每个程序员应该使用的东西,还是更适合有很多人的大项目的东西?

谢谢

c# nunit unit-testing

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

'__getnewargs__'在这段代码中做了什么

class NavigableString(unicode, PageElement):

    def __new__(cls, value):
        if isinstance(value, unicode):
            return unicode.__new__(cls, value)
        return unicode.__new__(cls, value, DEFAULT_OUTPUT_ENCODING)

    def __getnewargs__(self):#this line
        return (NavigableString.__str__(self),)
Run Code Online (Sandbox Code Playgroud)

python

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

什么是将大型课程分解为模块的好红宝石成语?

我有一个很大的类,有很多方法,它开始变得有点无组织,难以导航.我想将其分解为模块,其中每个模块都是类和实例方法的集合.也许是这样的:

更新:我现在意识到这是一个非常糟糕的例子.您可能不希望将验证或属性移出核心类.

class Large
  include Validations
  include Attributes
  include BusinessLogic
  include Callbacks
end
Run Code Online (Sandbox Code Playgroud)

在阅读了Yehuda关于Better Ruby Idioms的文章之后,我很好奇其他人如何解决这个问题.这是我能想到的两种方法.

第一种方法

module Foo
  module Validations
    module ClassMethods
      def bar
        "bar"
      end
    end

    module InstanceMethods
      def baz
        "baz"
      end
    end
  end

  class Large
    extend Validations::ClassMethods
    include Validations::InstanceMethods
  end
end
Run Code Online (Sandbox Code Playgroud)

第二种方法

module Foo
  module Validations
    def self.included(base)
      base.extend ClassMethods
    end

    module ClassMethods
      def bar
        "bar"
      end
    end

    def baz
      "baz"
    end
  end

  class Base
    include Validations
  end
end
Run Code Online (Sandbox Code Playgroud)

我的问题是:

  • 有一个更好的方法吗?
  • 如何以最少的魔法为一组类/实例方法获得单行模块mixin?
  • 如何在没有命名空间类本身的情况下将这些模块命名为基类?
  • 你如何组织这些文件?

ruby refactoring module

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

模糊复制构造函数vc 2008

我正在尝试在最新的Visual Studio(2008)中重新编译旧代码,而以前工作的代码现在无法编译.其中一个问题是由于我班级的操作员超载.下面有一个简化的类来演示这个问题.如果我删除int和char*的转换运算符,那么它工作正常.因此,修复我的问题的方法之一是用过程to_char和to_int替换它们并使用它们,但它需要在代码中进行大量更改(该类被大量使用).必须有一些更好,更智能的方法来解决它.任何帮助是极大的赞赏 :-)

class test
{
public:
    test();
    test(char* s2);
    test(int num);
    test(test &source);

    ~test();

    operator char*();
    operator int();

};

test::test()    {    
}

test::test(char* s2)    {
}

test::test(int num)    {
}

test::test(test &source)    {
}



test::operator char*()    {
}

test::operator int()    {
}

test test_proc()    {
    test aa;
    return aa;
}

int test_proc2(test aa)
{

return 0;
}

int main()
{
    test_proc2(test_proc());
}


//test.cpp(60) : error C2664: 'test_proc2' : cannot convert parameter 1 from 'test' to 'test'
//        Cannot copy …
Run Code Online (Sandbox Code Playgroud)

visual-c++

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