Docs

Python Crash Debugging
Python Crash Debugging
This document demonstrates debugging Python exceptions using PDB debugger covering traceback analysis, KeyError investigation, and fixing UTF-8 BOM encoding issues in CSV files. Practical case study of database import script debugging.
Debugging Segmentation Faults
Debugging Segmentation Faults
This document demonstrates debugging segmentation faults using core files and GDB, covering commands like backtrace, up, list, and print to analyze crashes and identify off-by-one errors. Practical walkthrough of C program debugging.
Working with Someone Else's Code
Working with Someone Else's Code
This document covers strategies for understanding and fixing problems in code written by others, including reading comments and tests, navigating large codebases, and practicing with open-source projects. Essential skills for maintaining unfamiliar code.
Unhandled Errors
Unhandled Errors
This document explains unhandled errors and exceptions in high-level languages like Python, covering error types, tracebacks, debugging techniques, logging strategies, and making programs resilient. Focus is on proper error handling and user-friendly failure modes.
Invalid Memory
Invalid Memory
This document explains invalid memory access errors, including segmentation faults, memory management in operating systems, debugging techniques with symbols, and tools like valgrind for detection. Coverage includes common programming errors and remediation strategies.
Resources For Understanding Crashes
Resources For Understanding Crashes
This document provides resources and tools for understanding computer crashes including hardware failures, OS errors, and software deficiencies. Coverage includes BSoD, system logs, Process Monitor, strace, and system call tracing across platforms.
Internal Server Error
Internal Server Error
This document demonstrates debugging a web server returning HTTP 500 errors by investigating logs, configuration files, process information, and file permissions. Focus is on systematic investigation and root cause identification.
Fixing Program
Fixing Program
This document This document outlines practical workarounds for fixing crashing applications when source code cannot be modified, including data pre-processing compatibility wrappers, isolation, and watchdog strategies. Focus is on restoring service and producing high-quality bug reports.
Understanding Crash Application
Understanding Crash Application
This document summarizes techniques to analyse application crashes using logs tracing tools, change analysis, and minimal reproduction cases. Emphasis is on isolating root causes and collecting evidence for remediation or reporting.
System Crash
System Crash
This document describes steps to diagnose and resolve system crashes, covering hardware checks, OS and application troubleshooting, and remediation planning. Focus is on isolating root causes and selecting efficient fixes.
Crashing Programs
Crashing Programs
Learn how to troubleshoot and debug crashing programs effectively, including monitoring strategies, bug reporting, and long-term fixes.
Using Threads to Improve Performance
Using Threads to Improve Performance
This document demonstrates practical implementation of threading and multiprocessing in Python to optimize image processing performance. It walks through converting a sequential thumbnail generation script to use ThreadPoolExecutor and ProcessPoolExecutor, comparing their performance characteristics and explaining the differences caused by Python's Global Interpreter Lock.
Monitoring and Long-Term Solutions
Monitoring and Long-Term Solutions
This document covers the importance of monitoring systems, alerting strategies, bug reporting best practices, and long-term solution design to prevent recurring issues and maintain system reliability.
Concurrency and Parallelism in Python
Concurrency and Parallelism in Python
This document explores concurrency and parallelism strategies in Python for optimizing complex systems. It covers threading and asyncio for I/O-bound tasks, multiprocessing for CPU-bound operations, and techniques for combining both approaches to create efficient, responsive applications with optimal resource utilization.
Evolving Solutions for Growing Systems
Evolving Solutions for Growing Systems
This document examines how solutions must evolve as systems grow from simple scripts to complex distributed applications. It demonstrates technology progression through a Secret Santa example, starting with CSV files, advancing through SQLite and database servers, adding caching layers, and ultimately scaling to cloud-based distributed architectures with load balancing.
Dealing with Complex Growing Systems
Dealing with Complex Growing Systems
This document examines performance troubleshooting in large-scale distributed systems with multiple interconnected components. It covers identifying bottlenecks through monitoring infrastructure, optimizing database operations with proper indexing, implementing caching and distribution strategies addressing CPU saturation, and simplifying unnecessarily complex architectures.
Parallelizing Operations for Performance
Parallelizing Operations for Performance
This document explores concurrency and parallel execution techniques to improve script performance. It covers operating system process management splitting work across processes and threads, understanding I/O-bound versus CPU-bound operations, and finding the optimal balance of parallel tasks to maximize resource utilization without system degradation.
Using Threads to Improve Performance
Using Threads to Improve Performance
This document demonstrates practical implementation of threading and multiprocessing in Python to optimize image processing performance. It walks through converting a sequential thumbnail generation script to use ThreadPoolExecutor and ProcessPoolExecutor, comparing their performance characteristics and explaining the differences caused by Python's Global Interpreter Lock.
Profiling and Optimizing Slow Scripts
Profiling and Optimizing Slow Scripts
This document demonstrates practical profiling and optimization techniques using a real-world email reminder script. It covers measuring execution time with the time command, using pprofile and kcachegrind for performance analysis, identifying expensive operations in loops, and optimizing code by replacing repeated file operations with dictionary-based caching.
Keeping Local Results and Caching
Keeping Local Results and Caching
This document explores caching strategies for performance optimization including when to create caches, managing cache freshness, validation techniques, appropriate cache lifetimes, and implementing simple to complex caching patterns to avoid expensive repeated operations.