This article demonstrates how to enhance Python error handling using the traceback module while leveraging uv's support for PEP 723 to create reproducible scripts. It provides practical examples of how to move beyond basic ValueError implementations to include stack traces in error messages, making debugging and error handling more informative in production environments.
Troubleshooting GPU configuration on GKE can be painful. I explain how to troubleshoot GPU configuration issues in Google Kubernetes Engine (GKE) when running PyTorch workloads, emphasizing the importance of ensuring compatibility between Nvidia drivers, CUDA, and PyTorch. I outline a systematic approach to debug and verify that the GPU is recognized within the container and that PyTorch can access the GPU resources correctly.
I've integrated Large Language Models (LLMs) into my workflows to automate developer activities. This improves my understanding of their capabilities. I provide practical use cases, including code review, file summarization, web page content extraction, and even analyzing running processes, illustrating the diverse applications of LLMs in my daily tasks.
I've implemented a process for recording the things I learn in the form of questions and answers, using the active recall technique. I document how I use the latex exam class to generate worksheets with and without the answers.
I demonstrate how to serve a TensorFlow model from Scala by serializing it to the ONNX format, allowing it to be utilized through the Java ONNX runtime. I provide a step-by-step guide on exporting a model and implementing the necessary logic in Scala to invoke it, highlighting key considerations and potential next steps for further development.
In this blog post, I explain how I implemented a GitHub Actions workflow to automate the updating of my Jekyll blog by building it and transferring files to my Droplet using `rsync`. I configured the workflow to trigger on pushes to the `gh-actions` branch and on pull requests to the main branch, ensuring efficient testing and deployment of changes.
I explain how to perform metaprogramming in Scala using Scalameta to generate case classes based on a dataset schema defined in a CSV file. I detail the process of transforming schema information into an Abstract Syntax Tree (AST) to create valid Scala code automatically, illustrating the solution with various code snippets.
I describe the process and rationale behind deploying my personal Jekyll blog using Terraform and Ansible, emphasizing the importance of simplicity and minimizing dependencies on external services. I also outline the architecture of my blog, the tools I used, and my future plans for automation and expansion of the deployment process.
I share a Python script that safely upserts Pandas DataFrames into a Postgres database using psycopg2, highlighting the importance of handling potential SQL injection risks. I explain the process of constructing SQL statements to manage inserts and updates based on specified constraints, while utilizing the `execute_batch` function for efficient batch processing.
Using scikit-learn and some Python features to set up a machine learning pipeline to quantify the efficiency of different classifers for classifying the movement of a stock price.