小编Moo*_*ker的帖子

libtorrent-rasterbar 的 Python 绑定不起作用

我正在运行 Debian 6.0.6

我从这里下载了最新版本的 libtorrent-rasterbar:http : //code.google.com/p/libtorrent/downloads/detail? name=libtorrent-rasterbar-0.16.6.tar.gz&can=2并安装了它:

./configure --enable-python-binding
make
make install
cd bindings/python
python setup.py build
python setup.py install
Run Code Online (Sandbox Code Playgroud)

现在我想测试该库是否有效:

>>> import libtorrent
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libtorrent-rasterbar.so.7: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)

来自分发库的 libtorrent 的打包版本有一些有趣的行为(抱怨 boost 依赖),所以我决定升级。我的两个 debian 机器上的情况相同,但 ubuntu 机器没问题。

来自我的 debian 盒子的旧错误消息:

  File "ar.py", line 15, in create
    s.start_dht()
Boost.Python.ArgumentError: Python argument types in
    session.start_dht(session)
did not match C++ signature:
    start_dht(libtorrent::session …
Run Code Online (Sandbox Code Playgroud)

python ubuntu debian libtorrent

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

如何在lua中递归地使用Windows注册表?

我来自linux的土地,所以请耐心等待.

我想递归地浏览Windows注册表.到目前为止,我所做的就是获得各个键的值

> require 'luacom'
> sh = luacom.CreateObject "WScript.Shell"
> = sh:RegRead "HKCU\\Console\\ColorTable01"
8388608
Run Code Online (Sandbox Code Playgroud)

但是看不到迭代注册表节点的方法......

windows registry recursion lua

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

如何在从网络接收新项目后重新绘制flutter.io中的小部件网格?

我正在修改Pesto示例https://github.com/flutter/flutter/blob/76844e25da8806a3ece803f0e59420425e28a405/examples/flutter_gallery/lib/demo/pesto_demo.dart以通过添加以下功能从网络接收新配方:

  void loadMore(BuildContext context, query) {
    HttpClient client = new HttpClient();
    client.getUrl(Uri.parse("http://10.0.2.2:5000/search/" + query ))
        .then((HttpClientRequest request) {
      return request.close();
    })
        .then((HttpClientResponse response) {
      // Process the response.
      response.transform(UTF8.decoder).listen((contents) {
        // handle data
        var decoded = JSON.decode(contents);
        var rec = new Recipe(
            name: decoded['title'],
            author: decoded['author'],
            professionIconPath: 'images/1.png',
            description: decoded['description'],
            imageUrl: 'http://example.jpg',
        );
        kPestoRecipes.add(job);
        //Navigator.push(context, new MaterialPageRoute<Null>(
        //    settings: const RouteSettings(name: "/"),
        //    builder: (BuildContext context) => new PestoHome(),
        //));
      });
    });
  }
Run Code Online (Sandbox Code Playgroud)

并且我将其他配方加载到点击界面按钮:

floatingActionButton: new FloatingActionButton(
                child: …
Run Code Online (Sandbox Code Playgroud)

user-interface android ios dart flutter

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

用户注册和通过电子邮件地址而不是用户名进行身份验证

我不想编写自定义身份验证后端,我认为这样的常见任务必须已经由一些第三方应用程序解决.

我做了一些谷歌搜索和略读,但发现只有https://bitbucket.org/hakanw/django-email-usernames/wiki/Home这是相当老(2008年).还有其他替代品吗?

authentication django

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

python和scipy中稀疏矩阵的聚类

我正在尝试使用python和scipy聚类一些数据,但以下代码不能正常工作我不明白:

from scipy.sparse import *
matrix = dok_matrix((en,en), int)

for pub in pubs:
    authors = pub.split(";")
    for auth1 in authors:
        for auth2 in authors:
            if auth1 == auth2: continue
            id1 = e2id[auth1]
            id2 = e2id[auth2]
            matrix[id1, id2] += 1

from scipy.cluster.vq import vq, kmeans2, whiten
result = kmeans2(matrix, 30)
print result
Run Code Online (Sandbox Code Playgroud)

它说:

Traceback (most recent call last):
  File "cluster.py", line 40, in <module>
    result = kmeans2(matrix, 30)
  File "/usr/lib/python2.7/dist-packages/scipy/cluster/vq.py", line 683, in kmeans2
    clusters = init(data, k)
  File "/usr/lib/python2.7/dist-packages/scipy/cluster/vq.py", line …
Run Code Online (Sandbox Code Playgroud)

numpy cluster-analysis data-mining scipy k-means

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

为什么我在matlab中得到错误的矩阵规范?

我有一个小的,条件良好的Hermitian矩阵L,其特征值为[0,2].在尝试计算L的倒数范数时,我得到了奇怪的结果:

>> norm(inv(L))

ans =

    2.0788

>> min(eig(L))

ans =

    0.5000 
Run Code Online (Sandbox Code Playgroud)

这很奇怪,因为逆的第二范数应该是矩阵的最小特征值的等倒数.

我知道机器算术引入的错误,但在这个小的,埃尔米特和良好条件的例子中,我预计它可以忽略不计.

这是矩阵https://www.dropbox.com/s/nh1wegrnn53wb6w/matrix.mat

我在Linux mint 16(Petra)上使用matlab 8.2.0.701(R2013b).

floating-point matlab matrix numerical-methods

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