Use the following code snippets as you wish. I've hacked my way through a
number of quick jobs and, not finding the code I needed at the time on the
web, decided to place some of my own where people could find it when they
need it. Most of this code does not check for proper usage - meaning that
it doesn't always check for entries to be within range or option selections
to be valid, etc. You should test your own applications in the environment
where they will be run.
If you have a specific algorithm or task you need help with, feel free to send an email to the address found on the Home page.
Read more discussions and subscribe to RSS feeds on Computer Science and Computer Theory topics at the Computer Algorithms Blog Site.
Visual Basic
A Comparison of Sorting AlgorithmsA comparison of the Bubble, Heap, Quick, Shell, Shell-Metzner, and O-Sort (a variation of the Comb sort) algorithms. Example code is provided.
Infix to Reverse Polish NotationConvert typical infix notation, where mathematical operators bisect their operands to reverse polish notation (RPN) where operators follow their operands. Example code is provided in Visual Basic.
Calendar CreatorThis bit of code will find the starting day of the week for any given year after 1600, then print a 12 month calendar for that year. Example code is provided in Visual Basic.
Visual Basic for Applications
Extract Peaks in Excel DataHow to extract positive and negative peaks from a column of data in an Excel Spreadsheet. Extensive Visual Basic for Applications program code included.
Open FileHow to open a file from inside an Excel macro. I use this extensively for importing text or comma separated data into an Excel Spreadsheet for further data manipulation. Very short Visual Basic for Applications code is included.
Converting Bases in ExcelHow to create a function in Excel to convert between different number bases. Lately there seems to be a lot of people searching for a function to do this in Excel, this page will give you the complete instructions on how to create the function in Excel and how to use it. The function described here is almost completely identical to the code listed in the article titled Numeric Base Conversion, which you can find further down on this page.
Excel Function to Convert Decimals to Integer FractionsHow to create a function in Excel to convert a decimal number to a text string containing an integer numerator and integer denominator. Lately there seems to be a few people looking for a function to do this in Excel, this page will give you the complete instructions on how to create the function in Excel and how to use it.
Fortran
Alpha to RealHow to convert numbers which are stored in a string array to integer or floating point numbers. A subroutine in FORTRAN is included.
Area of an OpeningSample subroutines to calculate openings in appliances when there are semi-regular shaped openings.
Selected Range CopyA routine to move or copy data from one location to multiple other locations which may or may not be contiguous.
Decimal to HexadecimalConverting decimal numbers to hexadecimal strings. This is a specialized version of the Numeric Base Conversion routine found elsewhere on this page.
Hexadecimal to DecimalRoutine to convert hexadecimal strings to decimal integers. This is a specialized version of the Numeric Base Conversion routine found elsewhere on this page.
LabVIEW
Excel TimestampHow to create a timestamp value in LabVIEW (G) that can be read by an Excel Spreadsheet.
Misc (you should be able to figure it out)
All Permutations RoutineA very efficient algorithm for running through all permutations of an array of data.
Numeric Base ConversionHow to convert from one numeric base to any other numeric base. The magnitude of the bases is only limited by the number of symbols available on your computer system. There is a Pseudo Code listing as well as a PHP implementation of that code provideded by Maurice K., a reader of this site.
Roman Numeral ConversionFive different algorithms are presented that demonstrate how to convert a Decimal value to Roman Numerals and how to convert Roman Numerals back to Decimal values. Example code is provided in VB .NET along with VB projects that you can download and manipulate to fit your own requirements.
Temperature ConversionConverting temperatures from fahrenheit to celsius or from celsius to kelvin is simple.
All code and original algorithms are Copyright E. Oosterwal - 1987-2008 Home