Tag: React

  • CLI Corner: rsync

    Synchronise two directories, e.g. Nextcloud and an encrypted USB drive with archive, recursive, partial, and progress flags:


  • Gogh

    Check out these awesome terminal themes at http://gogh-co.github.io/Gogh/


  • Excel – is it a working day?

    Need to know if a date is a working day? Excel has a WORKDAY function which takes a date, adds to it, and tells you the next working day. What about if a specific day is a working day? Assuming the date is in A1:


  • Rainbows, decorators arguments & threads

    Playing with Rainbow Hat I learned a few things about Python as a result I found out what a decorator is, the difference between args and kwargs and threads. I also learned that a lot of guides don’t understand either. If you can’t explain it simply, you don’t understand it well enough1. Decorators Rainbow Hat…


  • Python List Comprehension

    I’ve been spending time with Python recently and am beginning to really like some of the language’s features. List comprehension creates a list by evaluating an expression on each item in each list, from left to right. It combines an expression and a loop: Apply a condition : It’s useful for combining lists: Pimoroni’s Rainbow Hat…


  • Using Threading rather than Thread

    In an earlier post, I used Threads but the thread module in Python when I should be using threading. The documentation for threading says it builds upon the thread module (renamed _thread): This module provides low-level primitives for working with multiple threads (also called light-weight processes or tasks) — multiple threads of control sharing their global data…


  • 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…


  • 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.