Learn how to determine whether a given number can be expressed as the sum of two or more consecutive integers.
Also find me here:
Baeldung Editor
David Martinez
David is a Software Engineer with over 10 years of working experience in different industries. Lately, his focus is on cloud-based Java applications. He plays guitar when not coding.
Here's what I've reviewed (so far):
Baeldung on Java
- All
- Testing (35)
- Java (23)
- Spring (20)
- Data (20)
- Spring Boot (19)
- Spring Data (15)
- Core Java (13)
- Persistence (12)
- Java Concurrency (12)
- Reactive (11)
- Maven (11)
- Java Streams (11)
- Java IO (11)
- DevOps (11)
- Security (10)
- REST (10)
- JVM (9)
- Spring WebFlux (8)
- NoSQL (8)
- Java Array (8)
- JPA (8)
- Spring MVC (7)
- Java Dates (7)
- Artificial Intelligence (7)
- Architecture (7)
- Spring Web (6)
- Java String (6)
- Java Map (6)
- Java Collections (6)
- JSON (6)
- XML (5)
- Spring Persistence (5)
- IDE (5)
- Spring Security (4)
- Jackson (4)
- Gradle (4)
- Algorithms (4)
- Web Services (3)
- Spring Cloud (3)
- Logging (3)
- Java Web (3)
- Java Numbers (3)
- Java List (3)
- Jakarta EE (3)
- Docker (3)
- Cloud (3)
- HTTP Client-Side (2)
- Series (1)
- Networking (1)
Read a Gradle Defined Variable in Java
Filed under Gradle
Learn how to read a variable defined in the Gradle file at build time.
Spring AOP for a Method Call Within the Same Class
Filed under Spring
Learn how to handle method calls from within the same class in Spring AOP.
Conditional Logging With Logback
Filed under Logging
Learn about the conditional logging features provided by the Logback framework.
Grouping Endpoints by Resources in Swagger
Filed under REST
Learn how to organize your project’s APIs based on their URLs using the Swagger documentation.
Mastering Context in MapStruct: Leveraging @Context for Complex Source Mappings
Filed under Java
Learn about the @Context annotation in the MapStruct library and populate POJO attributes using external sources or services.
Serialization of Enum Values in Avro
Filed under Data
Learn how to serialize Java enum values using Apache Avro.
Guide to Eclipse OpenJ9 JVM
Filed under JVM
Learn how to install OpenJ9 JVM and review its main features.
Building an AI Chatbot in Java With Langchain4j and MongoDB Atlas
Filed under Artificial Intelligence
Walk through the process of building a chatbot using Langchain4j and MongoDB Atlas.
Baeldung on Linux
- All
- Administration (73)
- Networking (34)
- Security (29)
- Processes (27)
- Network Configuration (22)
- User Administration (17)
- Scripting (16)
- Network Monitoring (15)
- Files (14)
- Web (10)
- Service Management (10)
- Filesystems (10)
- File Editing (9)
- Docker (9)
- File Searching (8)
- Package Management (6)
- Installation (6)
- File Transfer (6)
- File Permissions (6)
- File Compression (4)
- Boot Process (4)
- File Viewing (3)
- Building (2)
- Search (1)
- File Conversion (1)
Using Different User-Agents with wget
Filed under Networking
Learn how to use custom user-agent strings with wget.
What Time Does cron.daily Run
Filed under Administration
Discover how cron works and how it interacts with components like anacron and systems.
Modify Media Metadata Using Ffmpeg
Filed under Administration
Learn how to modify media metadata using FFmpeg.
Download URLs Using wget
Filed under Web
Explore different techniques for downloading URLs using wget.
Removing Old Versions of Java and Installing New Versions on Linux
Filed under Installation
Learn how to manage your Java versions on Linux and keep them up to date.
How to Have Multiple Default Gateways for Outbound Connections
Filed under Network Configuration
Learn how to configure multiple default gateways in Linux using routing tables and network bonding for enhanced redundancy, load balancing, and effective failover.
How to Copy From One File to Another File in Shell Script
Filed under Scripting
Learn how to copy data from one file to another in the shell script.
How to Open Ports Using nftables
Filed under Network Configuration
Learn how to use nftables to open ports.
Meaning of useDNS Option for SSH
Filed under Security
Learn about the useDNS option within SSH.
Baeldung on Scala
- All
- Scala Collections (7)
- Scala Strings (4)
- Scala IO (3)
- Scala OOP (2)
- Scala Basics (2)
- Build Tools (2)
- Testing (1)
- Scala Web (1)
- Scala Numbers (1)
- Play Framework (1)
- Libraries (1)
Forms in a Play Application
Filed under Play Framework
Discover how to use Twirl within a Play application to create and submit forms.
eventually Block In ScalaTest
Filed under Testing
Learn how to use the eventually block in ScalaTest.
Introduction to ElasticMQ
Filed under Libraries
Learn how to use ElasticMQ with Scala.
Iterate a List Backwards in Scala
Filed under Scala Collections
Learn how to iterate a Scala list backward using only the existing Scala standard syntax constructors.
Remove Elements from the End of a String in Scala
Filed under Scala Strings
Learn how we to remove characters from the end of a String in Scala.
Introduction to Scala.js
Filed under Scala Web
Learn how to create a front-end application in Scala using the Scala.js plugin.
Get a Random Number in Scala
Filed under Scala Numbers
Learn how to generate a random number in Scala.
Find Unique Items in a List in Scala
Filed under Scala Collections
Learn how to find unique items in a list using Scala
Console I/O in Scala
Filed under Scala IO
Learn how to read user input using Scala.
Baeldung on Computer Science
- All
- Security (13)
- Math and Logic (10)
- Networking (9)
- Software Architecture (7)
- Algorithms (7)
- Programming (4)
- Data Structures (4)
- Machine Learning (3)
- Trees (2)
- OS (2)
- Graphs (2)
- Artificial Intelligence (2)
- Web (1)
- Sorting (1)
- Searching (1)
- Graph Traversal (1)
- Deep Learning (1)
The Method of Lagrange Multipliers
Filed under Math and Logic
Discover how to use the Lagrange multipliers method to find the maxima and minima of constrained functions.
Difference Between Quantum Computing and Artificial Intelligence
Filed under Artificial Intelligence
Discover the key differences between Quantum Computing and Artificial Intelligence (AI).
Why Use Softmax as Opposed to Simple Normalization
Filed under Machine Learning
Learn how and why to use Softmax instead of simple normalization in a neural network’s output layer.
Positive and Negative Acknowledgments (ACKs)
Filed under Networking
Discover the difference between positive and negative ACKs.
Security: Data Loss Prevention (DLP)
Filed under Security
Learn about DLP and its best practices.
What Is an Aggregate Root?
Filed under Software Architecture
Discover what is an Aggregate Root is in a Domain-Driven Design (DDD).
How Does the Burrows-Wheeler Transform Work?
Filed under Algorithms
Learn about the Burrows-Wheeler Transform (BWT) algorithm and its uses.
An Introduction to the Hilbert Transform
Filed under Math and Logic
Learn about the Hilbert transform and its applications.
Crockford’s Base32
Filed under Security
Learn about Crockford’s Base32 encoding.
Baeldung on Kotlin
- All
- Kotlin Collections (6)
- Kotlin Strings (4)
- Kotlin Numbers (3)
- Kotlin Classes and Objects (3)
- Kotlin Arrays (3)
- Kotlin IO (2)
- Kotlin Basics (2)
- Testing (1)
- Patterns (1)
- Libraries (1)
- Kotlin (1)
- Functional Programming (1)
Format Number With Thousand Separator in Kotlin
Filed under Kotlin Numbers
Learn different ways to use a thousand separator in Kotlin.
Testing StateFlows in Kotlin
Filed under Testing
Explore the best practices of unit testing StateFlows: the cases with single and continuous state updates, as well as converting a regular Flow into a StateFlow.
Excluding a Library from All Dependencies in Kotlin DSL in Gradle
Filed under Libraries
Learn how to exclude a library or a transitive dependency using the Kotlin DSL syntax in a Gradle.
Convert Int to Float in Kotlin
Filed under Kotlin Numbers
Learn several methods of converting an Int to a Float in Kotlin.
Iterating Over Components of Object in Kotlin
Filed under Kotlin Classes and Objects
Learn different approaches to iterating over object components.
Railway Oriented Programming in Kotlin
Filed under Functional Programming
Learn how to implement Railway Oriented Programming (ROP) with Kotlin.
How to Get the Name of a Variable in Kotlin
Filed under Kotlin Basics
Learn how to get the name of certain variables in Kotlin.
How to Add List Contents Into a Set in Kotlin
Filed under Kotlin Collections
Discover the various ways of adding List contents into a Set in Kotlin.
Convert an Array to a String
Filed under Kotlin Arrays, Kotlin Strings
Learn how to convert an Array’s content to a String in Kotlin.
Baeldung on Ops
- All
- Kubernetes (13)
- Docker (12)
- DevOps (10)
- Git (7)
- Jenkins (5)
- DevOps Concepts (4)
- Cloud (2)
- Monitoring (1)
Migrating a Project to a Different Organization in Azure DevOps
Filed under DevOps
Learn different ways to move an Azure DevOps project between organizations.
How to Prevent Two Pipeline Jenkins Jobs of the Same Type to Run in Parallel on the Same Node?
Filed under Jenkins
Discover several methods you can use to control a Jenkins jobs concurrency on a single node.
How to Debug “You Do Not Have Permission to View This Directory or Page” in Azure?
Filed under DevOps
Explore different troubleshooting method for this error message in Azure.
Troubleshooting Organization Lookup Errors in Azure DevOps Git
Filed under DevOps
Learn how to troubleshoot “Cannot determine the organization name for this dev.azure.com remote URL” in Azure DevOps Git.
Check if a File Exists in a Jenkins Pipeline
Filed under Jenkins
Learn different ways to check if a file exists in a Pipeline.
When to Use –hostname in Docker
Filed under Docker
Learn how to use –hostname flag in Docker to control network settings, efficiently deploy applications, and ensure seamless interactions across services.
GitHub: What Is a “wip” Branch?
Filed under DevOps Concepts
Learn what a GitHub wip branch is and the best practices for using it.
How to List the Roles Associated with a GCP Service Account?
Filed under Cloud
Discover different ways to list the roles associated with a GCP Service Account.
Enable and Use GitLab Container Registry
Filed under Git
Learn how to enable the GitLab Container Registry on self-managed instances.
Baeldung on SQL
- All
- SQL Functions (5)
- SQL Tables (2)
- SQL Queries (2)
- SQL Operators (2)
- SQL Basics (2)
- Security (1)
- SQL Joins (1)
- SQL Constraints (1)
- Database Concepts (1)
- Database Access (1)
Difference Between != and <> for Not Equal in SQL
Filed under SQL Operators
Discover the differeneces between not equal operators in SQL.
Making a Column Nullable in SQL
Filed under SQL Constraints
Learn how to make a column nullable in SQL across PostgreSQL, SQL Server, and MySQL.
Understanding WHERE 1=0 in SQL: When and Why to Use It
Filed under SQL Basics
Discover several useful real-world applications for the WHERE 1=0 clause in SQL: metadata retrieval, query safety, dynamic conditions, and empty table creation.
How to Change the Default Port of MySQL
Filed under Security
Add an extra layer of security by changing Mysql’s default port.
The Relationship Between Primary Keys and Clustered Indexes
Filed under Database Concepts
Discover clustered indexes, as well as their relation to and differences from primary keys.
Calculating SUM() for Multiple Rows with Conditions
Filed under SQL Functions
Learn how to use the SUM function with WHERE, GROUP BY, and other more advanced techniques tu sum multiple rows.
Sorting by a List of Strings in SQL
Filed under SQL Operators
Learn how to sort a list of strings alphabetically or in a specific order.
Obtaining Multiple Counts Using a Single SQL Query
Filed under SQL Functions
Learn how to do multiple counts with a single query.
Retrieving the Current Date and Time in SQL
Filed under SQL Functions
Learn how to obtain the current date and time in MySQL, SQL Server, and PostgreSQL.