当我试图安装最新版本的compass (https://rubygems.org/gems/compass/versions/1.0.0.alpha.17)时,我得到以下错误。

ERROR:  Error installing compass:
ERROR: Failed to build gem native extension.

 ERROR:  Error installing compass:
  ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... yes
checking for ffi_call() in -lffi... yes
checking for ffi_prep_closure()... yes
checking for ffi_raw_call()... no
checking for rb_thread_blocking_region()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling AbstractMemory.c
compiling ArrayType.c
compiling Buffer.c
compiling Call.c
Call.c:303:5: warning: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in C99 [-Wimplicit-function-declaration]
    rbffi_thread_blocking_region(call_blocking_function, data, (void *) -1, NULL);
    ^
./Thread.h:78:39: note: expanded from macro 'rbffi_thread_blocking_region'
# define rbffi_thread_blocking_region rb_thread_call_without_gvl
                                      ^
1 warning generated.
compiling ClosurePool.c
compiling DataConverter.c
DataConverter.c:43:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
1 warning generated.
compiling DynamicLibrary.c
compiling ffi.c
compiling Function.c
Function.c:479:33: warning: incompatible pointer types passing 'VALUE (void *)' to parameter of type 'void *(*)(void *)' [-Wincompatible-pointer-types]
        rb_thread_call_with_gvl(callback_with_gvl, &cb);
                                ^~~~~~~~~~~~~~~~~
Function.c:102:46: note: passing argument to parameter 'func' here
extern void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
                                             ^
Function.c:563:9: warning: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in C99 [-Wimplicit-function-declaration]
        rb_thread_call_without_gvl(async_cb_wait, &w, async_cb_stop, &w);
        ^
Function.c:738:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
3 warnings generated.
compiling FunctionInfo.c
compiling LastError.c
compiling LongDouble.c
compiling MappedType.c
compiling MemoryPointer.c
compiling MethodHandle.c
compiling Platform.c
compiling Pointer.c
compiling Struct.c
compiling StructByReference.c
compiling StructByValue.c
compiling StructLayout.c
compiling Thread.c
compiling Type.c
compiling Types.c
compiling Variadic.c
linking shared-object ffi_c.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [ffi_c.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.3 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/ffi-1.9.3/gem_make.out

这是怎么回事?如何正确安装最新的指南针?

位置指令的发射顺序是什么?

假设我有两个c++类:

class A
{
public:
  A() { fn(); }

  virtual void fn() { _n = 1; }
  int getn() { return _n; }

protected:
  int _n;
};

class B : public A
{
public:
  B() : A() {}

  virtual void fn() { _n = 2; }
};

如果我写下面的代码:

int main()
{
  B b;
  int n = b.getn();
}

有人可能认为n被设为2。

结果是n被设为1。为什么?

我使用jQuery SVG。我不能向对象添加或删除类。有人知道我的错误吗?

SVG:

<rect class="jimmy" id="p5" x="200" y="200" width="100" height="100" />

jQuery不会添加类:

$(".jimmy").click(function() {
    $(this).addClass("clicked");
});

我知道SVG和jQuery一起工作很好,因为我可以瞄准对象,并在点击时发出警报:

$(".jimmy").click(function() {
    alert('Handler for .click() called.');
});

我使用nginx作为前端服务器,我已经修改了CSS文件,但nginx仍然服务于旧的。

我尝试重新启动nginx,没有成功,我已经谷歌了,但没有找到一个有效的方法来清除它。

一些文章说我们可以删除缓存目录:var/cache/nginx,但在我的服务器上没有这样的目录。

我现在该怎么办?

可能的重复: *.h或*.hpp用于类定义 正确的c++代码文件扩展名?.cc vs .cpp

我曾经认为它是这样的:

.h文件是C和c++的头文件,通常只包含声明。 . C文件是C的源代码。 .cpp文件是c++源代码(也可以是C源代码)。

然后出现了。hpp、。cc和。cxx这样的文件,我完全搞糊涂了……它们之间有什么区别?什么时候使用“新的”?

我有一个应用程序,我想在纵向模式下使用,所以我已经定义了 android:screenOrientation=“portrait”在manifest XML中。这适用于HTC Magic手机(并防止方向变化的其他手机以及)。

但当我打开硬件QWERTY键盘(不是虚拟键盘)时,HTC G1手机遇到了一个问题。我的活动保持在肖像模式,但它似乎重新启动,失去了所有的状态。HTC Hero版本不会出现这种情况。

我的应用程序相当大,所以我不希望它在打开键盘时重新启动并失去所有状态。我该如何预防呢?

我试图从mac终端设置一个python服务器。

我导航到文件夹位置使用:

python -m SimpleHTTPServer

但这给了我错误:

socket.error: [Errno 48] Address already in use

我以前使用相同的命令打开了一个连接 在我的电脑里的不同位置的一个不同的网站。

我试图从mac终端设置一个python服务器。

我导航到文件夹位置使用:

python -m SimpleHTTPServer

但这给了我错误:

socket.error: [Errno 48] Address already in use

我以前使用相同的命令打开了一个连接 在我的电脑里的不同位置的一个不同的网站。

因此,我在一段时间前安装了JDK 8的测试版,以查看一些示例。我想,到目前为止,在不同版本之间进行更改是很容易的。

用IntelliJ开发游戏。由于某些原因,IntelliJ正在使用8编译,即使:

我在首选项中将编译器设置为使用1.6 据说它通过外部构建使用SBT,但从命令行使用SBT是有效的 JAVA_HOME指向JDK 6。

如果我转到Java首选项页面,它确实显示安装了8个,但没有卸载它的选项,也看不到任何其他版本。

当我执行哪个java时,它会告诉我/usr/bin/java然后执行/usr/bin/java -version,它会返回1.6。

注意:只需稍作调整,就可以使用IntelliJ和JDK7,见这里。