我在Ubuntu 11上使用easy_install安装lxml时遇到了困难.
当我输入时,$ easy_install lxml
我得到:
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 2.3
Downloading http://lxml.de/files/lxml-2.3.tgz
Processing lxml-2.3.tgz
Running lxml-2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-7UdQOZ/lxml-2.3/egg-dist-tmp-GacQGy
Building lxml version 2.3.
Building without Cython.
ERROR: /bin/sh: xslt-config: not found
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
In file included from src/lxml/lxml.etree.c:227:0:
src/lxml/etree_defs.h:9:31: fatal error: libxml/xmlversion.h: No such file or directory
compilation terminated.
Run Code Online (Sandbox Code Playgroud)
似乎libxslt
或libxml2
没有安装.我已尝试按照http://www.techsww.com/tutorials/libraries/libxslt/installation/installing_libxslt_on_ubuntu_linux.php …
我有一个被调用两次的方法,我想捕获第二个方法调用的参数.
这是我尝试过的:
ArgumentCaptor<Foo> firstFooCaptor = ArgumentCaptor.forClass(Foo.class);
ArgumentCaptor<Foo> secondFooCaptor = ArgumentCaptor.forClass(Foo.class);
verify(mockBar).doSomething(firstFooCaptor.capture());
verify(mockBar).doSomething(secondFooCaptor.capture());
// then do some assertions on secondFooCaptor.getValue()
Run Code Online (Sandbox Code Playgroud)
但是我得到了一个TooManyActualInvocations
例外,因为Mockito认为doSomething
应该只调用一次.
如何验证第二次调用的参数doSomething
?
我正在尝试使用Mockito测试一些遗留代码.
我想FooDao
在生产中使用如下的存根:
foo = fooDao.getBar(new Bazoo());
Run Code Online (Sandbox Code Playgroud)
我可以写:
when(fooDao.getBar(new Bazoo())).thenReturn(myFoo);
Run Code Online (Sandbox Code Playgroud)
但显而易见的问题是,getBar()
永远不会使用Bazoo
我为该方法存根的相同对象调用.(诅咒那个new
操作员!)
如果我能以一种myFoo
不管参数而返回的方式存根方法,我都会喜欢它.如果做不到这一点,我会听取其他的解决方法建议,但我真的希望避免更改生产代码,直到有合理的测试覆盖率.
我正在查看文档IntStream
,我看到了一种toArray
方法,但没有办法直接进入List<Integer>
当然有一种方法可以将a转换Stream
为List
?
如果我想丢弃所有更改,并返回到存储库中的代码,我会执行以下操作:
$ rm -fr *
$ svn up
Run Code Online (Sandbox Code Playgroud)
这很容易,但我想知道是否有一个命令可以实现这一点,例如:
$ svn revert-all
Run Code Online (Sandbox Code Playgroud) 是否有一种在Haskell中拆分字符串的标准方法?
lines
和words
上一个空格或换行从拆分工作的伟大,但肯定没有拆就一个逗号一个标准的方式?
我在Hoogle上找不到它.
具体来说,我正在寻找split "," "my,comma,separated,list"
回报的东西["my","comma","separated","list"]
.
我有一个大的solr索引,我注意到一些字段没有正确更新(索引是动态的).
这导致一些字段具有空的"id"字段.
我尝试了这些查询,但它们不起作用:
id:''
id:NULL
id:null
id:""
id:
id:['' TO *]
Run Code Online (Sandbox Code Playgroud)
有没有办法查询空字段?
谢谢
因此,在高中数学,也可能是大学,我们学习如何使用三角函数,他们做什么,以及他们解决了什么样的问题.但它们总是作为一个黑盒子呈现给我.如果你需要某些东西的正弦或余弦,你可以点击计算器上的sin或cos按钮然后进行设置.哪个好.
我想知道的是三角函数通常是如何实现的.