When High Performance Computing Is Not High Performance
Everybody cares about codes running fast on their computers. Hardware improvements over recent decades have made this possible. But how well are we taking advantage of hardware speedups? Consider these two C++ code examples. Assume here n = 10000000. void sub(int* a, int* b) { for (int i=0; i<n; ++i)
Read moreLeading zeros
The confusion between numbers such as 7 and 007 comes up everywhere. We know they’re different—James Bond isn’t Agent 7—and yet the distinction isn’t quite trivial. How should software handle the two kinds of numbers? The answer isn’t as simple as “Do what the user expects” because different users have
Read moreMaximum Glitch: How to break Tetris
The home team is back with a conversation about the 13-year-old who beat Tetris by breaking it; stories from the Mathematics Stack Exchange; and the robot butler that will do your dishes, fold your laundry, and water your plants. Happy New Year!
Read moreAn Alphebetized List of MIME Types
MIME types are a way to specify the nature and format of a document, file, or assortment of bytes. Here's a list of common MIME types. Continue reading An Alphebetized List of MIME Types on SitePoint.
Read moreKy Fan’s inequality
Let with each component satisfying 0 < xi ≤ 1/2. Define the complement x′ by taking the complement of each entry. Let G and A represent the geometric and arithmetic mean respectively. Then Ky Fan’s inequality says Now let H be the harmonic mean. Since in general H ≤ G ≤
Read moreKey C++ practice problems (and solutions) from beginner to senior level
Not sure what to practice? In this guide, we delve into a wide array of C++ problems, ranging from fundamental syntax and basic data structures for beginners, to advanced concepts like object-oriented programming (OOP) and efficient memory management for experienced developers. Each problem is accompanied by a detailed solution and
Read moreChris’ Corner: Swinging For It
New year, new local code editor? It’s maybe worth a peak at Zed, at least. They do a good job in the one-sentence pitch: Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter. All tech things have to be fast, so check. No shade either,
Read moreThe Best PHP Frameworks for 2024
Dive into the fundamentals of PHP frameworks and which are the best PHP frameworks for you, whether you're a beginner or PHP expert. Continue reading The Best PHP Frameworks for 2024 on SitePoint.
Read moreChris’ Corner: Switch
The “switch” is a pretty common design pattern on the web. It’s pretty much a checkbox. In fact, under the HTML hood, it really ought to be an <input type="checkbox"> or perhaps a <select> with just two <option>s (or a third if there is an indeterminate state). But unfortunately, the
Read more