Home » Programming

Using JavaScript ‘toLowerCase()’ String Method [with Examples]

JavaScript toLowerCase

Want to make a string all lower case in JavaScript? It’s the toLowerCase() method to the rescue! The toLowerCase() method is part of the string object and has full support in all browsers. In JavaScript, strings can either be a primitive or an object – primitives are the most basic kinds of variables, which are not objects, have no methods, and simply represent the given characters. However, String objects have useful methods for manipulating and measuring the string – like toLowerCase(). By default, JavaScript’s string variables are initialized as primitives – but will be automatically … Read more

Home » Programming

How to Install Pip/Pip3 for Python [Simple Guide]

How to Install Pip3

This tutorial will teach you how to install pip3, the package manager for Python, on Ubuntu Linux. Pip is a Python Package Manager. It’s currently at version 3 – hence, Pip3. Python is useful on its own, but it’s even more useful when you can start leveraging other people’s pre-written code. The default repository used by Pip is the Python Package Index (PyPI) (https://pypi.org/). PyPI contains a collection of other users’ code for performing a multitude of tasks, from drawing graphs to artificial intelligence. Checking if Pip is Already Installed … Read more

Home » Programming

GitLab vs. GitHub: A Simple Comparison

GitLab vs. GitHub

What is Git? Git is a Version Control system that allows you to track the changes you make to files stored in a repository. Git is most commonly used by programmers to store and track changes to their code, but is also used for tracking changes and progress on other text files or data sets – for example, it has become popular with Ph.D. students use it to store and manage the writing of their thesis’, and with authors writing complex books with many revisions. Terminology Here’s a quick … Read more

Home » Programming

Listing Databases and Tables in MySQL and MariaDB

mysql mariadb list databases tables

This guide explains how to list databases and tables using MySQL or MariaDB using simple commands. Managing your databases from the Linux shell is quick and efficient compared to some of the bloated database management tools available. Here’s a quick primer on seeing what databases and tables you’ve got set up on your MySQL or MariaDB server. Listing Databases Once you’ve logged in to your database, simply enter the following to list your databases: SHOW DATABASES; You’ll get a list of all of the databases … Read more

Home » Programming

Boolean Operators: Comparing Values in Python

Boolean Operators in python

Python is widely used for both scripting and automation on Linux, as well as building web and standalone applications. Python is designed to be easy to learn, easy to write, and easy to read. It’s a great multi-purpose programming language. Boolean Values This article covers how boolean operators work in Python. In programming, a boolean value is either TRUE or FALSE. When comparing values in Python, a boolean value is returned allowing you to store the result of the comparison, or take a certain action … Read more

Home » Programming

PHP in_array Function: Check Array Values Exist

PHP in_array Function

The PHP in_array() function allows you to check for the presence of a value in an array, and take an option based on this result. Syntax in_array ( $needle , $haystack [, $strict = FALSE ] ) Note That: $needle can be a variable of any type (string, number, date, etc) $haystack should be an array (see here, here, and here for more about arrays) $strict is optional, and will ensure that the type of values is also compared when checking whether $needle is present If $strict is FALSE (the default behavior), the number … Read more

Categories PHP

Home » Programming

Using the PHP Array ‘implode’ Function, with Examples

php implode function

We’ve previously covered the explode() function in PHP – now it’s time for implode()! This tutorial will teach you how to merge values from an array into a single string using the PHP implode() function. Processing data for presentation to the end-user is one of the common PHP tasks. PHP is frequently used on Linux to display database query results to the user. If some of those values are stored in an array, you may want to merge them into a single string for ease of display or brevity … Read more

Categories PHP

Home » Programming

PHP strpos Function: Check if a String Contains Another String

php strpos function

The PHP strpos() function checks whether a string is contained within another string – for example checking whether a certain word appears in a sentence, and what position it appears in.  It is a great companion to the PHP substr() and str_replace() functions for processing text data. Syntax strpos ( $haystack , $needle [, $offset = 0 ] ) Note that: $haystack is the string (text or series of characters) we want to search within $needle is the string search term we are looking for $offset Is optional … Read more

Categories PHP

Home » Programming

Check Python Version (Windows, Linux & macOS)

Check Python Version (Windows, Linux & macOS)

This tutorial explains how to check the version of Python that is installed on your system. The commands work on Windows, Linux & macOS, and with Python2 or Python3. Python is an incredibly popular and powerful programming language worldwide for everything from website development, content aggregation tools, link shortening, and writing scripts, to data analysis, virtual assistants, and machine learning. There are various versions available with different release dates, so how do you know which version is running on your machine? Here’s a quick guide … Read more

Home » Programming

How to Get the Length of a List in Python

How to get the length of a list in Python

This tutorial will teach you how to find the length of a list (array) in Python using some code examples. There are four data structures built into Python: tuples, sets, dictionaries, and lists. They are important for programmers because they allow for iteration over their contents. When we talk about data structures such as lists in Python, we are referring to a collection data type. Lists in Python can be ordered and changed. Also, unlike the sets collection type, a list allows for duplicated entries, … Read more