Day 21 – Dam Mega Christmas

Source file: Le Grand PortageDerivative work: Rehman, CC BY 2.0 https://creativecommons.org/licenses/by/2.0, via Wikimedia Commons

[Edited by author]

Scientists have also discovered that so-called megastructures built by humans can also affect the Earth’s rotation. Take the 185m (about 600 feet) tall Three Gorges Dam. Spanning the Yangtze River in Hubei province, Central China, it is the largest dam in the world and is over 2,300m (7,500 feet) in length.

Its vital statistics are dizzying. It was made using 28 million cubic metres of concrete and enough steel to build 63 copies of the Eiffel Tower. It took 40,000 people 17 years to construct, at a total cost of $37 billion (£28 billion). The dam can hold 40 billion cubic metres of water – about 16 million Olympic-sized swimming pools.

Dam, thought Rudolph (for he was prone to silent cursing). He was worried that this may confuse Santa’s SaNtav (ed – that’s a stretch!).

He decided to flex his Raku skills there and then and to check this nonsense once and for all. Luckily with his friends Anton and Ab5stract, he had the full power of the IntelliJ JetBrains Raku Plugin (the plugin formerly known as Comma) and Jupyter::Chatbook and could fire up a Jupyter Raku notebook in a jiffy.

IntelliJ Jetbrains Comma Raku Plugin

He loved it when his hooves hit the keyboard and he was able to get all that cool IDE shit:

  • Jupyter Raku kernel alongside Python
  • Raku Syntax highlighting in notebook cells
  • Latex and all manner of Jupyter cell magics
  • Out of this world LLM cell magic

But Rudi wanted even more power – he wanted to calculate some awesome numbers and needed a tool to keep him straight in his Physics.

Physics::Measure

Wait, right there in a notebook he could use the raku Physics::Measure module…

zef Physics::Measure did the trick.

And here’s how it went…

sorry about the images and the spill to the right margin for legibility here – please go here to copy and paste into your own notebook … meantime it may help to embiggen your browser view

Dam Close Call

Phew thought Rudolph – if I can just dial in the differential of 1.45µsec to the SaNtav (groan!). But, then he noticed that his hooves were too big to dial in the new numbers…

~librasteve

with inspiration from here.

PS. the full text, docker instances, installation instructions and example code is here if you want to emulate Rudolph – https://github.com/librasteve/raku-Physics-Measure-Jupyter

PPS. As a stretch goal, a mince pie to the first comment below that shows how to make a custom Physics::Measure unit called the mega-pool.

2 thoughts on “Day 21 – Dam Mega Christmas

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.