This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.FileProviders; | |
var builder = WebApplication.CreateBuilder(args); | |
// Add services to the container. | |
builder.Services.AddControllersWithViews(); | |
var app = builder.Build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk.Web"> | |
<PropertyGroup> | |
<TargetFramework>net7.0</TargetFramework> | |
<ImplicitUsings>enable</ImplicitUsings> | |
<Nullable>enable</Nullable> | |
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> | |
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion> | |
<IsPackable>false</IsPackable> | |
<SpaRoot>ClientApp\</SpaRoot> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WARNING: This script will delete everything in Downloads, Pictures, Videos, Documents\PowerShell folders for the specified user and the D: drive. | |
# Use it at your own risk. | |
# Specify the user's profile folder | |
$userProfile = [System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::UserProfile) | |
# Specify the folders to delete for the user | |
$userFoldersToDelete = @("Downloads", "Pictures", "Videos", "Documents\PowerShell") | |
# Specify the drive to delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CustomerChurnMLDemo; | |
using Microsoft.ML; | |
using Microsoft.ML.Data; | |
using Microsoft.ML.AutoML; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string trainDataFilePath = @"D:\CustomerChurnMLDemo\CustomerChurnMLDemo\Data\customer_churn_dataset-training-master.csv"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import the necessary ML.NET namespace | |
using Microsoft.ML; | |
using CustomerChurnMLDemo; | |
// Create an MLContext instance, which serves as the entry point to ML.NET functionality | |
var mlContext = new MLContext(); | |
// Load the data from a file using the CustomerChurn class's LoadIDataViewFromFile method | |
// It loads the data for retraining a machine learning model for customer churn prediction | |
var data = CustomerChurn.LoadIDataViewFromFile(mlContext, CustomerChurn.RetrainFilePath, CustomerChurn.RetrainSeparatorChar, CustomerChurn.RetrainHasHeader); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"age": 22, | |
"gender": "Female", | |
"tenure": 25, | |
"usage_Frequency": 14, | |
"support_Calls": 4, | |
"payment_Delay": 27, | |
"subscription_Type": "Basic", | |
"contract_Length": "Monthly", | |
"total_Spend": 598, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.UseSwaggerUI(c => | |
{ | |
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); | |
c.RoutePrefix = string.Empty; // <--------Add this line. | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ApiController] | |
[Route("api/[controller]")] | |
public class TodosController : Controller | |
{ | |
[HttpGet("/")] | |
// [ProducesResponseType(typeof(Todo), StatusCodes.Status200OK)] | |
[ProducesResponseType<Todo>(StatusCodes.Status200OK)] | |
public Todo Get() => new Todo(1, "Write a sample", DateTime.Now, false); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connection = new signalR.HubConnectionBuilder() | |
.withUrl("/chatHub") | |
.withServerTimeoutInMilliseconds(60000) | |
.withKeepAliveIntervalInMilliseconds(30000) | |
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connection = new signalR.HubConnectionBuilder() | |
.withUrl("/chatHub") | |
.build(); | |
connection.serverTimeoutInMilliseconds = 60000; | |
connection.keepAliveIntervalInMilliseconds = 30000; |
NewerOlder