The Baffled Architect

    • GitHub
    • LinkedIn
  • Triangular numbers (Euler 11)

    What’s a triangular number? It is the sequence found by summing all the natural numbers, for example the third number is $1+2+3=6$. Interestingly, it counts objects arranged as a triangle. This also has closed form $T_n=\sum_{i=1}^{n}i=\frac{n(n+1)}{2}$. I started with a brute force approach – iterate through the triangular numbers and test if the number of divisors

    Read more…

    12/6/2022 10:29 PM

    /

    Euler, Maths

    /

    Maths
  • Python’s with statement

    Managing resources usually involves three steps – allocating, using, and releasing. You’re familiar with the try… finally pattern but Python also provides context managers.

    Read more…

    9/6/2022 9:36 PM

    /

    Coding, Python, Snippet

    /

    Coding
  • Disable all WordPress Plugins

    Check error logs to find which plugin is crashing the site, then check the site’s wp-config.php file to identify the database name and prefix. Using phpMyAdmin or similar, assuming “wp” is the prefix, locate wp_options table and edit the active_plugins row. The data starts a:X where X is the number of active plugins. Change the

    Read more…

    9/6/2022 3:59 PM

    /

    Back end, Support, WordPress

    /

    WordPress
←Newer Posts


Copyright Dougie Richardson, 2023