# Saturday, December 19, 2020

The Founding Fathers of the United States hold a special place in my country's history. Centuries after they lived, people still speak with reverence of men like Benjamin Franklin, Thomas Jefferson, James Madison, and Alexander Hamilton. Yet one man of this era stands above even these giants. George Washington cemented his place in history by leading the American army that defeated the British in the Revolution War; then, serving as the first President of the United States.

Ron Chernow's biography Washington: A Life details the General/President's rise and how handled the power he was given.

Washington was born into an upper-middle class family; but rose to become one of the landed gentry by a series of fortuitous events: his widowed mother married a wealthy farmer and George inherited the large estate at Mount Vernon by outliving all other possible heirs; then, George married wealthy widow Martha Custis.

When the American Revolution began, Washington led a poorly-equipped, ill-trained army to victory over one of the great powers in the world. He did so despite infighting among his officers and the young country's lawmakers.

After the war, Washington was the most popular man in America and the logical choice to serve as its first leader. He won the Presidency unanimously and served two terms despite his desire to return to his Virginia estate and manage the farms there.

In his first term, George Washington attempted to unite the factions of the young country - surrounding himself with people of varying opinions. His cabinet and advisors included Northerners and southerners; slaveholders and abolitionists; those who favored a centralized government and those suspicious of concentrated power. Fierce debates arose as to whether the US should align itself more closely with England or France - two countries at war with one another. By his second term, Washington had tired of the infighting among his advisors and those that criticized him publicly. Quarrels between Jefferson, Adams, Hamilton, and Madison left him weary and disillusioned, so he retained a more homogeneous cabinet for his final four years in office.

As with Chernow's earlier biography of Alexander Hamilton, "Washington: A Life" goes beyond the historical facts and gives the reader a taste for Washington's character and personality. Washington was arrogant, stoic, and aloof; he was not given to long speeches, but he was eloquent in his writing; he rejected the idea of a British-style monarchy for America and was hurt that some thought he had ambitions of becoming king; he desperately wanted to leave public life and return to managing Mount Vernon (during the War, he corresponded frequently with the managers of his estate); he was unwavering in his honesty and integrity; he was highly conscious of his public image; he enjoyed the luxuries that came with wealth; he had a difficult relationship with his overly-demanding mother.

In this book, we see a complex man, who held together a nation during arguably its most vulnerable time. Few people had the universal respect to pull off this miracle.

Washington had a strong sense of duty that drove him to server in public office, despite his cash flow problems, which could have been better addressed by staying home and managing his estate. Ultimately, he was the unifying force that the young republic needed. His actions strengthened the central government and the country and defined the office of presidency.

But Washington had his faults.

As a general, he was not a great strategist - he lost more battles than he won - but held together a ragtag, underfunded army for years until the British forces committed a blunder he could exploit.

The most controversial aspect of Washington's life is his status as a slave owner. : or note that he appeared to treat his slaves better than his peers (Washington forbade beatings and refused to separate families).

Arguably the most conflicted aspect Washington was his dealings with slavery and Chernow covers this topic considerably. Washington and his wife owned hundreds of slaves and made almost no public effort to promote abolition. Yet he spoke privately of his desire to end slavery and thought the practice would eventually die out on its own. He showed less cruelty to his slaves than most other Virginia farmers, establishing rules against physical beatings and separating families; but he sometimes broke these rules when he felt it was necessary. One can take into account that nearly every wealthy Virginia landowner owned slaves and one can note that he freed his slaves in his will. But he remained publicly silent on the political hot topic, despite being in a position of great influence. Washington's position on slavery evolved throughout his lifetime, but he seems to have never fully grasped the inhumanity and cruelty inherent in one human being owning another

These are the kinds of things that Chernow presents to the reader to show the humanity and complexity of or first President. He praises Washington's achievements, while stripping away his legendary status, showing him as a great, but flawed human, not a demi-god or saint

If you are looking for a comprehensive biography of one of the most influential men in American history - a book that covers his entire life, this one is for you.

Saturday, December 19, 2020 5:08:28 PM (GMT Standard Time, UTC+00:00)
# Monday, December 14, 2020

Episode 639

Kyle Bunting and Joel Hulen on Data Engineering in Azure

Kyle Bunting and Joel Hulen of Solliance describe Data Engineering and some of tools, such as Azure Synapse Analytics, that allow you to perform Data Engineering at scale in the cloud.

Links:

https://www.solliance.net/

Monday, December 14, 2020 10:15:00 AM (GMT Standard Time, UTC+00:00)
# Sunday, December 13, 2020

The galactic Emperor had a hidden agenda when he ordered House Atreides to move to the Arrakis, replacing House Harkonnen as the planet's ruling family. Arrakis is a desolate wasteland covered almost entirely in desert, earning it the nickname "Dune"; but Arrakis is the only source of the spice melange - the most valuable substance in the universe.

Duke Leto Atreides's teenage son Paul is beginning to manifest mystical powers that will aid him in the coming battles and betrayals and in his fight for survival on a hostile planet.

Frank Herbert's classic novel Dune is the most complex science fiction novel I have read. In addition to an adventure story and a coming-of-age novel, the book includes insights into politics, sociology, ecology, economics, religion, philosophy, and language. Nearly every dialogue is layered with multiple meanings and nearly every action is a potential betrayal.

Herbert does an amazing job building the world of Arrakis and its people.

Among the creations of the book are:

-Sand Worms - giant tubular creatures that live beneath the surface of the desert sand, as sea dragons might swim in the ocean, breaching the surface from time to time to wreak havoc on protection of the spice.

  • The Bene Gesserit - a cultlike group with impressive mental powers, who strive to produce a superhuman via their secret breeding program.
  • The Fremen - a mysterious nomadic race that live in the deserts of Dune and have a special relationship with the sand worms.
  • Mentats - humans with the ability to think like computers

Although Dune is set centuries in the future, technology has not advanced at the rate one would expect. Advancements have been stunted by humanity's distrust of artificial intelligence and a war fought centuries earlier. Things like interplanetary travel have been made possible by the powers of the Bene Gesserit and the Mentats and the mind-expanding abilities of melange.

The local water scarcity, the global spice monopoly, and the struggle for control between powerful factions serve as a metaphor for similar constrained resources and conflicts on the Earth of today and the effect on global politics. The vast sand oceans and the Fremen people are not far removed from the 20th and 21st century Middle East.

Through it all is Paul - son of a Duke and gifted with great powers that lead others to perceive him as a Messiah. How he uses those powers defines him and defines the power structure of the galaxy.

This was my third reading of this novel, which I first discovered in my late 20s. After all these years, it still holds my interest.

Sunday, December 13, 2020 7:40:54 PM (GMT Standard Time, UTC+00:00)
# Monday, December 7, 2020

Episode 638

Emily Cooper on the ISTI STEM Challenge

The Illinois Science & Technology Institute (ISTI) organizes a STEM Challenge that allows high school students to work on real-world problems with industry mentors.

Emily Cooper talks about this program, its goals, and the organization.

Monday, December 7, 2020 9:58:00 AM (GMT Standard Time, UTC+00:00)
# Sunday, December 6, 2020

12/6
Today I am grateful for a warm home on cold days.

12/5
Today I am grateful to my building's maintenance staff which fixed a bunch of things in my condo yesterday.

12/4
Today I am grateful for a visit from my son Nick.

12/3
Today I am grateful for online shopping

12/2
Today I am grateful for my son's new job.

12/1
Today I am grateful for new tires on my car.

11/30
Today I am grateful to get my bicycle's gears repaired.

11/29
Today I am grateful for a Spartan trifecta yesterday: Michigan State victories in football, basketball, and ice hockey!

11/28
Today I am grateful to those who express appreciation.

11/27
Today I am grateful to celebrate virtual Thanksgiving with family yesterday.

11/26
Today I am grateful to receive phone calls from people I care about.

11/25
Today I am grateful to successfully complete work on a project on which we have been working for months.

11/24
Today I am grateful to awaken to a gently falling snow.

11/23
Today I am grateful for movies and TV on-demand.

11/22
Today I am grateful for unseasonably warm late November Chicago weather.

11/21
Today I am grateful for dinner at The Publican with Tim last night.

11/20
Today I am grateful for my new (to me) Herman Miller Aeron chair.

11/19
Today I am grateful for a negative COVID-19 test.

11/18
Today I am grateful for a hot bath.

11/17
Today I am grateful that American Express quickly replaced my lost card.

11/16
Today I am grateful for my new AirPods.

11/15
Today I am grateful for
-a chance to explore the Natchez Trace yesterday
-an 8-day vacation with visits to Springfield, St. Louis, Memphis, and Nashville.


11/14
Today I am grateful to sit around a bonfire last night with Gaines and Mary.

11/13
Today I am grateful for:
-3 great days in Memphis
-live music last night at Printer's Alley in Nashville
-a bike ride yesterday around Richmond Creek

11/12
Today I am grateful for:
-my first visit to Mississippi
-a visit to the National Civil Rights Museum in Memphis yesterday

11/11
Today I am grateful for a bike ride along the Shelby Farms Greenline Trail in Memphis yesterday.

11/10
Today I am grateful for
-My first-ever visit to Arkansas
-Seeing live music last night on Beale Street
-Meeting Glenn Campbell's son and telling him how much I enjoyed his father's music.

11/9
Today I am grateful for:
-Brunch yesterday with Jeffrey and his family yesterday
-The hospitality and generosity of Kevin and Darlene this weekend.

11/8
Today I am grateful for the millions of Americans who voted against dishonesty, hate, and racism.

11/7
Today I am grateful for my new bike helmet.

11/6
Today I am grateful that John has returned with his puns to save us all.

11/5
Today I am grateful to attend non-work meetings yesterday with my co-workers as part of our annual OneWeek event.

11/4
Today I am grateful to learn a lot about web security yesterday.

11/3
Today I am grateful for the opportunity to vote.

11/2
Today I am grateful for my new bicycle phone mount.

Sunday, December 6, 2020 11:01:20 AM (GMT Standard Time, UTC+00:00)
# Saturday, December 5, 2020

A few years ago, I sat in a cafe in Bergen on the west coast of Norway, sipping a coffee and enjoying a small pastry. It was sweet and satisfying by itself; but I enjoyed it enough to order another; and then, another.

The stories within Neil Gaiman's Norse Mythology are like this. Each story is short and easily consumable (about 10-25 pages) and stands on its own; but together, they weave an epic of the gods of Scandinavia.

We hear the adventures of Odin, Thor, Loki, Balder, and the gods of Asgard, along with the giants, dwarves, creatures, and sentient rocks and plants that inhabit their universe. We hear of shape-shifting and battles, and treachery, and love. We learn about the families of the gods and their births and their deaths.

Gaiman has inserted pagan gods into his books in the past (American Gods and Anansi Boys) and even written entire books around Thor, Loki, and Odin (Odd and the Frost Giants), but those books extended the legends of the deities, while this book pulls from the original source material - the oral stories recounting the adventures of these immortals, from the beginning of the world to Ragnarok - the final battle of the gods.

He does so with a voice that suggests these tales are told around a campfire at night.

Some of these stories were long familiar to me from the reading of my youth and some of them I had not heard. But all seemed fresh as told by Gaiman.

We have always known that Neil Gaiman knows how to tell a story. But with Norse Mythology, he proves that he can tell someone else's story.

Saturday, December 5, 2020 5:00:17 PM (GMT Standard Time, UTC+00:00)
# Wednesday, December 2, 2020

Recently, I have been working with MinIO – a container-based object storage service. I’ve recorded much of what I’ve learned. The links below will get you up to speed if you want to learn about this technology.

Blog Posts

Getting Started with MinIO Server

Creating and using a MinIO Gateway for Azure

Using the MinIO Java SDK

Managing MinIO with the Amazon S3 SDK

Videos

Creating a MinIO Server

Creating a MinIO Agent for Azure Blob Storage

Using the MinIO Java Client SDK

Accessing MinIO with the AWS S3 SDK

Wednesday, December 2, 2020 9:15:00 AM (GMT Standard Time, UTC+00:00)
# Tuesday, December 1, 2020

Intro

In my last article, I showed how to manage buckets and objects in MinIO using the MinIO Java SDK.

However, MinIO has the advantage that one can also access it using the Amazon S3 Java API. This is helpful if you are migrating from S3 (a comparable object store hosted by Amazon Web Services) to MinIO.

The code below assumes that the following values are declared and initialized appropriately:

private String endPoint;  // The MinIO endpoint (e.g., "http://127.0.0.1:9000") 
private String accessKey; // The MinIO Access Key 
private String secretKey; // The MinIO Secret Key 
private String bucketName; // A MinIO bucket in which to store objects (e.g., "mybucket") 
private String localFileFolder; // A local folder on your file system to upload/download files to/from MinIO (e.g., "c:\files\")
  

In order to use the S3 SDK, your app must have a reference to it. In a Maven project, this is done by adding the following to the <dependencies> section of the project's POM.XML:

<dependency>
    <groupId>com.amazonaws</groupId>
    <artifactId>aws-java-sdk-s3</artifactId>
    <version>1.11.858</version>
</dependency>
  

AmazonS3 Object

In your code, the first thing you will need is an AmazonS3 object, which has methods for managing your MinIO objects.

Here is the code for creating this object.

public static AmazonS3 getAmazonS3Client(String accessKey, String secretKey, String endPoint) { 
    ClientConfiguration clientConfig = new ClientConfiguration(); 
    clientConfig.setProtocol(Protocol.HTTP); 
    AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey); 
    AmazonS3 s3client = AmazonS3ClientBuilder 
            .standard() 
            .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endPoint, Regions.US_EAST_1.name())) 
            .withPathStyleAccessEnabled(true) 
            .withClientConfiguration(clientConfig) 
             .withCredentials(new AWSStaticCredentialsProvider(credentials)) 
            .build();

    return s3client; 
}
  

Once you have an AmazonS3 object, you can use it to manage MinIO objects.

Uploading a File

For example, here is code to upload a file to a MinIO bucket:

public void UploadWithS3Client(String fileName) throws IOException { 
     AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint); 
    String fileToUpload = localFileFolder + fileName; 
     try { 
        File file = new File(fileToUpload); 
        PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, fileName, file); 
        s3Client.putObject(putObjectRequest); 
    } catch (AmazonServiceException ase) { 
        System.out.println("Error Message:    " + ase.getMessage());

    } catch (AmazonClientException ace) { 
        System.out.println("Error Message: " + ace.getMessage()); 
    } 
}
  

List Objects

and code to get a list all the objects in a bucket

public List<String> ListS3Objects() { 
     List<String> blobList = new ArrayList<String>(); 
    System.out.format("Objects in S3 bucket %s:\n", bucketName); 
    AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint); 
     ListObjectsV2Result result = s3Client.listObjectsV2(bucketName); 
    List<S3ObjectSummary> blobs = result.getObjectSummaries(); 
    for (S3ObjectSummary blob : blobs) { 
        blobList.add(blob.getKey()); 
        System.out.println("* " + blob.getKey()); 
    } 
    return blobList; 
 }
  

Download a File

and to download one of those objects to your local file system:

public void DownloadFromMinIOWithS3Client(String objectName) { 
    System.out.format("Downloading %s from S3 bucket %s...\n", objectName, bucketName); 
    AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint); 
    try { 
        S3Object o = s3Client.getObject(bucketName, objectName); 
        S3ObjectInputStream s3is = o.getObjectContent(); 
        String downloadedFile = localFileFolder + "D_" + objectName; 
        FileOutputStream fos = new FileOutputStream(new File(downloadedFile)); 
        byte[] read_buf = new byte[1024]; 
        int read_len = 0; 
        while ((read_len = s3is.read(read_buf)) > 0) { 
            fos.write(read_buf, 0, read_len); 
        } 
        s3is.close(); 
        fos.close(); 
    } catch (AmazonServiceException e) { 
        System.err.println(e.getErrorMessage()); 
        System.exit(1); 
    } catch (FileNotFoundException e) { 
        System.err.println(e.getMessage()); 
         System.exit(1); 
    } catch (IOException e) { 
        System.err.println(e.getMessage()); 
        System.exit(1); 
        } 
    }
  

As you can see, once you have a reference to the object, the rest is just Java IO code.

Print File Contents

Finally, here is code to print the contents of a text object stored in MinIO. Again, it is simple Java IO once you have a reference to the object.

    public void PrintObjectContents(String objectName) throws IOException {
        AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint);
        GetObjectRequest rangeObjectRequest = new GetObjectRequest(bucketName, objectName);
        S3Object objectPortion = s3Client.getObject(rangeObjectRequest);
        System.out.println("Printing bytes retrieved:");
        displayTextInputStream(objectPortion.getObjectContent());
    }

    private static void displayTextInputStream(InputStream input) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(input));
        while (true) {
            String line = reader.readLine();
            if (line == null)
                break;

            System.out.println("    " + line);
        }
        System.out.println();
    }
  

Conclusion

Here is the full code that you can find at https://github.com/DavidGiard/MinIO_Java_Demo:

package com.gcast.gcastminio.services;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

import com.amazonaws.AmazonClientException;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.Protocol;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.GetObjectRequest;
import com.amazonaws.services.s3.model.ListObjectsV2Result;
import com.amazonaws.services.s3.model.PutObjectRequest;
import com.amazonaws.services.s3.model.S3Object;
import com.amazonaws.services.s3.model.S3ObjectInputStream;
import com.amazonaws.services.s3.model.S3ObjectSummary;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class S3Service {

    // The following are set in application.properties
    @Value("${minio.endPoint}")
    private String endPoint;
    @Value("${minio.accessKey}")
    private String accessKey;
    @Value("${minio.secretKey}")
    private String secretKey;
    @Value("${minio.bucketName}")
    private String bucketName;
    @Value("${localFileFolder}")
    private String localFileFolder;

    public void UploadWithS3Client(String fileName) throws IOException {
        AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint);
        String fileToUpload = localFileFolder + fileName;
        try {
            File file = new File(fileToUpload);

            PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, fileName, file);
            s3Client.putObject(putObjectRequest);
        } catch (AmazonServiceException ase) {
            System.out.println("Error Message:    " + ase.getMessage());

        } catch (AmazonClientException ace) {
            System.out.println("Error Message: " + ace.getMessage());
        }
    }

    public List<String> ListS3Objects() {
        List<String> blobList = new ArrayList<String>();
        System.out.format("Objects in S3 bucket %s:\n", bucketName);
        AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint);
        ListObjectsV2Result result = s3Client.listObjectsV2(bucketName);
        List<S3ObjectSummary> blobs = result.getObjectSummaries();
        for (S3ObjectSummary blob : blobs) {
            blobList.add(blob.getKey());
            System.out.println("* " + blob.getKey());
        }
        return blobList;
    }

    public void PrintObjectContents(String objectName) throws IOException {
        AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint);
        GetObjectRequest rangeObjectRequest = new GetObjectRequest(bucketName, objectName);
        S3Object objectPortion = s3Client.getObject(rangeObjectRequest);
        System.out.println("Printing bytes retrieved:");
        displayTextInputStream(objectPortion.getObjectContent());
    }

    private static void displayTextInputStream(InputStream input) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(input));
        while (true) {
            String line = reader.readLine();
            if (line == null)
                break;

            System.out.println("    " + line);
        }
        System.out.println();
    }

	public void DownloadFromMinIOWithS3Client(String objectName) {
		System.out.format("Downloading %s from S3 bucket %s...\n", objectName, bucketName);
		AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint);
		try {
			S3Object o = s3Client.getObject(bucketName, objectName);
			S3ObjectInputStream s3is = o.getObjectContent();
			String downloadedFile = localFileFolder + "D_" + objectName;
			FileOutputStream fos = new FileOutputStream(new File(downloadedFile));
			byte[] read_buf = new byte[1024];
			int read_len = 0;
			while ((read_len = s3is.read(read_buf)) > 0) {
				fos.write(read_buf, 0, read_len);
			}
			s3is.close();
			fos.close();
		} catch (AmazonServiceException e) {
			System.err.println(e.getErrorMessage());
			System.exit(1);
		} catch (FileNotFoundException e) {
			System.err.println(e.getMessage());
			System.exit(1);
		} catch (IOException e) {
			System.err.println(e.getMessage());
			System.exit(1);
			}
		}


    public static AmazonS3 getAmazonS3Client(String accessKey, String secretKey, String endPoint) {
        ClientConfiguration clientConfig = new ClientConfiguration();
        clientConfig.setProtocol(Protocol.HTTP);
        AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
        AmazonS3 s3client = AmazonS3ClientBuilder
                .standard()
                .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endPoint, Regions.US_EAST_1.name()))
                .withPathStyleAccessEnabled(true)
                .withClientConfiguration(clientConfig)
                .withCredentials(new AWSStaticCredentialsProvider(credentials))
                .build();

        return s3client;
	}
}
  

In this article, you learned how to use the Amazon S3 Java SDK to manage objects in MinIO.

Tuesday, December 1, 2020 7:23:00 AM (GMT Standard Time, UTC+00:00)
# Monday, November 30, 2020

Episode 637

Gaines Kergosien on ADHD

Gaines Kergosien discusses ways to identify and cope with the challenges of ADHD.

Links:

https://add.org/
http://blog.kergosien.net/
https://speakerdeck.com/gaines/succeeding-with-adhd

Monday, November 30, 2020 7:31:00 AM (GMT Standard Time, UTC+00:00)
# Saturday, November 28, 2020

Each of the novels in Madeleine L'Engle's Time Quintet contains allusions to religion, often including angelic and demonic beings that battle in a struggle of good versus evil; but, Many Waters" - her fourth book in this series (third chronologically) - takes it a step farther. Here, L'Engle explicitly introduces angels and fallen angels and even the Old Testament prophet Noah and his family.

Throughout the series, Dennys and Sandy have been the forgotten siblings of the remarkable Murry family. These twins mostly stood in the background while older sister Meg and Charles Wallace went on adventures to save the universe.

But, in Many Waters, the twins take the stage. After playing with one of their father's laboratory experiments, they find themselves thrust backward in time to encounter Noah and his family prior to the Great Flood. The boys find themselves in the middle of a struggle between Noah's family and others. Angels, fallen angels, and magical creatures play a part in the battle. The story is complicated when Noah receives instructions from God to begin building his ark in preparation for the coming flood.

It was fun to see some minor characters emphasized; and it was fun to read an adventure story with familiar characters. Madeleine L'Engle has made me care about the Murry family.

Saturday, November 28, 2020 9:57:00 AM (GMT Standard Time, UTC+00:00)