Photo by Charu Chaturvedi on Unsplash

Quack! Want to learn how to create an interactive game with javascript, html, and a duck in less than half an hour ? If that’s the case, keep reading. Game development is a great way to enhance your programming skills and creativity at the same time. However, understanding where to start can be confusing, with so many different platforms, graphics libraries, and game engines available to use. To illustrate and comprehend the more fundamental aspects of a game and how graphics work, this guide will use a pure canvas object instead. By far the easiest canvas to use amongst the…


Photo by Efe Kurnaz on Unsplash

Random numbers, and the generation of them, are vital to almost any production grade software. They are used heavily in gaming, artificial intelligence, functional testing, and much more. Yet, despite being prevalent in such a wide array of applications, the algorithm and means to generate them has not changed much at all in the last 25 years. Typically, pseudo random number generators (PRNG) are divided into two categories, those which are cryptographic, and those which are not cryptographic, and serve as a balance between randomness and speed. The primary one used for non-cryptographic use cases is called the Mersenne twister.


The short answer is not really. For copying via memcpy, the answer is no, because memcpy does not assume memory is aligned on an 8 byte boundary. So it only copies one byte at a time, as any memory alignment can be passed into memcpy.

For other operations, yes those operate on 8 bytes, but they do so for a single data type, such as a 64-bit integer. To operate on two 32-bit integers, you need SSE2 or the very least the older MMX instructions.


Photo by Anthony Indraus on Unsplash

Writing scalable and robust services and applications requires a scalable and robust solution for storing, searching, and querying data. The database marketplace presents many, many different choices. A few key factors differentiate one database from another, and why a specific application or service picks the database it uses. Most of the time, the most critical factor in choosing a database is how easy it is to deploy it and to scale it. …


CODEX

Photo by Boris Dunand on Unsplash

Multithreading is one of the most powerful and vital capabilities of nearly any computer processor that exists today. Multithreading allows software to execute different code simultaneously in the same program. Web servers, web browsers, databases, mobile applications, and just about any production grade software wouldn’t function as well as it does without multithreading.

Multithreading often carries a reputation for being difficult. Compared with other concepts in software development, one could certainly make a case for that. However, multithreading isn’t really that different from general programming. It’s just potentially more dangerous . …


Photo by Ashkan Forouzani on Unsplash

Regular expressions are used in almost any programming language to match, search, or extract complex or intricate text patterns. A regular expression is a statement in a regular language, a language with a grammar specialized for matching patterns of characters in strings. They come into play in a wide variety of applications. One example is password and naming validation. It’s very likely whatever website you create a new user account on validated your password or username with a regular expression.

One other regular expression operation that’s not talked about as much is replacement. Similarly to matching and searching, replace looks…


Better threading in your C++ program

Cables plugged into an interface
Cables plugged into an interface
Photo by John Barkiple on Unsplash.

C++ is a great programming language that’s generally associated with fast performance, custom memory management, and pointers. However, some of the most important and less-talked-about components of the language are threads and mutexes. Perhaps one of the most powerful features of C++ is possessing a wide range of control and precision over the execution of multiple concurrent threads and sharing resources safely between those threads. The web browser you are viewing this on right now uses multiple threads to facilitate multiple actions or displays simultaneously.

In this article, I will go over four tips for using threads and mutexes in…


Photo by Yancy Min on Unsplash

If you have ever worked or written a C or C++ project, you have probably heard of the build system called CMake. For programmers that are new to C or C++, the concept of a separate build system usage a separate language may seem odd. However, knowledge of how to properly to properly compile, build and package a project is absolutely essential knowledge for a C++ programmer. In this guide, the roles CMake plays as a build system will be explained, and the most essential aspects and features of CMake will be discussed. …


Photo by Andrew Neel on Unsplash

GitHub holds perhaps the largest collection of open source software on the planet. It’s an ecosystem of collaboration, learning, and integration for developers and organizations alike. You can write software, contribute to other software, or use free and open software in other projects and products. It’s an incredible tool that powers the world of programming, and promotes access and collaboration to produce open source software for everyone.

Using GitHub as a developer, to either further your career or increase your influence in a genre of open source is a bit different. Getting well known on GitHub isn’t straight forward, and…


Photo by Lee Aik Soon on Unsplash

We move and copy data all the time. From one object to the next, or when files are written, or when a client sends data to a server. Copying is everywhere, and there’s no avoiding it completely. Copying is also expensive, in terms of time, and eventually, money. What if we want to make this common operation an efficient? What can be done to make it faster?

With Advanced Vector Extensions (AVX), a specialized parallelized instruction set in the x86 architecture, copying gets a lot faster. I mean a LOT faster. 2000% faster. How is that even possible? Copying data…

Josh Weinstein

Programmer, Artist, Published Author. I’m an engineer on a mission to write the fastest software in the world.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store