Unique random coupon code generation in PHP

Generating pseudo random codes is usually a trivial task. However, coupon codes should have two features that make them computationally complex:

  • They have to be unique
  • They should be hard to guess

A third optional feature would be readability. This means that the final user should not be thinking “is this 0 or O?“.

I found the problem intriguing and decided to make my personal implementation of a coupon code generator in PHP.

Read more

Visualizing one second of Internet

One second of Internet

How many interactions happen every second on the Internet? You can check the numbers anywhere on the web, OR you can go to http://onesecond.designly.com/. Web designer/ dev Steven Lewis created a fantastic website along the lines of “If the moon were only 1 pixel”. Scroll your way through thousands of Google searches and don’t forget to … Read more

About Mars and the loss of atmosphere

NASA just announced another groundbreaking discovery regarding the history of Mars.

Data from the MAVEN spacecraft revealed how Mars loses 100 grams of its atmosphere every second.

Why? solar winds, and obviously solar storms, which increase the loss rate even more.

Mars vs Solar Storm
Mars vs Solar Storm

As explained in the official article from NASA:

[quote]The solar wind is a stream of particles, mainly protons and electrons, flowing from the sun’s atmosphere at a speed of about one million miles per hour. The magnetic field carried by the solar wind as it flows past Mars can generate an electric field, much as a turbine on Earth can be used to generate electricity. This electric field accelerates electrically charged gas atoms, called ions, in Mars’ upper atmosphere and shoots them into space.[/quote]

This is, of course, an extremely interesting discovery, which helps scientists to understand how Mars lost its atmosphere.

However, browsing my news feeds, I stumbled upon a good number of misleading headlines. This is not HOW Mars lost it’s atmosphere, it’s one of the responsible factors.

Read more

Disney Research gives a boost to fabrics rendering

Smoothed Aggregation Multigrid for Cloth Simulation

Disney Research found a different mathematical approach to solve the extremely complex equations necessary to render realistic fabrics.

As you can see from the video released with the official paper, the resulting simulation is extremely accurate. Like almost every algorithm, it’s not a generic solution to every cloth rendering problem. It performs better on large problems (more than 25k vertices), stiffer materials and small masses. Also, as stated by the authors, time to solution doesn’t really scale linearly, but there’s room for improvement.

Anyway, it’s a great addition to the 3D rendering algoritms’ world.