小编Kin*_*tic的帖子

How can I make the menus being displayed correctly when navigating between pages

The application I'm developing has this structure: there's two main pages with each a different side menu.

When accessing the first page, the right menu is being displayed. When accessing the second page from the first page, the right menu is also being displayed. The problem will occurred when trying to go the the first page again. The second menu is correctly hidden, but the menu from the first page is never displayed.

在此处输入图片说明

This is small repo to show the …

typescript ionic4 angular8

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

是否有任何理由在Task.Run中运行异步代码?

我最近在WinForm应用程序中遇到了这段代码,但我无法确定是否有任何理由asyncTask.Run等待中的内部运行代码。

public async Task SaveStuff()
{
    await Task.Run(() => SaveStuffAsync().ConfigureAwait(false));
    await Task.Run(() => SendToExternalApiAsync().ConfigureAwait(false));
}

private async Task SaveStuffAsync()
{
    await DbContext.SaveChangesAsync().ConfigureAwait(false);
}

private async Task SendToExternalApiAsync()
{
    // some async code that is awaited with ConfigureAwait(false);
}

Run Code Online (Sandbox Code Playgroud)

如果没有Task.Run,​​这段代码会不会做完全相同的事情?

public async Task SaveStuff()
{
    await SaveStuffAsync().ConfigureAwait(false);
    await SendToExternalApiAsync().ConfigureAwait(false);
}
Run Code Online (Sandbox Code Playgroud)

c# async-await

5
推荐指数
2
解决办法
128
查看次数

如何在 Windows 上安装 pyldap 包?

我一直在尝试从命令行使用 pip 添加 pyldap 包:

pip install pyldap
Run Code Online (Sandbox Code Playgroud)

但我收到此错误:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.25.1 IModules -I/usr/include -I/usr/include/sasl -I/usr/local/include -I/usr/local/include/sasl -Ic:\python\include -Ic:\python\include "-IC :\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\ Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits \8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt"/TcModules/LDAPObject.c /Fobuild\temp.win32-3.6\Release\Modules/LDAPObject.obj LDAPObject.c

c:\users\myUser\appdata\local\temp\pip-build-tzxw0vq9\pyldap\modules\errors.h(8):致命错误 C1083:无法打开包含文件:'lber.h':没有这样的文件或目录 错误:命令“C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe”失败,退出状态为 …

windows-10 python-3.5 pyldap

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