Skip to content

Instantly share code, notes, and snippets.

View bnjns's full-sized avatar

Ben Jones bnjns

  • UK
View GitHub Profile

Text Statistics Tool

You are given the following text:

lorem ipsum dolor sit amet consectetur lorem ipsum et mihi quoniam et adipiscing elit.sed quoniam et advesperascit et mihi ad villam revertendum est nunc quidem hactenus ex rebus enim timiditas non ex vocabulis nascitur.nummus in croesi divitiis obscuratur pars est tamen divitiarum.nam quibus rebus efficiuntur voluptates eae non sunt in potestate sapientis.hoc mihi cum tuo fratre convenit.qui ita affectus beatum esse numquam probabis duo reges constructio interrete.de hominibus dici non necesse est.eam si varietatem diceres intellegerem ut etiam non dicente te intellego parvi enim primo ortu sic iacent tamquam omnino sine animo sint.ea possunt paria non esse.quamquam tu hanc copiosiorem etiam soles dicere.de quibus cupio scire quid sentias.universa enim illorum ratione cum tota vestra confligendum puto.ut nemo dubitet eorum omnia officia quo spectare quid sequi quid fugere debeant nunc vero a primo quidem mirabiliter occulta natura est nec perspici

Telemetry Tool

We want to create a minimum viable application that can receive telemetry of the current National Grid frequency, and send alerts to IoT devices if the frequency is becoming unstable. We also need to be able to query the application to get the average frequency over the last x readings.

We don’t know how the telemetry will be sent to us yet (e.g. it could be REST, it could be from a Kafka topic etc), and we don’t have any devices to dispatch alerts to either, so we just need to build the core of the application. However, it should be built in an extensible way, so we can easily improve it later. We’re looking for well structured and well tested code, but actually delivering a working product is the most important thing.

The application should be as follows:

  • A method to receive frequency telemetry, which will be a single floating point number (e.g. 50.1). If the current frequency and the previous frequency are either both above or both below 50, this signifies instability and would tr

Text Statistics Tool

🧐 Background

You are given the following text:

lorem ipsum dolor sit amet consectetur lorem ipsum et mihi quoniam et adipiscing elit.sed quoniam et advesperascit et mihi ad villam revertendum est nunc quidem hactenus ex rebus enim timiditas non ex vocabulis nascitur.nummus in croesi divitiis obscuratur pars est tamen divitiarum.nam quibus rebus efficiuntur voluptates eae non sunt in potestate sapientis.hoc mihi cum tuo fratre convenit.qui ita affectus beatum esse numquam probabis duo reges constructio interrete.de hominibus dici non necesse est.eam si varietatem diceres intellegerem ut etiam non dicente te intellego parvi enim primo ortu sic iacent tamquam omnino sine animo sint.ea possunt paria non esse.quamquam tu hanc copiosiorem etiam soles dicere.de quibus cupio scire quid sentias.universa enim illorum ratione cum tota vestra confligendum puto.ut nemo dubitet eorum omnia officia quo spectare quid sequi quid fugere debeant nunc vero a primo quidem mirabiliter occulta natura