About the Author
Lou Mauget

Lou Mauget

Known as Ed Mauget in civilian life. Lou is a name imposed by IBM in 1966. Newly infatuated with Microservices Architecture. In 2015 I coded MockOla, a wire-framing tool for Keyhole Software. Have coded in Java since it was conceived. Also worked with C/C++. Current interests include microservices, Docker, Node JS, NoSQL databases, functional programming, single-page web applications ... any new software languages/frameworks.

Dynamic Unit Conversions in Math.js

Using Math.js for Dynamic Unit Conversions

Lou Mauget Development Technologies, JavaScript Leave a Comment

In this post, I’ll survey a convenient JavaScript math.js library approach for converting a numeric value having a unit to a value for another unit. I’ll show how to convert a number associated with a unit to a value having another unit, add custom units and conversions, and evaluate textual expressions containing values with units. To wrap up, we’ll walk through a few practical use cases.

By the end of this post, I hope you are inspired to use math.js in your projects. It’s a powerful tool in the right scenarios. With that, let’s get started.

3D Geospatial Rendering with Cesium

CesiumJS 3D Geospatial Rendering

Lou Mauget Development Technologies, JavaScript, Programming, Tutorial Leave a Comment

This blog is a brief overview of CesiumJS, a cool JavaScript client library for visualizing a geospatial Earth map, including artifacts (both real and generated). They eat their own dog food, so their homepage has a declaratively-rendered spinning globe by Cesium.

CesiumJS has a higher-level Entity API as well as a lower-level Primitive API. The API doc can be found here. I’ll point out a couple of interactive source examples that use the entity API; most Cesium apps use it. Cesium also provides open specification 3D Tiles to load, render, and cache on-demand terrain features, artifacts, and building renditions for surface viewing.

There is no IDE or download needed to interact with the material mentioned in this overview. You can interact with the material mentioned with your browser.

better sort in JavaScript

Better Sort Ordering in JavaScript

Lou Mauget Development Technologies, JavaScript, Programming, Tutorial Leave a Comment

In this post, I show how to cajole Array.sort() into producing the following order. This: [Item 1, Item 2, Item 100] instead of this…[Item 1, Item 100, Item 2].

The answer is to pass the sort function a comparator argument from the International Collator built into every major browser and Node.js. This approach is simple and declarative for lists of flat strings. The comparison function arguments default to each string being compared. For sorting objects such as a list of dropdown choices, just pass a pair of the sort field drill-downs to the comparison function.

Cancel a React Modal with Escape Key or External Click

Lou Mauget Development Technologies, React, Tutorial Leave a Comment

Web application users are accustomed to canceling a popup (aka dialog or modal) by pressing the escape key, and many modals can even cancel if the user clicks outside it. How does a React developer code that without a plumbing mess between the modal and every visible component beneath it? How do you cancel a React modal with an escape key or external click?

I’m glad you asked because I have an answer. In this blog, I’ll show a pair of easy-to-use custom React hooks that simplify the task.

Kubernetes on Raspberry Pi

Kubernetes on Raspberry Pi

Lou Mauget Cloud, Development Technologies, Kubernetes, Tutorial 3 Comments

Kubernetes, or k8s, is an important container orchestration platform. In this blog, I’ll describe creating a workable Kubernetes cluster implemented on a stack of four Raspberry Pi boards. In the end, I’ll have provided an outline of how I created it and I’ll show how to replicate a stateless app across Kubernetes pods running on the nodes — the Pi boards.