Pull to refresh

All streams

Show first
Period
Level of difficulty

WebSocket Reconnection in Flutter

Level of difficultyMedium
Reading time5 min
Views666

Continuous socket connection can be crucial to ensure correct app behavior. Whether it’s delivering real-time chat updates, stock prices, or in-app indicators, a reliable connection is vital.

One of the irritating problems with sockets is a sudden loss of connection. If the true cause is not visibly evident, i.e., unstable internet connection, then the disruption cause is often well hidden. To tackle this issue we can implement an automatic socket reconnection strategy. Let’s see what options we have in the industry-standard socket library for Dart — web_socket_channel.

Read more
Total votes 4: ↑4 and ↓0+4
Comments0

Why would a software engineer attend an FPGA hardware meetup at Hacker Dojo?

Reading time6 min
Views1.2K

For the last 30 years digital chip design is not a schematic entry anymore: hardware engineers write code just like software engineers.

The difference is that the code software engineer writes becomes a chain of CPU instructions stored in memory, while the code in a hardware description language (HDL) becomes the CPU itself, its transistors and metal connections. And not only a CPU: the same technique is used to design processor-less ("fixed function") blocks in GPU that shuffle triangles and pixels, as well as network router chips that edit packet headers 100 times faster than CPU.

There are ways to experience this workflow without paying a million dollars to a silicon fab. One way is simulation, and another way is to use a matrix of reconfigurable logic cells, a Field Programmable Gate Array (FPGA). You can come on January 14 to Hacker Dojo in Mountain View, California. We have a bunch of computers and FPGA boards, and we will show you how to use them not only to blink LEDs but also to output graphics and recognize music.

This will change your perspective of what the code is.

Prepare for a ride:
Total votes 8: ↑6 and ↓2+4
Comments0

Managing AWS Auto Scaling Group Instance Refresh: The Harmony of Terraform and Ansible

Level of difficultyMedium
Reading time6 min
Views637

In the DevOps realm, where automation is crucial, the management of resources and updating processes in the cloud is vitally important. Many modern projects, particularly in AWS cloud environments, leverage Auto Scaling Groups (ASG). This mechanism aims to achieve three key objectives: balancing loads, increasing service reliability, and optimizing operational costs for efficiency and effectiveness.

Imagine working at a company where you deploy applications on Amazon's resources. To streamline this process and manage configurations more effectively, you use pre-built AMI images. These are crafted with tools like HashiCorp Packer, ensuring your applications launch swiftly and reliably. For the actual infrastructure deployment, you turn to Terraform. It's widely recognized as the standard in many major companies for managing cloud resources and using the IaC (Infrastructure as Code) approach.

As an IT engineer, you sometimes need to update instance versions to a newer AMI image, either for the latest security patches or to introduce new functionalities. The challenge lies in updating an active ASG without causing downtime. It's crucial to ensure the new AMI performs as reliably as the existing one, balancing the need for updates with system stability and uptime.

ASG's instance refresh is a crucial feature that allows for updating instances within a group while minimizing downtime, thereby maintaining high availability. However, ensuring the success of such updates, especially in large, complex systems, can be a challenge. Terraform resources, such as aws_autoscaling_group, can initiate this process but don't provide progress tracking. This limitation becomes apparent when other infrastructure components, such as certificate renewals or DNS updates, depend on the state and version of the instances. Monitoring the update process is essential to maintain an accurate infrastructure state after Terraform's execution.

To overcome this challenge, Ansible can be utilized...

Read more
Total votes 4: ↑4 and ↓0+4
Comments0

How sqlalchemy uses greenlet to call an async Python function from a normal function

Reading time5 min
Views2K

The Python language has two kind of functions — normal functions that you would use in most cases, and async functions. The latter functions are used when performing network IO in an asynchronous manner. The problem with this division is that async functions can only be called from other async functions. Normal functions, on the other hand, can be called from any functions — however, if you call a normal function that does a blocking operation from an async function, it will block the whole event loop and all your coroutines. These limitations usually mean that when writing an using Python`s asyncio, you can`t use any of the IO libraries that you use when writing a synchronous application, and vice versa, unless a library supports usage both in sync and async applications.

Now, the question is, in case you are developing a large and complex library, that, say, allows users to interact with relational databases, abstracting away (some of) the differences between the SQL syntax and other aspects of these databases, and abstracting away the differences between the drivers for that database, how do you support both sync and async usage of your library without duplicating the code of your library? The way sqlalchemy is organized is that regardless of what database and driver for it you are using, you will be calling functions and methods related to Engine, Connection, etc classes, which will do some general work independent of database, then apply the logic specific to your database and finally, call the functions of your database driver to actually communicate with the database. If you are using Python`s asyncio, the database driver will expose async functions and methods, but the rest of the library that is driver‑independent would ideally remain the same. However, the issue is that that you can`t call the async functions of the driver from the normal functions of the core of the library.

Read more
Total votes 4: ↑4 and ↓0+4
Comments1

Exploring FIFO principles using an HDL training tool

Level of difficultyMedium
Reading time1 min
Views617

Ссылка на русскую версию / link to Russian version

FIFO is a key concept in hardware design. Understanding of FIFO is necessary for understanding the valid/ready protocol, which in turn is necessary for organisation of flow-control within a design.

Unfortunately, there are very few books on this topic, and to be fair, microarchitectural concepts are quite difficult to master from books, since understanding of these concepts are coming with practice. In other words it is more about developing hardware intuition.

The idea of the HDL training tool is that it can help develop a hardware intuition, providing the opportunity to explore ready-made scenarios in a step-by-step interactive way. The tool also provides detailed visualization of a simulated scenario.

Since the tool is a front-end for the HDL simulator, the real, synthesized SystemVerilog is executed on the simulator itself, which can be viewed and even modified.

So, the video of exploring FIFO on the training tool is here:

Watch the video and continue reading
Total votes 4: ↑4 and ↓0+4
Comments0

Wi-Fi internet radio from a router with station switching capability

Level of difficultyMedium
Reading time8 min
Views1.5K
Wi-Fi интернет-радиоприёмник.
ChatGPT was not used in writing this article.
The animated image uses the webp file format instead of gif.
In this article, you will find a complete description of how to make a Wi-Fi internet radio receiver from a router that can play mp3 streams from internet radio stations.
It is also possible to switch between two internet radio stations. We will use OpenWRT firmware installed on the router to create a Wi-Fi internet radio. It is possible to complete this project without using a soldering iron. All the components can be placed inside the router to create a finished device — a Wi-Fi internet radio.
To make this, you will need:
Read more →
Total votes 4: ↑4 and ↓0+4
Comments1

Redefining the VOD OTT Experience in 2023: A Glimpse into the Future of Digital Entertainment

Reading time3 min
Views485

In the rapidly evolving landscape of digital entertainment, the year 2023 has witnessed a profound transformation in Video On Demand (VOD) Over-The-Top (OTT) platforms. These platforms have redefined how audiences access and consume content, introducing cutting-edge technologies and innovative features that have revolutionized the entertainment industry.

Embracing Augmented Reality (AR) and Virtual Reality (VR)

In 2023, VOD OTT platforms have embraced AR and VR technologies to provide viewers with immersive and interactive experiences. Users can now step into virtual worlds, interact with characters, and actively participate in the content they are watching, transcending the boundaries of traditional passive viewing.

Imagine exploring an ancient civilization through the eyes of a protagonist, feeling the thrill of an adrenaline-pumping car chase, or even interacting with virtual avatars of celebrities and influencers. The integration of AR and VR into VOD OTT platforms has ushered in a new era of interactive and experiential entertainment.

Personalization: The Heart of the VOD Experience

Powered by advanced artificial intelligence (AI), VOD OTT platforms have taken personalization to new heights. By analyzing user behavior, preferences, and viewing habits, these platforms deliver tailor-made content recommendations, ensuring that viewers find exactly what they love without extensive searching.

This level of personalization ensures that users are presented with content that resonates with their tastes, creating a seamless and enjoyable content discovery experience. By removing the need for extensive searching, VOD OTT platforms have become the go-to destination for viewers seeking highly relevant and engaging content.

Read more
Total votes 4: ↑4 and ↓0+4
Comments1

Review of mini-book «60 terrible tips for a C++ developer»

Level of difficultyEasy
Reading time6 min
Views1.2K

I wrote a small e-book about terrible tips for C++ developers. Actually, it describes bad programming practices and explains why it's better to avoid them. However, every chapter of this mini-book starts with a terrible tip — just for fun.


60 terrible tips for a C++ developer


By the way, these tips may seem artificial but believe me, they are based on the real experience. In other words, the described terrible tips occur in developers' lives — that's why it's worth discussing them. First of all, this book will be useful for junior developers. But more skilled C++ developers can also find interesting and useful tips.


Even though it's a mini-book, it clearly does not fit into the Habr format. Too many words. So, I decided to write here the review. Here is the link to find the full version of the mini-book: 60 terrible tips for a C++ developer.


If you still hesitate whether to read it or not, below you will find a list of terrible tips that will be discussed in the mini-book.


View the terrible tips:

Read more →
Total votes 10: ↑7 and ↓3+4
Comments3

Validation WebHook troubleshooting, how low can you go?

Level of difficultyMedium
Reading time11 min
Views1.3K

I'm Alex Movergan, DevOps team lead at Altenar. I focus on automation in general and on improving troubleshooting skills within my team. In this article, I'll share a captivating tale that revolves around Kubernetes, validation webhooks, kubespray, and Calico.

Join me on this DevOps journey as we explore real-world scenarios unraveling the intricacies of troubleshooting in a Kubernetes environment.

Read more
Total votes 4: ↑4 and ↓0+4
Comments2

Push notifications. How to write push notifications that won't piss you off

Level of difficultyEasy
Reading time11 min
Views1.2K

Push notifications are similar to promoters. You're peacefully walking down the street, and suddenly promoters approach you, urging you to take their flyers. You take them, but you don't read them and throw them into the nearest trash can.

The same goes for push notifications. You're reading an article, and suddenly a notification pops up with a promo code for free delivery of products. Then another one arrives, informing you about a giveaway. And then another one, offering a discount on all fruits. Notifications can appear on your screen at any time. If there are too many of them, your reaction is either to ignore them or disable them.

In this article, we will talk about how to write push notifications that people will click on and show you how to build a push notification strategy. At the end, we will provide a template for a push notification strategy.

Push Notifications - What is it?

A push notification is a pop-up message on a smartphone screen. To send one, you need to use a delivery service. You can send a notification instantly, schedule it for a specific time, or set up a trigger-based delivery - a chain of notifications that will be triggered by specific user actions.

Triggered push notifications are sent after a specific action is taken. For example, if a person starts adding items to their cart but doesn't complete the purchase, you can send them a notification urging them to complete the transaction after a certain period of time.

Notifications are sent to users who fall into specific segments for targeting. Segments are formed based on specific events. For example, the event "6 hours ago, a product was added to the cart but no purchase was made" will divide users into two segments: those who made a purchase and those who didn't.

Read more
Total votes 4: ↑4 and ↓0+4
Comments1

Listicles — a simple technique for benchmarking your value proposition against alternatives

Level of difficultyMedium
Reading time5 min
Views781

I believe listicles have a huge potential for testing demand hypotheses. Have you tried using listicles for your demand validation? If so - let us know in the comments how this worked for you.

Do you know these "Top N something something" kind of articles? Like:
- 5 best GPS vehicle trackers
- The 14 hair growth products that actually work
- Top 10 Best CRM Software Tools in 2023
They are often referred to as "listicles" - articles presented in the form of a list.

I love them - they make picking a new phone, a movie to watch, an app to install much easier. I also use them at work all the time while looking for solutions to everyday challenges.

So what if we use one of them to benchmark our product against the best available alternatives?

Read more
Total votes 4: ↑4 and ↓0+4
Comments1

Message broker selection cheat sheet: Kafka vs RabbitMQ vs Amazon SQS

Level of difficultyMedium
Reading time6 min
Views8.7K

This is a series of articles dedicated to the optimal choice between different systems on a real project or an architectural interview.

At work or at a System Design interview, you often have to choose the best message broker. I plunged into this issue and will tell you what and why. What is better in each case, what are the advantages and disadvantages of these systems, and which one to choose, I will show with several examples.

Read more
Total votes 6: ↑5 and ↓1+4
Comments0

«Look what I have!» — how we made the feature of screen sharing in the mobile video conferencing app

Reading time4 min
Views1.2K

How we listened to the needs of our customers and implemented the feature with the maximum capabilities of the iOS and Android platforms. Then we looked into analytics, added onboarding, and usage grew. At the end of the article there are some cool conclusions and insights. Developing a video conferencing mobile app is fun!

Read more
Total votes 4: ↑4 and ↓0+4
Comments0

Queries in PostgreSQL. Nested Loop

Reading time17 min
Views2.5K

So far we've discussed query execution stagesstatistics, and the two basic data access methods: Sequential scan and Index scan.

The next item on the list is join methods. This article will remind you what logical join types are out there, and then discuss one of three physical join methods, the Nested loop join. Additionally, we will check out the row memoization feature introduced in PostgreSQL 14.

Read more
Total votes 4: ↑4 and ↓0+4
Comments0

Quantum Computers Without Math and Philosophy

Reading time13 min
Views1.8K

In this article, I will break down all the secrets of quantum computers piece by piece: what superposition (useless) and entanglement (interesting effect) are, whether they can replace classical computers (no) and whether they can crack RSA (no). At the same time, I will not mention the wave function and annoying Bob and Alice that you might have seen in other articles about quantum machines.

The first and most important thing to know is that quantum computers have nothing to do with conventional ones. Quantum computers are analog in nature, they have no binary operations. You have probably already heard about Qubits that they have a state of 0, 1 and 0-1 at the same time and with the help of this feature calculations are very fast: this is a delusion. A qubit is a magnet (usually an atom or an electron) suspended in space, and it can rotate on all three axes. In fact, the rotations of a magnet in space are the operations of a quantum computer. Why can it speed up calculations? It was very difficult to find the answer, but the most patient readers will find it at the end of the article.

Read more
Total votes 8: ↑6 and ↓2+4
Comments1

Android for electronics design engineers

Reading time5 min
Views1.9K

There is a list of well-known electronics design tools for Android which can be found in every review for the last 10 years: “Electrodoc”, “Every Circuit”, “Droid Tesla”, “Electronics Toolbox”, “RF & Microwave Toolbox” and so on. Also, there is a lot of trash on the market that turns finding a good tool into a quest.

This short review is about an unknown but cool tool “Circuit Calculator” working on Android devices and intended for professional electronics designers.

Read more
Total votes 4: ↑4 and ↓0+4
Comments0

How does Rust treat Strings and Vectors internally

Reading time4 min
Views3K

In Rust strings can be represented in two ways:

a)       String type

b)      String slice

String type:

String type is defined as a struct of the following structure:

Depending on arch (in my case x86 64bit it is 24byte)

{

   pointer to the address where string characters are stored (8b)

   capacity (8b)

   length (8b)

}

Read more
Total votes 4: ↑4 and ↓0+4
Comments0