News
Entertainment
Science & Technology
Life
Culture & Art
Hobbies
News
Entertainment
Science & Technology
Culture & Art
Hobbies
In the previous post of this focus, we replaced Philips Hue automation with the one from Home Assistant. One significant gap we noticed was that Home Assistant doesn’t automatically adjust the brightness according to the time of the day, a feature Philips Hue offers. In this post, we are going to address this gap. The first step when wanting to add a feature to Home Assistant is to browse through available integrations. While there was no out-of-the-box integration, I discovered an altern
I’m an average Reddit user, scrolling much more than reading or interacting. Sometimes, however, a post rings a giant red bell. When I stumbled upon If you could add one feature to K8s, what would it be?, I knew the content would be worth it. The most voted answer is: Namespace scoped CRDs A short intro to CRDs Kubernetes comes packed with existing objects, such as Pod, Service, DaemonSet, etc., but you can create your own: the latter are called Custom Resource Definitions. Most o
This is the 3rd post in the My journey with Home Assistant focus series. I’m the happy owner of a couple of Philips Hue connected lights for a some years. Some of them are colored, some of them regular. In addition, I bought a sensor to go along with the light I installed in my toilets: it turns on automatically when its detects a movement there. In this post, I want to document how I replaced the proprietary automation with Home Assistant’s.
Home Assistant is a massive beast. It can be overwhelming for a newcomer; it was for me. In this post, I want to describe the underlying model of Home Assistant, which is a good entry point for your home automation journey. The biggest issue in describing the Home Assistant is the number of conflicting sources for this model: The helpers package of the GitHub repositoryThe database; disclaimer: I didn’t find the schema generation in the code, and I wasn’t bold enough to check the d
This is the 1st post in the My journey with Home Assistant focus series. Last June, I spoke at Berlin Buzzwords. In all honesty, I rarely attend others' talks for a variety of reasons: lack of time, lack of energy, no interest in the proposed subjects, etc. When I do, I go either for subjects I know and want to deepen my understanding of or for subjects I know nothing about to get a foot in the door. This time, I attended Monitoring your home, with DevOps observability tools. I thought it would b
How can we generate a uniform sequence of random numbers? The randomness so beautifully and abundantly generated by nature has not always been easy for humans to extract and quantify. Pseudo-Random Number Generators are fundamental tools in many areas of software development: PRNGs do not produce truly random numbers but rather deterministic sequences that simulate randomness. The quality of a PRNG is determined by its ability to produce sequences that are statistically indistinguishable from t
I’m coming relatively late to the LLM party, but I rarely come very early in the hype cycle. For example, I never bought into blockchain, the solution still searching for problems to solve, nor in microservices, the latest in the cargo cult IT trends. Despite my late arrival at the LLM party, I have been a regular user of LLMs. I use OpenAI for non-controversial questions outside my cone of knowledge, e.g., linguistics or legal; I use GitHub Copilot in my IDE to improve my code. Th
The book was sent to me by Michael Simons. He asked for my feedback: I changed my reading schedule, took a few months, and here it is. Facts 10 chapters288 pages$33.59 (eBook) Note that MotherDuck, a company providing an online service that builds upon DuckDB, offers a free PDF copy. Chapters An introduction to DuckDBGetting started with DuckDBExecuting SQL queriesAdvanced aggregation and analysis of dataExploring data without persistenceIntegrating with the Python ecosystemDuckDB in the
Digital Twins, are digital replicas of physical assets, processes, or systems used to simulate, monitor, and optimize their real-world counterparts. Through real-time data exchange and advanced analytics, digital twins provide a virtual environment for testing scenarios, predicting outcomes, and enhancing decision-making. This concept, first introduced by Michael Grieves in 2002, has rapidly evolved and now plays a crucial role in various sectors, including manufacturing, healthcare, smart cities
In previous weeks, I’ve analyzed several libraries and frameworks that augment the client with AJAX capabilities. Vue.jsAlpine.jsHTMXVaadin In this post, I’ll compare them across several axes. Analysis Frontend skills Remember that I started this series from the point of view of a backend developer. In this section, I grade how much you need to know about client technologies to complete the job. Team organization In the introduction, I hinted that the decoupling of frontend
I’ve written a lot about Vaadin. I was so enthusiastic that I wrote the first book about it (besides the Book of Vaadin), its updated edition for Vaadin 7, and a companion website. Still, I’m amazed that so many people in the JVM world never heard of it. In this post, I’d like to introduce Vaadin in the context of AJAX and SSR. Short introduction to Vaadin The beauty of Vaadin lies in its simplicity - you only write backend code. You read that well. A Vaadin developer only
This post is part of a series comparing different ways to implement asynchronous requests on the client to augment the latter. So far, I described the process with Vue.js and Alpine.js. Both are similar from the developers' point of view: they involve JavaScript. In this post, I’ll focus on HTMX, whose approach is quite different. Laying out the work I’ll follow the same structure as in the previous posts of the series. Here’s the setup, server- and client-side. Server-s
This post is part of a series comparing different ways to implement asynchronous requests on the client, which is colloquially known as AJAX. I dedicated the previous post to Vue.js; I’ll dedicate this one to Alpine.js - not to be confused with Alpine Linux. I’ll follow the same structure as previously. Laying out the work Here’s the setup, server- and client-side. Server-side Here is how I integrate Thymeleaf and Alpine.js in the POM: pom.xml <dependencies>
In my previous post, I laid the ground to build upon; now is the time to start 'for real'. I heard a lot of Vue.js. Additionally, a friend who transitioned from developer to manager told me good things about Vue, which further piqued my interest. I decided to have a look at it: it will be the first 'lightweight' JavaScript framework I’ll study - from the point of view of a newbie, which I am. Laying out the work I explained WebJars and Thymeleaf in the last post. Here’s the setu
Understanding the shared steps in the project setup is crucial before delving into the specifics of each client-augmenting technology. My requirements from the last post where quite straightforward: I’ll assume the viewpoint of a backend developerNo front-end build step: no TypeScript, no minification, etc.All dependencies are managed from the backend app, i.e., Maven It’s important to note that the technology I’ll be detailing, except Vaadin, follows a similar approach. V
My journey in programming began over two decades ago, a time when JavaScript was a far cry from its current state, and developers were primarily focused on Microsoft Internet Explorer. One of my proudest achievements back then was writing a few lines of code that allowed users to add and remove table rows entirely on the client side. We called it DHTML. Many developers today have forgotten about it—or never knew it existed. A few years later, AJAX emerged, revolutionizing the way we approached
DRY is an important principle in software development. This post will show you how to apply it to Apache APISIX configuration. The DRY principle 'Don’t repeat yourself' (DRY) is a principle of software development aimed at reducing repetition of information which is likely to change, replacing it with abstractions that are less likely to change, or using data normalization which avoids redundancy in the first place. — https://en.wikipedia.org/wiki/Don%27t_repeat_yourself[Wiki
When I introduce Apache APISIX in my talks, I mention the massive number of existing plugins, and that each of them implements a specific feature. One of the key features of Apache APISIX is its flexibility. If a feature is missing, you can create your own plugin in Lua or a language compiled into Wasm, showcasing the platform’s adaptability to your specific needs. In this post, I aim to provide practical alternatives to writing a custom plugin, offering solutions you can quickly implement
I recently compared three OpenTelemetry approaches on the JVM: Java Agent v1, v2, and Micrometer. I used Kotlin and coroutines without overthinking. I received interesting feedback on the usage of @WithSpan with coroutines: Nice one..by the way to instrument the coroutine context properly, don't we need "opentelemetry-extension-kotlin" also? Without that, spans are not recorded properly for suspend functions (https://t.co/DSgJklnllD) pic.twitter.com/5wDwhYhoDM— Suresh G (@sur
In this post, I’ll explain how to provide a default value when querying an absent key in a hash map in different programming languages. Java Let’s start with Java, my first professional programming language. In older versions, retrieving a value from a map required using the get() method: Map map = new HashMap(); (1) Object value = map.get(new Object()); (2) if (value == null) { value = 'default';
My demo of OpenTelemetry Tracing features two Spring Boot components. One uses the Java agent, and I noticed a different behavior when I recently upgraded it from v1.x to v2.x. In the other one, I’m using Micrometer Tracing because I compile to GraalVM native, and it can’t process Java agents. I want to compare these three different ways in this post: Java agent v1, Java agent v2, and Micrometer Tracing. The base application and its infrastructure I’ll use the same base ap
Lots of service providers offer a free tier of their service. The idea is to let you kick their service’s tires freely. If you need to go above the free tier at any point, you’ll likely stay on the service and pay. In this day and age, most services are online and accessible via an API. Today, we will implement a free tier with Apache APISIX. A naive approach I implemented a free tier in my post Evolving your RESTful APIs, a step-by-step approach, albeit in a very naive way. I cop
In my talk Evolving your APIs, I mention that an API Gateways is a Reverse Proxy 'on steroids'. One key difference between the former and the latter is that the API Gateway is not unfriendly to business logic. The poster child is rate-limiting. Rate-limiting is an age-old Reverse Proxy feature focused on protecting against DDoS attacks. It treats all clients the same and is purely technical. In this day and age, most API providers offer different subscription tiers; the higher the tier, the hig
I spoke at Swiss PgDay in Switzerland in late June. The talk was about how to create a no-code API with the famous PostgreSQL database, the related PostgREST, and Apache APISIX, of course. I already wrote about the idea in a previous post. However, I wanted to improve it, if only slightly. PostgREST offers a powerful SELECT mechanism. To list all entities with a column equal to a value, you need the following command: curl /products?id=eq.1 id is the columneq.1 corresponds to the WHERE cla
Last week, I described how to add a dynamic watermark to your images on the JVM. I didn’t find any library, so I had to develop the feature, or, more precisely, an embryo of a feature, by myself. Depending on your tech stack, you must search for an existing library or roll up your sleeves. For example, Rust offers such an out-of-the-box library. Worse, this approach might be impossible to implement if you don’t have access to the source image. Another alternative is to use ready-mad
Displaying images on your website makes for an interesting problem: on one side, you want to make them publicly available; on the other, you want to protect them against undue use. The age-long method to achieve it is watermarking: A digital watermark is a kind of marker covertly embedded in a noise-tolerant signal such as audio, video or image data. It is typically used to identify ownership of the copyright of such signal. 'Watermarking' is the process of hiding digital information in a car
In my earlier post about moving from Kotlin Scripting to Python, I mentioned several reasons: Separating the content from the scriptKotlin Scripting is an unloved child of JetBrainsRenovate cannot update Kotlin Scripting files I was wrong on the third point. Here’s my mea culpa. First things first, Renovate does indeed manages Kotlin Scripting files - since 2022. Even better, Renovate can manage any type of file. Thanks to Max Andersen for the tip: JVM's are cheap; not having to
I moved my blog from WordPress to GitLab Pages in… 2016. I’m happy with the solution. However, I used GitHub Pages when I was teaching for both the courses and the exercises, e.g., Java EE. At the time, there was no GitHub Actions: I used Travis CI to build and deploy. Recently, I had to use GitHub Pages to publish my Apache APISIX workshop. Travis is no longer free. GitHub Actions are a thing. I used the now nominal path and faced a few hurdles; here are my findings. GitHu
My ideas for blog posts inevitably start to dry up after over two years at Apache APISIX. Hence, I did some triage on the APISIX repo. I stumbled upon this one question: We have a requirement to use a plugin, where we need to route the traffic on percentage basis. I’ll give an example for better understanding. We have an URL https://xyz.com/ca/fr/index.html where ca is country (canada) and fr is french language. Now the traffic needs to routed 10% to https://xyz.com/ca/en/index.html a
I continue to work on my Opentelemetry demo. Its main idea is to showcase traces across various technology stacks, including asynchronous communication via an MQTT queue. This week, I added a couple of components and changed the architecture. Here are some noteworthy learnings; note that some of them might not be entirely connected to OpenTelemetry. Here’s an updated diagram. New components appear in violet, and updated components appear in green. I want to be able to add more comp
I’m in the process of adding more components to my OpenTelemetry demo (again!). The new design deploys several warehouse services behind the inventory service so the latter can query the former for data via their respective HTTP interface. I implemented each warehouse on top of a different technology stack. This way, I can show OpenTelemetry traces across several stacks. Anyone should be able to add a warehouse in their favorite tech stack if it returns the correct JSON payload to the inv
A (long) time ago, my first job consisted of implementing workflows using the Staffware engine. In short, a workflow comprises tasks; an automated task delegates to code, while a manual task requires somebody to do something and mark it as done. Then, it proceeds to the next task - or tasks. Here’s a sample workflow: The above diagram uses Business Process Model and Notation. You can now design your workflow using BPMN and run it with compatible workflow engines. Time has passed. Sta
I’ve always liked GUI, both desktop-based and browser-based before you needed five years of training on the latter. That’s the reason I loved, and still love Vaadin: you can develop web UIs without writing a single line of HTML, JavaScript, and CSS. I’m still interested in the subject; a couple of years ago, I analyzed the state of JVM desktop frameworks. I also like the Rust programming language a lot. Tauri is a Rust-based framework for building desktop applications. Here&
I try to constantly 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 previously computed results to avoid overloading the latter. Depending on your infrastructure and requirements, this component can be a reverse proxy or an API Gateway. H
I recently read 6 Ways To Pass Parameters to Spring REST API. Though the title is a bit misleading, as it’s unrelated to REST, it does an excellent job listing all ways to send parameters to a Spring application. I want to do the same for Apache APISIX; it’s beneficial when you write a custom plugin. General setup The general setup uses Docker Compose and static configuration. I’ll have one plugin per way to pass parameters. docker-compose.yml services: httpbin: ima
I wrote previously about libs for error management in Rust. This week, I want to write about the try block, an experimental feature. The limit of the ? operator Please check the above article for a complete refresher on error management in general and the ? operator in particular. In short, ? allows to hook into a function call that returns a Result: If the Result contains a value, it continues normallyIf it contains an error, it short-circuits and returns the Result to the calling function.
The book Design Patterns: Elements of Reusable Object-Oriented Software was one of the texts that changed how we think about software design. This book came out in 1994 through the efforts of Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, later remembered as Gang Of Four (GoF) GoF Design Patterns: The Origin, the Impact The book’s importance lies in its effort to review the software production done up at that moment, giving more structure to the concept of Software Design
Last week, I wrote an analysis of the ITEF Idempotency-Key specification. The specification aims to avoid duplicated requests. In short, the idea is for the client to send a unique key along with the request: If the server doesn’t know the key, it proceeds as usual and then stores the responseif the server knows the key, it short-circuits any further processing and immediately returns the stored response This post shows how to implement it with Apache APISIX. Overview Before starting