Karthik Upadrasta·11h agoTranslate HTML Text in Python and Keep the Tags (BeautifulSoup)Walk the text nodes, skip scripts and styles, keep whitespace and entities right, and clean up pdf2htmlEX’s word-splitting spans before you…
Karthik Upadrasta·21h agoHow to Prevent Prompt Injection in Python LLM Apps: 6 Layers That Actually HelpNo single fix exists. Six layers, each with tested Python, make attacks harder and limit the damage when one gets through.
Karthik Upadrasta·1d agoThe One-Element Tuple Bug in mysql-connector cursor.execute: (val) vs (val,) in PythonYou write a parameterised INSERT, pass one value, and cursor.execute throws. The SQL looks right and so does the value. The problem is one…
Karthik Upadrasta·1d agoFix ‘cannot import name AgentExecutor from langchain.agents’ + 5 More LangChain ErrorsThe tutorial code worked last year. Now it dies on line one. Here is why, and two ways out for each error.
Karthik Upadrasta·2d agoDownload YouTube Audio as MP3 With yt-dlp in Python (and Avoid the .mp3.mp3 Trap)A small, testable yt-dlp wrapper: the right options, the FFmpeg postprocessor, the JavaScript runtime YouTube now needs, and a dry-run…
Karthik Upadrasta·2d ago5 LLM Chat History Summarization Techniques That Keep Long Chats in Context (Python)Rolling summaries, token budgets, summary-of-summaries, pinned messages and structured facts, all tested without an API key.A response icon1A response icon1
Karthik Upadrasta·3d agoUpload YouTube Videos with Python: One Saved OAuth Token per Channel, Captions and a First CommentA YouTube Data API v3 uploader that checks which channel it’s about to post to, survives expired tokens, and is honest about what the API…A response icon1A response icon1
Karthik Upadrasta·3d ago5 Ways to Do Hybrid Search (BM25 + Vector) in Python, With Code You Can RunHybrid search with BM25 and vectors in Python: keywords find the error code, embeddings find the paraphrase.
Karthik Upadrasta·4d agoBuild a Chrome Extension (Manifest V3) That Closes a YouTube Tab When the Video EndsThree small files, one MutationObserver, and the single-page-app trap that makes a “simple” content script miss most videos.
Karthik Upadrasta·4d ago6 Reasons AI Cannot Simply Give a Vendor a Cybersecurity Risk ScoreThe difference between an AI-generated opinion and an evidence-backed risk assessment.