FFT – Business After COVID-19

This is the first post of a set which I am calling “Food for Thought”. The main idea of this blog is to describe and possibly discuss things of interest to computer scientist and software developers. Occasionally I run into topics for which I would like to generate a post. You should be able to identify them quite easy for the first three letters “FFT” which I will include in all the titles lacking technical content. Continue reading “FFT – Business After COVID-19”

Sherlock and the Valid String

It is Sunday March 15, 2020 and it is a sunny day in the Twin Cities of Minneapolis and St. Paul. The current temperature is about 22 F. It has gone up a few degrees since I woke up today. The high is expected to be in the low 40’s. It seems like it is going to be a nice warm winter day.

It has been a crazy week. The count of confirmed COVID-19 cases in MN according to the StarTribune up to last Friday was 9. That said; my wife and I decided to get some supplies (e.g., two packages of toilet paper at Costco) and remain at home (with a few exceptions) until the pandemic is under control. I will write a set of posts regarding COVID-19 in a separate category. Continue reading “Sherlock and the Valid String”

Sherlock and Anagrams

The news is full of articles and posts about the corona virus. Before getting in panic mode, stop by the CDC “Coronavirus Disease 2019 (COVID-19)” web page and get informed.

My wife and I follow and watch several YouTube channels. We are mostly interested in foods to prepare and consume and places to visit on our next holiday. Yesterday we watched a new episode on one channel that deals with food and travel in Sicily, Italy. The channel is hosted by a couple of Americans that have roots in Europe and Italy.

They had some interesting facts about how to make a disinfectant using alcohol, aloe vera and some scents. I was not going to mention the specific video, but as I am going over this post, I feel that it is missing. The video is named “SPECIAL EDITION: Coronavirus update from Sicily!”. Quite appropriate for the times we are living in. Continue reading “Sherlock and Anagrams”

Sort on Frequency

UPDATE

Noticed that some of the code blocks had additional characters e.g., &s. I removed and inserted the  original code blocks. The code looks good. Sorry about that.

Today is Saturday March 07, 2020 and the high for today in Apple Valley, MN is forecasted to be in the low to mid 50’s. Tomorrow we should be hitting low to mid 60’s. We can call it global warming or whatever you would like, but the global climate is changing. We can debate the reasons but Occam’s Razor problem-solving principle would attribute it to us humans.

One way or the other, my wife and I believe that we are doing our part. Starting this month, the neighborhood has hired a new company for garbage removal. They collect both bins every week. Possible smell during summer would prevent us from keeping our garbage for more than a week, but we generate such a small amount that the service could pick it up once a month. Continue reading “Sort on Frequency”

A or B

Over the weekend I watched the YouTube video “Dealing with Negative Comments | AMA #3 – Ask Me Anything with Lex Fridman”. I have watched a few of his videos. I do enjoy them to the point that I have subscribed to them. There is one in which Lex interviews Donald Knuth and other where he interviews Andrew Ng. Both videos are over an hour so I will watch them over the weekend.

If you are interested in getting information about Lex Fridman you can find it here or there.

I picked the challenge “A or B” from HackerRank after receiving an email message. I guess that if you solve a few of their problems they like you to continue visiting their site and solving additional challenges. I like to work on one or two a week. I believe it is the only way to learn and / or refresh material. Continue reading “A or B”

Shuffle Array – Java

Every work day when quitting time approaches (around 05:00 PM) I check my to-do list. One thing I had for the day was to check is there is a method in a Java class to shuffle the contents of an array. This is a nice mechanism to have in your toolbox. For example, if you want to load a binary tree search (BST) and the data is sorted, the tree will basically load like a linked list. In a BST you can typically find an element in O(log(n)). But if the elements were inserted sorted, the search is performed in O(n) which is slower than O(log(n)). In such cases you can just shuffle the array and then load the BST. Continue reading “Shuffle Array – Java”

ODBC SQLDriverConnect Crashes – Additional Info

The purpose of this post is to provide additional information regarding an issue that I am experiencing with an application written in C / C++ that can also run as a service. This is legacy code and has been operating for almost two decades. The software can be invoked to run interactively or as a service. The code just stopped to work when invokes as a service about two months ago. I tried to replicate it on my development system and on a new computer system. The issue is that the software runs when invoked as an application but fails to start when started as a service. Continue reading “ODBC SQLDriverConnect Crashes – Additional Info”

Is Permutation

Let’s define the requirements for this algorithm. We are given two sets of integers. The idea is to check if the sets are permutations of each other. If they are, return YES; otherwise return NO.

First let’s make sure we agree with the definition of permutation. For the sets to be permutations we must have the same number of elements in both sets. Each set must have the same counts for each entry. For example if the sets are:

1 2 3 4 5 6

6 5 4 3 2 1

Then we would return YES. Both sets have the same length (six in this case) the numbers are the same on both sets, and the count of each number matches (one in this case).

7 6 5 0 9 7

7 6 1 0 9 7

Given that 5 is in the first set, but not in the second and 1 is in the second, but not in the first, these are not permutations of each other so we would return NO. Continue reading “Is Permutation”

Binary Tree Sum

In this post we will develop a couple methods to collect some information from a binary tree. The first method will be the base, and the second will be an enhancement of the first.

The first requirement is:  given a binary tree with double values, compute the sum of all nodes in the tree.

The second requirement is:  given a binary tree with double values, compute the sum of all nodes whose values are in a specified range (e.g., [ 10.0 : 15.0 ]). Continue reading “Binary Tree Sum”

ODBC SQLDriverConnect Crashes Service

I have an issue for which I have already posted a question “ODBC SQLDriverConnect crashes when running as a service” in Stack Overflow. I am generating this post to provide additional information and will add a link to it in Stack Overflow.

The software in question was written in C. It is a 32-bit application. When it starts it performs some checks and opens SQL Server database. The software support most (never say all) versions of SQL Server.

The base software has been running on different versions of Windows. The original software was designed about 20 years ago.

I am using a Windows 10 machine. The problem seems to happen in other versions of Windows (e.g., Windows Server 2016 Standard). Continue reading “ODBC SQLDriverConnect Crashes Service”