Are you tearing your hair out trying to figure out how to create a bar-line chart (i.e. a combination of a bar chart and a line chart) in Microsoft Word? Look no further, we’ve got step-by-step instructions for you in this post, as well as an accompanying video guide.
Continue readingAbout the author:
Terence
A geek of the highest order, Terence speaks a great number of (programming) languages and dabbles in a couple of tech fields. He writes about common problems programmers come across in this blog.
All posts by Terence:
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 readingExport your Unity project by building an APK (for Android)
Are you planning to create a Unity game for mobile devices? Wondering how you can export your game and build it as an app on Android? Look no further — here’s a step-by-step guide to exporting your game onto your Android device, updated for 2023.
If you’re looking for a way to test your game as you’re making it, check out Unity Remote — it’s an Android app that mirrors Unity Editor’s Game screen when you are in Play Mode. Once you’ve installed it, we have a guide covering how to get Unity Remote working on your devices.
Continue readingPHP 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 readingAdding virtual hosts on Bitnami Apache
Over the weekend, I’ve spent a substantial chunk of time figuring out how to add a virtual host onto a client’s subdomain. In laymen’s terms, this means that:
- My client has a website hosted on a domain (which we shall call example.com, for confidentiality reasons)
- We want to build a web application on app.example.com, which will be entirely separate from example.com.
- To save on cost, we want to host app.example.com on the same server that example.com is using (i.e. create a virtual host on the web server).
This means that we have to configure our web server so that it will serve a different webroot depending on the domain it is being accessed from.
Continue readingShallow 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.
The definitive guide to installing Unity in 2024
Unity has seen growth in leaps and bounds since its humble beginnings in 2005, having IPO-ed for a whooping US$1.3 billion in September 2020. It is also looking at releasing Unity 6 — chock with a whole bunch of new features — at the end of 2024.
Since its tremendous growth over the past 3 decades, the Unity Engine has also changed significantly over the past decade, so much so that it has become difficult to set up and use, especially for new users. If you’re just getting your toes wet with the engine for the first time, here is a guide to help you figure out how to set it up — the trouble will be worth it, because it is one of the easiest game engines to use, and also one of the most robust game engines out there.
Continue readingSave money by being smart with PayPal conversion
In today’s digital era, where everything is becoming smarter and faster, and everyone is about doing things that make them look smart, PayPal is absolutely invaluable. It’s a payment platform that stores all of our payment information across different cards and banks, so we don’t have to remember and re-enter pesky things like credit card numbers everytime we purchase something. Just click on PayPal’s big yellow checkout button! It’s the smart thing to do, right?
Continue readingDebugging PHP gettext
Over the last couple of weeks, I’ve been tinkering with PHP’s gettext to set up internationalisation for one of my web apps (i.e. getting it ready for translation into different languages). Even though there were many step-by-step guides and Stack Overflow topics on the web, all detailing a similar set of instructions, following them did not work things out for me.
After some frustration and a lot of time tinkering, it turns out that these guides were missing some pieces of information. If you are tearing your hair out troubleshooting PHP gettext, this article might be just what you’re looking for.
Continue readingUnity Rigidbody’s Interpolate property
If you looked at the properties available for configuration on a Unity Rigidbody and poured through the documentation for it, you’ll likely find that most of its properties are pretty easily to understand, with the exception of Interpolate and Collision Detection. We’ve explored what the Collision Detection properties do in another article on this blog, and we’re going to explore the Interpolate property in this article.
Continue reading