A primer on Base 64 strings — Part 1

A primer on Base 64 strings — Part 1: Introduction

If you have been around the web for awhile, you will notice that sometimes, you will find a series of gibberish alphabets appearing, most often in your browser address bar as part of a website’s URL:

The blue highlighted portions in the GIF above are the aforementioned gibberish alphabets.

These are Base 64 characters, and a large portion of the web uses these characters for a multitude of purposes.

Continue reading
Finding which is the shorter 2D angle

Calculating the shorter angle of rotation in 2D

Here’s a really simple math problem in 2D games development that has a surprisingly complex solution. If I were to give you angles a and b, how would you calculate 1) the direction — that is, clockwise being positive; and anti-clockwise being negative — and 2) magnitude of the shorter angle of rotation from a to b?

Main angle question
We want the angle in green.

When you visualise it, both values seem so obvious; which was why I was so surprised I couldn’t figure it out. On the surface, it seems really simple — if you just take b – a, doesn’t it give you the solution?

Continue reading
Fixing a data truncated warning in MySQL

How I fixed my “data truncated for column” warning in MySQL

Recently, while working on a project, I ran into a warning telling me that my “data was truncated for” one of my columns when I was importing a CSV file into one of my SQL tables.

Data truncated warning in MySQL
Pictured: The error in question.

Concerned that I had done something wrong, I Googled for a solution. Unfortunately, I didn’t find any answers there, so I ended up having to find the source of this warning myself.

Continue reading
Static variables explained, in Java

Static variables, explained (using Java)

One of the more complicated concepts that beginning programmers have trouble grasping is static variables. This is in part because static variables work in a way that is quite opposite to how classes and Object-Oriented Programming (OOP) work.

Since examples work wonders in explaining concepts, here’s a use-case in Java that will help to illustrate the concept. Don’t code in Java? No problem. OOP concepts are (mostly) the same across programming languages.

Continue reading

Content begins after the advertisement:


Fixing off-centre Tiles in the Unity Tile Palette

Fixing an off-centre Tile Palette in Unity

When importing Tiles into the Tile Palette in Unity, you may sometimes run into an issue where your Tiles are not aligned with the grids in the Tile Palette, which will subsequently lead to the Tiles being off-alignment with the grid in your Scene too.

Continue reading
Setting up a virtual Postfix mail server — Part 3

Setting up a virtual Postfix mail server — Part 3: Implementing DKIM, DMARC and rDNS

In the previous part of this tutorial series, we set up a mail server that could accept connections from mail clients like Gmail. This allowed us to send out domain emails using a mail client, instead of having to implement a mailbox on our server.

With our mail server’s basic functionality properly set up, we can now turn our attention to another problem — email deliverability. Spam email is a really big problem online, so many email providers have some kind of system in place to assess whether an incoming email is spam and either flag it, or reject it. Hence, after setting up our mail server, one thing we need to do is to ensure that our mail server conforms to certain email security standards, policies and protocols. This goes a long way to help us communicate to other mail servers that we are trustworthy, so that our emails will be deliverable.

Continue reading
Setting up a virtual Postfix mail server — Part 2

Setting up a virtual Postfix mail server — Part 2: Sending emails with SASL

In the first part of this series, we set up a basic virtual mail server with Postfix that received emails for our domain and forwarded it to a mailbox of our choice. To round off the basic set of features for our mail server, we will be setting up Simple Authentication and Security Layer (SASL) to work with Postfix, so that we can access our mail server with a mailbox client (like Gmail) and send out emails from our domain.

Continue reading
Setting up a virtual Postfix mail server — Part 1

Setting up a virtual Postfix mail server — Part 1: Receiving emails with mail forwarding

If you own a domain, and are looking to set up email hosting for it, you have a couple of options. You can either:

  1. Get a generic web hosting service that comes with a cPanel-based email hosting service, or;
  2. Use services like Google Workspace or Microsoft’s Enterprise Email Service.

The former option is cheap, but can be clunky to use and ineffective with blocking spam. The latter option — being specialised services — are generally much more accessible and effective with spam, but cost more.

There’s actually also a third option, and that is:

  1. Running your own mail server on a cloud server.

This means that you have to set up the server and maintain it, but it also means that you can have a cheap and effective mail server, instead of having to choose between one or the other.

In this series of articles, we are going to explore how we can set up a virtual mail server using a Mail Transfer Agent (MTA) called Postfix. This will be a fully-featured mail server, meaning that over the course of these articles, we will be building a mail server that can:

  1. Send and receive emails,
  2. Filter incoming emails for spam, and;
  3. Pass email policy checks, so that the emails it sends out are not flagged as spam.
Continue reading

Content begins after the advertisement:


Setting up Unity's Device Simulator

Setting up Unity’s Device Simulator

Unity’s Device Simulator is a very nice extension in Unity that allows users to quickly and easily test out their games on a mobile platform. It extends the Game window by adding a dropdown that allows the user to switch between the Game view and a newly-added Simulator view.

Continue reading