teleren/devto huggingface dataset:
Running Promises in Series with a delay between each (Throttling API calls)
Tags: javascript, promise, delay, series
Published: 2022-09-08 02:37:42


I wanted to call an endpoint updating an entity and I wanted to do it for 500 entities.
The API server had "rate limit" and I couldn't just use `Promise.all` since it will call the endpoint in parallel and the rate-limit would block my calls.

So I decided to write a script to bulk call the endpoint in series and have a 2 seconds wait before each call to make sure API server would not block them.

As I did that and it worked great, I thought it'd be advantageous to share!
Is there a better way for doing this?

How I'm doing this is starting from `0` and then adding up to that based on the array of data that I want to update. In the chain of promises that I have, I just added a delay before the API call, every time that I add 1 to the value that I'm passing to update the data till that number would be equal to my array length.

```js
import fetch from "node-fetch";
import { data } from "./data.js";

const bearerToken = ""

const updateData = (id) => {
  return fetch(
    `https://www.url/${id}`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Authorization: `Bearer ${bearerToken}`,
      },
    }
  );
};

const delay = () => {
  console.log(`Waiting: 2 seconds.`);
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve("2");
    }, 2000);
  });
};

const startTime = Date.now();

const doNextPromise = async (id) => {
  delay()
    .then((x) => {
      console.log(
        `Waited: ${x} seconds now calling the endpoint for updating data ${data[id]}`
      );
      return updateData(data[id])
        .then((res) => {
          if (res.status !== 200) {
            throw `Error updating data ${data[id]}: ${res.status}`;
          }
          return res.json();
        })
        .then((res) =>
          console.log(`Response: ${JSON.stringify(res)} for data ${data[id]}`)
        )
        .catch((e) => console.log(`Error: ${e}`));
    })
    .then((res) => {
      id++;
      if (id < data.length) doNextPromise(id);
      else console.log(`Total: ${(Date.now() - startTime) / 1000} seconds.`);
    });
};
doNextPromise(0);
```
Core C++ OOP Concepts
Tags: cpp, beginners
Published: 2022-09-08 02:37:15

Four concepts:
1. Encapsulation - setting access level for whatever is inside a class
2. Abstraction - creating a design of things you like

Things learned today
- When you write static array and assign to a variable with less than x in array[x] then the rest of the space is by default filled in as 0 (in c++ 14)
- If you do not specify the length of the array, then the size is size of element multiplied by how many you put in when you initialize
- array as argument in a function parameter will 'read' only one element (int* aka pointer to int) 

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



![Compiler Warning](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0clr3jhr4znuzjmqb3c5.png)
How to Scale Up Your Website Applications
Tags: news, startup, webdev, productivity
Published: 2022-09-08 02:33:49

Imagine when users or visitors visit your website applications, but they have a bad experience. It will be a horrible both for your business continuity and user journey. In fact, a friendly and accessible website application is an essential point for your brand image. The average user expects the web page to load within 2 seconds. Some of them will wait up to 10 seconds before bouncing off your website for good. It is no big deal for you to have a responsive website application. Here is a way to scale up your website applications.

## Manage Stakeholders Expectation

If your website application is already growing as per your business plan then your business expansion requirement is already supported. Set aspirations of your company partners so that you don’t take up these tasks prematurely simply because everybody else is thinking about mobile website application.

## Use the Right Tools

Now that you have agreed to concentrate on the metrics, you need to track the app’s output with respect to certain metrics on a regular basis. You need to invest in a successful ‘Application Performance Management’ (APM) system if you are running your own infrastructure.

## Choose the Right Hosting

We need to remember that the scalability is not just about your code. Having proper server infrastructure and configuration is important. Just choosing the right software and providers will save a lot of time. Amazon EC2 provides auto-scaling functionality, for example, Docker offers a docker-compose scale, etc.

## Cache Database Queries

Majority databases sustain query logging, and there are a lot of tools that will intake those logs and perform some evaluation to tell you which queries are running most frequently, and which queries tend to take the longest to complete.

Simply cache the answers to regular or sluggish queries so that they reside on the webserver in memory, and do not need a round trip across the network or any excessive load on the database.

## Final Thought
In sum, increasing a website application experience doesn’t require a complexity thing. What you need to keep an eye for this are see our visitor expectations, use the right tools to manage it, take a suitable and good hosting, and monitor database queries.

**More Resources**:
[Website Development Requirements Checklist 2022 [Updated 2022]](https://www.emveep.com/blog/website-development-checklist-2022/)
[Best Web Development Guide in 3 Minutes](https://www.emveep.com/blog/best-web-development-guide-in-3-minutes/)
[What Is a "Crawler-Friendly" Website?](https://www.emveep.com/blog/what-is-a-crawler-friendly-website/)
How Ceramic Coating Can Protect Your Car's Paint Job
Published: 2022-09-08 02:32:22

Ceramic coating is a clear, durable layer of protection that is applied to the exterior of a car. This invisible barrier repels water, dirt, and other contaminants, protecting your car's paint job from damage. Ceramic coating also makes it easier to clean your car, and can even help to preserve its value over time.

If you are looking for a way to protect your car's paint job, **[Ceramic Coating in Gilroy, CA](https://gilroyblackout.com/ceramic-coating/)** can help. We offer ceramic coating services that will keep your car looking its best. Contact us today to learn more about our services and how we can help you maintain your car's value.
How to do...
Published: 2022-09-08 02:24:40

when I tried to run .net watch, I got this error:
  * You intended to execute a .NET application:
      The application 'watch' does not exist.
  * You intended to execute a .NET SDK command:
      No .NET SDKs were found.

Download a .NET SDK:
https://aka.ms/dotnet-download

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
linkdkbong88
Published: 2022-09-08 01:33:37

Đăng ký bong88 luôn là một chủ đề được nhiều cược thủ quan tâm, bởi đây là một nhà cái uy tín hàng đầu Châu Á. Chỉ với vài thao tác đơn giản là anh em có thể mở cho mình một tài khoản và thoải mái tham gia đặt cược.
#dangkybong88 #bong88 #linkdkbong88
Location: 30 Đường số 10, Tân Hưng, Quận 7, Hồ Chí Minh
Hotline: 946951590
[](http://dailybong88.gold/dang-ky-bong88/)
[](http://dailybong88.gold/dang-ky-bong88/)
Why should you learn to </code>
Tags: programming
Published: 2022-09-08 01:26:33

Yes, you should learn code. Everyone should know the code. Even if you are not trying to change your career, WHY? It's the same question throughout history "Why should I educate myself?" Computers rank on par with humans regarding cognitive ability in this digital age. Yes! How a computer operates, and the human brain does are almost identical. Coding, then, aids in problem-solving and sharpens your reasoning skills. It will be 2x times higher if you are a woman as your brain can multitask. 

<img src="https://tenor.com/view/uptime-gif-20288826.gif">


As `Artificial Intelligence` is replacing humans in many jobs, You should be in a position to give instructions rather than taking one. At the very least, you must know what's happening around your programming world. We don't exist anymore without programming running around us. It's hard to avoid technology irrespective of your Background. Here are the reasons why you should code.


`Work flexibility:` The fact that you can work from home must make our ancestors jealous. It's time to say goodbye to 8 hours of dull office space! You can work from your couch. Avoiding the commute to work will save you a lot of time. You can do whatever fudge you want in that time. If you are married, well!... that's vice versa. 

<img src = "https://tenor.com/view/ok-crying-sad-emotional-sentimental-gif-20646670.gif" >

`Money:` There is a lot of money, dude, yes, a lot. Who doesn't like the money? That's the driving force of our boring busy lives. Isn't it? You can earn a lot of money by learning to program. You don't believe me. Check out the top billionaires. They all are tech firm founders. Techies can make a lot of money. Software Developers made a median salary of $110,140 a year. 
<img src ="https://tenor.com/view/tuzki-usagi-wink-counting-money-rich-green-gif-13764223.gif">
Holy cow! Well, my young grasshopper, that's not the case for everyone. Hey, but compared to other industry engineers, you are making more money than a seasoned man.

`Career Options:` you got a lot of career options. Especially these covid times, You can easily land a job if you know how to code it. You can become a web designer, backend developer, App developer, Technical content writer, freelancer for programming jobs, YouTuber, Blogger, and Program manager. There are a ton lot of things you can do if you know how to code. 


`Automation:` Yes, it's an underrated reason, but you can automate things you do regularly by using small scripts and, for example, checking your favorite merchandise on sale. An automated program checks those sites and lets you know when they are in the deal. Same for Data Entry, making groceries list, etc.

This is my opinion to conclude. You are welcome to your thoughts, but I genuinely believe learning to code will open new doors in life. Happy Coding! Folks


[My portfolio](https://yellowmultiverse.netlify.app/)


[my insta](https://www.instagram.com/ipa22751/)
about technical debt
Tags: discuss, writing
Published: 2022-09-08 01:21:15

Dear followers

As there is no way to "retweet" or "quote retweet", I have to do this kind of article.

I read this article

{% embed https://dev.to/aha/technical-debt-isnt-technically-debt-4oke %}

And I reacted here.

{% embed https://dev.to/ccoveille/comment/21fkd %}

I'm curious to see what you are thinking about.

I would like to suggest you to reply in the thread of my reply to the article, but you can do it here too.

Thanks
Hello, dev.to
Tags: opensource
Published: 2022-09-08 00:46:51

Hi there, this is my first ever post on [dev.to](http://dev.to/), let me just start off by talking about why I choose to be a programmer and why I specifically love open source.
To me computer always has a magic, I fell in love with my first ever computer immediately on the first day I saw it. Initially the first couple of weeks of me using my computer, I barely got any gist of how to use it, however, as I used it more, I got more interests on how computers actually work and wanted to write my own program. My enthusiasm of computer software development starts from here.
When I was graduated from high school(grades 9 to 12), I heard about the concept of open-source and I was fascinated by it, because I love sharing cool stuff with others, and also I love using cool stuff created by others. The spirit of open-source touches me due to the fact that open-source community promotes the creed of free-software licensing, and people in this community collaborate with each other and everyone involved in it can bring up new features and concepts into the project and eventually get implemented.
After I moved to Canada and started my first degree here, I was lucky enough to be able to enroll in the BSD program to symmetrically learn what I love to do. Fortunately, we have a class regarding open-source in this program, I chose this class as soon as it has available spot, this is because I wish to learn more knowledge about git and use this class as an opportunity to get myself more involved into GitHub community.
Also, this class provides us an opportunity to work on our personal project which can help me exceed other competitors in my future job. The project I would like to work is a VPN app running on Android that helps users to bypass the censorship and keep their network flow safe. I will investigate further into it to gain more technological details about it.
Dockerize an application in less than 3 minutes
Published: 2022-09-08 00:18:44

Everyone knows Docker. Docker is a set of tools that use OS-level virtualization to deliver software in packages called containers. If you have never tried Docker before, this guide is a perfect place to start. Follow these instructions and it will take less than 3 minutes to Dockerize your first application.

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

**Step 1. Install Docker.** Follow the instructions for your platform:
Windows: https://docs.docker.com/desktop/windows/install/
Linux: https://docs.docker.com/engine/install/ubuntu/

**Step 2. Install Node.js.** The application we will containerize is written on Node.js. Therefore, we need tooling that will allow us to test the application locally without a container first. However, of course, we can use an application that is written in any other language.
Linux: https://www.geeksforgeeks.org/installation-of-node-js-on-linux
Windows: https://www.geeksforgeeks.org/installation-of-node-js-on-windows

**Step 3. Download the sample app.** Open your terminal and run these commands:

Linux:
```
wget https://raw.githubusercontent.com/vladimirmukhin/nodejs-hello/main/app.js
```
Windows:
```
powershell "Invoke-WebRequest -Outfile app.js -Uri https://raw.githubusercontent.com/vladimirmukhin/nodejs-hello/main/app.js"
```
**Step 4. Launch the application locally**
```
node app.js
```
**Step 5. Make sure the application responds on port 3000**
```
curl http://127.0.0.1:3000
```
or open this address in your browser

**Step 6. Create a Docker file.** Create a file that is called Dockerfile(without extension) and add the following lines inside

Use node as your base image:
```
FROM node:latest
```
copy app.js into your container:
```
COPY ./app.js .
```
On a container startup run the application:
```
CMD node app.js
```
To summarize, your Dockerfile should look like this:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ofn80ymc4j9xy9iba2yf.png)

**Step 7. Build your image.**
```
docker build -t nodejs-hello:latest .
```
**Step 8. Run your container.**
```
docker run -d -p 3000:3000 nodejs-hello:latest
```
**Step 9. Validate your container.** Make sure the application responds on port 3000. But this time, it is actually being served from the container:
```
curl http://127.0.0.1:3000
```
or open this address in your browser.

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

Congratulations! You have created your first docker image and launched your first container. Let me know in the comments how much time did it take for you.

---
Apply for individual mentorship here: https://yourdevopsmentor.com/apply/

Connect with me on LinkedIn: https://www.linkedin.com/in/vladimir-mukhin-devops/

The success story of my client: https://yourdevopsmentor.com/blog/from-biologist-to-devops-engineer/

---
Originally published on https://yourdevopsmnetor.com
How do I talk to a Live Person of Netspend Customer Service?
Tags: netspendcustomerservice, netspendlogin
Published: 2022-09-07 23:05:01

Netspend is a payment solution company that services the retail market.  The company's extensive technology platform allows it to provide merchants with solutions that are both local and automated.We are here to help you 24/7, 365 days a year. If you have any questions, problems or concerns about your Netspend Credit Card or account, we're just a phone call away.If you come across any issues with your Netspend card, we have a team dedicated to helping you. You can call the [Netspend Customer Service Phone Number](https://sites.google.com/view/netspend-customer-service-num/) toll-free number and get connected to a customer service rep who can answer your questions and problems over the phone or through live chat.[Netspend login error Fix Phone Number](https://sites.google.com/view/netspend-customer-service-num/).Our customer service representatives are available to help you on the phone, Monday through Friday, 8:00 am–5:00 pm Pacific Time. We have easy-to-follow live chat options so we can answer your questions in just a few minutes. If you reach our automated system, you can leave a message that we will call back within 24 hours.We'd love to hear from you. Reach out by calling us on the phone, or use our Live Chat option so we can answer your questions in just a few minutes! If you reach our automated system, you can leave a message that we will call back within 24 hours.[Netspend Gift Card Support Number](https://sites.google.com/view/netspend-customer-service-num/).
We're here to help! Whether you're looking for new ways to pay, or have general questions, we're just a way away.
How do I Contact to Live Norton Security Customer Service?
Tags: nortonlogin, nortonnumber, nortontechnicalsupport
Published: 2022-09-07 23:01:20

Norton Antivirus is the most popular antivirus in the world. [Norton Antivirus Customer Service Number](https://sites.google.com/view/connect-norton-customerservice/) Provides the best security to our personal and professional devices.Welcome to [Norton Security Support](https://sites.google.com/view/connect-norton-customerservice/), where we're here to help. You can get all the help you need right here on this page or in our support center. If you don't see what you are looking for or need any additional information, please contact us at any time so that we can help get your Norton product working as it should be.[Norton Login Error Phone Number](https://sites.google.com/view/connect-norton-customerservice/).Norton Antivirus offers the best protection and gives your system the strongest defense against hackers, phishing attacks and viruses. With features like Proactive Predictive Live Scanning, real-time scanning and automatic updates you can be sure you are constantly protected against new threats.
How do I Contact to Live Chime Customer Service?
Tags: thechimebanking, chimelogin, chime
Published: 2022-09-07 22:56:23

Chime Banking is here. Discover better. You’ll get the convenience and security you want, along with a great interest rate.Chime is a mobile banking app that helps you save money on fees, check your balances and transfer funds, with no hidden fees and no service charges. You can even send and receive payments from anyone using just their email address.The best way to talk with a Chime customer service agent is to chat live or call their help desk number. You can be connected with a Chime support representative in under one minute.

Chime Banking is all about making your life easier, so if you have a question about our services, or something else that we can help you with, please let us know!

Our support team is always happy to help you.

Our agents are ready 24/7 to help with any account issues that come up.

One of the best ways to contact [Chime Customer Service Number](https://sites.google.com/view/chime-customer-services-number/) is through our Support Center. We are available in your native language and can assist you with any questions or concerns about your account. Use the form below to begin a live chat session with a representative who will be happy to assist you with any issues you're having![Chime Login Error Phone Number](https://sites.google.com/view/chime-customer-services-number/).
At Chime, we strive to make your banking experience as simple and safe as possible. We're here to help in any way we can with our award-winning app, award-winning 24 hour customer service team, and the ability to chat with us online.[Chime Banking Helpline Number](https://sites.google.com/view/chime-customer-services-number/).
CamelCase to normal String in JavaScript
Published: 2022-09-07 22:49:59

In this post we will see how we can turn any camelCase string to normal string in JS JavaScript..

### Step 1 - Breaking the Camel Case

Lets take an example - "checkThisOutBro"

Now we want to break this camelCase string to "Check This Out Bro".

So, In order to do this we will use a regex 

```javascript
const camelToFlat=(camel)=>{
    const camelCase =camel.replace(/([a-z])([A-Z])/g, '$1 $2')
    
    return camelCase
}

```

this will give us ```check This Out Bro```

hmmmmm, well atleast it is now a simple string, lets improve it better

### Step 2 -  Taking every letter out from this string...

So after getting ```check This Out Bro``` we can use split() function with " " as args to break it down in an array with each word as element.

```javascript

const camelToFlat=(camel)=>{
    const camelCase =camel.replace(/([a-z])([A-Z])/g, '$1 $2').split(" ")
    
    return camelCase
}


```

This will return `[ 'check', 'This', 'Out', 'Bro' ]` as output and we now have an array of words in that camelCase.


"**_Wow Suyash you said we will be changing camelCase to string , how come it is an array now huh ?_**"

![BigBrainTime](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwlhv9v8dtalp919iprv.jpeg)


Just wait a min, we will make it a string again but better !

### Step 3 - Making each First letter capital this time !

Now as we have an array of words for a string, we can simply run a loop and make every letter or char at 0 index upperCase.

```javascript

const camelToFlat=(camel)=>{
    const camelCase =camel.replace(/([a-z])([A-Z])/g, '$1 $2').split(" ")
    
    let flat =""
    
    camelCase.forEach(word=>{    
        flat = flat + word.charAt(0).toUpperCase() + word.slice(1) + " "
    })  
    return flat
}



```

After doing this, our function will take every word in camelCase array and convert it's first letter ( at 0 index) capital and join it with others to make an string



![Magik](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7srigifj9vujez4inluj.gif)
"**_POOOOOF ! Magic_**"

**And now our output will be `Check This Out Bro`**

[ Snippet Sauce link for code snippet !](https://snippetsauce.tech/snippet?title=Camel+Case+to+Normal%2F+Flat+word+in+JavaScript+JS+%7C+Camel+case+to+normal+in+JS&sauce=jvs734158)


------------

This is commonly used while rendering keys of an object in applications ( Objects.keys(yourObject) returns array ). And generally keys are in camelCase so you want them to be a normal string but with a dynamic way..

**_If you liked the blog please drop a ❤️_**