Very rarely it is necessary to find the multiplicative inverse of a number in the ring of integers modulo p. Thie recipe handles those rare cases. That is, given x, an integer, and p the modulus, we seek a integer x^-1 such that x * x^-1 = 1 mod p. For example 38 is the inverse of 8 modulo 101 since 38 * 8 = 304 = 1 mod 101. The inverse only exists when a and p are relatively prime.
If you need to generate the cross product of a variable number of lists, here is how to do it with an obscure one-liner instead of a nice and clean recursive function. I came to this while trying to find a short and simple solution for generating...
Easy method to estimate the pile forces of a pile system. The program is very fast to run. This gives the engineer the possibility to try out a couple of different designs of the pile system in a quite small amount of time. The pile system is also...
To find the intersection point of two data sets can be non-trivial in case of the data sets have just a few data points. In this case the both data sets can be interpolated so that there exist a number of data points large enough to find an...
CONDOR is a new optimizer whose aim is to find the minimum x* of an objective function F(x) (x is a vector whose dimension is between 1 and 150) using the least number of function evaluations of F(x). It is assumed that the dominant computing cost...
Uses optimization to find the spatial location of each axis articulator. The program contains innovative algorithms for finding the angles between the links.
As a working point and length of links to determine the angles of rotation of...
With this equation we can find the specific volume of a real gas, in a rank of pressures, isothermally, knowing the factor acentrico the compound. The equation this in function to the understandability factor
This function gets the 1st derivatives of a vector V with two boundaries Input: V = the input vector, 1D data delta_x = delta x INDstart = first index INDend = last index
Output: VDx = 1st derivative of V...
I've seen many people ask for a way to find the closest point on a curve from some given point in space. If the curve is a piecewise linear one, this is not too difficult, since this reduces to finding the closest point on a line segment, and then...
It could be useful to know the normal vectors of a surface. The function provided is able to take a 2.5D unrestricted triangulation (Delaunay or not) which define a 3D surface and computes the normal vectors of each cell. It is possible to compute...
The standard zipfile module provides only a method to extract the entire content of a file from within a zip-file. This extension adds a generator method to iterate over the lines in a file, avoiding the memory problems.
This short script allows a user to track the current status of a package sent through FedEx. It is meant to be run from the command line and takes 1 option argument (-v) to determine whether or not it shows all tracking information, or just the...
This script allows you to format the target window of a form from the form's target property.
This script allows you to change the background color of a TABLE cell where the cell contains an image.
Any number strings of a unique portion of an Image SRC are passed to a function which changes the background color of all...
There are two stages in our experiments, one is to find the predicted values of the signal strengths (RSSId-deOaos) by using Grey prediction algorithm and second is to find the location coordinate of the mobile user by using Dynamic Triangular...
This function allows one to calculate the Fourier transform of a chirped function evaluated at specific points using the stationary phase approximation.
Imagine a pulse with a large time-bandwidth produce: this would require a large...
This package is designed to ease the installation & setup of a Drupal based forum. It contains the necessary content types and views, however it is a very basic implementation at the moment.
Because it is based on cck/views, you can...
This module allows an authorized user/administrator to modify the tree structure of a book using a graphical interface and then update the database to reflect those changes. At some point the javascript in the background that creates the GUI will...
Primary Group extends the Organic Groups (OG) module to allow users to select a primary group when saving a node, and provides API functions to get the primary group of a node.
Sometimes we need to show the different images of a video on our post instead embedding the whole video. To give a video snippet it is a quick way to embed web video thumbnails on your post (youtube and vimeo only this time). More video sites... |