Monthly Archives: October 2013

Serializing and Deserializing Instances of Types in JavaScript

The code below builds a complex object that contains sub-objects as properties, serializes the object with all its children to JSON, deserializes that string to get back the original object, re-serializes that deserialized object, and then prints the two different … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Converting Triangles into Scan Lines

The JavaScript code below converts each of several different triangles into a series of “scan lines” (that, is, horizontal lines of pixels on a display), and then displays those scan lines (or actually, only every third one, so that you … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Finding Intersections Between Polygons in JavaScript

The JavaScript code below generates and displays two random triangles, then locates and highlights any and all intersections between them. To see the program in action, copy it into an .html file and open that file in a web browser … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Running CentOS in VirtualBox

Following the steps below will result in the creation of a CentOS virtual machine in VirtualBox, with the Guest Additions package installed, and a shared folder configured to allow files to be transferred between the host and guest systems. These … Continue reading

Posted in Uncategorized | Tagged , , , | 2 Comments

Splitting a Single JavaScript Program File into Classes

The code included below, when executed, will accept a text file containing a JavaScript program as input and output each root-level function of that script to its own separate text file. The idea is to split a single, consolidated source … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment