Java Articles by Foojay.io

May, 2024

  • 15 May

    Software Testing as a Debugging Tool

    The Intersection of Debugging and Testing Unit Tests Integration Tests Coverage The Debug-Fix Cycle Composing Tests with Debuggers Test-Driven Development Final Word Debugging is not just about identifying errors—it’s about instituting a reliable process for ensuring software health and longevity. In this post we discuss the role of software testing in debugging, including foundational concepts and how they converge to …

    Read More »
  • 15 May

    The Vary HTTP Header

    I try to constantly to deepen my knowledge of HTTP and REST. Recently, I stumbled upon the list of all registered HTTP Headers. This post is dedicated to the Vary HTTP Header. The problem Two years ago, I wrote about web resource caching server-side. The idea is to set up a component between the client and the upstream to cache …

    Read More »
  • 13 May

    Hello eBPF: XDP-based Packet Filter (9)

    Welcome back to my series on ebpf. In the last blog post, we learned how annotation processors can generate C code, simplifying writing eBPF applications. This week, we’ll use this work together with new support for XDP to create a simple package blocker for eBPF (GitHub): ./run_bpf.sh XDPPacketFilter twitter.com This blocks all incoming IPv4 packages from twitter.com. We see how …

    Read More »
  • 13 May

    Diagnosing User-Reported Issues Using WireQuery

    As a developer, I’ve often struggled with diagnosing user-reported issues, which is often caused by a lack of information to reproduce the problem. While a ticket may contain a screenshot of the problem and a description, it often does not portray the complete picture. For example: what did the user do that led up to the issue? What endpoints were …

    Read More »
  • 12 May

    Building a Simple Home Assistant using Langchain4j and Raspberry Pi

    Many believe that the future of IoT is AI. Building a Smart Home Assistant is less complex today than ever before. AI has become so accessible that you only need an internet connection and a computer to connect to an API. While training specialized deep learning models or using commercial APIs to harness machine learning for specific deterministic use cases …

    Read More »
  • 10 May

    SQL Query Optimization: How to Identify and Optimize Slow SQL Queries

    In this article, we want to share our experience with fellow developers and offer insights using real-life examples on how to identify and optimize slow SQL queries, especially when working with relational database management systems like PostgreSQL, MySQL, MSSQL, Oracle, etc. If you are a developer who doesn’t use database ORMs like Hibernate that much, you are no stranger to …

    Read More »
  • 9 May

    Spring AI: How to Write GenAI Applications with Java

    Generative AI (GenAI) is currently a hot topic in the tech world. It’s a subset of artificial intelligence that focuses on creating new content, such as text, images, or music. One popular type of GenAI component is the Large Language Model (LLM), which can generate human-like text based on a prompt. Retrieval-Augmented Generation (RAG) is a technique that enhances the …

    Read More »
  • 9 May

    Duplicate Finder for Documentation

    Anyone who worked on technical documentation in a big team is certainly aware of the content duplication issue. Even with the best tools and practices at hand, duplication is fundamentally difficult to overcome. As the project grows in size, duplicated content will start to occur. This is especially true for big projects including many similar products or features. Good: define …

    Read More »
  • 8 May

    Is your Java application ready for the next generation of server CPUs?

    If you only know about Arm CPU architecture from working on smartphones or Raspberry Pi devices, it might come as a surprise to you that there are also high-performance, cloud-scale Arm CPUs already on the Java market. The share of cloud and server workloads running on Arm is increasing every year. Back in 2011, Arm released the AArch64 instruction set, …

    Read More »
  • 7 May

    Let’s Replace the synchronized Keyword

    Let’s see in this article different ways to replace the synchronized keyword to make our code more virtual threads friendly. Lines of code of the different solutions discussed in this article Synchronized and pinning threads Since Java 21, we can enjoy virtual threads and have more than 1 million threads in Java.But it has a condition, the virtual thread shouldn’t …

    Read More »