The basic idea of a function was to give it information and have it return a single value as a result. That result could have been an integer or a float or even an object or struct. On that principle alone many great programs have been made. However, there came a need for returning multiple values from a function. Sometimes the function not only needed to return a single value ...
The Johnson-Trotter algorithm is an algorithm for figuring out permutations given a value set. A permutation is a way of altering the values in a set to create a different unique sequence from the original. If we have the set 1, 2, 3, 4, 5... one permutation would be 2, 1, 4, 5, 3 and another would be 3, 4, 2, 1, 5. Using a quirky little algorithm, we can ...
Here we go again! Another exciting blog entry talking about programming theory. This episode comes by way of a question that appeared on the board today. Someone was looking to pick out colors from an image, convert them to a hex value and write them to a CSV file (comma separated file) for Excel. I put this in the Deep Underground Misc category because frankly I don't know much about ...
Statistics... the bane of some coders existence. Why would it be any fun unless the stats say you are a superstar sports athlete (which coders are not), are going to win a huge prize like the lottery (which coders realize is futile with something like 1 in 13 million PER SELECTION) or that the probability for love is high... you mean with an actual girl? Hogwash! Never the less, statistics ...
Ever wonder how they make those nifty color pickers on graphics programs like Adobe Photoshop? Typically they have a formula that generates the colors of the spectrum and makes it into one of those colorful swatches. You may have the swatch but perhaps you want to know how you can go about giving your users the ability to mouse over the swatch and pick out colors. Maybe display things like ...
We have a lot of newbies on the forum these days. Again and again we are asked "What are some good books for language _______?" We all have our favorites and some books lean towards a certain learning style. So one programmer is going to like a particular book more than another programmer might. But besides that little glitch in perspective, there are some books that are generally accepted as ...