teleren/devto huggingface dataset:
How to create a 2D array of integers in JS?
Published: 2022-09-20 18:55:52

Today I was working on leetcode daily challenge using JS.  There was a minor issue with Array, and I found the right way to create an array. And this is how I created the Array.

```js
let dp = [...Array(n+1)].map(e => Array(m+1).fill(0))
```

Wait a minute? Give me more explanation if you ask.
I used to use.

```js
let dp = new Array(1001)
```

By which I assumed even the below code would work.


```js
let dp = new Array(1001).fill(new Array(1001).fill(0))
```

But when I tried, the code gave me unexpected issues.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5y924caod62d6upcj8xt.png)


So, I have tried using the spread operator.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/atun3f6s0udywi9rbvqo.png)

Yet still, the issue isn't resolved. My code doesn't work as expected.


## What's going on in the background?

To understand this, we need to understand what's happening in `Array.prototype.fill` and how it works.

Fill is a prototype of Array.
The fill() method changes all elements in an array to a static value, from a start index (default 0) to an end index (default array.length). It returns the modified Array.

## What does it not say here?

If the first parameter is an object, each slot in the Array will reference that object. 

If you think of it helpful, but for something else, since it has the same reference. 

```js
// A single object, referenced by each slot of the array:
const arr = Array(3).fill({}); // [{}, {}, {}]
arr[0].hi = "hi";              // [{ hi: "hi" }, { hi: "hi" }, { hi: "hi" }]
```

So, I couldn't use fill when creating a 2D array. But, I would say someday we might have a new prototype for creating 2D arrays much efficiently.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill


> Note:
> For that matter, always be cautious sometimes. It's not about how you write the code. It's also about how the prototypes is written using any standard prototype.
> So whenever you use any prototype, you must know about them again and not take them for granted.
How to Build a Blog with React and ButterCMS
Tags: blog, headlesscms, react, webdev
Published: 2022-09-20 18:46:45

React: Is it ideal to build a blog with? How do you go about building one? And why should you employ the help of a headless CMS? [Read more here!](https://buttercms.com/blog/how-to-create-a-blog-with-react/)
Study 6 Machine Learning Projects
Tags: machinelearning, python, tutorial, programming
Published: 2022-09-20 18:44:08

Hope you enjoy studying machine learning in Python with 6 different projects as follows : 

1- How to create a stocks dashboard using Dash [Python]
2- How to use Bokeh to visualize stocks data [Python] 
3- How to create a rainfall prediction model [Python] 
4- How to trade stocks using Quandl [Python] 
5- How to create a Crypto dashboard with Streamlit [Python] 
6- How to Forecast Sales in Google Colab [Python Jupyter] 

Your feedback is more than welcome.
I've written before about Machine Learning and the difference between it and Artificial Intelligence - a mistake rookies make so often - make sure to check my previous articles in the repertoire.

{% youtube q_VKnVq902M %}

Thank You.
Best,
Bek
Compress images from a folder
Tags: tooling
Published: 2022-09-20 18:40:46

Yes, another one. 

_Sometimes you have to use a few tools that you just forget about them. And then you have to search for them all over again._

This one compresses all images from a folder.

Follow this magic link:

https://gist.github.com/JesseRWeigel/756cc507cbe59084d66e376eaf05c6e9
How to Build a Cool GitHub Profile in 2 Minutes
Tags: tutorial, productivity, design, discuss
Published: 2022-09-20 18:40:34

Hey Guys, Today I want to share with you all, how you can make a **Cool GitHub Profile in just 2 minutes.**

Here is My GitHub Profile Page

![GitHub Profile](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xce0v7rlb1ulmrmdt8gt.png)


You can Check out My Profile [here](https://github.com/Jayant818)

To make Similar Profile like this Follow these Steps.

### Step 1

Go to the [Readme File Generator](https://rahuldkjain.github.io/gh-profile-readme-generator/) & Fill out all your Details

After that Click on Generate Readme File.

### Step 2

After your [README.md](http://README.md) file is generated, Go to the  [Lottie Files](https://lottiefiles.com/search?q=web%20Developer&category=animations) & choose any of the Given Animated-Image

**Download the image as a File type - GIF** 

```html
<img align="right" alt="Coding" width="400" src="<SourceLink>">
```
**Add this to your README File after Your Name and Subtitle**

### Step 3
You can either Create the header Image Using Canva or you can steal someone made image form [here](https://github.com/Jayant818/awesome-github-profiles/tree/main/profiles)

Once You have done all this Create a new Repo Named `<your-username>` & Add the README file to that Repo

**Your Awesome GitHub Profile Page is Ready 🥳🎉🎊**

<aside>
💡 **If you are Lazy like me, you can just copy any README.md file from [here](https://github.com/Jayant818/awesome-github-profiles/tree/main/profiles) 😁 and don't forgot to change your Name**

</aside>

Have a Nice Day.
A Flow to Help With Lifecycle Reporting
Tags: nocode, workflows, okta, ipaas
Published: 2022-09-21 14:54:05

---
title: A Flow to Help With Lifecycle Reporting
published: true
date: 2022-09-20 18:37:14 UTC
tags: nocode, workflows, okta, ipaas
canonical_url: https://maxkatz.net/2022/09/20/a-flow-to-help-with-lifecycle-reporting/
---

[Okta Workflows](https://www.okta.com/platform/workflows/) community flows are flows shared by community members. These flows show how to solve a particular problem. You might have the same problem you are trying to solve or a similar one. Either way, these community flows will help you learn and build automations.

A directory of all other Okta Workflows community-created flows ⤵️
{% embed https://dev.to/oktaworkflows_staff/all-okta-workflows-community-created-flows-3kmm %}


_This flow is from [Pete Viri](https://www.linkedin.com/in/pete-viri-64b29165/). Pete is an Okta Certified Professional, with over of 10 years of IT experience currently working as a Senior IAM Engineer at [Faire](https://www.faire.com/)._

> Hey Everyone, I wanted to share a flow I recently created to help with lifecycle reporting. This is a native feature in a lot of SIEM tools, but if you currently don’t have a service like that or want lightweight reporting, this flow will let you know when X users are being added/removed from apps within Y seconds.  
>   
> This can help mitigate issues that arise from HRIS changes that may cause a large amount of people to be added or removed from apps via group rules. The only thing you need to do is configure your quantity (X) and time (Y) thresholds, and the slack channel you want it to post to.
> 
> <cite><em><a rel="noreferrer noopener" href="https://www.linkedin.com/in/pete-viri-64b29165/" target="_blank">Pete Viri</a></em></cite>

[![Lifecycle activity reporting flow](https://katzmax.files.wordpress.com/2022/09/workflows_community_lifecycle_activity.png?w=1024)](https://katzmax.files.wordpress.com/2022/09/workflows_community_lifecycle_activity.png)
<figcaption>Lifecycle activity reporting flow</figcaption>

[Download](https://macadmins.slack.com/archives/C011DBUDT28/p1663610012496009) the flow (this is a link to a [MacAdmins Slack channel](http://macadmins.org). You need to be a member or join to download).

* * *

**More resources to help you learn** :

🎥 Short how-to [Workflows videos](https://youtube.com/playlist?list=PLIid085fSVdvyK8F4xuk49EchBPmAVNHG) to help you become a better automation builder.

🍿 A collection of helpful [Workflows tips](https://maxkatz.net/okta-workflows-tips/).
Angular Structure
Tags: angular, angularstructure
Published: 2022-09-20 18:35:50

```
|-- app
    |-- components
    |-- directives
    |-- mocks
    |-- modules
        |-- general   (contains the elements found in all project types)
            |-- not-found
            |-- home
            |-- contact
            |-- login
            |-- signup
        |-- application  (contains the specific elements to our project)
            |-- item01
            |-- item02
            |-- ....
            |-- itemXX
     |-- pipes
     |-- services
|-- assets
|-- environnement

```



[source](https://www.ganatan.com/tutorials/routing-with-angular)
Deleting node modules folders from projects you are not working
Tags: tools, javascript
Published: 2022-09-20 18:31:01

Sometimes you have to use a few tools that you just forget about them. And then you have to search for them all over again.

This is what brought me here today. I will start sharing a few tools that I use not that often but it helps me sometimes.

The first one can be a lifesaver or I should say a space saver.

To run it you just need to go to your folder where your projects are and then run it.

```
$ npx npkill
```
Integer va String
Tags: beginners, programming, cpp, github
Published: 2022-09-20 18:13:48

**Integer** va **String** nima?

   C++ dasturlash tilida boshqa boshqa har bir dasturlash tillarida _integer_ va _string_ kabi soʻzlarni uchratishingiz mumkin.
  Integer va String tipidagi o'zgaruvchilar deyiladi.
  

- **Integer**
 butun sonlar toʻplami va ushbu tipda faqat butun sonlarni eʼlon qilishimiz mumkin bo'lgan o'zgaruvchi tipidir.

**Masalan**
 Integer tipiga mansub son bilan ishlashning eng sodda ko'rinishini ko'rishimiz mumkin:


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

int main(){

int yosh = 18;
  cout<<yosh;

  return 0;
  }

```
 

- Ushbu kod natijasida _ console_ ga 

```cpp
18

```

- **String** - C++ da matn ko'rinishidagi ma'lumotlarni saqlashda foydalanishimiz.
 Biz uchun string tipidagi o'zgaruvchilarni yirik matnli ma'lumotlarni saqlashimiz va ushbu ma'lumotlarni keyinchalik foydalanish imkoniyatini beradi.

**Masalan**

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

int main(){
string ism;
  ism = "Jamol";
string familiya;
  familiya = "Meyliyev";
  cout<<"Mening ismim " <<ism<<", Familiyam "<<familiya;

  return 0;
  }

```
- Ushbu kod natijasida _console_ ga 

```cpp
Mening ismim  Jamol, Familiyam Meyliyev

```
 

- Yuqorida **integer** va **string** turidagi o'zgaruvchi turlari haqida qisqacha tanishib chiqdik.

[Telegram](http:\\t.me\meyliyev_blog)
[Github](http:\\github.com\JamolMeyliyev)
How to encrypt data easily when your apps and databases are already running
Tags: security, cryptography, encryption, database
Published: 2022-09-20 18:11:57

> What if you’ve built your app and now think about **encrypting sensitive fields** that it sends to the database and back? 🤔 Should you just enable the “at rest encryption” checkbox, use TLS, or add an extra encryption layer into your application code? 

The first and second options make sense, the third one is not for everyone. ✨ Consider implementing **transparent database encryption**.✨ 

---

Database encryption works for transforming readable data into a ciphertext, aiming to protect it from unauthorized parties. 

💡 When speaking about **transparent** data encryption, which is implemented, for example, in the [Acra database security suite](https://www.cossacklabs.com/acra/), we mean that **encryption happens neither in the database nor in the app it speaks to**. But where?—In Acra proxy! 

Acra works as a SQL database proxy—so, your application communicates with the database via Acra which encrypts/decrypts sensitive fields. You can customize which fields to consider sensitive (PII, financial or regulatory-specific data), as well as what actions Acra should do ([encrypt](https://dev.to/cossacklabs/application-level-encryption-4n32), [searchable encrypt](https://dev.to/cossacklabs/searchable-encryption-4gjl), [mask](https://dev.to/cossacklabs/acra-features-data-masking-3ng7), [tokenize](https://dev.to/cossacklabs/acra-features-tokenization-57fn), etc.). 

> In such a way, the **database never gets access to the plaintext data or encryption keys**. That saves a lot of resources on development and requires minimum effort for protecting data.

You have encrypted data, using modern strong encryption, but you don’t deal with cryptographic code. Win-win. 😊

[![Acra Server works as database proxy and encrypts/decrypts sensitive data fields transparently.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7izf3gcd0u78uab66pv.png)](https://www.cossacklabs.com/blog/acra-transparent-data-encryption-for-sql-databases/)

We designed Acra just like that. It doesn’t require any change in your app code. **That is extremely useful** when you have your infrastructure (apps, databases) already built.

---

💡 Acra is available for free on GitHub, suitable for small apps:
[https://github.com/cossacklabs/acra](https://github.com/cossacklabs/acra)

💡 And as a paid Enterprise license for security-sensitive products:
[https://cossacklabs.com/acra](https://cossacklabs.com/acra)

---

###But how transparent database encryption works?

If you want to get deep into detail and learn more about database wire protocols, check out our new engineering blog post 👉 [Transparent data encryption for SQL databases with Acra 0.93](https://www.cossacklabs.com/blog/acra-transparent-data-encryption-for-sql-databases/) 👈

[![Transparent data encryption for SQL databases with Acra 0.93](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1h578gj29fut9ixce3bm.png)] (https://www.cossacklabs.com/blog/acra-transparent-data-encryption-for-sql-databases/)
Protectly - DigitalCrafts Capstone Project
Published: 2022-09-20 17:56:47

[Protectly](https://protectly.cloud/) is a Capstone Project created by Stacy Samuels, Amanda Hargrove and Olivia Campbell in September 2022. Stacy, Amanda and Olivia were in the same group for the June 2022 DigitalCraft's Cohort for Web Development. 

**What is Protectly?**

Protectly is a platform designed to work in tandem with Calendly's scheduling links and provide protection against unwanted meetings. 

To understand Protectly, you'll first need to know how Calendly works. Calendly is a scheduling software that connects directly to the calendars of users in order to provide real-time availability for invitees to book meetings with users or "meeting hosts". The challenge for some Calendly users is that when they connect their calendar and create a Calendly link to send to invitees, that link becomes available to everyone on the Internet.

Protectly allows users to provide a list of approved email addresses and those are the only invitees allowed to book with that person's Calendly link. Using Calendly's API, Protectly will cancel meetings on behalf of users to ensure the only Calendly meetings on their calendars are only with their approved list.

**Do you have an example of how someone would use Protectly?** 

Sally the CEO was eager to start using Calendly to help manage her busy schedule. However, everyone wants to schedule meetings with Sally: sales people want to pitch her products, marketers want interviews with her, but some people really need to meet with her which is why she created a Calendly link in the first place. Before Protectly, Sally used her 30 Minute Scheduling Link to schedule a meeting with a candidate interviewing for the open VP Position at Sally's Software Company, but when a sales person who had been prospecting her guessed the URL for her Calendly Link, the sales person booked a meeting during her one open time slot (Sally is a busy CEO) and the candidate had few options to choose from. Sally was quite surprised at the end of a long day to realize that instead of having an interview the next day on her calendar, she actually had an unwanted sales call that she had to delete/cancel to free up her calendar. **This is where Protectly can help.**

 If Sally had used Protectly, that unwanted meeting with a sales person would have been automatically canceled and her availability would have been free for the VP Candidate.  


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

**How does Protectly work? Is Protectly a Calendly company?**

Protectly is not a Calendly company. Protectly works by connecting directly to your Calendly account using a secure OAuth 2.0 connection. Once that connection is established, Protectly receives webhook notifications each time a meeting is scheduled with the user. Protectly then cross references the user's list of approved email addresses and if the invitee of that scheduled meeting is not on the list, Protectly uses Calendly's API to immediately cancel the meeting. When the meeting gets canceled, that user's availability is immediately freed for new bookings.
Community Update!
Tags: devrel, community
Published: 2022-09-20 17:56:18

---
title: Community Update!
published: true
description: The Deepgram DevRel team has been busy, and we're inviting you to join us with some fun, new endeavors.
tags: devrel, community
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---

We're always working to find more space for our community and to provide a place for continued conversations and collaboration. Here are some of the things we've been up to:

## We've launched a forum!
Over the past year, we've done hackathons, Twitter Spaces, Meetups, Conferences, podcasts, and more. We've always wanted to continue those conversations and keep in touch with all the amazing people we've met. Now, with [our Deepgram Community Forum](https://github.com/orgs/deepgram/discussions) we can do that, provide support for folks who want to know more about using Deepgram for speech-to-text projects, talk about the tech industry, and have some fun. 

We're so excited, in fact, that we're doing a giveaway! If you post in our forum between now and the end of September, you'll be entered to win a $100 Amazon gift card. If you're looking for a quick way to get started on our forum, check out our [intro thread](https://github.com/orgs/deepgram/discussions/3).

## Twitter Spaces
We're adding some Twitter spaces back to our schedule! Our next space is this Friday, September 23, at 12p PT. We're going to be talking GitHub discussions with one of the engineers on the project, Lindsey Bieda. Just a note, if you've joined our past Twitter spaces, we've moved over to [@DeepgramAI](https://twitter.com/DeepgramAI) so join us over there for all future Spaces. 

{% twitter 1571901179080187904 %}

## :mega: Calling all podcast people
Our Developer Advocates have been on :fire: with their podcast content! Check out our blog for the full list, but here are some of our latest:
- [Track Brand Mentions Across Podcast Episodes](https://blog.deepgram.com/track-brand-mentions-across-podcast-episodes/?utm_source=devto&utm_campaign=blog&utm_content=track-brand-mentions-across-podcast-episodes)
- [Automatically Transcribing Podcast Episodes with Pipedream and Python](https://blog.deepgram.com/automatically-transcribing-podcast-episodes-with-pipedream-and-python/?utm_source=devto&utm_campaign=blog&utm_content=automatically-transcribing-podcast-episodes-with-pipedream-and-python)
- [How To Transcribe Your Podcast with Python](https://developers.deepgram.com/blog/2022/08/create-readable-transcripts-for-podcasts/?utm_source=devto&utm_campaign=blog&utm_content=/blog/2022/08/create-readable-transcripts-for-podcasts/)
- [Topic Detection in Podcast Episodes with Python](https://blog.deepgram.com/topic-detection-with-python/?utm_source=devto&utm_campaign=blog&utm_content=/blog/2022/08/topic-detection-with-python/)

If you have any questions or comments, be sure to head over to our [discussions](https://github.com/orgs/deepgram/discussions) so we can keep the fun going and follow us on [Twitter](https://twitter.com/DeepgramAI) for more great spaces!
AWS Elastic Container Service Cheat Sheet
Tags: 30daysofaws, day11, certifieddeveloperassociate, ecs
Published: 2022-09-20 17:44:52

![Elastic Container Service](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0i4rxskwsnft9wt00sfl.jpg)

- Microservices are built in multiple programming languages
- Containers simplify deployment of microservices: 
  - Step 1 : Create a self contained Docker image
    - Application Runtime (JDK or Python), Application code and Dependencies
  - Step 2 : Run it as a container any where Local machine OR Corporate data center OR Cloud
- Use On-Demand instances or Spot instances
- Launch type: EC2 or Fargate
- Data volumes attached to containers
- Deployment type:
  - Rolling update
  - Blue/green deployment (powered by AWS CodeDeploy)
- Task Placement Strategies:
  - **binpack** - Leave least amount of unused CPU or memory. **Minimizes number of container instances in use**
  - **random** - Random task placement
  - **spread** - Based on specified values:
    - Host (instanceId)
    - (OR) Availability Zone(attribute:ecs.availability-zone)
    - (Alowed) Combine strategies and prioritize
- How do you manage 100s of containers?
- ECS - Fully managed service for container orchestration
  - Step 1 : Create a Cluster (Group of one or more EC2 instances)
  - Step 2: Deploy your microservice containers
- AWS Fargate: Serverless ECS. DON'T worry about EC2 instances.
- Cloud Neutral: Kubernetes
  - AWS - AWS Elastic Kubernetes Service (EKS)
- Load balancing:
  - Performed using Application Load Balancers
    - **Dynamic host port mapping**: Multiple tasks from the same service are allowed per EC2 (container) instance
    - **Path-based routing**: Multiple services can use the same listener port on same ALB and be routed based on path (www.myapp.com/microservice-a and www.myapp.com/microservice-b)

![Elastic Container Service](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/crscs503f1xdiy4dk9ld.png)

> - [Practice notes](https://romankurnovskii.com/en/docs/aws-certified-developer-associate/ec2/)
> - [Questions](https://dev.to/romankurnovskii/aws-ec2-top-
questions-certified-developer-exam-27oo)
Write an algorithm that takes an array and moves all of the zeros to the end, preserving the order of the other elements.
Tags: javascript, array, arraymethod, webdev
Published: 2022-09-20 17:40:49

Arrays in Javascript are an important data structure alongside objects. As a javascript developer you will use arrays in almost every project that involves grouping/storing data. Arrays are the backbones of javascript data structure, from being able to store any data type to storing arrays inside other arrays i.e multidimensional arrays. We could write about arrays forever and never be out of more words to explain its importance.
To keep it short and precise, lets dive directly to this blogs aim. I love practicing to solve algorithms in [](codewars.com) and I have seen a question on an algorithm that that takes an array and moves all of the zeros to the end, preserving the order of the other elements. and here is how i solved 

```
function moveZeros(arr) {

//filter out array elements whose values are zero. make sure to use deep comparison operator otherwise false will be refered as a zero, use filter method and this returns a new array of elements with value zero
  let newArr =  arr.filter ( el => el === 0)

//filter out the elements whose values are not zero                    
  let anotherArr = arr.filter (el => el !== 0)

//merge the two arrays using concat method. and to preserve order make sure the array with values zero be passed after the other array
  let finalArr = anotherArr.concat(newArr)

//finally return the final array
return finalArr
}
```

this can be achieved in one liner but for explanations I decided to keep it longer. 
Thanks for reading this blog post. I would personally recommend codewars.