teleren/devto huggingface dataset:
C++ Yangi qator.
Tags: beginners, programming, tutorial, cpp
Published: 2023-02-21 09:55:42

Assalamu aleykum xurmatli dasturchi bugungi o'rganadigon narsamiz C++ dasturlash tilida yangi qator tashlashni korib chiqamiz.
Yangi qator kiritish uchun "\n" belgisidan foydalanishingiz mumkin:

**Misol uchun::**

```
#include <iostream>
using namespace std;

int main()
{

cout << "Men C++ o'rganishni boshladim\n";
cout << "Judayam qiziqarli va o'rganishaga oson";

return 0;
}

```
Maslahat: Bir-biridan keyin ikkita \n belgi boʻsh qator hosil qiladi:

**Misol uchun::**

```
#include <iostream>
using namespace std;

int main()
{

cout << "Sizga maslahatim dasturlashni C yoki C++ dan boshlang\n\n";
cout << "Qani kettik";

return 0;
}
```

Yangi qatorni kiritishning yana bir yo'li "endl" maxsus buyurug'idan foydalanamiz:

**Misol uchun::**

```
#include <iostream>
using namespace std;

int main()
{

cout << "I am learning C++" << endl;
cout << "Salom Dunyo";

return 0;
}
```

Satrlarni kesish uchun `"\n"` va `"endl"` ham ishlatiladi. Biroq, `"\n"` eng ko'p ishlatiladi.

Lekin `\n` aynan nima?
Yangi qator belgisi (\n) qochish ketma-ketligi deb ataladi va u kursorni o'z o'rnini ekrandagi keyingi qatorning boshiga o'zgartirishga majbur qiladi. Buning natijasida yangi qator paydo bo'ladi.

Boshqa haqiqiy qochish ketma-ketliklariga misollar:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4eh3iwl1rnd9ip0mszhy.png)
Understanding Terraform: part 1 – What is Terraform?
Tags: terraform, devops, beginners, iac
Published: 2023-02-22 07:35:07

---
title: Understanding Terraform: part 1 – What is Terraform?
published: true
description: Serie of sketchnotes about Terraform. Explaining in a visual way Terraform principles.
tags: Terraform, DevOps, beginners, IaC
series: Understanding Terraform in sketchnotes
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pbac4oqhjwm8nbewhi9d.jpg
---

Understanding Terraform can be difficult or time-consuming. In order to spread knowledge about Cloud technologies and Infrastructure as Code I started to create sketchnotes about Terraform. I think it could be a good way, more visual, to explain Terraform (and other technologies like Kubernetes, Docker and Istio).

Terraform is an Infrastructure as Code tool, it began a defacto standard but do you know really the tool? :-)

We start the serie of sketchnotes with a sketchnote about What is Terraform:

![What is Terraform](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pbac4oqhjwm8nbewhi9d.jpg)
![What is Terraform](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/epxedkg3kuowb0e18ebi.jpg)
![What is Terraform](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snh77yaej5woom1jb5dz.jpg)

As usual, if you like theses sketchnotes, you can follow me, and tell me what do you think. I will publish others sketchs shortly :-).

I'll try to write and publish other sketchnotes about Terraform shortly.

If Docker interests you, I published a book in a paperbook version on Amazon: [Understanding Docker in a visual way](https://www.amazon.fr/Understanding-Docker-visual-way-sketchnotes/dp/B0BT6ZXR1W/ref=sr_1_1) and also in a PDF/ebook version on [GumRoad](https://gumroad.com/aurelievache#YTLzM).

If Kubernetes interest you too, the book [Understanding Kubernetes in a visual way](https://www.amazon.fr/dp/B0BB619188/ref=cm_cr_arp_d_product_top?ie=UTF8) is available also.
Conditional Waiting in Cypress
Published: 2023-02-22 09:11:31



![](https://cdn-images-1.medium.com/max/1024/1*2YPshgVie4Ot2FRMwt1ygw.png)

_By using a recursive function, you can repeatedly wait for the request until you get the desired response_

#### Test Case

Our test case involves an existing user (permanent user) who invites a new user via email. The new user receives a registration link and registers for the [Determ](http://determ.com) application. After the new user has been registered and has access to the app, we need to delete them to “clean up” after the test. However, we don’t want to delete the existing user, so we need to check the user ID before deleting the user.

#### Solution

To delete the newly created user, we need to intercept and wait for a specific API request that contains the user’s access token. However, the same request is also sent for the existing user, and we don’t want to delete them. The only difference between the users is their user ID, which we can only get from the response of the API request.

To solve this problem, we can use a recursive function that waits for the API request and checks the user ID. If the user ID is the same as the ID of the existing user, the function calls itself again. If the user ID is not the same, we save the access token and use it to delete the user later.

Here’s the code for the recursive function:

{% gist https://gist.github.com/ajdinmust/8f66c6f25dc87802ca879cedce3c1d7c %}

Then inside your test just call the function:

{% gist https://gist.github.com/ajdinmust/9822419ba4456593ad909984a725a75e %}

![](https://cdn-images-1.medium.com/max/688/1*1-t3e18tmAVlIiCWfXJunA.png)
_Conditional cy.wait()_

#### Conclusion

By checking the user ID in the response, we can make sure we only delete the correct user. The recursive function approach can be useful when you need to wait for a specific API request and process its response conditionally. And by using a recursive function, you can repeatedly wait for the request until you get the desired response.

If you have a similar problem or need help implementing this solution, feel free to leave a comment.
Samsung Galaxy A14 5G specification, review, release date, price in Bangladesh
Published: 2023-02-21 16:31:10

## Samsung Galaxy A14 5G specification, review, release date, price in Bangladesh

There’s a 50-megapixel primary camera with an f/1.8 lens, phase detection autofocus (PDAF), and a 5,000mAh battery that should last a long time. It is delicate and makes sense. You’ve got a pretty sweet deal at a starting price of only $200 and INR 15,000.https://mobilepricedokan.com/xiaomi-poco-x5-pro-full-specification/
What I have learned.
Tags: beginners
Published: 2023-02-22 00:02:50

I am excited to learn how to code, never had any pervious experience. I'm going in with an open mind and ready to seek and overcome strenuous challenges along the way. I'm currently reading about an HTML article. I have learned a lot so far. There are titles, style, links, meta, script, and noscript. That is used in the programming language. It is a lot to take in at the moment. I will do everything I can to get better.
1011. Leetcode Solution in JavaScript
Tags: javascript
Published: 2023-02-22 04:11:45

=================================================================
#description:
A conveyor belt has packages that must be shipped from one port to another within days days.

The ith package on the conveyor belt has a weight of weights[i]. Each day, we load the ship with packages on the conveyor belt (in the order given by weights). We may not load more weight than the maximum weight capacity of the ship.

Return the least weight capacity of the ship that will result in all the packages on the conveyor belt being shipped within days days.

 

Example 1:

Input: weights = [1,2,3,4,5,6,7,8,9,10], days = 5
Output: 15
Explanation: A ship capacity of 15 is the minimum to ship all the packages in 5 days like this:
1st day: 1, 2, 3, 4, 5
2nd day: 6, 7
3rd day: 8
4th day: 9
5th day: 10

Note that the cargo must be shipped in the order given, so using a ship of capacity 14 and splitting the packages into parts like (2, 3, 4, 5), (1, 6, 7), (8), (9), (10) is not allowed.
Example 2:

Input: weights = [3,2,2,4,1,4], days = 3
Output: 6
Explanation: A ship capacity of 6 is the minimum to ship all the packages in 3 days like this:
1st day: 3, 2
2nd day: 2, 4
3rd day: 1, 4
Example 3:

Input: weights = [1,2,3,1,1], days = 4
Output: 3
Explanation:
1st day: 1
2nd day: 2
3rd day: 3
4th day: 1, 1
 

Constraints:

1 <= days <= weights.length <= 5 * 104
1 <= weights[i] <= 500

=================================================================
#solution
```javascript
/**
 * @param {number[]} weights
 * @param {number} days
 * @return {number}
 */
var shipWithinDays = function(weights, D) {
    function getDays(capacity) {
        let days = 1, total = 0;

        // See how many days it will take to unload all the weights given the current capacity
        for(let n of weights) {
            total += n;
            // Increase days only when we will exceed the capacity
            if(total > capacity) {
                total = n;
                days++;
            }
        }
        return days;
    }

    // Start is the minimum capacity of one day which is the max of all the weights
    // End is the max capacity we could load on one day which is the sum of all the weights
    let start = Math.max(...weights), 
        end = weights.reduce((acc, cur) => acc + cur, 0);

    // The min cacpaity needed is between start and finish
    while(start < end) {
        const mid = Math.floor((end+start)/2);
        // See how many days it would take to unload all the weigths given mid as the current capacity
        const days = getDays(mid);
        // If capacity at mid took more than D days to load, then we can add more weigth on the ships each day which means we need to increase the daily capacity
        if(days > D) start = mid+1;
        // mid might be our answer so we cannot set end to mid-1
        else end = mid;
    }
    return end;
};
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/
How to make a NFT Sold Notification Discord Bot
Tags: web3, nft, discord, crypto
Published: 2023-02-22 12:36:00

Want to get notified whenever a NFT from a collection is sold directly on Discord?
This is how you could do it:

**Create an account on Chainbase**
We will be using [chainbase](https://chainbase.online/) for the whole process so make sure to create an account on chainbase.

**Get Chainbase API Key**
Get a chainbase API key from [here](https://console.chainbase.online/web3ApiService).
Note it as `CHAINBASE_API_KEY`.

**Get a Chainbase ETH network API key**
Get ETH network API key from [here](https://console.chainbase.online/chainNetwork).
Note it as `CHAINBASE_ETH_MAINNET_KEY`.

**Get chainbase data cloud API key**
Get the Data Cloud api key by writing any SQL [here](https://console.chainbase.online/dataCloud) and clicking `Generate API`.
Note it as `CHAINBASE_DATACLOUD_API_KEY`.

**Clone this github repo**
```bash
git clone git@github.com:vanxh/nft-sales-bot.git
# or using HTTPS
git clone
```

**Create a `.env` file and enter the API keys we created above**
```env
CHAINBASE_API_KEY="FROM THE STEPS ABOVE"
CHAINBASE_DATACLOUD_API_KEY="FROM THE STEPS ABOVE"
CHAINBASE_ETH_MAINNET_KEY="FROM THE STEPS ABOVE"
DISCORD_WEBHOOK_URL=""
```

**Install modules**
```bash
yarn install
# or npm
npm install
```

**Update contract address in `src/index.ts`**
Update this line with contract address of NFT you want to track.
```ts
const CONTRACT_ADDRESS = '0x0000000005756b5a03e751bd0280e3a55bc05b6e';
```

**Build the project**
```bash
yarn build
```

**Run the project**
```
yarn start
```

You can find the repository for this post [here](https://github.com/vanxh/nft-sales-bot).
Top Chrome Extensions Every Frontend Developer Should Use 💡💻🔧
Published: 2023-02-22 19:53:23

Introduction: As a frontend developer, using the right tools is essential for improving productivity and delivering high-quality work. Chrome extensions can be incredibly helpful in this regard, providing a range of features that can streamline your workflow, optimize your code, and improve your overall development experience. In this thread, we've highlighted some of the best Chrome extensions for frontend developers, which can help you build better websites and applications faster and more efficiently.

#1. Lighthouse
Audits your web pages for performance, accessibility, and best practices. 💻🚀 Get it from https://chrome.google.com/webstore/detail/lighthouse/blipmdconlkpinefehnmjammfjpmpbjk

#2. JSON Viewer 

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

Makes JSON data easier to read and debug by formatting it in a tree structure. 🔍💡 Get it from https://chrome.google.com/webstore/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh

#3. React Developer Tools 

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


Allows you to inspect the React component hierarchy and see their props, state, and more. 🔍💡 Get it from https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi

#4. Axios Dev Tools
Makes it easy to debug Axios API requests and responses. 🔧💻 Get it from https://chrome.google.com/webstore/detail/axios-dev-tools/cffnfgppjihohebhicijihlhnpkpjifd

#5. CSS Peeper 

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


Inspect and copy any CSS styles from a website with just one click. 🔍🎨 Get it from https://chrome.google.com/webstore/detail/css-peeper/mbnbehikldjhnfehhnaidhjhoofhpehk

#6. Fontface Ninja 

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


Allows you to identify the fonts used on any website with ease. 🔍🎨 Get it from https://chrome.google.com/webstore/detail/fonts-ninja/eljapbgkmlngdpckoiiibecpemleclhh

#8. Wappalyzer 

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


Reveals the technologies used on a website, including the CMS, e-commerce platform, and more. 🔍💻 Get it from https://chrome.google.com/webstore/detail/wappalyzer/gppongmhjkpfnbhagpmjfkannfbllamg


These are just a few of the best #ChromeExtensions for frontend development. Which ones do you use and love? 💻🔧 #WebDevelopment #FrontendTools 💻🔧
New Programmers, What Challenges Are You Facing?
Tags: discuss, beginners, codenewbie
Published: 2023-02-22 22:34:05


It can be tough to navigate the world of coding, especially when you're a newbie. Figuring out where to start, dealing with imposter syndrome, and feeling overwhelmed by the amount of information out there. It’s...A LOT.

But you're not alone! 

Let’s hear from those of you who are just starting out: what are your challenges? And for those of you who’ve made it (are making it): what tips can you share?
Criando uma api em shelf com socket + app com provider e bloc
Tags: dart, flutter, bloc, shelf
Published: 2023-02-23 04:48:02

Fala pessoal!
Resolvi trocar o medium pelo dev.to, simplesmente pelo fato dele ser free e não impedir a galera de ver somente alguns posts por mês!

---

Vamos para o post em Sí!
Farei uma série de alguns artigos que irão consistir em:

Faremos uma api simulando um sistema de delivery (rappi/ifood)
onde o endpoint vai salvar o pedido, recuperar um pedido por id, todos  e deletar o pedido por id e finalmente alterar o pedido (teoricamente o status)



1. Criação de uma API simples Restfull (GET/POST/DELETE/PUT) , vou usar o PUT para editar também pra ficar mais fácil e testaremos tudo via POSTMAN


2. Criação de um aplicativo simples para consumir essa api (Tentarei fazer um drag/drop) todo estilizado com provider e cubit (Se Deus quiser!)

3. Modificação dessa API para integrar um servidor socket embutido emitindo cada um dos métodos pertinentes (POST/DELETE)

4. Modificação do nosso APP para escutar o socket e fazer as alterações em tempo real.


Então fiquem ligados aqui que logo mais teremos a saga completa separada de como criar tudo passo a passo!

E colocarei os links em ordem aqui também abaixo a medida que for desenvolvendo!

[Parte 1](https://dev.to/brasizza/criacao-de-uma-api-em-shelf-3c29)
Vamosys gps
Tags: fuelmonitoringsolution, fueltheft, drivertracking, gps
Published: 2023-02-23 07:01:45

[FleetOS
](https://vamosys.com/fleetos-fms-fleet-management-systems)Derive maximum efficiency, increase your fleet size.
A new-gen 360-degree fleet management system to support your growth in fleet business.
High Concurrency of Thread Pools
Tags: opengauss
Published: 2023-02-23 07:22:42


Availability
This feature is available since openGauss 1.0.0.

Introduction
The thread pooling technology is used to support stable running of databases at high concurrency.

Benefits
The overall system throughput is stable in case of a large number of concurrent requests.

Description
The overall design idea of the thread pool technology is to pool thread resources and reuse them among different connections. After the system is started, a fixed number of working threads are started based on the current number of cores or user configuration. A working thread serves one or more connection sessions. In this way, the session and thread are decoupled. The number of worker threads is fixed. Therefore, frequent thread switchover does not occur in case of high concurrency. The database layer schedules and manages sessions.

Enhancements
This feature is available since openGauss 1.0.0.

In openGauss 1.1.0, thread pools can be dynamically scaled in or out.

Constraints
None

Dependencies
None
A Fun Programming Joke To Start Your Day
Tags: jokes, dailydeveloperjokes
Published: 2023-02-23 08:00:08

---
title: "A Fun Programming Joke To Start Your Day"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258884db70.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ What do you call a busy waiter?

___A:___ A server.
 -->
Apollo Federation Gateway Demo
Tags: graphql, apoll, nestjs, node
Published: 2023-02-23 08:09:19

{% embed https://www.youtube.com/embed/Q29N6gvaFBE %}

Hi everyone welcome to my another brand new playlist in this playlist, we are going to talk about graphical Federation which is a part of all about Node js microservices 

Playlist https://www.youtube.com/watch?v=hHpKy_n-Aag&list=PLIGDNOJWiL1918oR1DYgeOEe0cWwuDPCm

Recently I have already covered Node JS microservices using REST API now I am going to cover Node JS microservices using graphql and here we are going to use all the concepts of graphical

- how to build a graphql microservices in the nest js and how to use data loaders with how the data loaders are solving the query N + 1 one problem
- we will also see how we can connect different subgraph through Apollo graphical Gateway and how can we use Apollo graphical Federation to talk to multiple microservices where gateway will expose unique centralize interface for queries and mutation

Major topics of this playlist 

- Building Code First or schema first Graphql service in Nest JS 
- What is Graphql Federation and what problem it solves Graphql
- What is the N+1 Query problem in Graphql and how Data loaders can help us to fix it.
- Building Graphql service in Nest JS with TypeORM
- Building Graphql service using apollo federation 
- We will build multiple graphql microservices and then we will compose all sub graphs using apollo gateway 

Connect different subgraphs services to Graphql Gateway 
Build end-to-end solution using graphql apollo federation

{% embed https://www.youtube.com/embed/3kMDI8--PLc %}

### Long Story short

In this playlist we will build backend having multiple microservices like 

- auth service 
- home manager service 
- booking manager service 
- apollo gateway service 

We will see how we can reference types from one service to another and how these types can be resolved from different services (that's what our graphql apollo federation will do)

Stay tuned, i will be posting more videos on this playlist.

Enjoy development
npm i или npm ci?
Tags: npm
Published: 2023-02-23 13:38:09

## npm i vs npm ci — какую команду использовать.

### npm i (npm install)

`npm i` устанавливает пакеты и их зависимости в директорию `node_modules`. По-умолчанию, список пакетов берется из раздела `dependencies` в `package.json`.

`npm` обновляет файл `package-lock.json` после любых измений `package.json` или `node_modules`. То есть, если в результате выполнения какой-либо команды `npm`, будет обновлен `package.json` или содержимое `node_modules`, то будет обновлен `package-lock.json`.

`package-lock.json` описывает фактическое дерево пакетов, которое было уставновлено и нужен для того, чтобы выполнение `npm i` приводило к одному и тому же набору пакетов. Другими словами, `package-lock.json` это описание того, что установлено в `node_modules`.

`npm i` может устанавливать пакеты по-одному, по-умолчанию `npm i` добавляет установленный пакет в раздел `dependencies` (и обновляет `package-lock.json`).

### npm ci

Команда `npm ci` похожа на `npm i` — тоже устанавливает зависимости, но предназначена для установки зависимостей с чистого листа — при сборке приложения, в релизных пайплайнах, в проверках пулреквестов, используется автоматикой. `npm ci` быстрее, чем `npm i` и имеет существенные отличия:

- удаляет `node_modules` перед установкой.
- `npm ci` требует для работы наличие `package-lock.json`, иначе получим ошибку:

> npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate it, then try again.
> 

- `npm ci` не может устанавливать пакеты по-одному, устанавливает все сразу как описано в `package-lock.json`.
- `npm ci` не обновляет `package-lock.json` и `package.json`, так как предназначен для автоматики, а в этом случае репозиторий только на чтение.
- если версии пакетов в `package.json` и `package-lock.json` расходятся, команда завершится с ошибкой:

> npm ERR! cipm can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm ERR! Invalid: lock file's lodash.get@4.4.2 does not satisfy lodash.get@4.4.0
> 

Иногда в `node_modules` могут накапливаться проблемы (например, рассинхрон фактических и ожидаемых версий пакетов), для таких случаев `npm ci` — быстрый способ переустановить все зависимости.

---

_Photo by [Paul Teysen](https://unsplash.com/fr/@hooverpaul55?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/photos/bukjsECgmeU?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_
Where publish nodeJs+Angular app for free
Published: 2023-02-23 13:44:19

I needed to publish a simple web application composed of Angular frontend and Node backend on a server to make it accessible on the network. I was looking for a hosting service for this architecture, perhaps free, and I discovered [https://www.render.com](https://www.render.com)

Render.com is a fully-managed cloud platform, which can host sites, backend APIs, databases, cron jobs and all applications in one place.

Static site publishing is completely free on Render and includes the following:

- Continuous, automatic builds & deploys from GitHub and GitLab.
- Automatic SSL certificates through Let's Encrypt.
- Instant cache invalidation with a lightning fast, global CDN.
- Unlimited contributors.
- Unlimited custom domains.
- Automatic Brotli compression for faster sites.
- Native HTTP/2 support.
- Pull Request Previews.
- Automatic HTTP → HTTPS redirects.
- Custom URL redirects and rewrites.

If you have a github account, it is very convenient to release updates, as you can directly link a repository to render.com, and automate the deployment.