Programming – 22blog.com https://22blog.com The past programmed the future, the present makes it so. Fri, 29 Jan 2016 18:21:00 +0000 en-US hourly 1 https://wordpress.org/?v=4.8.1 Programming Starfields – A Puzzle Worth Solving https://22blog.com/programming-starfields-a-puzzle-worth-solving/ https://22blog.com/programming-starfields-a-puzzle-worth-solving/#respond Sat, 12 Dec 2015 22:23:00 +0000 https://22blog.com/?p=10

psRecently, I overheard some programmers talking about creating a simple starfield simulation for a screen saver module. You probably have seen one of these before. The stars begin clustered in the center of the screen and move out toward the edges, producing an effect similar to what you might see while looking out of a spaceship window.

The programmers were talking about the best way to plot the path of the stars, and the general consensus was that it should be done using trigonometry and would require a great deal of floating-point calculation. Each star would occupy a given point and traverse a course which would be defined by triangulation using trigonometric functions.

These programmers knew something about trigonometry and immediately understood

]]>

psRecently, I overheard some programmers talking about creating a simple starfield simulation for a screen saver module. You probably have seen one of these before. The stars begin clustered in the center of the screen and move out toward the edges, producing an effect similar to what you might see while looking out of a spaceship window.

The programmers were talking about the best way to plot the path of the stars, and the general consensus was that it should be done using trigonometry and would require a great deal of floating-point calculation. Each star would occupy a given point and traverse a course which would be defined by triangulation using trigonometric functions.

These programmers knew something about trigonometry and immediately understood

]]>
https://22blog.com/programming-starfields-a-puzzle-worth-solving/feed/ 0
Math Coprocessors – The Bee’s Knees Of 90s Computers https://22blog.com/math-coprocessors-the-bees-knees-of-90s-computers/ https://22blog.com/math-coprocessors-the-bees-knees-of-90s-computers/#respond Wed, 08 Jul 2015 12:34:50 +0000 https://22blog.com/?p=12

mcThe application itself may also test to see if a math coprocessor is installed. During initialization, it tests for the math coprocessor in the same way the BIOS does. In fact, it is becoming more common for applications themselves to test for the presence of the math coprocessor as well as other parameters, and then configure themselves automatically to operate with the hardware that is installed.

If no math coprocessor is present, the CPU will perform the math calculations using lengthy software instructions that emulate the math coprocessor’s built-in functions. While the emulation may occur within the operating system, it is more likely to occur within the application program. Thus, when a math coprocessor instruction is encountered, the application will execute the

]]>

mcThe application itself may also test to see if a math coprocessor is installed. During initialization, it tests for the math coprocessor in the same way the BIOS does. In fact, it is becoming more common for applications themselves to test for the presence of the math coprocessor as well as other parameters, and then configure themselves automatically to operate with the hardware that is installed.

If no math coprocessor is present, the CPU will perform the math calculations using lengthy software instructions that emulate the math coprocessor’s built-in functions. While the emulation may occur within the operating system, it is more likely to occur within the application program. Thus, when a math coprocessor instruction is encountered, the application will execute the

]]>
https://22blog.com/math-coprocessors-the-bees-knees-of-90s-computers/feed/ 0
Get Your Recursion On https://22blog.com/get-your-recursion-on/ https://22blog.com/get-your-recursion-on/#respond Mon, 06 Apr 2015 14:36:04 +0000 https://22blog.com/?p=14

tspHere’s an appropriate example of where recursion is absolute gold. How about a searching problem? Have you ever heard of the Traveling Salesman problem? The idea is that a traveling salesman must visit several cities. His time is valuable, so he wants to find the shortest route through all the cities. This problem is about as practical as they come.

Airlines, delivery services, the post office, and just about any businesses that move things welcome the discovery of a more efficient route. It’s worth a lot of money to them. How about yourself? If you travel, wouldn’t it be worthwhile to find faster routes?

An interesting application that finds the shortest routes, not by using factorials, but by applying other means, is

]]>

tspHere’s an appropriate example of where recursion is absolute gold. How about a searching problem? Have you ever heard of the Traveling Salesman problem? The idea is that a traveling salesman must visit several cities. His time is valuable, so he wants to find the shortest route through all the cities. This problem is about as practical as they come.

Airlines, delivery services, the post office, and just about any businesses that move things welcome the discovery of a more efficient route. It’s worth a lot of money to them. How about yourself? If you travel, wouldn’t it be worthwhile to find faster routes?

An interesting application that finds the shortest routes, not by using factorials, but by applying other means, is

]]>
https://22blog.com/get-your-recursion-on/feed/ 0