Home » 2021

How to Install & Use Bash (Linux Shell) on Windows 10 [Tutorial]

bash for windows

Here’s how to set up and use the Linux shell on Windows – using the Windows Subsystem for Linux (WSL). This tutorial is intended for up-to-date versions of Windows 10 from 2020 onwards. I’m not going to cover how to use WSL on older versions of Windows 10 or other methods for Windows 8/7/XP/3.1 because you shouldn’t be using outdated software. If you must use Windows, use a version that still receives security patches! WSL is a great tool and allows you to pretty much run Linux software on windows … Read more

Home » 2021

PHP strtotime() Function – Converting Text to Timestamp [With Examples]

PHP strtotime

The PHP strtotime() function takes a string containing text and converts it to a Unix Timestamp. Find out how to use this function in this guide. A Unix timestamp is a number representing the number of seconds since 00:00:00 UTC on 1 January 1970. From it, you can build more complex Date/Time objects which can readily provide Dates/Minutes/Hours/Seconds or other information about the supplied time. strtotime Syntax strtotime ($datetime , $baseTimestamp) Note that: $datetime is your supplied text string (possibly) containing a date strtotime() supports the English language only See … Read more

Categories PHP

Home » 2021

Raspberry Pi & Python Powered Tank – Part II

Raspberry Pi Python Powered Tank Part II

This is part 2 of the Raspberry Pi and Python powered tank project. In this article, we attempt to display a live video stream and buttons to control the tank in a web UI. In the Last Episode In part 1, I gutted a toy tank and wired in a Raspberry Pi, and wrote some Python to make it move around. Now, to write a remote control interface that runs in a web browser, with a live video stream and buttons to control the motors. … Read more

Home » 2021

Concatenating (Joining) Strings in JavaScript [3 Methods]

javascript string concatenation

Being able to concatenate (join) two or more strings together is pretty useful – you may be combining user input for storage in a single database column or doing the reverse – combining data from multiple database columns into a single string for display or output. There are several ways to concatenate strings in Javascript, and we’ll cover these methods below, along with some useful examples. The string.concat() Method The string.concat() method will join any number of strings to a given initial string. Syntax string.concat(string1, string2, string3…) Note that: string is … Read more

Home » 2021

Javascript String includes() Method – Check if a String Contains Another String

Javascript String includes

Here’s a guide on checking whether a string contains another string in the JavaScript programming language using the includes() method. includes() Syntax string.includes(search, start) Note that: string should be a string value or variable search should be the string you are checking for start is the index (position) you want to start searching at. It’s optional Indexes start counting at 0 – The first character of the string is at index 0 returns bool Examples var string = “Linux all over the world”; var result = string.includes(“over”); // Will … Read more

Home » 2021

Python isinstance Function, With Example [Guide]

Python isinstance Function

The Python isinstance() function determines the type or class of a variable. Read on to find out exactly how isinstance works, with an example below. What are Types? The type of a variable determines what it can or can’t do. It determines what value the variable may take and what can be done with that value. isinstance Syntax isinstance(OBJECT, CLASS) Note that: OBJECT is the variable or value to check the type or class of CLASS is the type or class we want to see if the variable type matches The function returns a boolean value (True/False) Types in Python Generally, … Read more

Home » 2021

What is a Tuple in the Python Programming Language?

python tuple

A Tuple is a type of variable in Python – a data structure containing multiple parts. It’s a collection (or array) of data – but a specific kind of collection. It’s Ordered (Indexed) Elements in a tuple are stored in order – stored with an index or position – their position in the collection is fixed, and they can be found by their position. It’s Unchangeable (Or Immutable) Once a tuple is created, elements in it cannot be moved, removed, added, or altered. Duplicates are Allowed Duplicate values are allowed as tuples are indexed, so multiple elements with the same … Read more

Home » 2021

Using JavaScript try/catch/finally Statements [With Examples]

JavaScript try catch finally

This tutorial explains how to use the try/catch/finally statements in Javascript to handle errors, with some useful examples. Sometimes an error is expected – and rather than wanting the application to halt execution on the error; you want to do something else. Other times, an error is unexpected or detrimental to the running of an application, and you want to make sure that it is reported. try/catch statements in JavaScript let you do this. try/catch will attempt to run a block of code and take a specified action … Read more

Home » 2021

Array slice() Method in JavaScript, with Examples

Array slice in JavaScript

We have covered removing items from arrays in JavaScript, as well as checking whether an item is present in an array. This article will look at copying or returning a subsection of arrays using the slice() method in Javascript. slice() Syntax arr.slice([start[, end]]) Where: arr is an array or existing array variable start is the index to start the slice at If it is undefined, it will default to 0 The index is the position of the item within the array. Remember, they start at 0! end is the index to end the slice at If it … Read more

Home » 2021

The Macintosh Pi – Vintage Apple Macintosh + Raspberry Pi!

Vintage Apple Macintosh Raspberry Pi

In this project, I will be putting a vintage Apple Macintosh to use with Linux and Raspberry Pi! My latest purchase. The Powermac G4. Stylish. Powerful (For 2001). Completely impractical in 2021. Why did I get it? Because it looks cool, and I really like the late 90’s/early 2000’s design of Apple’s hardware. It’s all translucent and cool. There’s still a lot of good software for these old macs – and the simplicity of them is kind of nice, so I thought – could I use … Read more