问题:

我在这里得到一个“错误的类型参数:commandp,(lambda nil(forward-line 5))”。

(global-set-key [?\M-n] (lambda () (forward-line 5)))

错误是什么? 我很确定这很简单,我错过了一些明显的东西。

I am getting a “Wrong type argument: commandp, (lambda nil (forward-line 5))” here.What is the error?I’m fairly sure it’s simple & I’m missing something obvious.

问题:

尝试修改主题设置时,此简单代码给出以下错误:

library(ggplot2)
theme_nogrid <- theme_set(theme_update(  
                  plot.margin=unit(c(.25, .25, .25, .25), "in"),))

Error in do.call(theme, list(...)) : could not find function "unit"

对于使用“ unit”的任何元素, R都会给我这个错误。 其他任何不称为“单位”的设置都可以正常工作。 我正在运行R v.2.15.2(64位Windows)。

我在网上广泛搜索了此问题,却一无所获。 感谢您对问题的任何建议。

While trying to modify theme settings this simple code gives the following error:R gives me this error for any element that uses ‘unit’.Any other settings that do not call ‘unit’ work fine.I am running R v.2.15.2 (64-bit Windows).I extensively searched online about this problem and found nothing.I appreciate any suggestions to the problem.

问题:

请问这是我下面的代码,我正在粘贴下面的错误消息:我试图在微调器上使用setOnItemClickListener ,是允许的吗?

@Override
public void onItemClick(AdapterView<?> arg0, View v, int index, long arg3) {
    if (quantity[index]=="Meter" ){
        s1="Meter";
        Toast.makeText(v.getContext(), "convert from meter",Toast.LENGTH_SHORT).show();
    } 
}

   });

convertto.setOnItemClickListener(new OnItemClickListener()
{
    @Override
    public void onItemClick(AdapterView<?> arg, View v1, int index1, long arg4)
    {
        if ((quantity[index1]=="Meter") && (s1.equalsIgnoreCase("Meter")))
        {
            Toast.makeText(v1.getContext(), " to meter",Toast.LENGTH_SHORT).show();
            var2=var1;
            lresult.setText("" + var2);
        }
    }      
});

}

}

这是错误

FATAL EXCEPTION: main
07-04 09:48:39.912: E/AndroidRuntime(694): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.a2zunitconverter.miniproject/com.a2zunitconverter.miniproject.lenght}: java.lang.RuntimeException: setOnItemClickListener cannot be used with a spinner.
07-04 09:48:39.912: E/AndroidRuntime(694):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
07-04 09:48:39.912: E/AndroidRuntime(694):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
07-04 09:48:39.912: E/AndroidRuntime(694):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-04 09:48:39.912: E/AndroidRuntime(694):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
07-04 09:48:39.912: E/AndroidRuntime(694):  at android.os.Handler.dispatchMessage(Handler.java:99)
07-04 09:48:39.912: E/AndroidRuntime(694):  at android.os.Looper.loop(Looper.java:123)
07-04 09:48:39.912: E/AndroidRuntime(694):  at android.app.ActivityThread.main(ActivityThread.java:3683)
07-04 09:48:39.912: E/AndroidRuntime(694):  at java.lang.reflect.Method.invokeNative(Native Method)
07-04 09:48:39.912: E/AndroidRuntime(694):  at java.lang.reflect.Method.invoke(Method.java:507)
07-04 09:48:39.912: E/AndroidRuntime(694):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-04 09:48:39.912: E/AndroidRuntime(694):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-04 09:48:39.912: E/AndroidRuntime(694):  at dalvik.system.NativeStart.main(Native Method)
07-04 09:48:39.912: E/AndroidRuntime(694): Caused by: java.lang.RuntimeException: setOnItemClickListener cannot be used with a spinner.
07-04 09:48:39.912: E/AndroidRuntime(694):  at android.widget.Spinner.setOnItemClickListener(Spinner.java:102)
07-04 09:48:39.912: E/AndroidRuntime(694):  at com.a2zunitconverter.miniproject.lenght.onCreate(lenght.java:31)
07-04 09:48:39.912: E/AndroidRuntime(694):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-04 09:48:39.912: E/AndroidRuntime(694):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
07-04 09:48:39.912: E/AndroidRuntime(694):  ... 11 more

Kindly This is my code below, and I am pasting the error messages underneath: I am trying to use setOnItemClickListener on the spinner, is it permissible?and here are the errors

问题:

我一直玩clang一段时间,我偶然发现了“test / SemaTemplate / dependent-template-recover.cpp”(在clang发行版中),它应该提供从模板错误中恢复的提示。

整个过程可以很容易地删除到一个最小的例子:

template<typename T, typename U, int N> struct X {
    void f(T* t)
    {
        // expected-error{{use 'template' keyword to treat 'f0' as a dependent template name}}
        t->f0<U>();
    }
};

clang产生的错误消息:

tpl.cpp:6:13: error: use 'template' keyword to treat 'f0' as a dependent template name
         t->f0<U>();
            ^
            template 
1 error generated.

…但是我很难理解究竟应该在哪里插入template关键字以使代码在语法上正确?

I’ve been playing with clang a while, and I stumbled upon “test/SemaTemplate/dependent-template-recover.cpp” (in the clang distribution) which is supposed to provide hints to recover from a template error.The whole thing can be easily stripped down to a minimal example:The error message yielded by clang:… But I have a hard time understanding where exactly one is supposed to insert the template keyword to have the code to be syntactically correct?

问题:

我想使用pip在Mavericks上安装PIL,但是会出现此错误。

_imagingft.c:73:10: fatal error: 'freetype/fterrors.h' file not found
#include <freetype/fterrors.h>
         ^
1 error generated.
error: command 'cc' failed with exit status 1

我的命令行工具已安装并且是最新的,我发现的每个提示都没有帮助。 我该如何编译?

编辑:我刚刚检查过,freetype也已经通过自制软件安装了

I want to install PIL on Mavericks using pip but get this error.My Command Line Tools are installed and up to date and every hint I found didn’t help.How can I get this to compile?EDIT: I just checked, freetype is also already installed via homebrew