teleren/devto huggingface dataset:
When Frontend loves Backend : BFF Pattern Explained
Tags: distributedsystems, backenddevelopment, cloudcomputing, frontend
Published: 2024-04-13 21:43:11

As platforms evolve from monolithic architectures to distributed systems, the variety and number of clients—ranging from mobile and web to various API consumers—also increase. With this diversification, the one-size-fits-all API contract of traditional microservices becomes less effective. Each client has unique requirements and faces distinct challenges when rendering their user interfaces, necessitating a more tailored approach.

###BFF - Backend For Frontend#

> Consider a scenario involving a hypothetical version of Shopify, an e-commerce giant, which we'll use as our example to illustrate this concept. As "Shopify" grows, it is accessed by an increasing number of mobile and web clients. These clients interact with backend microservices for fetching product catalog details, order management, and payment processing.

![Before BFF](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6bbhbvu0jakrq2a25f02.gif)

When retrieving product catalog details, both mobile and web clients currently use the same API provided by the catalog service. While the core information required by each client remains the same, significant challenges arise due to their differing needs:




- **Mobile App Requirements**:
  - **Speed**: Essential for user satisfaction, requiring quick load times.
  - **Data Efficiency**: Crucial for users on limited data plans, necessitating smaller image URLs.
  - **Performance**: Important to minimize on-device computation to save battery life.

- **Web Application Requirements**:
  - **Rich Data**: Users on larger screens need more detailed information and higher resolution images.
  - **Complex Features**: Capabilities like additional product recommendations and interactive elements to enhance user engagement.
  - **Resource Utilization**: Desktops can handle more data and complex features without the constraints of mobile devices.

To address these distinct needs effectively, the BFF (Backend for Frontend) pattern comes into play, creating specialized backend services tailored specifically for each type of client.

- **Web Catalog Service**: Delivers rich content and interactive experiences suitable for desktop browsing.
- **Mobile Catalog Service**: Ensures speed and efficiency for mobile users.

![After BFF](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzn2y4093uhbrq4se5k4.gif)

### Considering API Design Alternatives

Instead of two separate backend services, another approach might involve creating two distinct sets of APIs within the same service that cater to different frontends. This method would still align with the BFF philosophy by tailoring API responses to the needs of each client type, though it would maintain a single service architecture. This could simplify deployment and maintenance but might require more sophisticated internal logic to manage the different API behaviors effectively.

Both approaches aim to optimize the user experience by addressing specific frontend needs, leveraging the BFF pattern's flexibility to enhance service delivery.
How to divide two numbers in JavaScript with out using the "/" operator?
Tags: javascript, programming, productivity, coding
Published: 2024-04-13 21:25:32

Here're some tips on how to divide numbers in javascript without using the "/" operator. This is a very efficacy method. Which means that it has just a few steps.

I will use ES6 syntax for writing my code.

```
const divide = (dividend, divisor) => {
    if (divisor === 0) {
        throw new Error("Division by zero is not allowed.");
    }

    let quotient = 0;
    let isNegative = false;

    if ((dividend < 0 && divisor > 0) || (dividend > 0 && divisor < 0)) {
        isNegative = true;
    }

    dividend = Math.abs(dividend);
    divisor = Math.abs(divisor);

    while (dividend >= divisor) {
        dividend -= divisor;
        quotient++;
    }

    if (isNegative) {
        quotient = -quotient;
    }

    return quotient;
}

// Test the divide function
console.log(divide(10, 1)); // Output should be 5
console.log(divide(7, 3)); // Output should be 2
console.log(divide(10, -2)); // Output should be -5
console.log(divide(-7, 3)); // Output should be -2
console.log(divide(0, 5)); // Output should be 0
console.log(divide(2, 10)); // Output should be 0


```

## Breakdown
First, we declare the function **divide** and pass the **dividend** and **divisor** as parameters.

In the function block, we start by checking if the divisor is equal to zero. If that is true, we throw an error message.

The next step is to declare the **quotient** and assign it to zero, and **isNegative** and assign it the value of false.

We then check if any of the numbers is less than zero, which makes **isNegative return true**.

If isNegative returns true, we take the absolute value of the numbers to convert them to positive numbers by using the JS built-in **Math.abs()**.

We now enter a while loop that keeps subtracting the divisor from the dividend, and the quotient is incremented.

If isNegative is true, the quotient should be multiplied by **-1 ** and returned as our result.

[Watch the video on Youtube](https://www.youtube.com/watch?v=GWGT8YHq0MM&ab_channel=TichaGodwill)
DragonWebRecovery @ TUTA.IO  /recover Stolen Cryptocurrency
Published: 2024-04-13 20:49:58

A few months ago, I was approached by an individual who claimed to be a successful cryptocurrency trader with a foolproof investment opportunity. They promised high returns in a short period and assured me that my investment was safe and secure. Filled with excitement and the prospect of making quick profits, I decided to invest a significant amount of money in the scheme. The initial weeks seemed promising as I saw small returns on my investment, which further fueled my belief in the legitimacy of the operation. However, as time passed, the individual became increasingly difficult to reach, and my requests to withdraw my profits were ignored. It soon became clear that I had fallen victim to a cryptocurrency investment scam. I had lost a substantial sum of money, and the promises of high returns were nothing but a facade to lure unsuspecting investors.  
However, I refused to give up hope and began searching for solutions online. 
That's when I came across DragonWebRecovery specializing in recovering stolen cryptocurrency. I reached out to them and explained my situation, and they immediately sprang into action. Through their expertise, determination, and relentless effort, they were able to track down my lost bitcoin and recover it for me. I was overjoyed and relieved beyond words when I received the news that my funds had been successfully retrieved. If you find yourself in a similar situation search their name on google DragonWebRecovery.
I urge everyone to exercise caution when approached with investment opportunities that seem too good to be true, especially in the realm of cryptocurrency. DragonWebRecovery Social media communications Plus44 7492213552
DragonWebRecovery AT tuta.io  
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/93mw3yc3kg183w7cg512.jpg)
gemini-chat-python
Tags: googlecloud, python, django, flask
Published: 2024-04-13 20:37:42


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d7sl5gwneu9upahtnstd.png)

GeminiAI-Chat – the revolutionary Python library designed to power up your applications with advanced conversational AI capabilities GeminiAI-Chat, developers can effortlessly integrate AI-driven chat functionalities into their projects

**How to install geminiai-chat-python**

```
pip install geminiai-chat-python --upgrade
```

**Documentation**
GeminiAI-Chat offers a seamless way to incorporate intelligent, responsive AI chat features

```
from GeminiAIChat.core import API


res = API("your_api_key") # https://aistudio.google.com/app/apikey
res.prompt("what is python")
print(res.response())

```

**Get API KEY**
https://aistudio.google.com/app/apikey 

**Issues**
https://github.com/MominIqbal-1234/geminiai-chat-python/issues
Spin-Python-SDK Templete
Tags: python, webassembly, spin, spintemplete
Published: 2024-04-13 20:31:41

**What is Spin**
Spin is a framework for building and running event-driven microservice applications with WebAssembly (Wasm) components.

**Spin Templete**
spin templete is the layer of Spin-python-sdk for render html

**How to install spin_templete**

```
pip install spin_templete
```

**Setup**

```
mkdir templete
cd templete
touch index.html
```
**index.html**

```
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>Hello World Again Momin</h1>

    <ul>
        {% for item in items %}
            <li>{{ item }}</li>
        {% endfor %}
        </ul>   
    <ul>
        {% for item in mylist %}
            <li>{{ item }}</li>
        {% endfor %}
        </ul>   



<h1>{{name}}</h1>

</body>
</html>
```
**app.py**

```
from spin_sdk.http import IncomingHandler, Request, Response
from spintemplete.templete import Render


html = Render("templete")

class IncomingHandler(IncomingHandler):
    def handle_request(self, request: Request) -> Response:
        return html.render("index.html",items=[1,2,3,4,5],mylist=["hello","world"],name="momin")
```
**spin.toml**
Add more html files your requirements

```

[component.myapp]
source = "app.wasm"
files = ["templete/index.html"]
```
Repository : https://github.com/MominIqbal-1234/spin_templete
Developed by : Momin Iqbal
site : https://image.mefiz.com
What hobbies do you enjoy most outside of work?
Published: 2024-04-13 20:23:01

For me personally, I'm passionate about various sports activities. I enjoy running, cycling, swimming, skateboarding, [Rapper name generator](https://jarvis.cx/help/usecase/rap-lyrics-generator/rapper-name-generator) and engaging in calisthenics training. When the weather allows, I also love heading to the mountains for some outdoor adventures. These activities not only keep me physically fit but also invigorate my mind and spirit.
AI-Generated Animal-Based Quotes + Dynamic Image : Cloudfare AI 🤯
Tags: cloudflarechallenge, devchallenge, ai, webdev
Published: 2024-04-13 20:01:17

*This is a submission for the [Cloudflare AI Challenge](https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99).*

## What I Built

I have build a simple cloudfare worker application that randomly generated quote with nice looking image for background base on `openchat-3.5-0106` and `dreamshaper-8-lcm` models.
 
## Demo

https://cloudfareworkers.infoaselalk.workers.dev/

## My Code

https://github.com/zaselalk/animal-inspired-ai-quote

## Journey

Building this application was an amazing journey for me, I have learn lot about different type of cloudflare services including Cloudflare workers, R2 and more echo system that provided by Cloudflare for developers.

Even though I'm not using all those services provided by Cloudflare, to what I build, I learn lot about them by when I go through the documentation.

I also go through the video published by Cloudflare then I have studies several sample application provided in the example and as well as the project on Github.

Video : https://youtu.be/H7Qe96fqg1M?si=jKhlzvjaigrPV3an

I also did experiment with hono framework as well, then I started building the application which make me struggle few hours due to internet connection issues, the npm refuse to install packages on my local machine abut luckily Github codespace save my day.

First I tried to develop AI post drafted application and but when I try different models, I realized these models are well suited for short text generation, after hours of testing different models I selected the `openchat-3.5-0106` model and then try with text to image models as well, The model of `dreamshaper-8-lcm` is fine for me.

Then I release app with some basic design and share with my friends to take some feedback, the feedback was positive and then some of them are asking about the feature of selecting animal, which I planned to add as next update.

**Multiple Models and/or Triple Task Types**

I have use two models to achive the quote creation task
 - `openchat-3.5-0106` for text generation 
 - `dreamshaper-8-lcm` for image generation


there are some other quotes generated by application, try your self as well.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ei9jpien5vdc8vvr3srm.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v2j8ym8w580dqhpee7yv.png)
C# dasturlash tilida kasrlar
Published: 2024-04-13 19:50:20


Bilamizki, C# dasturlash tilida sonlar 2 turga bo'linadi, **butun sonlar** va **kasr sonlar**. Bugun kasr sonlar va ularga aloqador bir nechta xususiyatlar haqida gaplashib o'tamiz. 

Kasr sonlarning barchasi **value type** hisoblanadi. Kasr sonlarning butun qismidan so'ng raqamlari bo'ladi. Masalan, **2.7**, **3.54**, **4.976**. C# dasturlash tilida kasr sonlarni **float**, **double**, **decimal** turlari bilan ifodalasa bo'ladi va o'z o'rnida ularning bir-biridan farqli tomonlari mavjud.

## Float
`float son = 11.5f`. Bu float tipining C#  tilida e'lon qilish va qiymat berishning umumiy ko'rinishi.
- Float tipidagi o'zgaruvchini oxirida albatta **f** yoki **F** harfini yozish kerak, aks holda xatolik beradi. 
- Float tipidagi o'zgaruvchilar butun qismidan keyin maksimal _6~9_ tagacha sonlarni o'zida saqlay oladi. 
- Aniqlanish sohasi esa **±1.5 x 10e−45 to ±3.4 x 10e38** shu oraliqda. 
- Xotiradan **4byte** egallaydi.

## Double
`double son = 34.9`. Bu double tipining C# tilida e'lon qilish va qiymat berishning umumiy ko'rinishi.

- Double tipidagi o'zgaruvchini oxirida hech qanday harf qo'shib yozish shart emas. Ixtiyoriy ravishda **d** yoki **D** harfini qo'shib qo'ysa bo'ladi.
- Double tipidagi o'zgaruvchilar butun qismidan keyin maksimal _15~17_ tagacha sonlarni o'zida saqlay oladi. 
- Aniqlanish sohasi **±5.0 × 10e−324 to ±1.7 × 10e308** shu oraliqda.
- Xotiradan **8byte** egallaydi. 

## Decimal 
`decimal son = 45.7m`. Bu decimal tipining C# tilida e'lon qilish va qiymat berishning umumiy ko'rinishi.
- Decimal tipidagi o'zgaruvchi oxirida **m** yoki **M** harfini yozish shart, aks holda xatolik beradi.
- Decimal tipidagi o'zgaruvchilar butun qismidan keyin maksimal _28~29_ tagacha sonlarni o'zida saqlay oladi.
-  Aniqlanish sohasi **±1.0 x 10e-28 to ±7.9228 x 10e28** shu oraliqda.
- Xotiradan **16byte** egallaydi.

## Lifehack

**e** harfidan foydanlangan holda sonlaringizni 10ning ma'lum bir darajasigan oshirib chiqarishni bilarmidingiz? Shaxsan mening o'zimga yangilik bo'ldi. Keling birga ko'rib chiqamiz. 

```
float f1 = 35e3F;
double d1 = 12E4D;
decimal m1 = 987.65E-2M; 
Console.WriteLine(f1); // 35000 chiqaradi
Console.WriteLine(d1); // 120000 chiqaradi
Console.WriteLine(m1); // 9.8765 chiqaradi
```
Im glad you’re here. Dont go anywhere.
Published: 2024-05-27 19:32:32

---
title: Im glad you’re here. Dont go anywhere.
published: true
date: 2024-04-13 19:44:57 UTC
tags: 
canonical_url: https://yuricunha.bearblog.dev/im-glad-youre-here-dont-go-anywhere/
---

Hey, how's it going?

Congratulations, you've made it through another day!

Take a moment to acknowledge yourself; these past few months have been quite the journey.

I understand completely. It's been a struggle for me too.

I hate to be the bearer of bad news, but it seems like you're slipping back into that place you worked so hard to escape from.

Remember, you aimed to be where you are right now. You wanted to conquer each day.

But don't let yourself slip. Keep in mind, every setback is an opportunity to learn and grow.

Life throws so much at us; it's all about learning to navigate through it.

I'm rooting for you, buddy. I want to see you thrive again. I want to see you back on track.

Promise me you'll find your way back.
Mirth Connect: Secure DICOM Transmission Over TLS with Mirth Connect: A Comprehensive Guide
Tags: mirthconnect
Published: 2024-04-13 18:52:58

[This guide provides a comprehensive overview of how to securely transmit DICOM files over Transport Layer Security (TLS) using Mirth Connect, ensuring that sensitive patient data is protected against unauthorized access and cyber threats.](https://saga-it.com/blog/mirth-connect-dicom-over-tls/)
OXVA Xlim Pro Pod Kit
Published: 2024-04-13 18:29:14

Hãng OXVA đã ra mắt phiên bản mới của Oxva Xlim Pro 30W Pod Kit với 8 tùy chọn màu sắc mới độc đáo, bao gồm Coral Orange, Kingkong Pink, Denim Green, Denim Blue, Denim Brown, Pine Green, Aurora Blue, Aurora Pink.

Dòng sản phẩm Xlim Pro đang được nhiều anh em vaper săn đón đã có mặt tại Pod Sanda, đánh dấu trở lại sau đợt bùng nổ của phiên bản Xlim chắc chắn hứa hẹn sẽ tiếp tục hạ gục ngay cả những người dùng khó tính. Được đánh giá là dòng Pod System mạnh, đẹp và nhỏ gọn thích hợp cho những người mới sử dụng hoặc kể cả bạn là vaper lâu năm cũng sẵn sàng trải nghiệm chiếc máy Xlim Pro này. 



Vẫn được làm bằng hợp kim nhôm & PCTG, là loại vỏ toàn diện nhất cho hương vị X-treme và âm thanh mạnh mẽ. Xlim Pro Pod nâng cấp dung lượng pin 1000 mah và đạt công suất lên đến 30W giải phóng các cấp hiệu suất mơi với con quái vật này

Sử dụng Màn hình Mini OLED cùng với chế độ Auto (Tự động hút) hoặc bấm kích hoạt . Pod hỗ trợ thiết kế kiểm soát luồng gió bên. Pod chống rò rỉ 2ml với thiết kế hình quả trám phía trên, cùng với sạc nhanh Type-C thì thời gian chờ đợi vaping không quá lâu.

Điều đặc biệt ở phiên bản Pro này là nó tương thích với mọi loại đầu Pod Xlim

>>> Xem thêm: [Top 7 Pod Kit được ưa chuộng trong năm 2024](podsanda.vn/top-7-mau-pod-kit-hot-dang-duoc-ua-chuong-trong-nam-2024)

Tính năng Xlim Pro:
Hộp mực đổ đầy trên cùng để ngăn rò rỉ, với cửa sổ có thể nhìn thấy để quan sát tinh dầu
Tích hợp cuộn dây 0,8 / 1,2ohm cho MTL và Cuộn 0.6 mới cho DTL
Pin tích hợp 1000mAh, công suất đầu ra 5-30W, Auto / Bấm kích hoạt
Van lưu lượng gió có thể điều chỉnh ở bên hông của mod, với màn hình nhỏ OLED


Thông số kỹ thuật OXVA Xlim Pro:
Kích thước: 24 x 14 x 111mm

Dung tích: 2ml

Công suất: 30W

Kháng: 0,8Ω

Pin: 100mAh

PHỤ KIỆN THAY THẾ :

Đầu Pod OXVA Xlim
Bộ sản phẩm OXVA Xlim Pro bao gồm:

1 x thiết bị Xlim Pro

1 x đầu pod Xlim 0.6Ω (được cài đặt sẵn)

1 x đầu pod Xlim  0.8Ω

1 x Hướng dẫn sử dụng

1 x cáp Type-C

Mua ngay - hàng có sẵn, Xlim Pro Hà Nội, Xlim Pro Sài Gòn, Xlim Pro Hà Đông, Xlim Pro Thanh Xuân, Xlim Pro quận 1, Xlim Pro chính hãng, Xlim Pro giá rẻ, oxva xlim pro, xlim pro giá rẻ
Nguồn: [Pod Sanda](https://podsanda.vn/oxva-xlim-pro-pod-kit)
Pod Sanda - Cửa hàng chuyên cung cấp Pod Vape Juice, OCC và phụ kiện
Published: 2024-04-13 18:25:44

Pod Sanda có địa chỉ website là [www.podsanda.vn](podsanda.vn) - Chúng tôi là đơn vị cung cấp Pod, Juice Pod, OCC, phụ kiện Pod Vape tại Hà Đông, Thanh Xuân Hà Nội và Quận 1, Sài Gòn

Chúng tôi chuyên cung cấp sỉ lẻ Pod với giá cả cạnh tranh nhất, liên hệ chúng tôi ngay để nhận được nhiều ưu đãi, cơ hội cộng tác đồng hành cùng phát triển!

[Twitter](https://twitter.com/podsanda)
[Pod Sanda Hà Đông](https://maps.app.goo.gl/F8hfw7DiTfp6BAAD8)
[Pod Sanda Thanh Xuân](https://maps.app.goo.gl/FHBFyBD9Lhc3CQuM9)
[Pod Sanda Quận 1](https://maps.app.goo.gl/pJz2tYh2RT9oJDFLA)
[Linkedin](https://www.linkedin.com/in/pod-sanda-72bbaa302/)
[Vimeo](https://vimeo.com/podsanda)
[About](https://about.me/podsanda)
[Maps](https://www.google.com/maps/d/u/0/edit?mid=1FmLB2nx3LE_lttzdeg12QEZhk1VeiVo&usp=sharing)
Docker
Published: 2024-04-13 17:10:27

Docker is an open-source platform for developing, shipping, and running applications. It utilizes a concept called containerization, which packages your code and its dependencies into standardized units called containers. These containers are lightweight and portable, allowing them to run consistently across different environments.

- Structure of Docker

Docker operates using a client-server architecture:
Docker Client: This is the user interface you interact with to build, run, and manage your containers. It sends commands to the Docker daemon.

Docker Daemon (dockerd): This is the background service that handles the heavy lifting. It builds, runs, and distributes your Docker containers based on instructions from the client.

Benefits of Using Docker
Portability: Containers run consistently regardless of the underlying infrastructure.
Isolation: Applications run in isolated environments, preventing conflicts.
Efficiency: Containers share the host's operating system kernel, making them lightweight and fast to start.
Scalability: Easily scale your applications by adding or removing containers.
Evolution of Quality Attributes in Agile Software Development
Published: 2024-04-13 18:09:16

Title: Evolution of Quality Attributes in Agile Software DevelopmentAgile software development has undergone significant changes since its inception. Along with this, the quality attributes that have become key in the development process have also evolved. Let's explore the changes that have occurred in this area.Flexibility: One of the initial qualities of agile development was flexibility. Teams could quickly adapt to changing customer and market requirements, reducing time to market and increasing product competitiveness.Transparency: As agile methodologies evolved, it became clear that transparency is a key factor in successful collaboration within the team and with the customer. Transparency in reporting, processes, and communication helps avoid misunderstandings and conflicts.Quality: Initially, the focus was on speed of development and flexibility, but over time, the understanding of quality became deeper. Quality is not limited to just the functionality of the product but also includes development processes, testing, and change management.Value: It's important not only to develop the product quickly but also to provide maximum value to the customer. This means focusing on key features and customer needs, as well as continuously gathering feedback to improve the product.Resilience: As projects become more complex, resilience has become an important characteristic. Agile development teams must be able to adapt to unexpected changes while maintaining functionality and product quality.Innovation: Agile methodologies stimulate innovation. Teams are encouraged to experiment, test new ideas, and explore new technologies to create unique and competitive products.Collaboration: Finally, collaboration as a quality has become even more important in agile development. Effective interaction between team members, as well as with the customer and stakeholders, plays a key role in achieving success.In conclusion, the evolution of quality attributes in agile development has demonstrated a transition from emphasis on speed and flexibility to a deeper understanding of value, quality, resilience, and innovation. Collaboration and transparency remain fundamental to successful team work.