Algorithms

Possibly one of the coolest and simplest algorithms of all time. An easy way to find the greatest common divisor (GCD) of two numbers. This algorithm was discovered/created by Euclid and presented as a proposition in his Elements book.

5 REM Euclid's algorithm for greatest common divisor
  6 PRINT "Type two integers greater than 0"
  10 INPUT A,B
  20 IF B=0 THEN GOTO 80
  30 IF A > B THEN GOTO 60
  40 LET B=B-A
  50 GOTO 20
  60 LET A=A-B
  70 GOTO 20
  80 PRINT A
  90 END
Published
Categorized as Coding

Looking up

Amazingly enough my losses on the stocks have dropped from $7 to just $4. In fact:

In other news, I have another bet going on on a horse, following a hot tip. I’ve got £1 each way on Brilliant Light at Meydan 16.15.

Update: It came in! My £2.00 bet resulted in a return of £2.50. I can’t retire just yet.

Published
Categorized as Finance

Brewing

Another ‘lockdown hobby’ I thought would be fun to start off – home brewing! Getting barrels and bottles and casks and kits and yeast and sugar and steraliser and syphons and hydrometers and CO2 and secondary tablets and everything else is such a faff though.

So I’ve ordered a Pinter. This is a new device – an all-in-one brew keg and beer conditioner. The concept is quite simple: add your fresh press (fruity stuff and malt) plus a load of water and a dose of the yeast (comes as part of the kit) into the plastic cask; attach to a special docking stationb; leave for 7 days or so.

Then, remove the cask from the docking station. All the dead yeast crap will have sunk to the bottom, out of the cask, and into the docking station. Condition the brew in the fridge for a few days and then tap directly for 10 pints of intersting craft beer. It’s from here:

https://thegreatergood.co.uk/

I also added an add-on keg so I am able to brew one batch while conditioning the next. One in yellow, one in black. I ordered it on Sunday 14 Feb and it says t should take 10-15 working days to arrive, som hopefully I can provide an update on or before 7 March.

On top of this, I’m getting itchy about waiting so I’ve also ordered a gadget to go with it. This is an iSpindel – a digital hydrometer that measures specific gravity by its tilt. Just bung it in the keg at the start and monitor via wifi and phone. Hopefully it’ll integrate with IFTTT so I can auto-publish progress:

https://www.assetsolution.co.uk/

Published
Categorized as Edibles

Inventing greenhouse clips

Playing with 3d modelling and printing. This is the latest version of a greenhouse clip we invented. You twist it into the aluminium frame and then have a convenient eyelet for tying string to.

WP 3D Thingviewer need Javascript to work.
Please activate and reload the page.

This is at least the third iteration of this invention. The first one had a couple of springy ‘levers’ on the shoulders to pull agains the inside of the aluminum ‘gutter’ and hold the device firm against the outer side. UNfortunately the springs were not reliable, broke off, impossible to get tension right, and too detailed to print.

So back to basics – it transpired that all we needed to do was to slope the shoulders in the extra dimension so that twisting it into the groove automatically pulls the clip agains the metal. Job done. Easy to print too.

The only improvement to make is to work out the best type of filament to print this with. PLA as in the prototype has a habit of breaking down over time when exposed to sunlight so not really ideal for greenhouse use.

Published
Categorized as 3d

Fun for meetings

I read the other day of somebody who had cunningly put a large QR code on their background when attending Zoom/Teams meetings as we all need to do nowadays. When this code was scanned by anyone in the meeting then it made the lights in their office turn on or off.

There’s something that I immediately needed to do. So I did. I already have a Philips Hue bulb installed in my office so things were relatively straightforward but nevertheless it took some doing:

  • Had to install new Philips Hue hub. We’ve been running with version 1 for years but the lates software and app only work with the newer model. Fortunately I had one of these ready to install as I hadn’t got aroud to doing it yet.
  • Link Philips Hue account with IFTTT account
  • Create a Maker Webhooks trigger that triggers an event when a URL is POSTed or GETted.
  • The trigger triggers a toggle event on IFTTT on the hue bulb in the office
  • Created a QR code pointing to the wekhook URL. Printed out the code and stuck to the wall behind me.
Turn light on and off

Then I decided to do the same for Claire. She hasn’t got a Hue bulb in her ceiling spotlights so instead I added a spare Teckin smart socket to her floor lamp. This was more complicated as I had to set up an event via the IFTTT app on phone, connected to the Smart Life app. But it seems to work.

Claire’s light
Published
Categorized as Hardware

Photon drives ePaper

One thing I’ve wanted to do for ages now is to use a Particle Photon board to place information onto an ePaper electronic ink display.

The problem has been that it is impossible to find code libraries for any specific ePaper device you might own. I bought the one below at reasonable cost and thus far have only managed to drive one third of the display. I’ll keep at it.

Garam Masala

Having bought the amazing Dishoom cookery book I started making long-game* Indian food.

Virtually every dish requires this amazing garam masala spice combination, which is nothing like you buy ready made in the shops. Ingredients are:

  • 1 black cardamom pod
  • 4 cloves
  • 5g black peppercorns
  • 2 large cinnamon sticks
  • 10g coriander seeds
  • 5g cumin seeds
  • 4g fennel seeds
  • 2g star anise
  • 1 bay leaf
  • 2g mace blades
  • 1g poppy seeds
  • 2g dried rose petals

Put the lot on a baking trak in the oven at 50 degrees Centigrade for 2 and a half hours. Grind to a powder.

* items that take many hours if not days to cook from start to finish. Very satisfying.

Published
Categorized as Edibles

Addendum

I should have said right at the start – I will also use this to post posts about previous things I have learned or tried to learn!

Update on the trading: Now down $6.4. This isn’t going well.

Published
Categorized as Admin

Speculating to accumulate

Apart from investing a bit of cash with the Nat West online investments easy-to-use thing I’ve never played around with the stock exchange. So today I changed that.

I’ve invested £145 ($200) using the app ‘eTorro’, mainly because I fancied seeing what cryptocurrencies actually do. Thus far it’s been a wild ride. I bought $25 of shares in BitCoin (BTC), and $25 of shares in ZCash (ZEC). Then I pressed the wrong button and accidentally bought $50 of shares in Apple.

This was half an hour ago. So far I seem to have lost $1.37. Updates to follow as I learn more about the share trading ability.

Spot where I bought my bitcoin 🙁

Published
Categorized as Finance

Gambling

I’ve placed one or two small bets in the past but never had the understanding or confidence to continue. Or interest in learning for that matter. A couple of notable instances spring to mind:

  • Going to York Races with a friend. Placing £5 bets on each of the six races as each was run, and losing on every one, except for the last, which returned enough money to make up my losses, pay for the entry fee to the races, pay for all the drinks I had had, and still walk away with a profit. Purely random luck.
  • Placing a bet online on the outcome of the 2016 Brexit Referendum. I was convinced we would all sensibly vote to remain and had an email fro a well-known betting company to offer good odds if I wanted to make a bet. So I thought that would be amusing. I opened an account, placed £10 on us remaining, forgot about it and went to bed. In the morning I woke to the strangest story that we had a majority for ‘leave’. I checked on my betting account and it turned out that I had pressed the wrong button and accidentally put my £10 on leave instead of remain. I got £60 back. Every cloud etc…

Anyway, this weekend another friend of mine gave me a tip on a horse in a Newmarket race at 15:35. I thought that this would be a good opportunity to learn how to do this sort of stuff so I opens an account with William Hill and deposited a fiver, and placed £2 of it on the tip. It came in and I won £15.

Looking into it further it seems I am able to place bets on the outcome of eSports, virtual races, TV shows an politics, as well as all the boring stuff around football, racing and other sports. I could get into this. Will report back in due course.

Published
Categorized as Finance