You can overwrite the default confirm function using the following snippet of code which combines jQuery UI and Bootstrap to create a nice looking confirm box that is easier to read.
Being able to transport encrypted data is important in some of my projects at work. One-way hashes using MD5 usually suffice for most encryption purposes but Symmetric Encryption algorithms are important for encrypting and then decrypting data. For this, we use the Rijndael and AES algorithm in a few different languages.
Cosine similarity measures the angle between two vectors and can be used to perform similarity between text strings. In the following code, the two input strings are vectorized and the similarity is returned as a floating point value between 0 and 1.
Multidimensional Scaling (MDS) is a linear embedding method used when we only know the pairwise distances between data points. For linear systems, MDS works well with as little as 10 points and the system is 2 dimensional.
Particle swarm optimization can be used in a variety of different applications. A few examples involving nonconvex, multi-objective, discontinuous search spaces and applications in neural networks and support vector machines are mentioned.
I explain and show code to construct the Particle Swarm Optimization in Python. I conclude by optimizing on the Rastrigin function, a function that researchers use to test optimization algorithms on.