小编blu*_*zcz的帖子

如何在Ubuntu上安装lxml

我在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)

似乎libxsltlibxml2没有安装.我已尝试按照http://www.techsww.com/tutorials/libraries/libxslt/installation/installing_libxslt_on_ubuntu_linux.php …

python ubuntu lxml libxml2 easy-install

435
推荐指数
8
解决办法
27万
查看次数

c ++警告:交换机中未处理枚举值[-Wswitch]

我试图在没有警告的情况下编译以下代码:

    while (window.pollEvent(event))
    {
        switch (event.type) {
            case sf::Event::Closed:
                window.close(); break;
            case sf::Event::KeyPressed:
                if(event.key.code == sf::Keyboard::Escape )
                    window.close();
                if( sf::Keyboard::isKeyPressed( sf::Keyboard::Space ) )
                    particleSystem.fuel( 200/* * window.getFrameTime() */);
                if( sf::Keyboard::isKeyPressed( sf::Keyboard::A ) )
                    particleSystem.setPosition( --xpos, ypos );
                if( sf::Keyboard::isKeyPressed( sf::Keyboard::D ) )
                    particleSystem.setPosition( ++xpos, ypos );
                if( sf::Keyboard::isKeyPressed( sf::Keyboard::W ) )
                    particleSystem.setPosition( xpos, --ypos );
                if( sf::Keyboard::isKeyPressed( sf::Keyboard::S ) )
                    particleSystem.setPosition( xpos, ++ypos );
                if( sf::Keyboard::isKeyPressed( sf::Keyboard::Left ) )
                    particleSystem.setGravity( --xgrv * 0.1f, ygrv * 0.1f);
                if( sf::Keyboard::isKeyPressed( sf::Keyboard::Right ) …
Run Code Online (Sandbox Code Playgroud)

c++ warnings compiler-warnings switch-statement

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

Android - getIdentifier总是返回0(库+应用程序)

我有Android项目(com.appocaliptic.quizknife.app),它使用Android库(com.appocaliptic.quizknife.core).

我想要做的是获取图片库的资源ID.图像的路径是:res/drawable-xhdpi/fr_200_133.png

但是,所有尝试使用getIdentifier结果为0.问题出在哪里?

resId = getResources().getIdentifier("fr_200_133", "drawable", "com.appocaliptic.quizknife.core");
resId = getResources().getIdentifier("com.appocaliptic.quizknife.core:drawable/"+"fr_200_133", null, null);
resId = getResources().getIdentifier("drawable/fr_200_133", null, "com.appocaliptic.quizknife.core");
Run Code Online (Sandbox Code Playgroud)

编辑:

Ach,在R.java中有drawable和corensponding属性.

resources android

17
推荐指数
4
解决办法
1万
查看次数

Sublime Text 2在sshfs工作期间缓慢

我正在使用Sublime Text 2.0.1,不幸的是它使用sshfs分发的文件很痛苦 - 切换到其他选项卡并返回使Sublime检查文件是否未被更改.

是否有任何Sublime首选项或sshfs挂载选项可以使我的远程资源工作成为可能?

目前我正在使用以下sshfs选项(更快的加密):

-o Ciphers=arcfour
Run Code Online (Sandbox Code Playgroud)

editor remote-access sshfs sublimetext2

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

从jQuery对象获取值数组

我有以下对象:

$("input:checkbox:checked")
[
<input class=?"li_checker" type=?"checkbox" category_uid=?"1.3" category_language=?"da">?, 
<input class=?"li_checker" type=?"checkbox" category_uid=?"1.3.1" category_language=?"da">?
]
Run Code Online (Sandbox Code Playgroud)

如果jQuery中有任何帮助器允许我为所有元素获取"category_uid"的值并将其作为另一个数组返回?预期结果:

["1.3", "1.3.1"]
Run Code Online (Sandbox Code Playgroud)

javascript jquery

9
推荐指数
3
解决办法
2万
查看次数

Linux mingw32 sfml交叉编译为windows - 缺少dll文件

我正在以下列方式编译我的c ++项目:

/usr/bin/i686-w64-mingw32-g++ -g -std=c++0x -Wall -I /home/bluszcz/dev/win64/SFML-2.1/include -L /home/bluszcz/dev/win64/SFML-2.1/lib -static-libgcc -static-libstdc++ -static -O4 -c src/game.cpp -o src/game.a -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试运行我的exe文件时,我得到关于丢失dll文件的错误:

bluszcz@zendo ~/dev/win32/builds/magicwizard $ wine mw.exe 
err:module:import_dll Library libgcc_s_dw2-1.dll (which is needed by L"Z:\\home\\bluszcz\\dev\\win32\\builds\\magicwizard\\sfml-system-2.dll") not found
err:module:import_dll Library libgcc_s_sjlj-1.dll (which is needed by L"Z:\\home\\bluszcz\\dev\\win32\\builds\\magicwizard\\libstdc++-6.dll") not found
err:module:import_dll Library libwinpthread-1.dll (which is needed by L"Z:\\home\\bluszcz\\dev\\win32\\builds\\magicwizard\\libstdc++-6.dll") not found
err:module:import_dll Library libstdc++-6.dll (which is needed by L"Z:\\home\\bluszcz\\dev\\win32\\builds\\magicwizard\\sfml-system-2.dll") not found
err:module:import_dll Library sfml-system-2.dll (which is needed by L"Z:\\home\\bluszcz\\dev\\win32\\builds\\magicwizard\\sfml-audio-2.dll") not found
err:module:import_dll Library …
Run Code Online (Sandbox Code Playgroud)

c++ command-line mingw sfml

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

无法将应用程序移动到SD卡

我无法将自己的应用程序移动到SD卡.

清单的相应部分如下(我也粘贴了它需要的权限).

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
    android:installLocation="preferExternal"
    android:label="@string/app_name" >

<uses-sdk
    android:minSdkVersion="6"
    android:targetSdkVersion="9" />
Run Code Online (Sandbox Code Playgroud)

我相信我遵循了此处描述的指南:http://developer.android.com/guide/topics/data/install-location.html(兼容性和权限).但是,在安装期间(从SDK但也从Android Market)应用程序登陆内部存储,我无法使用"管理应用程序"移动它.

permissions android sd-card

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

Imagemagick font_stretch还是字母间的间距?

我正在使用ImageMagick生成一些按钮.但是,我无法在生成的图像中设置字母之间的间距.我使用的命令:

convert -gravity center button_subscribeme.png -font /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf  -fill white -draw "text 0,0 'CLICK ME'"  -font_stretch 10  render/mailbox-submit.png
Run Code Online (Sandbox Code Playgroud)

抛出:

convert: unrecognized option `-font_stretch' @ error/convert.c/ConvertImageCommand/1561.
Run Code Online (Sandbox Code Playgroud)

所以我猜font_strech不是正确的选择.我怎么能实现它?生成的文本太窄.

fonts spaces imagemagick

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

从img标签(与URL.createObjectURL相反的方法)获取图像数据(blob)

在我的 HTML 代码中,我有以下 IMG 标签:

<img src="picture.png"  id="picture" />
Run Code Online (Sandbox Code Playgroud)

我想在图像 Blob 对象(https://developer.mozilla.org/en-US/docs/Web/API/Blob)中创建(以在 FirefoxOS 网络活动中进一步使用它)拥有它的 uri(“picture.png ”)。我想我需要与 URL.createObjectURL 以相反方式工作的方法:

https://developer.mozilla.org/en-US/docs/Web/API/URL.createObjectURL

html javascript dom image fileapi

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

unique_ptr - 无效指针和段错误

我正在学习一个新的C++ 11标准并在SFML中编写小游戏.我已经遵循代码,我试图将精灵的指针传递给另一个对象.

bool Game::detectCollision()
{
    std::unique_ptr<sf::Sprite> sprPtr1(&iPlayer.charSprite);
    return field.detectCollision(sprPtr1);
}

bool FieldElem::detectCollision(std::unique_ptr<sf::Sprite> charSprite)
{
    std::cout << "X: " << charSprite->getPosition().x << std::endl;
    return true;
}
Run Code Online (Sandbox Code Playgroud)

此代码在没有警告的情况下编译,并在运行时给出了以下段错误:

*** glibc detected *** ./game: munmap_chunk(): invalid pointer: 0x00007fffb8617d90 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7f8694b37b96]
./game(_ZN2sf6SpriteD0Ev+0x24)[0x405772]
Run Code Online (Sandbox Code Playgroud)

为什么指针无效?我想我错过了一些关于unique_ptr的重要细节......

c++ pointers unique-ptr sfml c++11

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

对象不实现IField

我有以下代码片段来修补文件夹:

ATFolderSchema = ATContentTypeSchema.copy() + \
    ConstrainTypesMixinSchema.copy() + NextPreviousAwareSchema.copy()
finalizeATCTSchema(ATFolderSchema, folderish=True, moveDiscussion=False)

field =  StringField("rafal_shortdescription",
            schemata = "default",
            widget = StringWidget(
                label = _(u"label_shortdescription",
                    default=u"Short Description"),
                description = _(u"help_shortdescription",
                    default=u"Used in tabs."),
                ),
            ),

ATFolderSchema.addField(field)   
Run Code Online (Sandbox Code Playgroud)

并且最后一行抛出:

 File "/home/rafal/projects/vidensportalen_v2/eggs/Products.Archetypes-1.6.4-py2.6.egg/Products/Archetypes/Schema/__init__.py", line 198, in _validateOnAdd
    raise ValueError, "Object doesn't implement IField: %r" % field
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/home/rafal/projects/vidensportalen_v2/parts/instance/etc/site.zcml", line 12.2-12.39
    ZopeXMLConfigurationError: File "/home/rafal/projects/vidensportalen_v2/eggs/Plone-4.0.2-py2.6.egg/Products/CMFPlone/meta.zcml", line 39.4-43.10
    ValueError: Object doesn't implement IField: <Field rafal_shortdescription(string:rw)>
Run Code Online (Sandbox Code Playgroud)

知道为什么吗?

python zope plone archetypes

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

在哪里报告针对Plone.org网站的错误

我在Plone.org门户网站上发现了一个错误(完全搞砸了为您的产品创建新版本),我制作了一个正确的屏幕截图并希望将其提交到某个地方.但是,我找不到应该做的信息 - https://dev.plone.org是正确的地方吗?

如果没有 - 我应该在哪里这样做?

plone

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