Troubleshooting PHP gettext

Troubleshooting 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.

Continue reading
Unity Rigidbody Interpolation Hero

Unity 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.

Unity Rigidbody's Interpolate
The Interpolate property has 3 possible values.
Continue reading
Swords and Shields
Awesome starters artwork by Ry Spirit: https://instagram.com/ryspiritart/

Calculating EVs needed to raise a stat in Pokémon

As a result of working on upgrades for this Pokémon Effort Value Calculator, math has been a pretty big part of my life for the past few months, as I’ve been rearranging the games’ formulas for stat and damage calculation to make my own that fit my needs.

One such formula was the EVs needed one, which gives you the amount of EVs you need to invest to raise a stat by n points. Everyone knows that at Level 100, you get 1 stat point for every 4 EV points you invest; but what happens when you’re not at Level 100, or when you factor in stat modifiers like Nature, or item and ability boosts?

Don’t know what effort values are? Start with this article from Bulbapedia. Don’t play the mainline Pokémon games? Then you should start with these.

Continue reading
reCAPTCHA Meerkats
Image by Mike Birdy, from https://stocksnap.io/photo/animals-mammals-VJ91Z8LULN

Verifying Google reCAPTCHA v2 checkbox on PHP

17 July 2020: Updated the class provided in this article to make it easier to use.

For those of you using Google reCAPTCHA to weed out spam on your websites, here’s a code snippet for verifying the reCAPTCHA v2 tickbox response on the server-side using PHP.

Continue reading
RAM in Black
Image by Tim Sullivan, from https://stocksnap.io/photo/computer-ram-IN0CFPMXAQ

RAM, explained in English

RAM stands for Random-Access Memory, but that is something that you can find out just by doing a quick Google search. If you read the results of said Google search to understand what it is, you’ll start running into jargon that can be difficult to understand for a layperson. Here are some examples:

…a form of computer memory that can be read and changed in any order, typically used to store working data and machine code

Wikipedia: https://en.wikipedia.org/wiki/Random-access_memory

…temporary storage that goes away when the power turns off

Avast: https://www.avast.com/c-what-is-ram-memory

…is used to load and run applications, such as your spreadsheet program, respond to commands, such as any edits you made in the spreadsheet, or toggle between multiple programs, such as when you left the spreadsheet to check email

Crucial.com: https://www.crucial.com/articles/about-memory/support-what-does-computer-memory-do

These are not bad examples, per se, but if you don’t work with computers a lot, these explanations will seem very abstract. What does working data mean, for example; or why is RAM temporary storage (why not just make it permanent)?

Continue reading
Unity Remote Splash Screen
Unity Remote 5 Android app splash screen

More tricks to get Unity Remote for Android working on Windows

This article is a continuation of Getting Unity Remote for Android to work on Windows. If you haven’t read that, I suggest you take a look at the article and make sure that Android Build Support (and its accompanying Unity-native SDK, NDK and JDKs) is installed, and that you have tried installing the Google USB Driver.

There are also some simple troubleshooting tips listed in that article that you should try first, before you attempt the ones here.

Continue reading
Unity Remote Splash Screen
Unity Remote 5 Android app splash screen

Getting Unity Remote for Android to work on Windows

30 July 2020: We’ve updated the article with helpful comments from past readers. Thanks for all your contributions!

If you’re developing a game for Android on Unity, Unity Remote is an irreplaceable tool that allows you to quickly test your game on your Android device using Unity’s built-in Play-in-Editor feature. Unfortunately, it is also pretty difficult to get Unity Remote to work, since it requires some very specific configurations on both your Android device and your computer.

Available solutions online are often incomplete, inaccurate, or outdated (Unity Remote was released more than 4 years ago, and the Android development scene is very different from how it was then), so you often have to piece solutions from multiple sources to get one that works. Hence, after recently grappling with getting Unity Remote to work on a handful of my own computers, I’ve decided to write an article outlining the most important steps for getting Unity Remote to work. Hopefully, this will save you from having to do over 9000 Google searches like I did.

Continue reading
GitHub Desktop
Image from https://desktop.github.com/

Using GitHub Desktop as your source control repository in Unity

If you’re working on a Unity project on the default, free Unity license, you’re only allowed to have a maximum of 3 people (and a storage limit of 1GB) on Unity Collaborate. While you can work around the headcount limitation by adding and removing members as and when they need to make a commit, it can quickly become a tremendous hassle. Hence, for those not willing to pay for a Unity license, a cheap and easy way to go around both the personnel and storage limit is to use GitHub Desktop for collaboration.

Continue reading
Debugging with Beverage

Fixing an Apache cron log rotation error

If you manage a Unix-like server, every now and then, you might get an email from the server notifying you of important errors that occur in your server. Here’s one that I got earlier today from an Ubuntu 18.04 server of mine:

Cron <root@terresquall> test -x /usr/sbin/anacron || ( cd / && run-parts –report /etc/cron.daily )

/etc/cron.daily/logrotate:
error: error running shared postrotate script for ‘/var/log/apache2/*.log ‘
run-parts: /etc/cron.daily/logrotate exited with return code 1

Mail sent at 06:39

It’s never fun to receive server admin emails like this, because it means that your server has issues, but the message tends to be really ambiguous, so it’s really hard to figure out what the issue is. Obviously, I didn’t know what the issues were, so I had to do some research.

Continue reading