Skip to content

Instantly share code, notes, and snippets.

View nishanc's full-sized avatar
馃殌
This is the way!

Nishan Chathuranga Wickramarathna nishanc

馃殌
This is the way!
View GitHub Profile
馃 1. Brainstorming Ideas
Prompt:
=============================================
Update your memory.
Here's the context of what we're trying to solve: [Insert context].
Now, don't try to impress me. Don't automatically agree with my approach. Instead, based on the data and knowledge you have, generate your own honest perspective. Break your answer down into digestible parts to help me think it through clearly.
=============================================
馃攳 Use this when you're not sure how to approach a problem or want fresh perspectives that challenge your own assumptions.
using Microsoft.Extensions.FileProviders;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
var app = builder.Build();
<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>
# 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
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";
// 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);
{
"age": 22,
"gender": "Female",
"tenure": 25,
"usage_Frequency": 14,
"support_Calls": 4,
"payment_Delay": 27,
"subscription_Type": "Basic",
"contract_Length": "Monthly",
"total_Spend": 598,
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
c.RoutePrefix = string.Empty; // <--------Add this line.
});
[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);
}
var connection = new signalR.HubConnectionBuilder()
.withUrl("/chatHub")
.withServerTimeoutInMilliseconds(60000)
.withKeepAliveIntervalInMilliseconds(30000)
.build();