小编Jon*_*Jon的帖子

在Intellij Idea编辑器的每个查找结果中获得多个光标(尖号)?

我想同时选择所有包含单词“ key”的字符串资源键。我很难弄清楚这一点,所以我想将其发布给其他人。多光标文档没有解决此问题。

我要从中选择文件的摘录。

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- User Preferences -->    
    <string name="preference_key_pedigree_enable_offline_mode">Pref.OfflineMode</string>
    <string name="preference_title_pedigree_enable_offline_mode">Offline Mode</string>
    <string name="preference_summary_on_pedigree_enable_offline_mode">Scans work without an internet connection, don\'t require a VIN and can\'t be saved.</string>
    <string name="preference_summary_off_pedigree_enable_offline_mode">Scan results will be sent to the server.</string>
    <string name="preference_default_pedigree_enable_offline_mode">false</string>

    <string name="preference_key_pedigree_hide_cleared_dtcs">pref_pedigree_hide_cleared_dtcs</string>
    <string name="preference_title_pedigree_hide_cleared_dtcs">Hide Cleared DTCs</string>
    <string name="preference_summary_on_pedigree_hide_cleared_dtcs">DTC\'s are hidden after they\'ve been cleared</string>
    <string name="preference_summary_off_pedigree_hide_cleared_dtcs">DTC\'s are still shown after they\'ve been cleared</string>
    <string name="preference_default_pedigree_hide_cleared_dtcs">true</string>

    <string name="preference_key_analytics_global_opt_out">pref_analytics_global_opt_out</string>
    <string name="preference_title_analytics_global_opt_out">Analytics Opt-Out</string>
    <string name="preference_summary_on_analytics_global_opt_out">Analytics switched off.</string>
    <string name="preference_summary_off_analytics_global_opt_out">Crash …
Run Code Online (Sandbox Code Playgroud)

intellij-idea android-studio

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

Pandas.plotting 不显示图形

我正在学习“python机器学习简介”一书中的教程,我复制了以下代码:

#create dataframe from data in X_train
#label the colums using the strings in iris_dataset.features_names
iris_dataframe = pd.DataFrame(X_train, columns = iris_dataset.feature_names)
#create a scatter matrix from the dataframe, color by y_train
pd.plotting.scatter_matrix(iris_dataframe,c=y_train,
                           figsize=(15,15), marker='o', 
                           hist_kwds={'bins':20},s=60, 
                           alpha=.8,
                           cmap=mglearn.cm3)
Run Code Online (Sandbox Code Playgroud)

它应该绘制一个图形,但它只打印这些行:

array([[<matplotlib.axes._subplots.AxesSubplot object at 0x7f0d073934a8>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x7f0d07352908>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x7f0d07376e48>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x7f0d0732ee48>],
       [<matplotlib.axes._subplots.AxesSubplot object at 0x7f0d072e3f28>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x7f0d072e3f60>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x7f0d07308ac8>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x7f0d07211400>],
       [<matplotlib.axes._subplots.AxesSubplot object at 0x7f0d071ca470>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x7f0d07183470>,
        <matplotlib.axes._subplots.AxesSubplot object …
Run Code Online (Sandbox Code Playgroud)

python machine-learning matplotlib pandas

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

ASP.NET Core (.Net 6) Web 应用程序在作为服务运行时抛出 System.NotSupportedException。(服务不会启动)

当我尝试将 .Net Web 应用程序作为 Windows 服务运行时,它无法启动。如果我只运行可执行文件,它会起作用,但在尝试作为服务运行时会神秘地失败。我已记录相关错误消息并在下面报告了我的解决方案。

事件查看器中出现以下异常。

事件查看器中的异常

应用程序:WebApplication5.exe CoreCLR 版本:6.0.222.6406 .NET 版本:6.0.2 说明:由于未处理的异常,进程被终止。异常信息:System.NotSupportedException:内容根目录从“C:\Windows\system32”更改为“C:\Program Files (x86)\My Company\webapp5”。不支持使用 WebApplicationBuilder.Host 更改主机配置。请改用 WebApplication.CreateBuilder(WebApplicationOptions)。在 Microsoft.AspNetCore.Builder.ConfigureHostBuilder.ConfigureHostConfiguration(操作1 configureDelegate) at Microsoft.Extensions.Hosting.HostingHostBuilderExtensions.UseContentRoot(IHostBuilder hostBuilder, String contentRoot) at Microsoft.Extensions.Hosting.WindowsServiceLifetimeHostBuilderExtensions.UseWindowsService(IHostBuilder hostBuilder, Action1 配置) 在 Microsoft.Extensions.Hosting.WindowsServiceLifetimeHostBuilderExtensions.UseWindowsService(IHostBuilder hostBuilder) 在 Program.$(String[] args) 在 C:\Users\Jonathan\source\repos \WebApplication5\WebApplication5\Program.cs:第 10 行

重新创建的步骤

程序.cs

我的应用程序基于ASP.NET Core Web API模板。我按照https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/windows-service?view=aspnetcore-6.0&tabs=visual-studio#app-configuration上的说明进行操作并添加UseWindowsService()Program.cs

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.

builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

builder.Host.UseWindowsService(); …
Run Code Online (Sandbox Code Playgroud)

c# windows-services asp.net-core .net-6.0

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

带有CountDown TImer的Android对话框

在我的应用程序中,我将推送通知显示为一个对话框,其中有两个名为YesNo的按钮。我需要显示对话框标题中运行的计时器(20秒)。

如果用户单击“ 是”,则应转到一个活动。
如果用户单击“ 否”,对话框将在计时器结束前被取消。
倒计时结束后,对话框应消失。我应该如何实施呢?

这是我的警报对话框方法

public void showAlertDialog(final Context context, String title, String message,
                            Boolean status) {
    AlertDialog.Builder alertDialog = new AlertDialog.Builder(context);

    // Setting Dialog Title
    alertDialog.setTitle(title);

    // Setting Dialog Message
    alertDialog.setMessage(message);

    // Setting Icon to Dialog
    //alertDialog.setIcon(R.drawable.fail);

    // Setting Positive "Yes" Button
    alertDialog.setPositiveButton("YES", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            Toast.makeText(getApplicationContext(), "You clicked on YES", Toast.LENGTH_SHORT).show();

        }
    });

    // Setting Negative "NO" Button
    alertDialog.setNegativeButton("NO", new DialogInterface.OnClickListener() {
        public …
Run Code Online (Sandbox Code Playgroud)

android android-alertdialog countdowntimer

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

当Web应用程序托管在子目录中时,ASP.NET Core Swagger使用不正确的json url

我按照这些说明向我的ASP.NET Core应用程序添加了swagger.

当我将它作为根网站托管时,它工作正常,但是当我将应用程序作为现有网站上的别名托管时,例如myserver.com/myapp,swagger会查找swagger.json错误的URL并报告:*无法读取来自的swagger JSON https://myserver.com/swagger/v1/swagger.json.它应该使用https://myserver.com/myapp/swagger/v1/swagger.json.

我收到的消息是:

无法从https://myserver.com/swagger/v1/swagger.json中读取swagger JSON

如何配置swashbuckle/swagger以使用应用程序基本路径并在正确的位置查找swagger.json文件?

我在IIS上托管.

swashbuckle的版本是:

"Swashbuckle": "6.0.0-beta902"
Run Code Online (Sandbox Code Playgroud)

我怀疑我必须app.UseSwaggerUi()Configure方法中添加一些内容,Startup.cs但我不确定是什么.

启动配置:

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
    loggerFactory.AddConsole(Configuration.GetSection("Logging"));
    loggerFactory.AddDebug();

    if (env.IsDevelopment())
    {
        app.UseDeveloperExceptionPage();
        app.UseBrowserLink();
    }
    else
    {
        app.UseExceptionHandler("/Home/Error");
    }

    app.UseStaticFiles();

    app.UseMvc(routes =>
    {
        routes.MapRoute(
            name: "default",
            template: "{controller=Home}/{action=Index}/{id?}");
    });

    // Enable middleware to serve generated Swagger as a JSON endpoint
    app.UseSwagger();

    // Enable middleware to …
Run Code Online (Sandbox Code Playgroud)

swashbuckle asp.net-core-webapi

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

抽奖动画不起作用

如何在Android中使用Lottie Animation?我尝试过,但是动画没有运行。如何开始JSON动画?我想使用自定义加载动画,而不是使用常规的圆形进度栏。

android lottie-android lottie

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