Nona’s Kitchen – JavaScript

Good morning! It is Sunday of the Thanksgiving Day 2020 weekend. Time seems to be passing by quite quickly. Earlier this morning I was reading an article regarding the Pfizer COVID-19 vaccine. It seems that there are still some items that need to be addressed before that vaccine becomes readily available in the USA. Accordingly to the article, we should achieve herd immunity summer 2021. Let’s keep our fingers crossed. In addition there are many other laboratories that are about the same stage as Pfizer. It is safe and reasonable not to depend on a single source.

While I was about to finish editing this document and getting ready to post it, my wife called me to go grocery shopping to Trader Joe’s. On weekends, unless I get up earlier (around 04:00 AM), I typically have time to work on a single 2-hour block. I can extend the block if needed, but if I am doing something with my wife, that tends to put an end to work on that day. Continue reading “Nona’s Kitchen – JavaScript”

First Web Application – Node.js

Hope you are having a nice day. Today is Tuesday. Unless I am mistaken, it has been three weeks since Election Day and as far as I know the results for the presidential election are still up in the air. Hopefully we will find out the results in the next few days.

Next week is Thanksgiving Day. My wife and I were planning on having very few people over, but after further deliberations, we decided that we will skip and celebrate Thanksgiving 2021 with family and friends. Based on what is going on with COVID-19, it seems that a few vaccines will be made available early next year. By November 2021 we expect that most things would be back to normal; that is, the new normal. Continue reading “First Web Application – Node.js”

Simple and Second Web Servers in Node.js

I am about to call it a day. It is dark and cold (25 F) in the Twin Cities of Minneapolis and St. Paul. I am in my office attempting to finish this post while my wife is upstairs in the living room wrapped in a blanket. Tomorrow morning we will wake up to a balmy 12 F. What else can I say?

I am reading and experimenting with the content of the book “Get Programming with Node.js” by Jonathan Wexler. I am currently on page 55. Expect to be done with towards the end of next month. At that time I will switch to experiment with Deno. Then I will move on to generate and post a first pass of a storage server. It should be a lot of fun. Continue reading “Simple and Second Web Servers in Node.js”

REST API

It is another average fall day in the Twin Cities of Minneapolis and St. Paul. It is sunny and cold. Two more days for the weekend; not that it matters because we are still in the COVID-19 pandemic. That said things appear to be getting better. Hopefully a vaccine will be available soon and we will all get into a new normal.

I am still reading the book Hacker’s Delight by Henry Warren. I have a couple more chapters that I would like to finish before putting it down and starting Get Programming with Node.js by Jonathan Wexler. As I mentioned a few months ago, I will be working on a storage project for my blog. I will start with the APIs and database interface. I decided to use MongoDB for the metadata and the file system for the data. The server part code will be implemented using Node.js in JavaScript. After we have the base functionality we will split the software to work on multiple servers. Once that is done we will move to place the modules in Docker containers and will manage them with Kubernetes. Once all is well, I will see if we can move it to the Azure cloud. After that we will create and integrate additional features. Continue reading “REST API”

Typing Speed

Hope you are doing well. In the Twin Cities of Minneapolis and St. Paul things appear to have gone back to normal. As far as I know looting and riots have stopped. There are talks about disbanding the Minneapolis police department. Not sure what liberals are thinking. No matter where you live, social rules and laws have to be enforced so people will follow them. The approach may vary, but force needs to be present. Hopefully it is there just as a deterrent.

Talks about the terrible things happening in many police departments in different liberal cities are being blamed on the current conservative federal government. Please note that in the past 50 years the USA has been under conservative and liberal leaders. If there is blame on what triggered the last wave of looting and riots in several cities in the USA, it needs to be done using established laws. First, the involved police officers should have been put in administrative leave (not fired). Second there should be a trial in which all evidence is presented and discussed. Then the jury should come up with a verdict. If the process is fouled, then the issue should be elevated to the next court. Eventually, if not resolved to the satisfaction of all parties involved, it would reach the Supreme Court. After a decision is made at the highest legal level, people responsible at all levels (i.e., judges, lawyers, union members, politicians, and police officers) should be held accountable and sent to prison if they have done something considered unlawful. Accountability will induce changes which will make groups like “Black Lives Matter” obsolete. Looting and riots do not help the cause of black people. It only aggravates it. Not only that, but the people that lives in the areas that were looted and burned down, now will experience higher prices in stores and shops and will have to travel longer distances to get their shopping done. Thanks looters and rioters! Continue reading “Typing Speed”

Analog Clock in JavaScript

It has been over a week since my last post. A lot of things have happened besides COVID-19. As you might know I live in a suburb in the Twin Cities of Minneapolis and St. Paul. I live in Dakota County. On May 24, 2020 the county had experienced 33 deaths due to the pandemic. Today is June 03, 2020 and the count is up to 59. The count is going up. It seems that a second wave has been forecasted by models for about June 15, 2020. As the rate things are going, I would not be surprised. Continue reading “Analog Clock in JavaScript”

MongoDB for RESTful Service

In the past few days the temperature in the Twin Cities of Minneapolis and St. Paul has been lower than average. The days have been cloudy and rainy. Today the sun might peak in the afternoon and the temperature will hopefully reach 55 F. On the positive side the forecast for Saturday is sunny and temperatures in the low 70s. Hopefully will be able to grill and spend a few hours outside walking.

In this post I will cover interacting with MongoDB using Node.js via the Mongoose module. I will not say much about Installing MongoDB on Windows or Using the MongoDB Shell due to the fact that I have covered such topics on previous posts. I am using the Windows 10 OS due to the fact that several tools I use to generate the post are installed in this Windows machine. You can follow just as well if you decide to use Linux. The installation instructions provided by MongoDB are well written and are easy to follow. Continue reading “MongoDB for RESTful Service”

Node.js in Production

It is a partly sunny Sunday in the Twin Cities of Minneapolis and St. Paul. Currently I am waiting for my wife to get ready to go out for a walk. Yesterday it was cloudy and sprinkled on and off all day. Towards the end of the day it cleared up but we were not in the mood to walk given that we were watching movies at home.

Spoke on the phone with my youngest son. He and his wife were driving to Wisconsin from Indiana to check out a few homes today. He got a job in the area and the family is moving in a month or two. Seems like a house that matched their expectations came on the market last week and they are hoping will meet and exceed their expectations. Will find more about it later this afternoon when they drive back home. Continue reading “Node.js in Production”

Promise to Async and Await

Yesterday on snail mail I received a pin from the Red Cross. Apparently I have given blood 16 times so far. That adds up to two gallons of blood. Planning on continue to donate in the foreseeable future.

As you can tell based on the code we will be using for this post, I am a fan of Ian Fleming’s spy novels staring James Bond. I read all his books when I was growing up. Have watched all the James Bond movies and own a DVD collection of all the titles that have been released of 007.

To start we have a set of functions written in JavaScript Continue reading “Promise to Async and Await”

JavaScript Promise

I have been asked why I am dealing with RESTful services in JavaScript. My idea is to create a set of services that implement sets of APIs (e.g., DICOM storage server) using different programming languages (e.g., C#, Java, and JavaScript). Once that is done will decide on a single service implementation implemented using microservices written in different programming languages. The API for such RESTful server will be determined at the time. As you can see there is some logic behind this madness. If possible, I will then deploy the same set of microservices in a couple public platforms (e.g., AWS and Azure). Continue reading “JavaScript Promise”