Planning to add proper PHPunit and PHPlogger code examples and blog about it at http://bcmoney-mobiletv.com/blog/

### Advertisement

### Categories

Handy snippets of code

Planning to add proper PHPunit and PHPlogger code examples and blog about it at http://bcmoney-mobiletv.com/blog/

Posted in PHP Also tagged development, example, fibonacci, iterative, php, programming, Recursive Leave a comment

This is a simple hash that pads its input to the block size and XORs every block together. Output is in hexadecimal octets.

Posted in Python Also tagged development, hash, hashing, Hexadecimal, programming, python, xor Leave a comment

Numerical Methods application for solving system of equation using Gaussian Elimination based on this Wikipedia article:Aï¿½http://en.wikipedia.org/wiki/Gaussian_elimination

Posted in C++ Also tagged algorithm, c++, cpp, development, equation, gauss, linear algebra, programming Leave a comment

Prime numbers have many applications. For example, in cryptography. The RSA algorithm for public-key cryptography uses large prime numbers for generating keys. Quote: The RSA algorithm works as follows: take two large primes, p and q, and compute their product n = pq; n is called the modulus. Choose a number, e, less than n [...]

Posted in C# Also tagged algorithm, biginteger, c#, c-sharp, cryptography, development, fermat, fermat's little theorem, miller-rabin, primality, primality test, prime, prime numbers, programming, public-key cryptography, random, rsa 2 Comments

Posted in Java Also tagged development, factorial, fibonacci, golden ratio, java, loop, programming, recursion Leave a comment

Posted in C# Also tagged c#, c-sharp, development, Generator, prime, prime numbers, programming Leave a comment

Normalizing a vector can derive the direction of the vector in 2D or 3D space. A normalized vector is also known as a unit vector. We’re going to normalize and calculate the angles of a 2D vector at position (5,5) and a 3D vector at position (5,5,5). This can come in very handy when, for [...]

Posted in C++ Also tagged 2d, 3d, atan, atan2, azimuthal angle, c++, class, degrees, formula, gaming, header file, normalization, phi, pi, polar angle, radians, radians to degrees, radius, spherical coordinates, square root, theta, unit vector, vector, vector length 2 Comments

The fibonacci sequence has many applications , such asAï¿½paintings , predicting stock market changes and even sunflowers. This example illustrates the fibonacci sequence in Haskell.

Posted in Haskell Also tagged fibonacci, functional programming, ghci, haskell, programming, recursion, sequence Leave a comment

The HTML5 specification includes the canvas element for drawing graphics with JavaScript. This example demonstrates the use of the canvas element and JavaScript for drawing circles.

Posted in JavaScript Also tagged 2d, canvas, circles, context, cosine, drawing, graphics, html5, javascript, radius, sine, trigonometry 3 Comments