teleren/devto huggingface dataset:
MikroServis
Tags: microservices
Published: 2024-05-11 18:00:32

Mikroservisler, büyük ve karmaşık uygulamaların daha hızlı ve güvenilir bir şekilde çalışmasını sağlamak için kullanılan bir yazılım mimarisidir. Her bir mikroservis, bir uygulamanın farklı bir işlevini yerine getiren bağımsız bir birim olarak işler ve birbirleriyle ağ protokolleri üzerinden iletişim kurarlar. Mikroservis mimarisi, uygulamaların esnekliğini ve ölçeklenebilirliğini artırır, böylece uygulama parçaları birbirlerinden bağımsız olarak değiştirilebilir ve güncellenebilir.

### Mikroservis mimarisinin temel avantajları şunlardır:

Bağımsız dağıtım: Her mikroservis, diğer hizmetlerden bağımsız olarak dağıtılabilir, test edilebilir ve düzeltilir.
Kolay yönlendirme: Mikroservislerle oluşturulan uygulamalar, istekleri almak, işlemek ve hızlı yanıt vermek için daha basit bir yönlendirmeye sahiptir.
Merkezi olmayan yönetim: Her mikroservisin kendi veri tabanı ve yönetim sistemi vardır, bu da monolitik sistemlerin aksine daha esnek bir yapı sunar.

Mikroservis mimarisi, özellikle büyük veri akışı olan ve hızlı yanıt süreleri gerektiren uygulamalarda tercih edilir. Ayrıca, sistemdeki bir hizmette meydana gelen bir sorunun diğer hizmetleri etkilememesi gibi bir avantaja da sahiptir. Copilot
Como solucionar o erro "The engine node is incompatible with this module."
Tags: programming, tutorial
Published: 2024-05-11 17:58:57

Caso você esteja enfrentando o erro "The engine node is incompatible with this module." e não saiba o que pode ter ocorrido, entenda que não é tão incomum quanto pode parecer.
&nbsp;

###**Qual é a explicação do erro apresentado?**
O erro geralmente acontece após a tentativa de instalação de uma versão recente de um pacote que você tentou incluir na sua aplicação. Quando você instala um pacote, a última versão disponível do pacote é baixada e colocada na pasta node_modules, e uma entrada correspondente é adicionada nos arquivos package.json e package-lock.json presentes na pasta atual.

O **npm** calcula as dependências e também instala a última versão delas.

E quando se enfrenta este erro de incompatibilidade, geralmente, como foi o meu caso, foi feita uma formatação do sistema, troca de sistema operacional no meio do desenvolvimento (caso você utilize um dual-boot) /ou uma grande atualização do Node.Js. Felizmente, podemos resolver este problema atualizando todos os pacotes e dependências globalmente.

Um exemplo real que aconteceu comigo, foi quando eu precisei iniciar uma aplicação que desenvolvi anteriormente em outro sistema operacional e o console me retornava um erro "The engine node is incompatible with this module. Expected version ^14.16.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0. Got 20.9.0"

&nbsp;

### **Solução**

Para resolver este problema atualizando para uma versão major desses pacotes, instale o pacote npm-check-updates globalmente.

```bash
npm install -g npm-check-updates
```
E depois, entrando na pasta da sua aplicação que possuiria a **node_modules**, aplique o seguinte comando:
```bash
ncu -u
```
Este comando atualizará a sua **package.json**, as **dependencies** e **devDependencies**.

&nbsp;
Após isso, faça a atualização utilizando o comando `npm update` e faça a reinstalação das dependências da aplicação. No meu caso, utilizei o gerenciador de pacotes **yarn**, então eu apliquei o comando de instalação.

```bash
yarn install // ou npm install
```
&nbsp;
Assim sendo, você resolve o erro com eficácia. Ah! e uma dica, para descobrir novas atualizações dos pacotes, você pode aplicar o comando `npm outdated`, este comando é responsável por verificar novas atualizações dos pacotes.

&nbsp;
✅ Prontinho! espero que tenha conseguido solucionar esta questão utilizando esse artigo. Obrigado pela sua leitura até aqui. 

&nbsp;
Conheça a Cherry Code -> https://cherrycode.com.br
Day 10: Anonymous Function
Tags: webdev, javascript, programming, blockchain
Published: 2024-05-11 17:50:34

Another day, another level deeper into the machine. Today's session felt like I was falling down a never-ending well of ones and zeroes. Started with the fundamental building blocks - binary code, the raw language the damn machines speak. Makes you wonder if they ever dream in those long strings of zeroes and ones.

Then came Assembly, a step up from the gutter, using those fancy "mnemonics" to make things a little less cryptic. Still feels like wrestling a goddamn mainframe with my bare hands.

High-level languages? Now that's where things get interesting.  C++, Python, Java - all these fancy names for layers of abstraction, hiding the real dirt from the programmer. Like wearing sunglasses indoors, keeps the world blurry but at least it's not blinding. Trade-off, I suppose. Makes you wonder what the real cost is for that convenience.

Compilers and Interpreters. Feels like a power struggle between two sides of the same coin. One builds the whole damn thing beforehand, the other one takes it line by line, on the fly. Fast and loose versus slow and steady. Gotta pick your poison, I guess.

Static vs Dynamic typing.  Another layer of control, another layer of illusion. Statics give you a false sense of security, like a locked door in a bad neighborhood. Dynamics are the wild west, anything goes, but one wrong move and your whole program goes tits up.

Then there's mutability and immutability. Data, ever-changing, or set in stone?  Feels like a philosophical question more than a programming one.  Maybe it all depends on what you're trying to build. Building a house? Needs flexibility. Building a goddamn time machine? Maybe some immutability wouldn't hurt.

Functional vs Object-oriented. Two different ways to see the world. Functions like building blocks, objects like... well, objects.  One emphasizes the "what", the other the "how". Guess it depends on how you like to think.

First-class functions. Now that's a concept I can get behind. Treating functions like real citizens, passing them around like gold coins. Makes code cleaner, more elegant. Like a well-oiled machine, everything working in harmony.

Anonymous functions. The ultimate disguise. No name, no face, just pure functionality. Like a ghost in the machine, haunting the code with its invisible power.

Finished the day with a quick dive into constructors. Building objects, giving them life (well, a digital kind of life). Feels like playing god in a way, shaping these little entities with code.

Head spinning, eyes burning. Another day spent learning the language of the machines. One day closer to cracking this damn system. But the deeper I go, the more I wonder... who am I really building all this for? Them, or me?

Just a thought. Maybe for another day.
Next js 14 First day - Styling in Next js
Published: 2024-05-11 17:35:49

There are 3 ways to style component :
1- CSS modules
2- Global
3- library like Tailwind

 

---

## CSS Modules

1. File has extension .module.css
2. import the file in the page component

```jsx
//page.js

import styles from "./page.module.css";

export default function Home() {
  return (
    <div>
      <h1 className={styles.title}>Hello world!!</h1>
    </div>
  );
}

```

```css
//page.module.css
.title{
  font-size: 36px;
}
```

---

## Global

- You can import **global.css** in any file, but it’s good practice to add it in top level component like : **layout.js.**
- It’s used to add CSS rules to all routes in your application such as CSS reset-rules….. etc.

---

## Tailwind

First install Tailwind in your app

```jsx
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
```

Now configure tailwind in your app by adding paths to your files in **tailwind.config.js.**

```jsx
/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    './app/**/*.{js,ts,jsx,tsx,mdx}', 
    './pages/**/*.{js,ts,jsx,tsx,mdx}',
    './components/**/*.{js,ts,jsx,tsx,mdx}',

  ],
  theme: {
    extend: {},
  },
  plugins: [],
}
```

Import your tailwind css directive in your global file **globals.css**

```css
@tailwind base;
@tailwind components;
@tailwind utilities;
```

Now, add some classes to your element to test 

```jsx
export default function Home() {
  return (
    <div>
      <h1 className="text-3xl font-bold underline">Hello world!!</h1>
    </div>
  );
}
```


⚠ If you have a struggle with it and tailwind classes doesn’t show in your app try to close your app and run it again by : npm run dev
How to get a better job offer
Tags: beginners, tutorial, codenewbie, career
Published: 2024-05-11 17:25:59

Getting a better job offer means negotiation.

There are some rules to negotiate a better job offer.

But first of all......

WHAT IS NEGOTIATION?

> In simple terms negotiation is the art of getting a better deal from someone who may be an individual or a group, where you fight for the deal for your own advantage or overall advantage of everyone.

HOW TO NEGOTIATE A BETTER SALARY?

Here are the RULES below 👇🏻 

Don’t underestimate the importance of likability.

- This is about more than being polite; it’s about managing some inevitable tensions in negotiation, such as asking for what you deserve without seeming greedy.

Make them believe in your offer.

- Never let your proposal speak for itself—always tell the story that goes with it.

Observe the person across the table.

- Understand your counterpart. They don't usually negotiate, you do.

Know their constraints.

- No matter how much you tell story and try to negotiate, if company is not flexible then there is no point to stretch further. If they are non negotiable then just make a low deal.

Avoid, ignore any ultimatum.

- If someone tells you, “We’ll never do this,” don’t dwell on it or make him/her repeat it. Instead you might say, “I can see how that might be difficult, given where we are today. Perhaps we can talk about X, Y, and Z.” Pretend the ultimatum was never given and keep him/her from becoming wedded to it.

Use number to impress interviewer.

- When asked for a salary number then don't say "I want $60,000" instead use number like $68754. This tells the interviewer that you have done some research.

So, these are the steps to get a better job offer💯🔥.
Netlify Dynamic Site Challenge: Photo Gallery with React and Netlify Image CDN
Tags: netlifychallenge, devchallenge, webdev, javascript
Published: 2024-05-11 17:22:34

*This is a submission for the [Netlify Dynamic Site Challenge](https://dev.to/challenges/netlify): Visual Feast.*


## What I Built
I built a dynamic photo gallery using Create React App and Netlify Image CDN. On the first load, page images are fetched from the CDN with widths determined by the initial display width. For desktop devices, the initial width of images is derived from the screen width divided by 4, and for mobile devices, it's the full width of the device. Other parameters are omitted for the first render.

Then, users can choose one of the images, and it will open in a fullscreen pop-up (similar to a fullscreen zoom) with an input field for image customization. For this window, the web app makes a request to the CDN and loads the image in its original size. There, users can set the width, height, fit, position, and quality of the image. After hitting the "Get an Image" button, the new image with applied modifications is requested and rendered on the page. Also, users can check requested image URL address.
Format options are excluded because the Netlify Image CDN determines the format of the image automatically depending on the user's browser.


## Demo
[Freya's photo gallery](https://visual-feast-challenge.netlify.app/)

![Webpage view](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nd4i7coaips4orf70vmk.png)

Image customization window:

![Image customization window](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2q4mvgav799kf70mxz31.png)

Requested custom photo with image URL open: 

![Custom image URL view](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gi7ko1w3ahmjwartf4f6.png)


## Platform Primitives

Netlify Image CDN allowed me to decrease the size of requested images by half. In addition to that, the user can make modifications to the image in the UI, which are translated into image URL query parameters. The query parameters are sent to CDN and it returns the image with the desired modifications. 

I don't set the requested image format in the query since Netlify CDN can automatically detect accepted image formats from the request header, which is set by the client's browser. This makes the platform compatible with multiple browsers.

To deploy my project, I used Netlify CLI, which allows local deployment. This feature enabled me to test the platform locally and fix any bugs before pushing it to production.

## Conclusion

Overall, I had a great experience with all Netlify services. They have clear and detailed documentation, and the deployment process is easy and straightforward. The APIs are very clear and enjoyable to work with. I have used their services to publish my projects before and plan to continue using them in the future.

Thanks to Netlify for conducting such challenges! I enjoyed working on my project and looking forward to participating in more events like this in the future!
Important Cloud Computing Concept
Tags: clouddev, importantcloudconptconcept, cloudvirt
Published: 2024-05-11 16:42:30

1, What is VIRTUALIZATION? Is a technology that we can use to produce virtual representations of networks,servers, storage and other physical machines.It imitates the functions of physical hardware to run multiple virtual machines simultaneously on a single physical machine.

2, SCALABILITY the ability to increase or decrease IT resources as needed to meet changing demand, the ability of an organization (or a system, such as a computer network) to perform well under an increased or expanding workload.

3, AGILITY is the ability to quickly develop, test, and launch applications in a cloud-based environment. 

4, HIGH AVAILABILTY is a quality of computing infrastructure that allows it to continue functioning, even when some of its components fail, mostly essential for mission-critical systems that cannot tolerate interruption in service, and any downtime can cause damage or result in financial loss.

5, FAULT TOLERANT is refers to the ability of a system (computer, network, cloud cluster, etc.) to continue operating without interruption when one or more of its components fail or malfunction.

6, GLOBAL REACH  This simply means that the Cloud does not constraint to one locality, it goes beyond a particular geographical boundaries, it enables organizations to establish a global footprint without the constraints of physical infrastructure.

7, WHAT IS THE DIFFERENCE BETWEEN ELASTICITY AND SCALABILTY? Elasticity refers to how fast your application can scale up or down based on demand, while scalability refers to how the system can handle much load, Elasticity involves stretching the boundaries of a cloud environment, while scalabilty has to do with building up or down of cloud computing.
icns Creator v2.1 Release
Tags: swiftui, opensource, utility, icon
Published: 2024-05-11 17:04:10

icns Creator is a macOS application that allows you to easily create individual `icns` and `iconset` files from any `Gif`, `PNG` or `JPG` image file. With this tool, you can quickly generate high-quality icns files to use as icons for your macOS applications or generate a single appropriate .iconset file.

It's native, written in SwiftUI, open source. Not telemetry, or any other data collection. Refer to [Github Repo](https://github.com/alptugan/icns-creator) to fork, download and install the app.
A small survey about modern social medias.
Tags: discuss, learning, community
Published: 2024-05-11 16:58:44

Hi everyone

Nice to meet you all, i'm Darnethal0z. Just a self-taught developer wandering around.

This is my first post here, it will be a little short but i hope i could catch your attention still.

I would like to ask you your global feedback about modern social medias. Whether technical, practical, social or other: I want to gather your opinions before starting a small project of mine in this domain.

The request is deliberately broad and i will accept any kind of comments. You can talk about your experiences, the things you like or dislike, or anything that comes through.

Thanks again for your time, and happy writing :)
4. Median of Two Sorted Arrays
Tags: php, leetcode, algorithms, programming
Published: 2024-05-11 16:47:31

4\. Median of Two Sorted Arrays

Hard

Given two sorted arrays `nums1` and `nums2` of size `m` and `n` respectively, return **the median** of the two sorted arrays.

The overall run time complexity should be `O(log (m+n))`.

**Example 1:**

- **Input:** nums1 = [1,3], nums2 = [2]
- **Output:** 2.00000
- **Explanation:** merged array = [1,2,3] and median is 2.

**Example 2:**

- **Input:** nums1 = [1,2], nums2 = [3,4]
- **Output:** 2.50000
- **Explanation:** merged array = [1,2,3,4] and median is (2 + 3) / 2 = 2.5.

**Example 3:**

- **Input:** nums1 = [0,0], nums2 = [0,0]
- **Output:** 0.00000

**Example 4:**

- **Input:** nums1 = [], nums2 = [1]
- **Output:** 1.00000

**Example 5:**

- **Input:** nums1 = [2], nums2 = []
- **Output:** 2.00000

**Constraints:**

*   `nums1.length == m`
*   `nums2.length == n`
*   `0 <= m <= 1000`
*   `0 <= n <= 1000`
*   `1 <= m + n <= 2000`
*   <code>-10<sup>6</sup> <= nums1[i], nums2[i] <= 10<sup>6</sup></code>

**Solution:**

```
class Solution {

    /**
     * @param Integer[] $nums1
     * @param Integer[] $nums2
     * @return Float
     */
    function findMedianSortedArrays($nums1, $nums2) {
        $mergedArray = [];
        $totalLength = count($nums1) + count($nums2);
        $median = ($totalLength / 2);
        if ($totalLength % 2 === 0) {
            $index = [$median - 1, $median];
        } else {
            $index = [floor($median)];
        }
        $i = 0;
        $i1 = 0;
        $i2 = 0;
        while ($i < $totalLength) {
            if (!isset($nums1[$i1])) {
                $mergedArray[] = $nums2[$i2];
                $i2++;
                $i++;
                continue;
            }
            if (!isset($nums2[$i2])) {
                $mergedArray[] = $nums1[$i1];
                $i1++;
                $i++;
                continue;
            }
            if ($nums1[$i1] < $nums2[$i2]) {
                $mergedArray[] = $nums1[$i1];
                $i1++;
            } else {
                $mergedArray[] = $nums2[$i2];
                $i2++;
            }
            $i++;
        }
        return isset($index[1])
            ? ($mergedArray[$index[0]] + $mergedArray[$index[1]]) / 2
            : $mergedArray[$index[0]];
    }
}
```


**Contact Links**

- **[LinkedIn](https://www.linkedin.com/in/arifulhaque/)**
- **[GitHub](https://github.com/mah-shamim)**
857. Minimum Cost to Hire K Workers
Tags: php, leetcode, algorithms, programming
Published: 2024-05-11 16:47:11

857\. Minimum Cost to Hire K Workers

Hard

There are `n` workers. You are given two integer arrays `quality` and wage where `quality[i]` is the quality of the <code>i<sup>th</sup></code> worker and `wage[i]` is the minimum wage expectation for the <code>i<sup>th</sup></code> worker.

We want to hire exactly `k` workers to form a **paid group**. To hire a group of `k` workers, we must pay them according to the following rules:

1. Every worker in the paid group must be paid at least their minimum wage expectation.
2. In the group, each worker's pay must be directly proportional to their quality. This means if a worker’s quality is double that of another worker in the group, then they must be paid twice as much as the other worker.

Given the integer `k`, return _the least amount of money needed to form a paid group satisfying the above conditions. Answers within <code>10<sup>-5</sup></code> of the actual answer will be accepted._

**Example 1:**

- **Input:** quality = [10,20,5], wage = [70,50,30], k = 2
- **Output:** 105.00000
- **Explanation:** We pay 70 to 0<sup>th</sup> worker and 35 to 2<sup>nd</sup> worker.

**Example 2:**

- **Input:** quality = [3,1,10,10,1], wage = [4,8,2,2,7], k = 3
- **Output:** 30.66667
- **Explanation:** We pay 4 to 0<sup>th</sup> worker, 13.33333 to 2<sup>nd</sup> and 3<sup>rd</sup> workers separately.

**Example 3:**

- **Input:** quality = [4,4,4,5], wage = [13,12,13,12], k = 2
- **Output:** 26.00000

**Constraints:**


- <code>n == quality.length == wage.length</code>
- <code>1 <= k <= n <= 10<sup>4</sup></code>
- <code>1 <= quality[i], wage[i] <= 10<sup>4</sup></code>


**Solution:**

```
class Solution {

    /**
     * @param Integer[] $quality
     * @param Integer[] $wage
     * @param Integer $k
     * @return Float
     */
    function mincostToHireWorkers($quality, $wage, $k) {
        $ans = PHP_INT_MAX;
        $qualitySum = 0;
        $workers = array();
        $maxHeap = new SplMaxHeap();

        for ($i = 0; $i < count($quality); ++$i) {
            $workers[$i] = array((double) $wage[$i] / $quality[$i], $quality[$i]);
        }

        usort($workers, function($a, $b) {
            return $a[0] <=> $b[0];
        });

        foreach ($workers as $worker) {
            $wagePerQuality = $worker[0];
            $q = $worker[1];
            $maxHeap->insert($q);
            $qualitySum += $q;
            if ($maxHeap->count() > $k) {
                $qualitySum -= $maxHeap->extract();
            }
            if ($maxHeap->count() == $k) {
                $ans = min($ans, $qualitySum * $wagePerQuality);
            }
        }

        return $ans;
    }
}
```



**Contact Links**

- **[LinkedIn](https://www.linkedin.com/in/arifulhaque/)**
- **[GitHub](https://github.com/mah-shamim)**
JobPosting from Schema.org
Tags: peviitor, backend, schema
Published: 2024-05-11 16:38:35

## What is Schema.org?
Schema.org is a collaborative, community activity with a mission to create, maintain, and promote schemas for structured data on the Internet, on web pages, in email messages, and beyond.
[Schema.org website](https://schema.org/)

---

## What is JobPosting?
A listing that describes a job opening in a certain organization.
[JobPosting website](https://schema.org/JobPosting)

---

## What do peviitor.ro use from Schema.org?

**Mandatory:**

- hiringOrganization.name;

- id;

- title;

- url.

**Optional:**
- applicationContact;
- baseSalary.value;
- datePosted;
- estimatedSalary;
- jobLocation.address.city;
- jobLocation.address.county;
- jobLocation.address.street;

- jobLocationType;
- jobStartDate;

- importedDate;
- validThrough;
- hiringOrganization.cui;
- sursa;

- tel.

---

## Example of code from peviitor.ro
![Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7uyy5rmfaeplvacgr25f.png)

---
Day 41/366
Tags: 1percentplusplus, 100daysofcode
Published: 2024-05-11 16:23:18

🚀 **Today's Learning:**

🌟 DSA

- Check if an array represents a min-heap or not
- Convert min Heap to max Heap

🌟 Dev

- pymongo library

🔍 **Some Key Highlights:**

DSA

To check if an array represents a min-heap, iterate through each parent node starting from the last non-leaf node towards the root. At each step, compare the parent node with its children. If any child is smaller than the parent, it violates the min-heap property, indicating that the array doesn't represent a min-heap. If no violation is found, the array is a min-heap.

To convert a min heap to a max heap, begin by swapping the positions of the parent node and its largest child if any child is greater than the parent. Then, recursively perform this swap operation for each subtree until the entire heap satisfies the max-heap property. This process effectively transforms the min heap into a max heap.

DEV

The PyMongo library is a Python driver for MongoDB, enabling interaction with MongoDB databases from Python applications. It provides a simple and intuitive interface for performing various operations such as inserting, updating, querying, and deleting documents in MongoDB collections. With PyMongo, you can establish connections to MongoDB servers, access databases and collections, and execute commands and queries efficiently. Its design aligns with Python's philosophy, making it easy for developers to work with MongoDB databases seamlessly within their Python projects.

 #100daysofcode #1percentplusplus #coding #dsa