Posts

Showing posts from October, 2020

Finite State Machine Wizard

Image
    Here's my free to use, no attribute required FSM Wizard .  This one generates C++ code.  I'm not a fan of C++ but it happens to be the language I'm using at the moment.  However, it can easily be ported to other languages if desired. The FSM Wizard works like this 1. Write a CSV file with format initialState,Event,NewState,ActionFn,OptionalComment .  The code includes an example called MyFsm.csv RedGateLow,TrainPassed,RedGateLow,CheckLine, RedGateLow,LineClear,RedGateLow,RaiseGate, RedGateLow,GateRaised,Green,SetGreen, Green,TrainDetected,Yellow,StartTimerYellowRed Yellow,TimerExpired,RedGateHigh,StartTimerRedGate RedGateHigh,TimerExpired,RedGateHigh,LowerGate RedGateHigh,GateLowered,RedGateLow,  2. Run the wizard: ./fsmGen.py MyFsm.csv   3. View the output PNG file and optionally edit the autogenerated C++ files

Can population control solve the climate crisis?

Image
Yes and no. According to the IPCC, if we continue to emit as we do now, we have 10 years worth of carbon budget remaining before we reach a dangerous 1.5$^\circ$C of warming.  We can avoid exceeding this budget by  halving our emissions between now and 2030, and then bringing them to zero by 2040. Let's imagine an incredibly successful population control strategy, based on family planning, that results in zero births this decade.  By how much would the world's population fall?  According to Wikipedia the average life expectancy globally is about 72 , so let's assume that anyone over the age of 62 would shuffle off this mortal coil by 2030.  According to the UN there were 962 million people over the age of 60 in 2017 , so there's at most that many over the age of 62 now.  Oh dear that means that the population would only fall by $100\times\frac{0.962}{7.8}$ or 12%, but we'd need it to fall by 50% if it was our main strategy in reducing emissions. So, population contr

Christmas Cracker Magic Trick

Image
 When I was a kid I pulled a Christmas Cracker and 6 cards with numbers fell out: It's a mind reading magic trick.  Have a go against my virtual assistant, and see if you can work out how it's done: