7 Reusable Code Snippet Topics
Remove Filter
|
|
Short snippet in C# to do this classic trick, I could not find one on the web. Little, (even none!) error checking is done here. |
|
This snippet shows how to find the complex roots of a polynomial using python (tested with python 2.6). You need the scipy or numpy module. |
|
|
Here is a simple Polynomial class. Its purpose is to show how one can [B]simply [/B]create a Polynomial class without using abstract datastructures such as linked lists etc. Each term is printed out in order of its power - from highest to lowest. Inspiration was taken from a Java source … |
Don’t know if this is ever been done before, or even if it is a good way to do it. I’ll just await your comments if any. What I mostly found on the web is that if you want to define a polynomial you need to have an array containing … |
|
Here is my first Code Snippet contribution: a C++ sub-routine that computes the roots of a quadratic equation. Notes: * This sub-routine checks if a = 0. * IF a = 0, then the equation is actually not a quadratic equation; it is a linear equation with one--if any--root. * … |
|
There was discussion thread http://www.daniweb.com/software-development/python/threads/424953/polynomial-division for class based implementation for polynomials, and I developed a version utilizing the magic methods to enable operation with normal arithmetic operation. I only inherited sequence structure from list type. Interoperability with scalar types is not implemented to avoid too complicated type checks of the … |
|
Here some experiments to pretty print polynomials with help of vegaseat's tip of wx.lib.fancytext. |
The End.