当我尝试用cabal安装它时,我明白了
~$ cabal install ghc-mod
Resolving dependencies...
[1 of 1] Compiling Main ( /tmp/haskell-src-exts-1.13.5-21238/haskell-src-exts-1.13.5/Setup.hs, /tmp/haskell-src-exts-1.13.5-21238/haskell-src-exts-1.13.5/dist/setup/Main.o )
/tmp/haskell-src-exts-1.13.5-21238/haskell-src-exts-1.13.5/Setup.hs:1:1:
Warning: In the use of `runTests'
(imported from Distribution.Simple, but defined in Distribution.Simple.UserHooks):
Deprecated: "Please use the new testing interface instead!"
Linking /tmp/haskell-src-exts-1.13.5-21238/haskell-src-exts-1.13.5/dist/setup/setup ...
Configuring haskell-src-exts-1.13.5...
Building haskell-src-exts-1.13.5...
Preprocessing library haskell-src-exts-1.13.5...
dist/build/Language/Haskell/Exts/InternalParser.hs:1:12:
Warning: -fglasgow-exts is deprecated: Use individual extensions instead
[ 1 of 22] Compiling Language.Haskell.Exts.Annotated.Syntax ( src/Language/Haskell/Exts/Annotated/Syntax.hs, dist/build/Language/Haskell/Exts/Annotated/Syntax.o )
cabal: Error: some packages failed to install:
ghc-mod-1.11.1 depends on haskell-src-exts-1.13.5 which failed …Run Code Online (Sandbox Code Playgroud) 我有一个数据库,一个ListView和一个CustomCursorAdapter扩展CursorAdapter.菜单按钮将项添加到数据库.我希望ListView更新并显示此更改.通常情况下,在我转到主屏幕并重新打开应用程序之前,它不会显示此新项目.
我最终通过调用cursor.requery()或mCustomCursorAdapter.changeCursor(newCursor)每当我添加一个新项目来CursorAdapter使它工作,但是当我在构造函数中将autoRequery设置为false时,它的工作原理相同.当autoRequery设置为false时,为什么会正确更新?
我使用CursorAdapter得当吗?使用数据库更新列表的标准方法是什么?autoRequery有什么作用?
如何设置IntelliJ查找JSP中引用的文件的位置?如果我有
<jsp:include page="/foo/bar" />
Run Code Online (Sandbox Code Playgroud)
它无法解析目录foo.
它看起来像设置>网络上下文处理这个,但当我去那里,它说
找不到网络目录
如果我有一个这样的匿名内部类对象(其中Foo是一个接口):
Foo foo = new Foo(){
@Override
public String hello(Object dummyArg){
return "hello, world.";
}
};
Run Code Online (Sandbox Code Playgroud)
我尝试Foo.hello从这样的jsp 调用:
${foo.hello('blah')}
Run Code Online (Sandbox Code Playgroud)
它抛出:
javax.el.MethodNotFoundException: Unable to find method [hello] with [1] parameters
Run Code Online (Sandbox Code Playgroud)
但如果没有参数:
Bar bar = new bar(){
@Override
public String hello(){
return "hello, world.";
}
};
Run Code Online (Sandbox Code Playgroud)
...
${bar.hello()}
Run Code Online (Sandbox Code Playgroud)
它工作正常.为什么?
这不是7121303的副本.我正在特别询问匿名的内部课程.使用常规类的实例,它可以使用任意数量的参数.
我main.xml看起来像这样:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
由于根元素是a LinearLayout,它扩展了ViewGroup,为什么main.xml变成a View而不是ViewGroup?例如,在我的主Activity类中,我尝试获取LinearLayout包含的子视图的数量,如下所示:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ViewGroup vg = (ViewGroup) findViewById(R.layout.main);
Log.v("myTag", "num children: " + vg.getChildCount());
Run Code Online (Sandbox Code Playgroud)
但是当我打电话时它崩溃了vg.getChildCount().
这样做的正确方法是什么?
当我在vim中构建一个cabal项目时,使用
:set makeprg=cabal\ build
:make
Run Code Online (Sandbox Code Playgroud)
haskellmode-vim似乎没有找到类型信息.否则_t,当光标在foo给我的"福键入不知道".
如何让haskellmode-vim从cabal构建中获取类型信息?
假设我有fooIds :: [Key Foo].我怎么会得到foos :: [Foo]?
我试过了
do
foos <- map get fooIds
Run Code Online (Sandbox Code Playgroud)
但它给了我
No instance for (MonadBaseControl IO m0)
arising from a use of `get'
Run Code Online (Sandbox Code Playgroud)
我假设因为我需要使用runDB.但我不太确定如何使用它.