Sunday, 28 September 2025

Python code to compare Blog files vs filesnames in sql server

 import pandas as pd

from azure.storage.blob import BlobServiceClient
import pyodbc

# ------------------ Azure Blob Storage Configuration ------------------
blob_connection_string = 'COnncetionstring'
blob_container_name = 'Blobcontainer Name'

# Connect to Blob Storage
blob_service_client = BlobServiceClient.from_connection_string(blob_connection_string)
container_client = blob_service_client.get_container_client(blob_container_name)

# Fetch file names from Blob Storage
blob_file_names = [blob.name for blob in container_client.list_blobs()]
df_blob_files = pd.DataFrame(blob_file_names, columns=['FileName'])

# ------------------ Azure SQL Database Configuration ------------------
sql_server = 'Server Name'
sql_database = 'Databse'
sql_username = 'user name'
sql_password = 'password'
sql_driver = 'ODBC Driver 17 for SQL Server'
sql_table = 'FileName table'

# Connect to SQL Server and fetch file names
sql_conn_str = f'DRIVER={sql_driver};SERVER={sql_server};DATABASE={sql_database};UID={sql_username};PWD={sql_password}'
sql_query = f'SELECT B2BFileName FROM {sql_table}'

with pyodbc.connect(sql_conn_str) as conn:
df_sql_files = pd.read_sql(sql_query, conn)

# ------------------ Comparison Logic ------------------
# Find files in Blob Storage that are not in SQL Server
missing_files = df_blob_files[~df_blob_files['FileName'].isin(df_sql_files['B2BFileName'])]

# ------------------ Export to Excel ------------------
output_file = r'C:\Users\Desktop\MissingBlobFiles.xlsx'
missing_files.to_excel(output_file, index=False)

print(f"Missing file names exported to: {output_file}")



3. .isin(...)

This method checks whether each value in df_blob_files['FileName'] exists in the list of values from df_sql_files['B2BFileName'].

It returns a boolean Series — True if the file name exists in SQL Server, False if it doesn't.

4. ~ (Tilde Operator)

This is a logical NOT operator. It inverts the boolean Series returned by .isin(...).

So now, it marks True for file names not found in SQL Server.

Wednesday, 10 September 2025

AI Tools for Developers

 The video outlines a "SMART" framework for software engineers to leverage AI, and it recommends several tools under each letter of this framework to enhance productivity and skill.

Here's a summary of the tools mentioned:

S - Study This section focuses on using AI to study and learn effectively.

  • Perplexity: Described as an "AI Sherlock Holmes," this tool investigates multiple sources, connects information, and provides deductive conclusions with proof. It synthesizes information from various sources to give comprehensive answers, unlike traditional search engines where users have to piece together information. It's particularly useful for tasks like building a real-time chat application, explaining pros and cons of technologies (e.g., websockets vs. WebRTC), and recommending libraries. It provides citations and real-time web results, making it more accurate than tools like ChatGPT.
  • NotebookLM: This tool is compared to "Doctor Strange of AI" for its ability to connect different dimensions of knowledge. It allows users to upload study materials (e.g., textbooks, lecture slides, coding solutions) and automatically shows connections between concepts. A favorite feature is its ability to transform study materials into personalized podcasts, creating engaging conversations between two AI hosts about the uploaded content. Users can also interrupt and join these conversations in real time, making it a "mini tutor".
  • Kodi.te: This AI resource is recommended for effective skill-building and upskilling. It offers bite-sized lessons, projects, and quizzes for learning various coding languages like JavaScript or Python, with a strong recommendation for Python for AI and machine learning. Its project-based learning approach helps users avoid "tutorial hell." It includes an AI assistant to help understand coding languages and answer questions. Kodi.te is completely free, with premium features like unlimited AI queries available with a discount code.

M - Make This part focuses on designing and presenting.

  • Napkin AI: This tool can instantly turn complicated systems into clear visuals, similar to Tony Stark's holographic workshop. Users can describe a complex system (e.g., a microservices architecture for an e-commerce platform), and Napkin AI will generate professional architecture diagrams, including data flow, API endpoints, and suggestions for load balancers. Crucially, it also identifies bottlenecks, helping in both designing and problem-solving.
  • Gamma AI: Used for transforming technical projects into impressive presentations. Users can feed it project details like GitHub READMEs, user testing results, and technical notes, and Gamma will create a compelling narrative, structuring the presentation to highlight problems, solutions, technical innovation, and competitive advantage. It also suggests demo flows and can convert notes into guides and API documentation.

A - Automation This section covers AI coding tools.

  • Cursor: Described as "Jarvis from Iron Man but for coding," Cursor doesn't just autocomplete code; it helps architect and build entire modules holistically. Users can describe a desired application (e.g., a to-do app with user authentication), and Cursor generates authentication setup, database schemas, API endpoints, and error handling. It acts like a senior software engineer, warning about API rate limiting, suggesting caching strategies, and accounting for edge cases. It is integrated directly into the IDE, offering better accuracy than simply copying code from ChatGPT.
  • GitHub Copilot: Excellent for implementation-level tasks, understanding specific domains and coding patterns. Compared to Hermione from Harry Potter, it "knows exactly what you need before you even finish asking." It can reformat code, rename variables, or fill out complete functions based on comments. Unlike GPT, it has the context of the entire codebase, providing accurate suggestions. It has made tools like Stack Overflow "useless" for many engineers due to its ability to provide specific method calls and documentation without needing external searches.

R - Run This segment focuses on running terminal commands and programs.

  • Warp.dev: This terminal has AI integrated into it, capable of creating full projects and writing code. Its key feature is understanding and executing terminal commands. Users can ask questions like "Do I have Python installed?" and it will find and run the relevant command. It can also create and run entire projects, such as a Pomodoro timer, automatically handling setup, package downloads, and even attempting to fix failed commands, eliminating the need for manual troubleshooting via search engines.

T - Trial & Error This final piece emphasizes staying updated and experimenting with new tools due to the rapid evolution of technology.

  • Replet: Mentioned as a tool that uses AI for quick prototypes and testing across different frameworks.
  • Windsurf: Noted for collaborative experimentation, allowing real-time testing of ideas with AI.
  • Code Sandbox: An AI platform optimized for front-end development.

The video encourages viewers to pick one or two tools to integrate into their workflow and continuously stay updated with new advancements in the market.

Data Structures

 https://www.youtube.com/watch?v=O9v10jQkm5c

Friday, 5 September 2025

Websites to Analyze Intrinsic value of a stock

  • Seeking Alpha (seekingalpha.com): Provides essential investment information, including stock movement data, company profiles, profitability metrics (gross profit and Avid margins) for financial health, and capital structure details. Kai emphasizes checking short interest, a "super super important" number, advising to generally avoid stocks with over 2% short interest as it indicates many are betting against the stock.
  • Yahoo Finance (finance.yahoo.com): A "classic" and "powerful tool". Its graph features a strong comparison tool to trend multiple companies over time and show percentage changes. Kai highlights recent insider transactions as crucial, suggesting significant insider selling might signal a potential stock drop.
  • Wallmine.com (wallmine.com): Consolidates most information onto a single page, which Kai finds convenient. It offers quick explanations when hovering over numbers, making it helpful for new investors. It also displays recent institutional transactions, which are powerful indicators given institutions' large holdings.
  • TipRanks (tipranks.com): Features a proprietary "Smart Score" aggregating different sentiments and provides a clear visual of analyst forecasts. Kai notes its unique website traffic tool, which can indicate potential revenue growth, and often offers free features that are paid on other sites.
  • Simply Wall Street (simplywall.st): Dissects stock analysis into categories like value, future, past, health, and dividend. It stands out by interpreting numbers for the user, highlighting positive (green) and negative (red) sentiments, and offers "super powerful and much cleaner" graphs.

Kai concludes by stressing the importance of cross-referencing information across these different platforms to ensure alignment and gain diverse perspectives, as analyst predictions and free features can vary. He also prefers visual graphs for easier trend identification. All these websites also provide mobile apps.