Skip to content

Category: english

1) everything that’s already in the world when you’re born is just normal;

2) anything that gets invented between then and before you turn thirty is incredibly exciting and creative and with any luck you can make a career out of it;

3) anything that gets invented after you’re thirty is against the natural order of things and the beginning of the end of civilisation as we know it until it’s been around for about ten years when it gradually turns out to be alright really.

Apply this list to movies, rock music, word processors and mobile phones to work out how old you are.

by Douglas Adams in “How to Stop Worrying and Learn to Love the Internet”, August 29th 1999.

Chess Puzzles

https://lichess.org/training/qkjAy

https://lichess.org/training/aTolD

https://lichess.org/training/yzAtI

Lego Powered UP fibonacci

Version 1. Stores fibonacci(n) and fibonacci(n+1) in the variables a and b up to n=10. Waits 1 second between each iteration for visibility.

Pseudocode:

a = 0
b = 1
for (10) {
  wait(1)
  b = a + b
  a = b - a
}

Version 2. Blinks a powered up hub (88009 or any other). The led blinks the number of times of fibonacci(n) sequence.

Pseudocode:

a = 0
b = 1
light(RED)
for (10) {
  wait(1)
  b = a + b
  a = b - a
  c = b
  while (c!=0) {
    light(GREEN)
    wait(0.5)
    light(RED)
    c = c - 1
  }
}

It may look like a wait is needed at the second red light but in practice each block takes a little delay to execute.

flatten directory structure

Move files in current subdirectories to the current directory.

find . -mindepth 2 -type f -exec mv -t . -i '{}' +

Delete local folders that are empty.

 find . -empty -type d -delete