The most common technology presented which .NET people looking for. Its gonna be your turn now.
Wednesday, October 22, 2025
Powershell script to bring news from news Feeds and create a nice looking HTML page.
# ===== DailyNews.ps1 =====
# RSS feed URLs
$techFeeds = @(
"https://techcrunch.com/feed/",
"https://feeds.arstechnica.com/arstechnica/index"
)
$propertyFeeds = @(
"https://www.abc.net.au/news/feed/52278/rss.xml"
)
# Output HTML file
$outputFile = "C:\temp\DailyNews.html"
# Current date
$date = (Get-Date).ToString("dddd, MMM dd yyyy")
# Function to fetch feed items
function Get-FeedItems {
param($url)
Write-Host $url
try {
$rss = [xml](Invoke-WebRequest -Uri $url -UseBasicParsing -ErrorAction Stop).Content
$items = @()
foreach ($item in $rss.rss.channel.item | Select-Object -First 5) {
$items += [PSCustomObject]@{
Title = $item.title
Link = $item.link
PubDate = $item.pubDate
Source = $rss.rss.channel.title
}
}
return $items
} catch {
Write-Host "⚠️ Could not fetch: $url"
return @([PSCustomObject]@{
Title = "⚠️ Could not fetch"
Link = $url
PubDate = ""
Source = ""
})
}
}
# Fetch items
$techNews = @()
foreach ($feed in $techFeeds) {
$techNews += Get-FeedItems $feed
}
$propertyNews = @()
foreach ($feed in $propertyFeeds) {
$propertyNews += Get-FeedItems $feed
}
# Build HTML content
$html = @"
<html>
<head>
<title>📰 Daily Tech & Property News - $date</title>
<style>
body { font-family: Segoe UI, Arial; background: #f9fafb; color: #333; margin: 20px; }
h1, h2 { color: #2a7ae2; }
a { text-decoration: none; color: #0078d7; }
a:hover { text-decoration: underline; }
section { margin-bottom: 40px; }
.article { margin: 8px 0; }
footer { margin-top: 40px; font-size: 12px; color: #777; }
</style>
</head>
<body>
<h1>📰 Daily Tech & Property News</h1>
<p><b>Date:</b> $date</p>
<section>
<h2>🏠 Property News</h2>
<ul>
"@
foreach ($item in $propertyNews) {
$html += "<li class='article'><a href='$($item.Link)' target='_blank'>$($item.Title)</a></li>`n"
}
$html += @"
</ul>
</section>
<section>
<h2>💻 Tech News</h2>
<ul>
"@
foreach ($item in $techNews) {
$html += "<li class='article'><a href='$($item.Link)' target='_blank'>$($item.Title)</a></li>`n"
}
$html += @"
</ul>
</section>
<footer>Generated automatically by PowerShell – $date</footer>
</body></html>
"@
# Save HTML
$html | Out-File -FilePath $outputFile -Encoding utf8
Write-Host "✅ HTML News Summary saved to $outputFile"
Tuesday, September 2, 2025
Springboot - Authenticating Microsoft Token
A JWT has 3 parts (Base64URL encoded, separated by dots):
<header>.<payload>.<signature>
Create a POSTMan POST request to get MS token:
POST https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
Send the below params in x-www.-form-urlencoded:
client_id: <id of application>client_secret: <generated secret of that app>score: api://<tenant-id>/.defaultgrant_type : client_credentials
The response would be :
{ "token_type": "Bearer", "expires_in": 3599, "ext_expires_in": 3599, "access_token": "eyJ0eXAiOiJKV1QiL................."}
Copy that access_token and get ready for actual API request:
https://<applicationurl>/<apiname>/<operationname>
For exhttps://tap/tcaservice/myapi
Send that access token as Bearer Token under Authentication Header
Here is the code for Token validation
@Componentpublic class MicrosoftTokenFilter extends OncePerRequestFilter {
private final JwtDecoder jwtDecoder;
public MicrosoftTokenFilter(@Value("${azure.ad.tenant-id}") String tenantId) { //String issuerUri = "https://login.microsoftonline.com/" + tenantId + "/v2.0"; String issuerUri = "https://sts.windows.net/" + tenantId + "/"; this.jwtDecoder = JwtDecoders.fromIssuerLocation(issuerUri); }
@Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
logger.info("Starting MicrosoftTokenFilter"); String authHeader = request.getHeader("Authorization"); if (authHeader != null && authHeader.startsWith("Bearer ")) { String token = authHeader.substring(7);
logger.info(" token = " + token); try { Jwt jwt = jwtDecoder.decode(token);
SetupAuthentication(jwt);
} catch (Exception e) { response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Invalid Microsoft token"); return; } }
filterChain.doFilter(request, response); }
private void SetupAuthentication(Jwt jwt) {
Map<String, Object> claims = jwt.getClaims();
String name = ""; String email = ""; String orgCode = ""; boolean isAuthUser = false; String environment = "TEST"; String orgName = "";
List<Role> roles = new ArrayList<Role>(); for ( Map.Entry<String,Object> claim : claims.entrySet()) {
if (claim.getKey().equals("EMAIL")) { email = claim.getValue().toString(); } }
//set faked name = "Naas api"; email = "vkumar@austroads.gov.au"; orgCode = "Naas"; isAuthUser = true; environment = "TEST"; orgName = "Austroads";
if (isAuthUser) { User user = new User(); user.setFirstName(""); user.setLastName(name); user.setEmail(email); user.setOrganisationCode(orgCode); user.setRoles(roles); user.setOrganisationName(orgName);
Authentication authentication = createAuthentication(jwt, user, environment); setAuthentication(authentication);
logger.info("Authorities set in context:" + SecurityContextHolder.getContext().getAuthentication().getAuthorities());
} }
private Authentication createAuthentication(Jwt jwt, User user, String environment) { List authList = new ArrayList(); authList.add(new SimpleGrantedAuthority("TEST_MyAdminRole"); JwtAuthenticationToken usertoken = new JwtAuthenticationToken(jwt, authList); return usertoken; }
private void setAuthentication(Authentication authentication) { SecurityContext context = SecurityContextHolder.createEmptyContext(); context.setAuthentication(authentication); SecurityContextHolder.setContext(context); }
}
Wednesday, August 27, 2025
Azure API Management tool
API: Application Programming Interface.
The API Gateway pattern is a design pattern used in distributed systems, especially in microservices architecture, to provide a single-entry point for all client requests. Instead of clients calling each microservice directly, they send requests to the API Gateway, which then routes, transforms, secures, and aggregates responses from backend services.

Popular tools:
-
Azure API Management (APIM) – what you’re learning now.
-
AWS API Gateway
-
Kong, Apigee, NGINX, Tyk, Traefik, Spring Cloud Gateway
Core Functions of an API Gateway:
- Request routing – Directing incoming calls to appropriate backend services
- Authentication and authorization – Verifying identities and access rights before allowing requests
- Traffic management – Controlling request flow to prevent system overload
- Response caching – Storing frequently requested data to improve performance
- Request/response transformation – Modifying data formats to ensure compatibility
- Logging and monitoring – Tracking usage patterns and system health
Core Features of APIM:
- API Gateway: Acts as an entry point for API requests, handling routing, load balancing, and caching.
- Developer Portal: Provides a customizable interface for developers to discover, learn about, and consume your APIs.
- Management Plane: Allows API providers to manage APIs, set policies, define security measures, and monitor performance.
Tuesday, April 22, 2025
Add Emojis ti your code - Shortcut
In visual studio 2022, you can add emojis like checkmark, smile and others in the code or logs to spruce up your logs or comments.
Shortcut Windows + ;
Search and chose name .
For example 0 fire, checkmark
Monday, April 7, 2025
Authentication in .NET
| Type | Common Use Case | Token Type / Auth Flow |
|---|---|---|
| ✅ JWT Bearer Token | APIs, SPAs, Mobile Apps | Token-based (Stateless) |
| ✅ Cookie Authentication | Web Apps (MVC / Razor Pages) | Cookie-based (Stateful) |
| ✅ OAuth2 / OpenID Connect | Social Login, Enterprise SSO | External Identity Providers |
| ✅ API Key Auth | Simple Public APIs | Key in Header/Query |
| ✅ Windows Authentication | Intranet apps, Enterprise networks (AD/LDAP) | Windows/Kerberos |
| ✅ Certificate Authentication | High-security APIs (B2B) | X.509 client certs |
| ✅ Custom Token / HMAC | Legacy systems, Highly controlled environments | Custom logic |
Tuesday, April 1, 2025
Count colored cells in Google sheets - create custom formula
In the google sheets, use the following script and enjoy the function to count the colored cells
=countColoredCells(B59:AF59, "#274e13") #Green color code
function countColoredCells(countRange,colorRef) {
Tuesday, March 25, 2025
Creating a Dental Application Front End using Angular
1. First install Nodejs from nodejs.org
2. Download and Install VSCode
3. After installing nodejs, set path environment
npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ npm
+ ~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
6. Run the following command:
Set-ExecutionPolicy RemoteSigned
7. Install Angular CLI using
npm install -g @angular/cli
8. ng new mydental
9. cd mydenal
10. ng serve mydental
11. For better UI, lets add Angular Materialng add @angular/material
12. Create your first component
ng generate component dashboard
Saturday, January 11, 2025
AI Learning Roadmap
Learning to create AI Agents is a fascinating journey that combines elements of programming, machine learning, and problem-solving. Here's a breakdown of how you can embark on this learning process:
- Programming Fundamentals:
- Python: This is the most common language for AI and machine learning due to its readability, extensive libraries, and active community. Learn basic syntax, data structures, control flow, and object-oriented programming concepts.
- Other Languages (Optional): While Python is primary, knowledge of languages like JavaScript (for web-based agents) or C++ (for performance-critical applications) can be beneficial later.
- Mathematics:
- Linear Algebra: Vectors, matrices, matrix operations are essential for understanding many machine learning algorithms.
- Calculus: Derivatives and gradients are crucial for understanding optimization techniques used in training models.
- Probability and Statistics: Understand probability distributions, hypothesis testing, and statistical inference.
- Core Concepts:
- Supervised Learning: Regression, classification, various algorithms like linear regression, logistic regression, support vector machines (SVMs), decision trees, random forests, and neural networks.
- Unsupervised Learning: Clustering (k-means, hierarchical clustering), dimensionality reduction (PCA), anomaly detection.
- Reinforcement Learning (RL): Learning through trial and error, concepts like Q-learning, SARSA, policy gradients, and deep reinforcement learning.
- Libraries and Frameworks:
- Scikit-learn: A great library for general-purpose machine learning, offering implementations of many standard algorithms.
- TensorFlow and PyTorch: Powerful frameworks for building and training deep learning models. Choose one and learn it well.
- Keras: A high-level API that simplifies building neural networks, often used with TensorFlow or PyTorch.
- Start with Simple Projects:
- Handwritten digit recognition (MNIST dataset): A classic introductory project using neural networks.
- Spam detection: A practical application of text classification.
- Regression problems: Predicting house prices or other numerical values.
- What is an AI Agent?
- An agent that perceives its environment, takes actions, and learns to achieve a goal.
- Differentiated from simple AI models by their ability to interact with an environment.
- Key Components:
- Perception: How the agent receives information about the environment (sensors, data).
- Decision-Making: How the agent chooses actions (algorithms, policies).
- Action: How the agent affects the environment.
- Learning: How the agent improves over time based on experience.
- Types of Agents:
- Reflex Agents: Simple agents that react to current percepts without considering history.
- Model-Based Agents: Maintain an internal model of the world.
- Goal-Based Agents: Act to achieve a specific goal.
- Utility-Based Agents: Maximize a utility function that quantifies the desirability of states.
- Environments:
- Fully Observable vs. Partially Observable: Can the agent perceive all aspects of the environment?
- Deterministic vs. Stochastic: Are actions predictable?
- Discrete vs. Continuous: Are the state and action spaces discrete or continuous?
- The core of AI agents: RL is essential for enabling agents to learn to make decisions in dynamic environments.
- Key RL Concepts:
- Markov Decision Processes (MDPs): A mathematical framework for modeling decision-making problems.
- Exploration vs. Exploitation: Finding a balance between trying new things and exploiting known good strategies.
- Rewards and Punishments: The signals that guide the agent's learning.
- Value Functions: Estimating the long-term reward of being in a particular state.
- Policy: The agent's strategy for selecting actions.
- RL Algorithms:
- Q-Learning, SARSA: Table-based RL algorithms for discrete state and action spaces.
- Deep Q-Networks (DQNs): Combining Q-learning with deep neural networks for high-dimensional state spaces.
- Policy Gradient Methods (e.g., REINFORCE, PPO, A2C): Directly learning the policy.
- RL Environments:
- Gym (OpenAI): A toolkit for developing and comparing reinforcement learning algorithms, offering a variety of environments.
- Custom Environments: Create environments tailored to your specific needs.
- Start with Simple Agents:
- Grid-world navigation: An agent learning to navigate a simple grid environment.
- Game-playing agents (e.g., Tic-Tac-Toe, simple games in Gym): Apply RL to train agents to play games.
- Gradually Increase Complexity:
- More complex game environments (e.g., Atari games using DQN).
- Developing agents for more realistic tasks.
- Experiment with different RL algorithms and architectures.
- Contribute to Open-Source Projects: This is a great way to learn from others and get real-world experience.
- Follow Research Publications: Keep up with the latest advancements in AI and RL.
- Attend Conferences and Workshops: Learn from experts and network with others.
- Online Courses and Tutorials: Resources like Coursera, edX, Udacity, and YouTube are invaluable for continuous learning.
- Online Communities and Forums: Engage with other learners and experts to ask questions and share knowledge.
- Online Courses:
- Coursera's "Machine Learning" by Andrew Ng.
- Udacity's "Deep Reinforcement Learning Nanodegree".
- edX's "AI Professional Certificate".
- Books:
- "Reinforcement Learning: An Introduction" by Sutton and Barto (free online version).
- "Deep Learning" by Goodfellow, Bengio, and Courville (free online version).
- Libraries and Frameworks:
- Scikit-learn
- TensorFlow
- PyTorch
- Keras
- OpenAI Gym
- Websites:
- OpenAI
- DeepMind
- Google AI
- Be Patient and Persistent: Learning AI takes time and effort. Don't get discouraged by initial challenges.
- Focus on Understanding the Fundamentals: Don't just memorize code; strive to understand the underlying concepts.
- Start Small and Build Up: Begin with simple projects and gradually increase the complexity.
- Practice Regularly: The more you code and experiment, the better you'll become.
- Collaborate with Others: Learn from your peers and share your knowledge.



