Home » 2022 » March

Beginners Guide to Floating Point Arithmetic Precision

The Ultimate Beginners Guide to Floating Point Math/Arithmetic Precision Problems

This guide will explain the programming issues you will encounter when performing arithmetic with floating point numbers, and how to avoid them. The reason why these issues occur will be summarised and solutions will be provided. Floating point precision issues are common hurdle for beginner programmers – sometimes the result of what should be a simple mathematical operation comes out wrong, and little reason is given. Floating point precision issues are usually the cause, so here’s what they are and why this problem occurs. What … Read more

Home » 2022 » March

Using The Python decimal Class for Accurate Calculations

Python decimal class

This guide will introduce you to the Python decimal library and class – Python tools which allow you to accurately work with decimal numbers without the rounding and accuracy issues which frequently arise when working with floating point numbers. Computers Can’t Perform Accurate Arithmetic With Decimal Numbers Decimal numbers are commonly stored as floating point number values. Computers are not particularly good at performing arithmetic with this type of numbers accurately. We break down why this is in our Ultimate Beginners Guide to Floating Point Math/Arithmetic Precision Problems. … Read more

Home » 2022 » March

The JavaScript toString() Method, Explained + Examples

JavaScript toString()

One of the most common things you will want to do with a variable is to print a string representation of it. That’s what the toString() method is for. This article will explain when and how you can use it. Converting to Strings Data is displayed on your computer screen is most frequently displayed as text strings, regardless of how the data was stored. Numbers, arrays, boolean values, and objects, all have string representations that allow them to be viewed as text on screen, either for the … Read more

Home » 2022 » March

Configuring a Privacy VPN with OpenVPN on OpenWrt With LuCI

OpenVPN on OpenWrt With LuCI

This tutorial will show you how to configure a privacy Vpn using OpenVPN on OpenWrt through the LuCI web interface (no command line required!). Lots of screenshots are included so that you can follow along. What is OpenWrt OpenWrt is a popular Linux distribution for routers and other low power devices. It makes a perfect host for a VPN gateway. What is a Privacy VPN/ What is OpenVPN? A VPN (Virtual Private Network) provides an encrypted connection between two networks over the internet. Traditionally this was used for … Read more

Home » 2022 » March

Building a Raspberry Pi 4 WiFi Access Point + Airplay Server

Raspberry Pi Access Point and Airplay

This tutorial will detail how to build a wireless access point using a Raspberry Pi 4 with hostapd. I’ll also set up an Airplay server using shairport-sync so that my access point can play music. There are a number of tutorials for setting up a Raspberry Pi as an access point, but many are outdated or don’t work – this one does! The Setup I want to set up my Pi as an access point – supplying internet via ethernet cable and broadcasting a wireless network. I’ll be … Read more

Home » 2022 » March

Browsing the Internet on a 1989 Macintosh II with a Web Rendering Proxy

Browsing the Internet on a 1989 Macintosh II with a Raspberry Pi

For completely impractical reasons I decided to try and browse the internet using my 1989 Macintosh IICI computer. Here’s how it went. I’ve previously tried web browsing with Web Rendering Proxy on a 1993 Windows 3.11 computer, and thought I’d see how the Apple experience stacks up. Setting up the Raspberry Pi with Web Rendering Proxy Web Rendering Proxy is a neat little tool that lets you browse the internet from older devices. It works by rendering a modern web-page in a modern Chromium browser, … Read more

Home » 2022 » March

DIY Raspberry Pi Powered Pinball Machine [Kitchen Build]

Raspberry Pi Powered Pinball

This article will show you how I built a DIY Raspberry Pi Powered Pinball game using GDevelop and an Arduino to add physical push-buttons to control the game. GDevelop is a zero-code game development studio, so this article has almost no coding required. I’ve been meaning to check out GDevelop for a while, so I’ve combined a simple GDevelop game with a 2-button Arduino game controller to make a little virtual pinball machine.  Here’s the finished product in action! What We’re Building As you can … Read more

Home » 2022 » March

Linux: Set Which Network Connection You Get Internet From [Default Route]

Linux set default internet route

This quick tutorial will show you how to set which network Linux uses to access internet when multiple networks are connected by setting the default route. If you have a Linux device (for example a Raspberry Pi) connected to multiple networks (like being connected to a wireless and wired network simultaneously), you might have trouble connecting to the internet. That’s because Linux will have automatically set up some default routes, and will have somewhat arbitrarily picked which interface it tries to use to access the internet … Read more

Home » 2022 » March

Using PHP sleep() and usleep() to Pause Execution [Examples]

Pausing PHP with sleep and usleep

This short tutorial will show you how to use the PHP sleep() and usleep() functions to pause script execution for a number of seconds/microseconds, and provide some code examples. The PHP sleep() and usleep() functions both pause execution of the script, but both behave a bit differently. Why Pause/Sleep PHP Script Execution? Delaying, sleeping, or pausing PHP script execution is commonly used when scheduling an event. A call to the sleep() function might be placed at the end of a loop, so that after the code inside the loop has been run, a certain amount of time … Read more

Categories PHP

Home » 2022 » March

How to Use Single/Multiline Comments in your PHP Code

PHP Code Comments

This article will quickly walk you through how to comment your PHP code with single and multi-line comments. What is a Comment? A comment in programming is one or more lines of text that aren’t interpreted as programming instructions. Instead, the computer skips the commented lines when executing your code, completely ignoring them. Comments don’t have to conform to any valid syntax. They’re just text that you read, and the computer doesn’t. Comments can span single or multiple lines. Single Line Comments Single line comments are any lines of … Read more

Categories PHP