In this article, you’ll discover what YOLO is and how to use it to analyze a video and detect and count people within it. We’ll walk through a simple Python script that lets you configure basic parameters and choose the most appropriate video source for your needs. What is YOLO? YOLO (You Only Look Once) is a real-time object detection algorithm based on neural networks. Put simply, YOLO analyzes each video frame (whether from a file or a webcam/IP stream) to identify objects such as people, vehicles, animals, and more. ...
Function Definition in Python
In all programming languages, one of the most important aspects is code organization and readability. In Python, as in many other languages, this goal is also achieved through the use of functions. By convention, all the code we write is executed within a main function, often called main. However, we can—and should—split our code into multiple functions to simplify maintenance and encourage reuse. What are functions in Python? The function definition in Python is done using the def keyword, followed by the function name and parentheses. There are two main types of functions: ...
Installing Java and Choosing an IDE
If you’re reading this article, it’s probably your first experience with Java — and perhaps with programming in general. In this article, we’ll go over how to install the Java SDK, choose an IDE, and write a simple program to make sure everything is working correctly. After discussing why Java can be a great choice for both beginners and experienced developers, let’s now see how to install the Java SDK and choose the most suitable IDE. ...
Java: What It Is and Why You Should Learn It
Java is an object-oriented programming (OOP) language, known as a strongly-typed language, meaning that variable types are specified statically directly in the source code. Java was created in 1992 at Stanford University under the name “Oak,” later renamed to “Java” due to copyright issues (source). The main strength of Java is probably its portability: it can run on different platforms without modifying the code, making it extremely versatile and contributing to its widespread adoption. ...
Control Flow and Loops in Python
In all modern programming languages, conditional statements and loops are essential for two primary purposes: Making decisions based on given or computed values. Automating repetitive tasks to avoid rewriting the same code. If…else The if...else statement allows you to change the normal flow of code execution by evaluating a specific condition. Here is an example x = int(input("Insert a number:")) if x % 2 == 0: print("Your number is even") else: print("Your number is odd") This code will print a different message depending on whether the value entered by the user is an even or an odd number. ...
Spring Framework – Part 2
In the previous articles… As we introduced in the first article, Spring is an excellent tool for Java application development. We also explored how to set up a basic project and create an initial, simple API. In this article, we’ll connect the project to a database, specifically PostgreSQL, and explore how to persist and manipulate saved data. PostgreSQL PostgreSQL, originally known as “post-ingres,” was conceived by Michael Stonebraker in 1985. It serves as a robust alternative to other relational databases like MySQL. The key distinction of PostgreSQL lies in its support for defining custom data types (based on standard SQL types) and data type inheritance. For detailed insights, refer to the official website. ...
Operators in Python: Arithmetic, Comparison, and Logical
In Python, as in every programming language, there are various operators for manipulating numbers, logical values, and comparing objects. Arithmetic Operators The most familiar ones are the mathematical operators. Sum: + Subtraction: - Multiplication: * Division: / or // Exponentiation: ** Modulus: % Let’s see an example for each operator: print(10 + 3) # Addition: 13 print(10 - 3) # Subtraction: 7 print(10 * 3) # Multiplication: 30 print(10 / 3) # Division: 3.3333... print(10 // 3) # Floor Division: 3 print(10 ** 3) # Exponentiation: 1000 print(10 % 3) # Modulus: 1 Of these, the one worth a quick note is the // operator, also known as “Floor Division.” This operator simply rounds down the division result to the nearest integer. ...
JWT Authentication
Have you ever noticed that some websites have a private section that requires a username and password to access? You might also have noticed that, once logged in, you’re often not asked to re-enter your username and password for subsequent visits. In stateless web applications, this behavior is achievable by using a JWT token. JWT, which stands for JSON Web Token, is a data exchange standard defined by RFC7519 in 2015. ...
Spring Framework – Part 1
What is a Framework A Framework, in simple terms, is a set of predefined classes, libraries, and tools that provide a basic structure for software development. The use of a framework allows developers to avoid implementing basic features from scratch, enabling them to focus on developing specific, customized functionalities for their projects. Spring Spring is an open-source framework for Java application development. The first version of the framework was released in 2003 by Rod Johnson, and it has been enhanced over the years with a series of extensions. Over time, Spring has earned a leading role in Java application development, thanks to its highly active community and the vast availability of documentation and practical examples. ...
Python – Data Types
As mentioned in this article, Python is a dynamically-typed language, meaning the type of a variable is determined during program execution and cannot be changed afterward. However, this does not mean that there are no distinctions between the various variable types. Let’s take a look at the data types natively present in Python: Strings: str Numbers: int, float, complex Sequences: list, tuple Mappings: dict Sets: set, frozenset Boolean: bool Binary: bytes, bytearray, memoryview In Python, it is not necessary to specify the type of a variable when declaring it. This allows a variable to hold any of the types listed above. Moreover, dynamic typing means that a variable’s type can change at any time during code execution. ...