Problems with Brute Force in Programming

"Damn! This solution just won't work! I have tried everything and all I get is a bunch of mush! Stupid programming I hate it!" Does this sound like you? Do you feel like one of those people on TV at the beginning of some paid television commercial? Many times the newbie and the expert alike finds themselves in the situation where a project just seems to stall. As human beings, ...

Storing Full Objects In ComboBox/ListBox in .NET

Most beginner and even intermediate level programmers, coming out of languages before .NET, often use comboboxes or listboxes to simply list strings of choices, items etc. Then they go through the headache of detecting a user's choice out of the listbox and fetch information to construct a simple object, possibly displaying that information in other controls related close by. There is an easier way of forming the "master to detail" ...

Euclidean, Bezout, and Coprime Oh My!

Occasionally a programmer loves to play with numbers. Some like to stick gum in their sister's hair, but that is besides the point. At the heart of some programming is the heart of mathematics and especially number theory. One of the great theoretical algorithms out there is the Extended Euclidean algorithm which is used to find the Greatest Common Divisor (GCD). The GCD is a number which divides both of ...

BozoSort Definitive (C++, C#, VB.NET, Java, PHP)

WARNING: PLEASE USE WITH EXTREME CAUTION! CONTENTS MAY BE FUNNY BUT NOT FOR PRODUCTION USE. Programmer Discretion is Advised! Hey you bozos out there, now there is a sort even for you! For those who don't know, a Bozo Sort is a joke sorting algorithm that actually sorts but at horrible timing and is very inefficient. It is good to see it at work from a theoretical stand point but it ...

Stair-step Table Access in VB.NET

There are various methods to access information in a table "lookup" structure. Indexed access, sequential access, etc but the type of access you go with always depends on the data. Many times on the board I have noticed people asking about setting up some type of scale. Most of them are usually working on a grading program of some sort. How does someone determine if the student got an A ...

Intro to A Regular Expression, a CSV Story

Regular expressions... sounds like a complicated term doesn't it? You better believe that when I drop the term at an office dinner party, others either immediately tune out or start saying "Oh hey so and so, good to see you" and then walk off pretending to say hi. Little do they know that the idea behind regular expressions is pretty simple and can actually make their lives easier. But hey, ...