Calculating distance using MySQL

Calculating distance using MySQL” is a very useful blog post for everyone who works with geographical location data and MySQL. It shows a simple example of how to calculate the distance between two coordinates on a sphere (Earth in particular) within the MySQL itself.

SELECT ST_Distance_Sphere(
    point(-87.6770458, 41.9631174),
    point(-73.9898293, 40.7628267)
);

The above will return 1148978.6738241839, which is the distance between the two points in meters.

This functionality is available since MySQL 5.7. Have a look at the documentation of the spacial convenience functions.

MariaDB has similar functionality, but with a slightly different function names. Use ST_DISTANCE() instead of ST_Distance_Sphere(). Have a look at this blog post for more details.

GDPR cookie scanner

I came across the GDPR Expert service via this HackerNews thread. It is a service that helps website owners with the GDPR compliance. Behind the scenes, there is this open source tool, which scans for cookies and provides the details about the vendor and purpose of each identified cookie. The database includes more than 10,000 known cookies.

Very handy.

Telegram’s description of DDoS attack is the best

The servers of Telegram, a popular instant messenger, were under a DDoS attack recently. While they were working on the problem, they’ve tweeted a couple of explanations of what’s going on. CNET brings those tweets to our attention, as they explain rather complex things in a very short and simple way.

Internet Trends 2019 (Bond Report)

Internet Trends 2019 report is the most comprehensive, detailed, and research document that I have ever seen on what’s going on with the Internet, web, mobile, social media, marketing, and security.

This year’s report spans 333 pages and is full charts, graphs, statistics, insights, and references. And if you are feeling nostalgic, there is an archive of the annual reports going all the way back to 1995.

It’s difficult to pick a single fact from such a huge document, but if I had to, I’d go with this:

51% of the global population, or 3.8 billion people, were Internet users last year.

Wow. That’s quite a crowd.

Via Slashdot.

Unraveling the JPEG

It always amazes me how little do we know about everyday things around us. Today I came across “Unraveling the JPEG” article, which is a deep dive into the JPEG format. JPEG images all around us, but how much do we really now about them? I bet you even the most technical web developers and designers will have their hands full with this, let alone all the non-technical people who snap selfies on a daily basis.

Not only the article itself dives into the technical details, but it also provides an inline JPEG editor, which you can use to play around with the data and see how it affects things. Great job!