How Is Reactive Different from Procedural Programming?

A recent post on Reactive Programming triggered discussions about what is and isn’t considered Reactive Logic. In fact, many have already discovered that Reactive Programming can help improve quality and transparency, reduce programming time and decrease maintenance. But for others, it raises questions like:

  • How does Reactive differ from conventional event-oriented programming?
  • Isn’t Reactive just another form of triggers?
  • What kind of an improvement in coding can you expect using Reactive and why?

So to help clear things up, here is a real-life example that will show the power and long-term advantages Reactive offers. In this scenario, we’ll compare what it takes to implement business logic using Reactive Programming versus two different conventional procedural Programming models: Java with Hibernate and MySQL triggers.

via How Is Reactive Different from Procedural Programming?.

How Not To Sort By Average Rating

PROBLEM: You are a web programmer. You have users. Your users rate stuff on your site. You want to put the highest-rated stuff at the top and lowest-rated at the bottom. You need some sort of “score” to sort by.

via How Not To Sort By Average Rating.

CORRECT SOLUTION: Score = Lower bound of Wilson score confidence interval for a Bernoulli parameter

Say what: We need to balance the proportion of positive ratings with the uncertainty of a small number of observations. Fortunately, the math for this was worked out in 1927 by Edwin B. Wilson. What we want to ask is: Given the ratings I have, there is a 95% chance that the “real” fraction of positive ratings is at least what? Wilson gives the answer. Considering only positive and negative ratings (i.e. not a 5-star scale), the lower bound on the proportion of positive ratings is given by:

The Mathematics of Gamification

At Foursquare, we have a simple, first-principles based method of resolving proposed venue attribute updates. We can gauge each Superuser’s voting accuracy based on their performance on honeypots (proposed updates with known answers which are deliberately inserted into the updates queue). Measuring performance and using these probabilities correctly is the key to how we assign points to a Superuser’s vote.

The Math

Let’s make this more concrete with some math.

via The Mathematics of Gamification | Foursquare Engineering Blog.

China: The Next Space Superpower

“They are having launches, and in the United States we’re in gridlock,” says Joan Johnson-Freese, a professor at the U.S. Naval War College, in Newport, R.I. “The Chinese will have a rover onthe moon, and we’re still developing PowerPoints for programs that don’t get approved by Congress.” That rover is rolling over the regolith right now.

via China: The Next Space Superpower – IEEE Spectrum.

NASA has a couple rovers on Mars.

Searching the Internet for evidence of time travelers

Abstract. Time travel has captured the public imagination for much of the past century, but little has been done to actually search for time travelers. Here, three implementations of Internet searches for time travelers are described, all seeking a prescient mention of information not previously available. The first search covered prescient content placed on the Internet, highlighted by a comprehensive search for specific terms in tweets on
Twitter.

The second search examined prescient inquiries submitted to a search engine, highlighted by a comprehensive search for specific search terms submitted to a popular astronomy web site. The third search involved a request for a direct Internet communication, either by email or tweet, pre-dating to the time of the inquiry. Given practical verifiability concerns, only time travelers from the future were investigated. No time travelers were discovered. Although these negative results do not disprove time travel, given the great reach of the Internet, this search is perhaps the most comprehensive to date.

Via Searching the Internet for evidence of time travelers

Mars Express Orbiter Buzzes Martian Moon Phobos

During the flyby, DSN operators reported “a slight effect in the Doppler residuals,” meaning that, as expected, Phobos’ gravity had accelerated Mars Express’ orbital velocity very slightly. Through careful analysis of the Doppler shifting of the radio signal, Phobos’ gravity can be measured, allowing scientists to discern its mass and density — the most precise measurement to date.

via Mars Express Orbiter Buzzes Martian Moon Phobos : Discovery News.

However, the operation allowed the spacecraft to beam back an extra 200 Gigabits of observational data, including imagery of Phobos during an earlier 500 kilometer pass of the moon.

The Art and Science of Digital Forensics

The need to a proficiency in digital forensics is manifest in the recent attack against Target stores. After an aggressive attack, the store called in external digital forensics consultants to help them make sense of what happened.

The book starts with an anatomy of a digital investigation, including the basic model an investigator should use to ensure an effective investigation. While the author is not a lawyer; the book details all of the laws, standards, constitutional issues and regulations that an investigator needs to be cognizant of.

via Book Review: Digital Archaeology: the Art and Science of Digital Forensics – Slashdot.

Solar Cells Could Help Windows Generate Power

The Oxford team, led by physicist Henry J. Snaith, made their solar cells using perovskites, a class of mineral-like crystalline materials that has recently grabbed much attention among researchers in photovoltaics. Perovskites have properties similar to inorganic semiconductors and show sunlight-to-electricity conversion efficiencies of more than 15%.

via Solar Cells Could Help Windows Generate Power | Chemical & Engineering News.

New superconductor theory may revolutionize electrical engineering

Heat makes atoms move and can shake Cooper pairs apart, so the holy grail is to design a material where the pairs are bound together so strongly that can happen even up to room temperature. It might be possible to describe a Fermi surface that would create that condition, and perhaps then imagine what crystal structure it would require. “Ideally we would like to be able to tell the materials scientist to put elements X, Y and Z together,” Lee said. “Unfortunately we can’t do that yet.”

via New superconductor theory may revolutionize electrical engineering.

How the Bitcoin protocol actually works

It may seem surprising that Bitcoin’s basis is cryptography. Isn’t Bitcoin a currency, not a way of sending secret messages? In fact, the problems Bitcoin needs to solve are largely about securing transactions — making sure people can’t steal from one another, or impersonate one another, and so on. In the world of atoms we achieve security with devices such as locks, safes, signatures, and bank vaults. In the world of bits we achieve this kind of security with cryptography. And that’s why Bitcoin is at heart a cryptographic protocol.

via How the Bitcoin protocol actually works | DDI.