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.


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.
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.
Just another JavaScript custom object example. With this one I create a global object variable that is referenced by my class through its prototype. In this way the could also be referenced by other classes and this allows me to maintain some datas independently of the code.

A binary search tree is a type of binary tree where the data in a node's left subtree is less than the node and the data in a node's right subtree is greater than (or equal to) the node, and the subtrees are also binary search trees. A binary search tree is a data structure upon which algorithms can be run. If a binary tree search was run, using a balanced binary search tree of course, the performance would be at most O(log n) since as you can see the pool of possible results is cut in half with each step (The tree must be balanced, my example does not properly balance when it adds. See:
AVL tree or
red-black tree).
I was talking about JavaScript objects with someone at work today and I wanted a simple example to look at, but I couldn't find one quickly. So, I decided to write up a quick example and post it here for future reference. I'm also posting some links to helpful information on the web.
This is an extension that I have been using to parse URL search strings and hash codes. I thought that I would share it with the world, and if the world has a better method I hope that someone shares it with me.
Sometimes it is nice to make a SmartForm more dynamic, especially since they can be a pain to maintain for complicated labels. In cases like this my colleagues in Germany have developed this method to apply SAP classification to SmartForms.
The first step is to create the desired characteristics. Follow these steps for each characteristic that is required.
- CT04 "Characteristics Management"
- Create a new characteristic (ZLE_MYLABEL_FIELD1)
- Basic Data: Data Type (Character Format), No. of chars (1)
- Descriptions: EN (My field), DE (Meine feld)
- Values: Char Value (1, 2, 3, …) Description (This is my field)
- Restrictions: Class type ZLW
- Save
Continued after the break...