All posts by :

Python in XAMPP

Running Python in XAMPP

Are you looking to run Python as a server-side scripting language on your XAMPP installation? Here’s a guide on how to set it up.

Continue reading
Pretty Computer Chips
Image by Jonas Svidras at https://stocksnap.io/photo/intel-8008-LBYK1XTHFC.

Passing a variable by value vs. reference

In programming, a concept that usually creates a lot of confusion among those new to it is the concept of passing a variable by value, versus passing a variable by reference. The 2 examples below illustrate the difference between these two ways variables can be passed in Java:

Continue reading
"Git" good

“Git” good Part 1 — Let’s “Git” the basics

Looking to learn Git on your own, but not sure about where to get started? This article will be a great starting point for you. It’s the first in a series of articles called “Git” good, and it’s designed to help anyone learn Git online in a simple, linear and accessible manner.

In this article, we will be going through the install process for Git and exploring its most basic functionalities.

Continue reading
A formula for rounding number

A formula for rounding numbers

Most programming languages come with native functions that help us round our numbers, either upwards (i.e. ceiling operation), downwards (i.e. floor operation), or to the nearest whole (i.e. round operation). While this is convenient, we sometimes need a bit more than that — what if — for example — we want to round our numbers to the nearest 0.5, or the nearest 3rd?

Continue reading
PHP mail not delivering domain emails to external mail server

PHP mail not sending domain emails to external mail server

Recently, I’ve done some work for a client with an odd issue: the contact forms on their website (let’s call it client-website.com) — which delivered completed form enquiries using PHP’s mail() function — could not send emails through to email addresses containing their own domain.

This means that, if we were to set the form to deliver enquiries to an address like hello@client-website.com, the email would be completely dropped — you would neither find it in the junk or spam folders, nor find any trace of the email in their admin and mail logs. If we delivered the email to our own personal email addresses (e.g. personal@gmail.com), or to emails from another domain (e.g. mail@terresquall.com), then the email would go through (and skip right past the spam folder too).

For weeks, this problem confounded me, until now… and it’s actually a really simple fix.

Continue reading
Shallow vs. deep copying in Python

Shallow vs. deep copying in Python

If you’ve worked with Lists in Python before, you’ll quickly realise that they work differently from primitives like integers and strings. Consider the following:

a = "hello"
b = a
a = "world"
print(a) # Outputs world
print(b) # Outputs hello

Notice that changing the value of a does not change the value of b. This is called passing by value. In Python, Lists do not behave this way:

a = [2, 3, 4, 5]
b = a
a.append(6)
print(a) # Outputs [2, 3, 4, 5, 6]
print(b) # Outputs [2, 3, 4, 5, 6]

In the above example, notice that changing the value of List a also changes the value of List b. This is because both a and b are referring to the same List, and this is called passing by reference.

Continue reading
Apoca Force - Gameplay

Drawing radar charts for stat UIs in Unity

As part of a school assignment in the past year, my team and I created Apoca Force, a tower defense game where WAIFUs (World Apocalypse Intercepting Frontline Units) are deployed onto a battlefield to combat an undead horde. To provide some variation (and eye candy) in gameplay, the game provides a variety of different WAIFUs for players to deploy.

To display the different stats WAIFUs have, we decided to include a radar graph on our build interface to illustrate the stats of each type of WAIFU. In this article, I will talk about the technicalities involved in making that happen.

I have previously written an article about how we rendered Unity’s NavMesh to show our WAIFUs’ walkable areas. Check it out!

Continue reading