小编Luk*_*vec的帖子

C#HttpListener指定的网络名称格式无效

我有这小段代码,尝试在其中添加前缀HttpListener

listener = new HttpListener();
listener.Prefixes.Add("http://192.168.0.108:8088/");
listener.Start();
Run Code Online (Sandbox Code Playgroud)

哪个抛出:

System.Net.HttpListenerException(0x80004005):指定的网络名称的格式无效

我已经尝试了所有方法:关闭防火墙,以管理员身份运行,使用来注册给定的URL,netsh http urlacl但到目前为止,没有任何效果。

我检查了netstat该地址是否可以使用。奇怪的是,在Windows 10 Fall Creators Update之前,我一直在使用此地址很长时间,因为此更新localhost一直有效。

还有什么我忘记或可以尝试的吗?

.net c# exception http httplistener

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

循环向量化 - 使用掩码对 7 字节记录的匹配进行计数

我有一个相当简单的循环:

auto indexRecord = getRowPointer(0);
bool equals;
// recordCount is about 6 000 000
for (int i = 0; i < recordCount; ++i) {
    equals = BitString::equals(SelectMask, indexRecord, maxBytesValue);
    rowsFound += equals;
    indexRecord += byteSize; // byteSize is 7
}
Run Code Online (Sandbox Code Playgroud)

哪里BitString::equals

static inline bool equals(const char * mask, const char * record, uint64_t maxVal) {
    return !(((*( uint64_t * ) mask) & (maxVal & *( uint64_t * ) record)) ^ (maxVal & *( uint64_t * ) record));
} …
Run Code Online (Sandbox Code Playgroud)

c++ gcc simd vectorization bitmap-index

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

为什么 Rust 的函数移植比 C++ 慢 2 倍?

我有一个在 C++ 中计算字符串编辑距离的函数:

#include <string>
#include <vector>
#include <algorithm>

size_t sed_diff(const std::string & a, const std::string & b) {

    std::vector<size_t> cp(b.length() + 1);
    std::vector<size_t> cc(b.length() + 1);

    // Edit distance on postorder traversal.
    for (int j = 0; j <= b.length(); ++j) {
        cp[j] = j;
    }
    for (int i = 1; i <= a.length(); ++i) {
        cc[0] = i;
        for (int j = 1; j <= b.length(); ++j) {
            unsigned int c1 = a[i - 1];
            unsigned int c2 …
Run Code Online (Sandbox Code Playgroud)

c++ optimization benchmarking edit-distance rust

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