315 957 929

Number of Web Sites Running PHP Today...

The Anatomy of Online Technical Communities

How tech communities are born and killed online

I'd like to discuss a topic I have spent many years researching and learning about that really fascinates me. The makeup of online communities. Specifically, online technical communities. What I've spent a lot of time trying to understand over the years is what makes up these communities and why do some of them grow to be so large while others quickly dissipate or wither away? It turns out there are some really interesting insights to this if you dig deep enough.

Making difficult software architecture choices

Concurrency and asynchronous PHP

Allow me to take you on a little stroll down memory lane. I look back on the last 10 years of my career using PHP and realize just how much things have changed on the web and yet how little of PHP's core architecture has changed in response. This is not necessarily a bad thing, because it speaks volumes about how good those architectural choices were that they managed to survive all of the changes we've witnessed on the web. Changes like WebSockets and HTTP/2, which have fundamentally changed the way we think about web development today. Despite these changes, however, PHP remained one of the most dominant languages used for web development to this day.

How to Build a URL Shortner like bit.ly or goo.gl

Bijection functions and real time analytics

URL shortners like bit.ly and goo.gl have grown quite popular over the years for several reasons. They make it easier to share lengthy URLs over mediums where character count poses a problem. Like SMS text messages in mobile devices and tweets where there are 140 characters, per message, constraints. They also serve an analytical purpose for tracking click-throughs, and other visitor data like client browser software, geo-location information, desktop vs. mobile device, etc… There's also the spam proponent where spamers and some malicious users will use the shortened URL to hide the true destination in emails and websites, with the intent of distributing malware, creating phishing scams, or conducting other malicious activities.

Bloom Filters in PHP

Stuffing an elephant into a hat…

Let's imagine you have built a music app like Spotify. You've finally grown this thing to sizeable amount of users and you have a decent number of titles in your content library. Let's also say this app has social elements to it so your users can connect with their facebook friends or twitter followers. Now, let's say each time your users play a song in your app you want to ask the question Which of this user's friends have NOT listened to this song yet? The intention being that you may recommend that song to them if they haven't listened to it.

A* Path Finding Algorithm

Fastest path between two points is a straight line… unless…

Have you ever wondered how in the game PacMan, the ghosts would chase, or run-away from, PacMan? Or how about how Google Maps can give you the shortest route to the next gas station? How about, how networks discover the fastest route between them? In the world of programming this is accomplished through a Path Finding Algorithm, which is a graphing problem. In this article we'll explore one of the most popular and commonly used path finding algorithms in the majority of general purpose applications (especially games)! It's called A* or A-star search.

Binary Search Trees in PHP

You're half-way there when the bits grow on trees...

Imagine you're a phone company and you want to implement an automated system on your website for assigning phone numbers for your customers. There are two use cases. One, is that the customer can ask if a specific number is available. The other, is that the customer can ask for any random number that's available. What data structure would you use to efficiently store and search these phone numbers? Keep in mind that you could potentially have billions of these phone numbers (1011 if we include international numbers).

In this article we'll explore the data structure known as Binary Search Tree or BST.

Why Do I Need to Know How to Reverse an Array?

The Technical Software Engineering Interview

Imagine you are a candidate for a software engineering job at a startup. Someone at your interview asks you to write a function that will reverse an array. Your immediate gut-response is "Why do I need to do that? I have array_reverse stupid!". As true and as pragmatic as this response may feel, it is the wrong attitude to have in the interview. Allow me to explain why.

How to Find the Longest Streak

The Maximum Subarray Problem

So you're on Github and you look at your stats... It looks like you're on a roll! You just made your one-thousandths commit. You notice Github is keeping track of your longest streak and current streak. Have you ever wondered how you'd calculate the longest streak for similar data sets in your own program? What's the most efficient way of doing so? What would the implementation look like?