The MATLAB file contains a method to find the value of pi. This is just an extension of the general method of finding pi from within a circle. It uses 3D-matrices and some more stuffs, which can be very helpful for educational purposes. Also, do change the values in the file, to see for yourself, how the value depends on the number of random numbers generated..... :)
This is a GUI that I had developed to find the palindrome of any number. The underlying algorithm will take any positive 2+ digit number, reverse the sequence, and add the reversed sequence onto the original number.
Example: 196...
A small snipet of code to find the determinant of a mtrix of any order.Input must be a list like [[1,2,3],[4,5,6],[7,8,9]] (for a matrix of order 3). Works fine.
Oftentimes you want to find the index of a list-like object. Numpy arrays, for example, do not have a index member function. These get the job done quickly.
Note: these do not raise exceptions, instead they return -1 on error. You...
This function solves the "forward geodesic problem," which is to compute the endpoint of a geodesic (shortest-distance) path on the ellipsoidal earth, given the start point, a path length, and a starting azimuth.
In response...
This program uses a digital trie search (Knuth 1998) to find the network of a given IPv4 address. It is fast, and can find nested subnets.
The Expectation-Maximization algorithm (EM) is widely used to find the parameters of a mixture of Gaussian probability density functions (pdfs) or briefly Gaussian components that fits the sample measurement vectors in maximum likelihood sense...
Kruskal's algorithm is used to find the branches of a ''tree'' having the minimum weight in a system of branches. The application of this algorithm is wide. One example is in finding the shortest (and cheapest) path of interconnecting several...
While I have seen many permutation recipes on this site, there seems to be no recipe yet which shows how to generate the permutations of a "bag". A bag is like a set but can contain elements more than once.
I decided not to customize the xml-parser to fit the structure of a xml-document, but to make a parser that adapts the structure of the document. By converting the xml-document in this way, the access to the elements is simple and...
How to obtain the name of a method or a function from within the running method/function.
Acknowledgement: the solution to this problem is given by Christian Tismer (tismer@tismer.com; Mission Impossible 5oftware)
A simple little task, how to find the intersection of two hashes. There's probably many ways to do this but there is one way to avoid...
This function find the percentile of a list of values. Note that the list must be sorted already.
This demo shows how to use MATLAB, Optimization Toolbox, and Genetic Algorithm and Direct Search Toolbox to optimize the design of a double wishbone suspension system.
Note: You will need to have the following products installed in...
http://akiscode.com/articles/gcd_of_a_list.shtml
This python code snippet allows you to find the GCD of a list of numbers, after this it is a simple matter of diving all the numbers in the list by the GCD to reduce it.
Why...
This function uses the Vincenty direct algorithm to solve the "forward geodesic problem," which is the problem of computing the endpoint of a geodesic (shortest-distance) path on the ellipsoidal earth, given the start point, a path...
A small tool to find all points of a geven data set wihtin the radial or box range around the query point. It fully uses the JIT hence is very fast compare to other implementations.
Version 2 is about 10 times faster. Now it is about...
Tumblr Widget allows you to display the contents of a Tumblr in any widget-enabled area of your WordPress blog. You can import all Tumblr posts or specify certain categories (photo, link, quotation, etc.) to display.
Requires cURL and...
Simple PHP class to check the validity of a VAT number from the European Union countries. Just include the class and call the function vat::check_vat($vat_number,$state_code). The state_code is the country 2 letter abbreviation (eg. GB, DE, AT etc.)
Get the title of a page is an easy tutorial through which the users can collect information about the method of accessing the title of particular page. The author gives details about the method of utilizing various functionalities to retrieve the... |