Home » 2021 » February

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 » February

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 » February

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 » February

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

Home » 2021 » February

Top 3 Best Linux Distro for Gaming in 2021

Best Linux Distro for Gaming

This article will take you through our top 3 picks of the best Linux distributions for gaming in 2021. Best Linux Gaming Distros There are so many Linux distributions available for a multitude of purposes, but there are not many Linux distros with gaming at the forefront. However, many distros are great for gaming. Let’s discuss the honorable mentions, each distribution has its purpose and could be a good fit for you. Pop!_OS Aside from the asinine use of punctuation, Pop!_OS is a really great Linux … Read more

Home » 2021 » February

Read a File Line by Line in Python [3 Methods]

Line by Line in Python

This tutorial will examine several methods and best practices for reading a file line-by-line in the Python programming language. Reading a file line-by-line will be useful for parsing log files, CSV spreadsheet files, or even reading files you have generated from an application yourself. Line by Line File Reading – Examples The examples on this page will read from a text file named mytext.txt with the following content: Linux Is Very Cool Using the readlines() Function The following python code will call the built-in open() function, which … Read more

Home » 2021 » February

PHP foreach Loop [With Examples]

PHP foreach Loop

Looping over arrays and iterating over an object’s attributes form the foundation of a lot of application logic. The foreach construct in PHP can do both and is a crucial tool for building your application logic. PHP foreach Syntax The syntax for a foreach construct in PHP is as follows: foreach (iterable_expression as $value) { # statement(s) } Or, if you also wish to access the array key as well: foreach (iterable_expression as $key => $value) { # statement(s) } Note that: iterable_expression is the variable or value to … Read more

Categories PHP