Home » Articles by: Brad Morton

Unix vs Linux – What’s the Difference?

Unix vs Linux

Here’s a quick summary of Unix and Linux and what makes them different, and ways you can try them out. Different products, similar uses What is Unix? Unix was developed in the 1970s by Bell Labs as an Operating System for developers. Over time features such as multitasking and support for multiple users were added, turning it into a versatile operating system popular with universities. The modular development of Unix lead to the Unix Philosophy – an emphasis on modular, reusable code and handling files as … Read more

Home » Articles by: Brad Morton

Checking Whether a String Contains a String in Python, With Examples

Python String Contains

This article will show you how to check if a string contains another string in the Python programming language. PHP and Javascript both have similar functions included: PHP strpos Function: Check if a String Contains Another String Javascript String includes() Method – Check if a String Contains Another String Python has several methods for accomplishing the same thing – read on for how to do it. Using in to Check if A String Contains a String in Python The fastest and best way to check if a … Read more

Home » Articles by: Brad Morton

Passing Variables by Reference in PHP, with Examples

PHP Pass Variable By Reference

This article will explain how to pass a PHP variable by reference and why you might want to do it – with some examples. What is a Variable? You probably already know this one. A variable stores a value – it has a name, and you can use that name to refer to the variable and the value it contains. In PHP, variable names are prepended with a $ (dollar symbol) and must contain only numbers, letters, dashes, and underscores: $variableName = “Variable Value”; Variable Behaviour in … Read more

Categories PHP

Home » Articles by: Brad Morton

Exiting Bash Scripts with the exit Command, With Examples

Bash Exit Script

Bash/Shell scripts usually run sequentially until all of the code in the file has been executed. The exit command will exit the script before this based on conditions of your choosing. exit Command Syntax Here’s the syntax for the exit command, which can be used in Bash/Shell scripts: exit STATUS Note that: STATUS is an optional parameter that sets the exit status of the script The exit status tells other programs whether the script executed successfully or not It will default to either 0 or the exit status of the last command executed by … Read more

Home » Articles by: Brad Morton

Arch Linux vs Ubuntu Linux – Which is To Choose?

Arch Vs Ubuntu

This article will explain Linux Distributions, Ubuntu, and Arch Linux, and give you some information to help choose between them. Linux Distributions The Linux Kernel is the core of the Linux Operating System – it handles the basic operations and interfaces with the computer hardware allowing software (like desktop interfaces, web browsers, and word processors) to run on top of it. On its own, the average user can’t do much with the Linux Kernel alone. A Linux Distribution (or distro for short) is an Operating System that … Read more

Home » Articles by: Brad Morton

Array Variables in Bash, How to Use, With Examples

Bash Array

We’ve covered using variables in Bash previously – this article will explain Bash array variables and provide some example usage. What is an Array An array is a type of variable that can hold multiple values. It’s a list of values you can loop through and perform operations on each individual value. For example, you might want to perform an action on a list of files. By storing that list as an array, you can loop through the file names in it and perform the action on each … Read more

Home » Articles by: Brad Morton

Using The isNaN() Function in JavaScript, With Examples

JavaScript isNan()

isNaN() is a JavaScript function that will tell you whether a value is equal to NaN – or Not a Number. It can be used to determine whether the result of a mathematical operation is valid or not. Here’s how to use it. What is NaN? NaN is a special value that means Not a Number. It means that a value that should be a number could not be parsed as a number. Any mathematical operation between any other value and NaN will result in NaN. It usually means something has … Read more

Home » Articles by: Brad Morton

What is $@ (Command Line Arguments) In Bash/Linux?

Bash $@

This article will explain what the $@ is in Bash and Bash/Shell scripting and how and why you might use it. The $@ variable is a special variable in Bash which holds the value of all of the command line arguments/parameters passed to the script. Command Line Arguments/Parameters in Bash Using command-line arguments/parameters in shell scripts is an important and useful feature, so we have a full article on it: This article follows on from our article on Command Line Arguments in Shell/Bash Scripts $@ Contains All Parameters/Arguments Passed to … Read more

Home » Articles by: Brad Morton

Merge Tables in MySQL (UNION/MERGE TABLES) – Tutorial

MySQL Merge Tables

There are one of two things you might be looking for – merging two MySQL tables, or the MERGE TABLE syntax – this article explains both, with examples. Merging Tables in MySQL (Moving Data From One Table Into Another) A note before I get to the code – if you’re moving data from one table to another, you should take into account the contents of the data and ensure that it will still be valid when merged with the second data set. This is particularly important if … Read more

Home » Articles by: Brad Morton

Find Large Files in Ubuntu/Linux (du/ncdu), With Examples

Ubuntu Linux Find Large Files

Running out of disk space? Here’s how to find large files in Ubuntu (and other Linux distributions) without any fuss using the du and ncdu commands. The du Command The du (Disk Usage) command does what it says it does – tells you about the disk usage of files in a given directory. du Command Syntax du OPTIONS PATH Note that: – OPTIONS is an optional space-separated list of options from the du command manual – OPTIONS will allow you to specify things like maximum and minimum file sizes to include, what unit to measure file sizes … Read more