Christopher
Stoll

JavaScript Binary Expression Tree

I am working on a personal project that requires a JavaScript expression evaluation engine, so I started by designing class that would evaluate mathematical expressions off of which I could build. The first step takes the user supplied string and parses it into an array of operands and operators, which has a performance of O(n) for the number of characters. Next, the array is turned into a binary tree, which has a performance of O(n) for the number of operands and operators. The binary tree is balanced based upon the weights of the operators in order to get the correct order of operations, which has a performance of O(log n). Finally, the expression that the tree represents can be evaluated and that performs in O(log n).

Most of the code is shown after the jump.

Who Started the Cold War

Near the end of the Second World War in the Soviet West Ukraine there existed clandestine guerilla forces with nationalist beliefs. In order to establish an “Autonomous Ukraine” these terrorists, the Organization of Ukrainian Nationalists (OUN) and its militia the Ukrainian Insurgent Army (UPA), were resisting Soviet influence in the region and had murdered no less than thirty-thousand Soviet military and Communist party members. The United States and Britain, afraid that the Soviet Union was planning to start a third world war, covertly used these forces to exploit internal tensions in the Soviet Union and undermine their system of government during a time of perceived weakness.

The Deer Hunter

At the most basic level The Deer Hunter is a story of three friends who volunteer for service in Vietnam, but the diegesis is composed of many artfully woven and nuanced threads. It explores the range of emotions experienced by each of these friends, the role of the civilians in their lives, and the interactions between those two distinct groups. The film skillfully uses suspense to fill the average viewer with a sense of apprehension that conveys the feelings a combat soldier might have had in Vietnam.

As the material for the Vietnam war was forged in midwestern steel mills, so were the rugged characters in the film. The three main characters came from an Orthodox Russian background. The assumption could be made that their families immigrated from the Soviet Union and that their parents bestowed upon them both a sense of patriotism and disdain for communism that would motivate them to volunteer for the war. They knew that they were physically tough enough to volunteer for military service, but it may have not occurred to them that more than physical durability would be required of them.

Economic Consequences of the Vietnam War

In his book Mr. Campagna performed a comprehensive examination of the economic consequences of the Vietnam War. He examined the immediate and direct costs as well as the future and indirect costs. One of the most interesting aspects of his analysis was his attempt to discern the non-monetary economic costs of the war. As Mr. Campagna said, “there may still be strands remaining from the period that continue to influence the present.”

According to Campagna, in the early years of the Second Indochina War the economic impact was minimal. The impact of aid sent by President Eisenhower was negligible. Under President Kennedy the costs of resolving the supposed missile gap far exceeded the costs of assistance to the Republic of Vietnam, even though the number of military advisors practically doubled every year of his administration.

The Long Telegrams

The Novikov telegram was written by a Soviet diplomat at the close of the Second World War. In the telegraph Novikov gives his interpretations of the United States’ international policies. He sees America’s policies as being imperialistic and driven by purely monopolistic capital interests. Novikov saw signs of this in the replacement of Roosevelt with the much more conservative Truman, as well as the general political shift toward reactionary “bi-partisan” policy. Novikov believed that the US entered the world war late in order to look after its financial interests, and was attempting to take advantage of the perceived power void left by the after the second world war. Since all the former world powers were physically destroyed and in financially pre- carious positions, the capitalists in the United States would be able to expand by selling their goods in rebuilding countries. They would then be able to establish further ownership of capital in those areas. Further evidence of the capitalistic nature of the motives was that the US was working with German industrialists that made the war possible rather than limiting their influence.

Analysis of JavaScript Sort Algorithms

The other day I wrote an article about JavaScript binary trees and mentioned that the native JavaScript sort was probably faster than using a binary tree for sorting. I decided to write a few sort algorithms in JavaScript and see how they compared to the native ".sort()".

I tested each sort method with three types of data sets. The first data set was made up of all the same number, the second set was an ascending series of numbers, and the third set was made up of random numbers between zero and four hundred. I used different data set sizes, from 25 to 4000. Finally, I ran the test 22 times, discarded the highest and lowest results, and averaged the remaining results.

So Long VMS

I shut down the last OpenVMS server that I maintained today. It was originally the head of a 37 system cluster, its clients had long since been removed. The system shows that it had been up and running nearly unattended for over 1246 days. All the applications and data that resided on the server were migrated to more modern systems almost three years ago and the system was left up just in case something was needed from it. I had all of the maintenance activities on it set to run automatically (like a great systems administrator, I programmed many DCL scripts to keep this thing running smoothly even in my absence), so it never caused any problems, and since it was tucked away in the corner of the server room I forgot about it. My final message was "@SHUTDOWN - LUKAXP will shutdown in 0 minutes; back up never. Please log off node LUKAXP". The box will probably sit there in the corner of the server room for another three years with its companion, another system I used to maintain, the SGI Origin 2000. All of these former super computers have been replaced with boring Windows boxes, how sad.

JavaScript Sort Algorithms

I wanted to compare some of the various, famous sort algorithms, and I decided to write them using JavaScript. I implemented them by extending Array, and they are all listed below. I wouldn't recommend using any of these however, they are not optimized and the built-in sort() can beat all of them under almost all circumstances. These are presented here solely for educational purposes.