I’ve been developing a WordPress child theme based on Astra for a client recently. This child theme comes with a custom post type, and I ran into a bit of trouble trying to remove the Astra Settings Meta Box (which Astra tags onto every single post type) from my custom post type.
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:
Fix jittery camera movement in Unity with Rigidbody Interpolate
If you’ve got a player character in your game that derives its movement from a Rigidbody
or Rigidbody2D
component in Unity, and you write a script to make your camera follow it, you will likely see jittering in your camera movement.
Here’s an example:
Unity C# error: Animator does not contain a definition for ‘SetBool’
Recently, I came across an error that was quite the head-scratcher while grading some Unity scripts. Here’s what the error says:
But SetBool()
is a valid method in the Animator
component from Unity, so what exactly is going on here?
Importing a CSV file into an SQL table
CSV stands for Comma-Separated Values, and CSV files are text files that look something like this:
example.csv
Username,Email,Address,Contact johndoe,john@example.com,"71 Pickering Street, Singapore, Singapore",+65-91234567 janedoe,jane@website.com,"24 Raffles Lane, Singapore, Singapore",+65-81234567 marysmith,mary@smith.com,"83 Riveting Road, Singapore, Singapore",+65-97654321 bobsmith,bob@smith.com,"84 Riveting Road, Singapore, Singapore",+65-87654321
Essentially, the CSV file format is meant to represent tabular data. The above CSV file represents the following table:
Username | Address | Contact | |
---|---|---|---|
johndoe | john@example.com | 71 Pickering Street, Singapore, Singapore | +65-91234567 |
janedoe | jane@website.com | 24 Raffles Lane, Singapore, Singapore | +65-81234567 |
marysmith | mary@smith.com | 83 Riveting Road, Singapore, Singapore | +65-97654321 |
bobsmith | bob@smith.com | 84 Riveting Road, Singapore, Singapore | +65-87654321 |
Due to their tabular nature, data in a CSV file can very easily be imported into and stored in an SQL table. The commands to do that, however, are not very well-documented online.
If a CSV file does not open as a text file on your computer, that’s because your computer is opening the file with a spreadsheet program such as Microsoft Excel. In such a case, to see the file as text, you will want to open these files on a text editing software such as Notepad.
Continue readingRunning 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 readingThe namespace <global namespace>
already contains a definition for…
Here’s a common error that people usually run into when doing Unity scripting, and it’s one that even reasonably-skilled programmers can take awhile to fix.
Hiding the WordPress admin bar programmatically on the backend
Whenever you are logged in to WordPress, there is a black admin bar that shows up above every page. On front-end pages, you can call show_admin_bar(false)
in one of your plugin or theme functions to remove it. Individual users can also hide the admin bar on their account’s profile page.
All of this, however, doesn’t work if you are on a backend page. No matter what you do, the admin bar will always show up in those circumstances, unless you remove the admin bar programmatically — this article is here to show you how, as well as why you would want to do such a thing.
Continue readingPassing 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 readingWhy doesn’t text-align: center
work? A primer on block and inline elements in HTML and CSS
If you’re just starting your foray into web development, you’ll probably find that HTML and CSS have a variety of quirks that can make working with them somewhat frustrating for beginners. One of these quirks involves the text-align
CSS attribute, as the attribute only applies its effects to certain kinds of HTML elements.
Creating a bar-line chart in Microsoft Word
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 reading