Download Logo

First notebook app (Ch. 2)

Using Polyglot Notebook in VS Code Step-by-Step Guide 1. Install Polyglot Notebook Open VS Code. Press Control + Shift + X to open the Extensions view. Search for “Polyglot Notebook” or directly open the URL Polyglot Notebook Extension. Look for the extension logo as shown below and install it. 2. Create a New File Create a new file named HelloWorld.ipynb as shown in the image below. Double-click to open the file. ...

June 17, 2024 · 1 min · 150 words · PrashantUnity
PostgreSQL database

Postgres 16 in Docker

Overview This guide shows how to run PostgreSQL 16 locally using the official Docker image and Docker Compose. You get a default database user and database, port 5432 on your machine mapped into the container, and a named volume so data survives container restarts. Prerequisites Docker Engine installed (Get Docker). Docker Compose v2 (bundled with Docker Desktop; on Linux you may use the docker compose plugin). The version: key at the top of a Compose file is optional in modern Compose; including version: '3.8' is still fine for compatibility. ...

March 24, 2026 · 3 min · 560 words · PrashantUnity
Google Drive Logo

GitHub Actions data jobs

Create a New Console Project I am going to create a dotnet project to demonstrate this, but it is applicable for all other programming languages as well Open any folder, then open Terminal In Terminal, create a new dotnet console project using the below command 1 2 3 4 5 6 7 8 dotnet new console -n GitCiCd cd .\GitCiCd\ code . mkdir .github cd .\.github\ mkdir workflows cd .\workflows\ echo "" > "dotnet.yaml" In dotnet.yaml file Paste Below Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 name: workflows on: push: branches: [ "master" ] jobs: scrape_videos: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - name: Set up .NET uses: actions/setup-dotnet@v2 with: dotnet-version: '8.0.x' # Use the latest .NET version - name: Restore dependencies run: dotnet restore - name: Build the project run: dotnet build --configuration Release - name: Run the scraping script run: dotnet run --project GetYoutubeVideo.csproj - name: Commit and Push Changes run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add Text.txt git commit -m "Update Text.txt list" git push Inside Program.cs file paste below code for. 1 2 3 4 5 6 7 8 9 10 11 var ls = Enumerable.Range(1,8).Select(i => i.ToString() + DateTime.Now).ToList(); SaveToFile(ls, "Text.txt"); static void SaveToFile(List<string> videos, string filePath) { using StreamWriter file = new(filePath); foreach (var video in videos) { file.WriteLine(video); } } The code Responsible for operation is below code 1 2 3 4 5 6 7 - name: Commit and Push Changes run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add Text.txt git commit -m "Update Text.txt list" git push Push to github Now Go to Repository Setting Tab ...

July 28, 2024 · 2 min · 356 words · PrashantUnity
Download Logo

C# basics (Ch. 3)

Comments in C# Comments are essential for making your code understandable. They can explain what your code does, which is helpful for anyone reading it (including yourself). Inline Comments: Use // for single-line comments. 1 // This is an inline comment. Multi-line Comments: Use /* */ for comments that span multiple lines. 1 2 3 4 /* This is a multi-line comment. It spans multiple lines. */ Semicolons In C#, every statement ends with a semicolon (;). This tells the compiler where a statement ends. ...

June 16, 2024 · 3 min · 461 words · PrashantUnity
Generate Thumbnail

Circles & lines in SkiaSharp

Setting Up SkiaSharp 1 #r "nuget:SkiaSharp" Importing namespace to use Skia library 1 using SkiaSharp; Points On circle This function will calculate points on circle and return as list of Points I Depends on number of points we wants to find out on circle Radius of Circle r Center of circle where is it located (x, y) 1 2 3 4 5 6 7 8 9 SKPoint[] CirclePoints(int n,float radius=3,float x=0, float y=0 ) { float degree = (float)(2*Math.PI/n); return Enumerable .Range(1,n) .Select(i=>degree*i) .Select(i=>(new SKPoint(x+ radius *(float)Math.Cos(i), y+ radius *(float)Math.Sin(i)))) .ToArray(); } Line points This Function will first Get all points on circle Then pair the all point with each other as Line Segment Require two Cordinate points one starting point and other end 1 2 3 4 5 6 7 8 9 10 11 12 13 14 List<(SKPoint,SKPoint)> GetAllLinePoints(int n,int radius=3,float x=0, float y=0 ) { var arr =CirclePoints(n:n,x:x,y:y, radius:radius); var ls = new List<(SKPoint, SKPoint)>(); for(var i =0; i<arr.Length; i++) { for(var j=i+1; j<arr.Length;j++) { ls.Add((arr[i],arr[j])); } } return ls; } All Circle This Function will give us all circular points 1 2 3 4 5 6 7 8 9 10 11 12 13 14 List<(float X,float Y)> GetCenter(int m, int n,int radius=60) { var ls =new List<(float X,float Y)>(); int X = radius*3; int Y = radius*3; for(var i=1; i<m;i++) { for(var j=1; j<n;j++) { ls.Add((Y*i,X*j)); } } return ls; } List of random Precalculated hex value 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 var listOfColor = new List<SKColor> { SKColor.Parse("#EEF5FF"), SKColor.Parse("#B4D4FF"), SKColor.Parse("#86B6F6"), SKColor.Parse("#176B87"), SKColor.Parse("#00A9FF"), SKColor.Parse("#89CFF3"), SKColor.Parse("#A0E9FF"), SKColor.Parse("#CDF5FD"), SKColor.Parse("#FF90BC"), SKColor.Parse("#FFC0D9"), SKColor.Parse("#F9F9E0"), SKColor.Parse("#8ACDD7"), SKColor.Parse("#F2AFEF"), SKColor.Parse("#C499F3"), SKColor.Parse("#33186B"), }; Final Code to ustiliase all above function 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 // Image size (pixels) int WIDTH = 1920; int radius =60; Random random = new Random(); SKBitmap bmp = new(1280, WIDTH); SKCanvas canvas = new(bmp); canvas.Clear(SKColor.Parse("#fff")); SKPaint paint = new() { Color = SKColors.White.WithAlpha(100), IsAntialias = true , StrokeWidth = 1, ColorF = SKColor.Parse("#000000"), Style = SKPaintStyle.Stroke }; var ls = GetCenter(10,7,radius); for(var n=3;n<=26;n++) { float X = ls[n-3].Y; float Y = ls[n-3].X; paint.ColorF =listOfColor[random.Next(0,listOfColor.Count)]; foreach(var i in GetAllLinePoints(n:n,x:X,y:Y, radius:radius)) { canvas.DrawLine(i.Item1,i.Item2,paint); canvas.DrawText($"{n} Points",X-20,Y+80,paint); } canvas.DrawCircle(X,Y,60,paint); } bmp.Display() Image Generated using above Code

August 3, 2024 · 2 min · 403 words · PrashantUnity
Download Logo

Math in C# (Ch. 4)

C# Basic Operations and Type Conversions Basic Operations In C#, you can perform various arithmetic operations using standard operators. Here are some examples: 1 2 3 4 5 6 int additionResult = 10 + 5; // result will be 15 int subtractionResult = 20 - 8; // result will be 12 int multiplicationResult = 7 * 4; // result will be 28 int divisionResult = 15 / 3; // result will be 5 int remainder = 17 % 5; // remainder will be 2 float floatDivisionResult = 15f / 4f; // result will be 3.75 Understanding Assignment in Programming In general mathematics, equality signifies that the expression on the left side of the = is equivalent to the expression on the right side: ...

June 18, 2024 · 2 min · 417 words · PrashantUnity
Download Logo

CFD loading SVG

Loading Animation 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg width="300" height="300" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> <text x="1" y="29" font-size="7" fill="white" font-family="Ubuntu">CFD AI</text> <style> .spinner { animation: move 2.4s linear infinite; } .delay1 { animation-delay: -2.4s; fill: #9BFAFF; } .delay2 { animation-delay: -1.6s; fill: #FFBD4D; } .delay3 { animation-delay: -0.8s; fill: #FFF8B3; } @keyframes move { 0%, 8.33% { x: 2px; y: 2px; } 25% { x: 13px; y: 2px; } 33.3%, 50% { x: 13px; y: 13px; } 58.33%, 75% { x: 2px; y: 13px; } 83.33%, 100% { x: 2px; y: 2px; } } </style> <rect class="spinner delay1" x="2" y="2" rx="2" width="10" height="10"/> <rect class="spinner delay2" x="2" y="2" rx="2" width="10" height="10"/> <rect class="spinner delay3" x="2" y="2" rx="2" width="10" height="10"/> </svg>

July 24, 2024 · 1 min · 171 words · PrashantUnity
Download Logo

Strings (Ch. 5)

C# String & string Manipulation String Basics In C#, a string is a sequence of characters stored as a single data type. Strings are immutable, meaning any operation that appears to modify a string actually creates a new string. string and String both can be used to represent string bath are same string preffered. String Concatenation Concatenation is the process of combining two or more strings into one. You can use the + operator to concatenate strings. ...

June 19, 2024 · 3 min · 633 words · PrashantUnity
Download Logo

YouTube API updates

YouTube Data API Sample in .NET Interactive Notebooks This sample demonstrates how to use the YouTube Data API to update video metadata (title, description, tags, etc.) in bulk using .NET Interactive Notebooks. It covers OAuth2 authentication, fetching uploaded videos, generating new metadata using an AI model, and updating the videos via the API. Get Gemini API Key Google Cloud Console for creating secret credentials 1 2 #r "nuget: Google.Apis.YouTube.v3" #r "nuget: Google.Apis.Auth" This cell loads the NuGet package references required to use the YouTube Data API and Google authentication in a polyglot/.NET Interactive notebook. ...

December 23, 2025 · 5 min · 978 words · PrashantUnity
Download Logo

QR codes in .NET

Generate QR Code in .NET Applications This comprehensive guide demonstrates how to create beautiful, customizable QR codes in .NET applications. We’ll build a QR code generator with advanced features including: Gradient coloring - Apply color gradients to QR code modules Rounded dots - Replace standard squares with rounded circles for a modern look Center logo - Embed logos with automatic sizing and contrast enhancement Footer text - Add descriptive text below the QR code UPI payment integration - Generate UPI URIs for Indian payment systems High error correction - Ensure QR codes remain scannable even with partial obstruction Base64 encoding - Easy embedding in web applications and documents Prerequisites You’ll need: ...

November 16, 2025 · 11 min · 2319 words · PrashantUnity