Programming 

The Ultimate Guide to Python Lists

The most important collection data type in Python is the list data type. You’ll use lists basically in all your future projects. So take your time and invest a good hour or so to study this guide carefully. You can also play my short video tutorials as you read over the methods. Let’s start with an overview: Python List Methods Method Description lst.append(x) Appends element x to the list lst. lst.clear() Removes all elements from the list lst–which becomes empty. lst.copy() Returns a copy of the list lst. Copies only…

Read More
MatLab 

Matplotlib Boxplot – A Helpful Illustrated Guide

Do you want to plot numerical data? And do it in a beautiful, engaging, and scientifically sound way? And do all of this in a few simple lines of code? You’re in the right place! A great way to plot numerical data is the matplotlib boxplot. It displays the median, the interquartile range, and outliers of the data. How can you visualize your data with the boxplot? Get that data into an array-like object – list, NumPy array, pandas series, etc. Pass it to plt.boxplot(). Call plt.show(). As a result,…

Read More

A Guide to SQL Naming Conventions

One of Java’s big strengths, in my opinion, is the fact that most naming conventions have been established by the creators of the language. For example: Class names are in PascalCase Member names are in camelCase Constants are in SNAKE_CASE If someone does not adhere to these conventions, the resulting code quickly looks non-idiomatic. What about SQL? SQL is different. While some people claim UPPER CASE IS FASTEST: @lukaseder MAKING SQL QUERIES IN CAPITAL LETTERS MAKES DATABASE TO SENSE URGENCY AND RUN FASTER. — Aleksey Shipilëv (@shipilev) February 26, 2016…

Read More
java 

Data structures and algorithms in Java: A beginner's guide

This tutorial series is a beginner’s guide to data structures and algorithms in Java. You’ll learn: How to recognize and use array and list data structures in your Java programs. Which algorithms work best with different types of array and list data structures. Why some algorithms will work better than others for your specific use case. How to use time and space complexity measurements to choose the most efficient algorithm for your use case. davidgoh / akindo / Getty Images PART 1: What is a data structure? And how to write…

Read More
Programming 

Python List index() – A Simple Illustrated Guide

This tutorial shows you everything you need to know to help you master the essential index() method of the most fundamental container data type in the Python programming language. Definition and Usage: The list.index(value) method returns the index of the value argument in the list. You can use optional start and stop arguments to limit the index range where to search for the value in the list. If the value is not in the list, the method throws a ValueError. Here’s a short example: >>> lst = [“Alice”, 42, “Bob”,…

Read More
MatLab 

BreadcrumbsCollector: How to mock in Python? – (almost) definitive guide

What is a mock? Mock is a category of so-called test doubles – objects that mimic the behaviour of other objects. They are meant to be used in tests to replace real implementation that for some reason cannot be used (.e.g because they cause side effects, like transferring funds or launching nukes). Mocks are used to write assertions about the way they are used – e.g. if they were called, which arguments were used etc. It is a flagship technique of interaction-based testing – checking how objects under test use…

Read More

A beginner’s guide to JPA persistence.xml file

Introduction In this article, I’m going to explain what is the purpose of the JPA persistence.xml configuration file, and how you can set up a Java Persistence application using the available XML tags or attributes. While Spring applications can bootstrap without needing an XML JPA configuration file, it’s still important to understand the meaning of each configuration option since Spring also offers an alternative way when building a Java Persistence LocalContainerEntityManagerFactoryBean or the Hibernate-specific LocalSessionFactoryBean. Persistence Unit The persistence.xml configuration file is used to configure a given JPA Persistence Unit.…

Read More
MatLab 

Python List sort() – The Ultimate Guide

Every computer scientist loves sorting things. In this article, I’ll show you how Python does it—and how you can tap into the powerful sorting features of Python lists. Definition and Usage: The list.sort() method sorts the list elements in place in an ascending manner. To customize the default sorting behavior, use the optional key argument by passing a function that returns a comparable value for each element in the list. With the optional Boolean reverse argument, you can switch from ascending (reverse=False) to descending order (reverse=True). Here’s a short overview…

Read More
Programming 

The Beginner’s Guide to Python Turtle

When I was a kid, I used to learn Logo, a programming language that involved a turtle that you could move around the screen with just a few commands. I remember feeling like a computer genius as I controlled this little object on my screen, and this was what got me interested in programming in the first place. The Python turtle library comes with a similar interactive feature that gives new programmers a taste of what it’s like to work with Python. In this tutorial, you will: Understand what the…

Read More
Programming 

A Guide to the Newer Python String Format Techniques

In the previous tutorial in this introductory series, you learned how to format string data using the string modulo operator. The string modulo operator is useful, and it’s good for you to be familiar with it because you’re likely to encounter it in older Python code. However, there are two newer ways that you can use Python to format strings that are arguably more preferable. In this tutorial, you’ll learn about: The string .format() method The formatted string literal, or f-string You’ll learn about these formatting techniques in detail and…

Read More