惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Cloudflare Blog
U
Unit 42
F
Fortinet All Blogs
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
月光博客
月光博客
Y
Y Combinator Blog
罗磊的独立博客
V
Visual Studio Blog
大猫的无限游戏
大猫的无限游戏
J
Java Code Geeks
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
爱范儿
爱范儿
B
Blog RSS Feed
aimingoo的专栏
aimingoo的专栏
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
I
InfoQ
博客园 - 叶小钗
博客园 - 聂微东
Last Week in AI
Last Week in AI

Stonecharioteer on Tech

I Traced My Traffic Through a Home Tailscale Exit Node What Was I Reading Last? In Three Not-So-Easy Pieces Dogfooding Is Hard Code blocks in your books, finally GoForGo v0.9.0 Merrilin - We built an app to read books I use a Macbook now Data Structures & Algorithms - Preparing for Interviews Using a local DNS namespace for local service discovery Direction KOllector - Publishing KOReader Highlights gbt: branches touched in the last 24 hours A Soiree into Symbols in Ruby Some Smalltalk about Ruby Loops Ruby Blocks Returning from Ruby Blocks, Procs and Lambdas My Linux Laptop Finally Works: How Claude Helped Me Fix Years of Annoyances TIL: Watchexec - Modern File Watching for Development Workflows A Less Busy Mind GoForGo - Learn Go through live examples Migrating My Old Blog to Hugo with Claude The Qtile Window Manager: A Python-Powered Tiling Experience Read the RFCs that Built the Internet Py-x-Protobuf - Or How I Learned to Stop Worrying and Love Protocol Buffers Python Reverse a List New Beginnings Leaving ChainSafe Systems Screen Lock for Cinnamon Desktop using Zenity and Terminal Commands Crews Not Teams A System for Getting Better at LeetCode
TIL: Debugging CSS Techniques, LLVM Architecture, Python ...
2020-12-14 · via Stonecharioteer on Tech

Today’s learning covered frontend debugging, compiler architecture, Python internals, and Unix shell fundamentals.

Systematic CSS Debugging

Debugging CSS provides a structured approach to solving CSS layout and styling issues. Key debugging strategies include:

Visual Debugging Techniques:

  • Using border outlines to visualize element boundaries
  • Applying background colors to understand element hierarchy
  • Using CSS Grid and Flexbox debugging tools in browser dev tools
  • Isolating problems by temporarily removing complex styles

Common CSS Issues:

  • Specificity conflicts: Understanding CSS selector precedence
  • Box model problems: Margin collapse and unexpected sizing
  • Positioning issues: Absolute vs relative positioning gotchas
  • Z-index stacking: Managing layer order in complex layouts

LLVM Compiler Architecture

The Architecture of Open Source Applications: LLVM provides deep insights into one of the most important compiler infrastructures. LLVM’s design principles include:

Modular Design:

  • Frontend: Language-specific parsers (Clang for C++, Swift frontend)
  • Optimizer: Language-agnostic intermediate representation (IR) optimizations
  • Backend: Target-specific code generation for different architectures

Key Innovations:

  • SSA Form: Static Single Assignment for efficient optimization
  • Pass Manager: Composable optimization passes
  • Just-In-Time Compilation: Runtime code generation and optimization
  • Retargetable: Support for multiple source languages and target architectures

The Python Language Reference is the authoritative specification for Python syntax and semantics. Unlike tutorials, this reference covers:

Language Fundamentals:

  • Lexical analysis: How Python tokenizes source code
  • Data model: Object protocols and special methods (__add__, __iter__, etc.)
  • Execution model: Name binding, scopes, and the import system
  • Grammar specification: Complete EBNF grammar for Python syntax

Advanced Topics:

  • Descriptor protocol: How properties and methods work internally
  • Metaclasses: Classes that create classes
  • Coroutines and async/await: Asynchronous programming primitives
  • Context managers: The with statement protocol

Shell Sourcing vs Execution

The difference between sourcing and executing explains a fundamental Unix concept:

Sourcing (. script.sh or source script.sh):

1
2
3
4
# Executes commands in the current shell environment
# Variables and functions become available in current session
source ~/.bashrc  # Updates current shell with new aliases
. ./config.sh     # Loads configuration into current environment

Executing (./script.sh):

1
2
3
4
# Runs script in a new subprocess
# Changes don't affect parent shell
./deployment.sh   # Runs deployment in isolated environment
bash script.sh    # Explicit subprocess execution

Practical Implications:

  • Environment setup: Use sourcing for configuration files
  • Isolated operations: Use execution for scripts that shouldn’t affect current environment
  • Debugging: Sourcing allows inspection of variables after script completion
  • Security: Execution provides isolation from potentially harmful scripts

These concepts form essential knowledge for web development debugging, understanding compiler design, mastering Python’s advanced features, and effective shell scripting.