Limit the Rate of SCP

I was using scp to upload some files (as you should!) and maxing out my connection while doing it. It made using ssh problematic! Fortunately there’s an easy switch to use to limit the rate:

scp -l 1024 /file1 user@host:/file2

The -l switch limits scp to the specified upload rate in kilobits per second. Handy!

Nostalgia is Playing Wipeout 2097 Again

Let me paint a picture for you. It’s 1996. Clinton is in power in the US and can do no wrong, while on this side of the pond John Major’s grip on power is weakening. One bright grey afternoon at my sister and brother-in-law’s flat my sister pointed out a new device on the floor of their living room. “Do you see what we’ve got?”. Not being familiar with the device in question, I asked “A Nintendo 64?”. The reply came smugly: “No… a PlayStation.”. Ace! I’d heard of that! It was supposed to be really cool. “Can I see?”.

So in due course Wipeout 2097 was loaded (I should say wipE’out” 2097, or Wipeout XL for our American friends) and I gazed in awe at the marvellous 3d graphics and smooth gameplay. Soon enough I was playing it myself, even more in awe of the power of this new machine.

So I took a trip down memory lane today and relived my first PSX moment. Despite being very rusty I breezed through the first four levels, but on the final two my lack of practice started to show:

It’s still a really good game, in my opinion. And while the music wouldn’t be my first choice for a lazy Sunday afternoon, it definitely complements the game.

Project Euler Problem 11

Just a hint, so you don’t go down the wrong path. You probably won’t, but if you don’t want any hints, stop reading this article!

PS If you don’t know what Project Euler is, I recommend having a look at their website, or just getting an idea from the problems themselves.

What is Project Euler?

Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.

Now problem / puzzle 11:

In the 2020 grid below, four numbers along a diagonal line have been marked in red.

(snip)

The product of these numbers is 26 63 78 14 = 1788696.

What is the greatest product of four adjacent numbers in any direction (up, down, left, right, or diagonally) in the 2020 grid?

Just a hint for those of you who spent too long on this like me: it’s essentially a word search. One of these but with numbers.

You see, when I got the wrong answer a couple times I reread the question, and figure “adjacent” just meant anywhere beside each other – eg a square of four numbers, a t-shape. This is not the case! You don’t need to develop a path-finding bot that navigates 4 numbers, looking for the best options! Although, having done that, it’s actually quite fun! In python, at least, it’s quite concise and the code is pretty-looking.

Bonus points (or a packet of chocolate-coated raisins) to the first person who does implement such an algorithm. The answer I’m looking for is the highest product of the resulting 4 numbers, and leave it in the comments.

Bet I won’t get an answer!