teleren/devto huggingface dataset:
Loop inside objects
Tags: javascript, objects, tips
Published: 2022-03-15 18:42:14

---
title: Loop inside objects
published: true
description: Object.keys, values, entries
tags: javascript, objects, tips
//cover_image: https://direct_url_to_image.jpg
---

We can travel inside Arrays with map, forEach and reduce function. What if we want to travel inside objects. As you known as objects has key and value so we can use those one all in one or separately.
 
## Object.keys, values, entries
For plain objects, the following methods are available:

[Object.keys(obj)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys) – returns an array of keys.
[Object.values(obj)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values) – returns an array of values.
[Object.entries(obj)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries) – returns an array of [key, value] pairs.


```js
let prices = {
  banana: 1,
  orange: 2,
  meat: 4,
};

let doublePrices = Object.fromEntries(
  // convert prices to array, map each key/value pair into another pair
  // and then fromEntries gives back the object
  Object.entries(prices).map(entry => [entry[0], entry[1] * 2])
);

alert(doublePrices.meat); // 8
```

**Training question:** [Kata 8kyu Pirates!! Are the Cannons ready!](https://www.codewars.com/kata/5748a883eb737cab000022a6/javascript)


---
# Source 
- [javascript.info/keys-values-entries](https://javascript.info/keys-values-entries)
AIOps-Based Progressive Delivery
Tags: devops, aiops
Published: 2022-03-15 18:27:37


I have submitted a talk on AIOPs-based progressive delivery to recent DevOps conference.

The talk covers a real-life experience related to building a AIOps Delivery-powered No Code AI/ML platform.


 for doctors’ community and telehealth support for patients during COVID-19 lockdown. The doctors’ community interacts related to cases and triage for different patient cases. They can extend telehealth support using medical practice management solutions. Patients can order medicines online through integrated pharmacies on the platform. AI Platform has digital, voice, and knowledge assistants to provide information to the doctor. DevOps is enabled using Jenkins on AWS which helps in continuous integration and progressive delivery of features to Mobile and web apps (Apple & Google app stores). Historical data is used for predictive analytics by the machine learning platform. The platform helps healthcare enterprises: 1. Deploy voice tech to facilitate clinical documentation 2. Reduce physicians’ administrative burden 3. Increase patient volume and billable revenue 4. Eliminate transcription costs 5. Use voice to increase touchpoints and increase patient engagement.
Kafka Architecture : Synchronous to Asynchronous [2]
Tags: kafka, architecture
Published: 2022-03-15 18:18:59

Today we will see the second of 3 cases to make this communication between the synchronous application more efficient depending your case.

This solution is more data secured and you will understand why.

---

## 2nd solution - Everybody reads solution

On paper, this solution is quite easy.

![Everybody reads solution - schema](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nqlzxfw9px0yita7a02r.png)

Like in the previous example, you have 2 instances of the API X which send requests on TOPIC REQUEST and is waiting a response on TOPIC RESPONSE.

But this time each instance of the API have it's own group, so each instance will read **each message**. 

So if the instance 1 of the API receive an http request, it will be able to answer!

---

### How to setup this?
In your ACL, define "PREFIXED" for the consumer group of your api.

Then, to have to be sure that **each instance of your API have a unique consumer group prefixed by what your declare in your ACLs**.

[Post about random values](https://dev.to/adaendra/generate-random-values-in-your-properties-spring-boot-4ppf)
 

As explain in this post, in Java it's quite easy.

```yaml
consumer_group: consumerGroupApiX${random.uuid}
```

Like this, it doesn't matter that you have 2 or 100 instances of your service, each and every pod will have an unique consumer group.

---

### Pros & Cons

|Pros|Cons|
|---|---|
|More data-secured than the first solution|We still have an issue when a service is restarted|
| |Each API instance consume every message|

It's more secured for the datas, but if the process is long or if you have a very high volume of requests, you will have the same issue than the first solution.

The advantage for this solution than the first one is that you won't have any issue when you scale up. You can have some issues when you are scaling down, but there are some solution to help to limit this.

---

In the last part we will see the best solution to avoid this kind of issues!

I hope it will help you! 🍺

---

<center><h3>You want to support me?</h3></center>
<a href="https://www.buymeacoffee.com/mxguilbert7" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
How do you get and stay in flow-state? Join us at 11am PST
Tags: productivity, programming, webdev
Published: 2022-03-15 17:59:34

Join the [Developer Happiness Hour](https://twitter.com/i/spaces/1gqxvlZlDejGB/peek) with the folks at Stateful to talk all things flow-state.

![Developer Happiness Hour](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yw499e8grlojuaa0py53.png)
 
Learn more: [https://twitter.com/i/spaces/1gqxvlZlDejGB/peek](https://twitter.com/i/spaces/1gqxvlZlDejGB/peek).
MS Teams: Animated Background
Tags: tutorial, productivity, watercooler, challenge
Published: 2022-03-15 17:59:05

---
title: MS Teams: Animated Background
published: true
description: Geeks like myself are bothered by the fact that we cannot (actually, we can) use an animated background in Microsoft Teams.
tags: Tutorial, Productivity, Watercooler, Challenge
series: Microsoft Teams
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j8d09wpr66k6h5j201fn.png
---

Geeks like myself are bothered by the fact that we cannot (actually, we can) use an animated background in Microsoft Teams.

## The Problem

GIF Images cannot be Added in the GUI.

Microsoft Teams does not allow the upload of GIF images as virtual backgrounds.

When trying to change the image format into another one, the upload fails with the error message "Couldn't add background".

## The Solution

Add GIF Images Directly.

There is a trick that allows adding GIFs and it works!

## Step-by-Step Guide

1. Choose an animated GIF and change the file extension into `.png`. If the image is called `animated.gif`, rename it into `animated.png`.
2. Duplicate the file and add a `_thumb` (abbreviation for thumbnail) to the name. In the example, the second file is called `animated_thumb.png`.
3. Copy both files directly into the background image folder of Microsoft Teams (See [Windows](#windows) or [Mac](#mac) below).
4. Restart Microsoft Teams.
5. Join a meeting and choose your new, animated background!

### Windows

**Default Windows location**: `C:\Users\YOUR-USERNAME\AppData\Roaming\Microsoft\Teams\Backgrounds\Uploads` (you can access this folder by pressing `Win + R`, typing `%appdata%` into the field and clicking Ok).

### Mac

**Default macOS location**: `~/Library/Application Support/Microsoft/Teams/Backgrounds/Uploads` (the ~ stands for the home directory).

## Conclusion

That's it.
The perfect image lazy loading
Tags: html, javascript, webdev
Published: 2022-03-15 17:52:49

Alright, lets get our JavaScript coding fingers ready for we are going to make the most awesomest image lazy loading!

```html
<img
  alt="A giraffe eating fallback code solutions"
  src="giraffe.jpg"
  height="500"
  width="1000"
  loading="lazy"
/>
```

## Wait, what?

Yes, HTML is enough to perfectly solve this issue. [Safari 15.4 now ships with lazy loading support](https://webkit.org/blog/12445/new-webkit-features-in-safari-15-4/). It was the last browser we waited for to catch up.

You no longer never need to do any JavaScript or CSS trickery related to typical image content loading.

## But what about my fade in animation!

Don't do it. You should use a **progressive image**. The thing with progressive image is that once browser receives any image data it is able to start rendering at least something visual.

If you do image animation such as a fade in transition you are making a mistake. Without adding in lots of complex code you can only trigger a fade in transition **once the entire image file is done loading**. On slow connection this means the image will display, well, probably way after user has scrolled past the image.

This is an unnecessary cost only for having a "cool fade in animation that I like and it fits the design".

## I want at least a fallback color!!

Don't do that either. If you're using a progressive image then the time a browser **might** show the "ugly alt text" is greatly reduced. Automating a fallback background color is not worth the extra code or complexity. Besides it can get in the way with alpha transparency images anyway.

## Conclusion

Embrace the simpliness that you now have and put your mind into other things.
Make immutable pop(), push(), shift(), unshift()?
Tags: javascript, webdev, discuss
Published: 2022-03-15 17:43:41

We know very well how these functions work in Javascript. So, here I am going to write immutable implementations for the same functions as per my understanding. Please do comment your suggestions/concerns/questions. I will always happy to update this article. 

```javascript
function pop(arr) {
    let newArr = [...arr];
    newArr.length = arr.length - 1;
    return newArr;
}

function push(arr, ...item) {
    const newArr = [...arr];
    if (item.length >= 1) {
        for (let i = 0; i < item.length; i++) {
            newArr[newArr.length] = item[i];
        }
    }
    return newArr;
}

function shift(arr) {
    let [a, ...b] = arr;
    return b;
}

function unshift(arr, ...item) {
    const newArr = [];
    if (item.length >= 1) {
        for (let i = 0; i < item.length; i++) {
            newArr[i] = item[i];
        }
    }
    newArr.push(...arr);
    return newArr;
}

```

Thank you! Happy Reading!

<hr style="border-width: 2px;border-color: #87CEEB;">
<h1> 💎 Love to see your response</h1>
<ol>
<li style="padding: 10px;font-size: 30px;"><b>Like</b> - You reached here means. I think, I deserve a like.  </li>
<li style="padding: 10px;font-size: 30px;"><b>Comment</b> - We can learn together. </li>
<li style="padding: 10px;font-size: 30px;"><b>Share</b> - Makes others also find this resource useful.</li>
<li style="padding: 10px;font-size: 30px;"><b>Subscribe / Follow</b> - to stay up to date with my daily articles. </li>
<li style="padding: 10px;font-size: 30px;"><b>Encourage me</b> - <a href="https://www.buymeacoffee.com/urstrulyvishwak" target="_blank">You can buy me a Coffee</a>
</ol>
<hr style="border-width: 2px;border-color: #87CEEB;">

<h2> Let's discuss further. </h2>

<ol style="padding: 20px;">
<li style="padding: 10px;font-size: 30px;">Just DM <br> <a href="https://twitter.com/messages/compose?recipient_id=1388837509824610314&text=Hello world"
class="twitter-dm-button" data-screen-name=“@urstrulyvishwak” data-size="large">@urstrulyvishwak</a>
</li>
<li style="padding: 10px;font-size: 30px;">
<p> Or mention <br> <a href="https://twitter.com/intent/tweet?screen_name=urstrulyvishwak&ref_src=twsrc^tfw" class="twitter-mention-button" data-size="large" data-text="Hi, Vishwak" data-related="@urstrulyvishwak" data-show-count="false">@urstrulyvishwak</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></p> </li>
</ol>

<h2> For further updates: </h2>
<a href="https://twitter.com/urstrulyvishwak?ref_src=twsrc^tfw" class="twitter-follow-button" data-size="large" data-text="Hi, Vishwak" data-related="@urstrulyvishwak" data-show-count="false">Follow @urstrulyvishwak</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Internet != web
Tags: computerscience, tutorial, beginners
Published: 2022-03-15 17:37:18

# Internet and Web is not same thing

The Internet is the network of networks and the network allows to exchange of data between two or more computers.   

The Web is a way to access information through the Internet.

# URI and URL

URI stands for ‘Uniform Resource Identifier’. A URI can be a name, locator, or both for an online resource whereas a URL is just the locator

URLs are a subset of URIs.  A URL is a human-readable text that was designed to replace the numbers (IP addresses) that computers use to communicate with servers.

A URL consists of a protocol, domain name, and path (which includes the specific subfolder structure where a page is located) like-

      ` protocol://WebSiteName.topLevelDomain/path`

Protocol – HTTP or HTTPS.

WebSiteName – geeksforgeeks, google etc.

topLevelDomain- .com, .edu, .in etc.

path- specific folders and/or subfolders that are on a given website.
World of Project Manegement
Published: 2022-02-03 18:09:45

SAVE YOURSELF TIME AND WORK WITH THESE PROJECT [MANAGEMENT TEMPLATES,](https://bit.ly/34jYync) WHICH HAVE 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/psjdjqdfvi24cyfs5dzv.png)
BEEN TRIED AND TESTED IN [VARIOUS ROJECTS](https://bit.ly/34jYync)

Strong projects need solid planning. Don't waste your time creating existing documents from scratch.
A professional set of tried and tested project management templates is available to you in less than 3 minutes and is just a few clicks away.
Set of project management plan templates, documents, registers, and forms. A total of 40+ templates.
The project management template set contains all the individual plans required by PMBOK. Each plan template contains the complete, geared to each other structure, which results in a complete project management plan.
Easy to use for project management beginners and experienced project managers. The templates have been created since 2013 and are continuously improved.
With this template set you get all of the below:
Project charter template
Project management plan template
Change control log
Project mobilization checklist
Lesson learned recording form
Lesson learned register
Post project review template
Project scope management plan template
Project requirements management plan template
Requirements register
WBS register
Statement of works
Project schedule management plan template
Milestone list
Activity list
Duration control sheet
Gantt chart template
Project cost management plan template
Activity cost estimation sheet
Project budget template
Feasibility cost estimation sheet
Project quality management plan template
Process improvement plan template
Testing register
Concrete testing and delivery register
Inspection register
NCR register
Project resource management plan template
Resource breakdown structure
RACI matrix
Project communications management plan template
Performance report
Daily report
Project risk management plan template
Risk register
Project procurement management plan template
Request for a quotation
Requisition order form and register
Vendor evaluation
Project stakeholder management plan template
Stakeholder register
Project financial management plan template
Payment application
Process matrix
Formula collection
Template usage guide
Using these tried and tested Project Management Templates will help you to achieve your goal faster. You will save yourself a lot of work and frustration. With the help of this template, the task will be easier for you and completed faster. You can use your energy and time better and do more work in less time. In addition, the structure of the template helps you to create the complete document without overlooking [important parts](https://bit.ly/34jYync)
Day-44 Training At Ryaz
Tags: javascript, webdev, mongodb, node
Published: 2022-03-15 17:32:55

- Date:15-03-2022
- Day:Tuesday

Today's I started at about 10:30 am as today my aim was to do most of work as it would be possible so, firstly as I was done with implementing CRUD operations so, I was to do connections with db as stated firstly I started with installing mongodb as I am a Mac user firstly I was supposed to install home brew so I did it after it I erote the command brew install mongodb firstly it was not able to trace mongodb but after some searches on stack overflow I was successful to install it so, as directed by instructor then I installed he mongo compass but after all this when I typed the command mongo to start the execution so, it shows some errors like it is denied and it is unable to connect to db. I gone through many of blogs but I was not able to connect my db with app so, this way my day ended up with this messy connection. so, tomorrow I would be starting with it and I would be completing my task on periority basis.
Paracetamol.js💊| #79: Explica este código JavaScript
Tags: javascript, spanish, webdev, beginners
Published: 2022-03-15 17:14:25

## **Explica este código JavaScript**

```js
console.log("hola".split("").reverse().join("")); // ?
```

A. `['h','o','l','a']`;
B. `['a','l','o','h']`
C. `"hola"`
D. `"aloh"`

Resuesta el el primer ocmentario.

---
My first post
Published: 2022-03-15 17:14:10


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m6lrps6pucmegul8qqt9.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gcoi8e929c8gcon6m0lr.jpg)
My first post
Published: 2022-03-15 17:13:56


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m6lrps6pucmegul8qqt9.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gcoi8e929c8gcon6m0lr.jpg
Serverless with Spring
Tags: cloudnative, functionalprogrammin, spring, springboot
Published: 2022-06-16 17:12:04

---
title: Serverless with Spring
published: true
date: 2022-03-15 17:09:54 UTC
tags: cloudnative,functionalprogrammin,spring,springboot
canonical_url: 
---

 **1.**  **Introduction** :  
 In [this](https://medium.com/@shethap.tech/java-functional-interface-67c27a4cbf79) article, we have gone through the functional interface implementation feature introduced in Java8.  
 Now, we will learn how to leverage functional interface implementation using spring boot.

**2. Tool(s)/Framework(s):**  
- Any java project tool suite like Spring tool suit, eclipse, IntelliJ  
- JDK 8 or above  
- Spring boot 2.x & above

**3. Prerequisites:**  
- Java functional interface  
- Lambda

**4. Spring Cloud Function Setup**

**4.1 Maven Dependencies**

> <dependency>  
> <groupId>org.springframework.cloud</groupId>  
> <artifactId>spring-cloud-starter-function-web</artifactId>  
> </dependency>

**4.2 Writing Spring Cloud Function**  
 Writing a spring cloud function like supplier, consumer, or function is very simple. We can define bean for each type of function & we can access this functional implementation via its method name.  
 For Ex:

> /\*\*  
> \* Function implementation.  
> \*   
> \* [@return](http://twitter.com/return) Function  
> \*/  
> [@Bean](http://twitter.com/Bean)  
> public Function<String, String> **welcome** () {  
> return (userName) -> “Welcome “ + userName + “ to the functional programming”;  
> }

**4.3 Testing**   
 We can verify the spring cloud function written above with curl command as given below.

> curl [http://localhost:8080/welcome](http://localhost:8080/welcome) -H “Content-Type: text/plain” -d apurv

**5. Key takeaways**  
 The spring cloud function is a really powerful feature that abstracts business logic from all of transport details & infrastructure. It might be in its earlier stage but there are many benefits via which we can,  
- use all spring boot features like auto-configuration, dependency injection & many more.  
- build cloud-agnostic unified programming model, across serverless providers.  
- leverage same code & can run as a web endpoint, a stream processor, or a task.

**6. Git Repo**

https://github.com/shethaptech/spring-boot.git  
   
7 **. References:**  
https://spring.io/projects/spring-cloud-function#support
The love of Perl in Memes
Tags: perl, programming
Published: 2022-03-15 17:07:51

Somewhere in the past I wrote [The hate of Perl in Memes](https://dev.to/thibaultduponchelle/the-hate-of-perl-in-memes-469e) and it's cool even if it's almost exclusively composed of *negative* memes (hence the post title :smiley:)

It's time to revenge :grinning:

## Unleash the power
Learning Perl is a rewarding journey:
![I know Perl](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1iva4c2uvjrgpvxde87v.jpg)

Or change your mind:
![chomp](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/syfj6zmk2njiaxaadqdp.JPG)

Let yourself be guided:
![Mandalorian Perl Meme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gkegv5npuqxdp482v4r6.jpg)
(@jrw this one is for you xD)

## Resist! :sunglasses:
General purpose language: 
![Maried](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rq0w20lmiibmkbr0du1l.jpeg)

A camel with a submachine gun:
![Perl Kalash](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/51icvra1z4itafm86f4v.jpeg)

Don't listen to haters:
![still use](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zklopujdty17buy3b1ph.jpeg)

## Productivity toolbox
Get the job done:
![BioInfo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/buv8o9h9546m7nwgw5i2.jpg)

Simply powerful:
![Looserz](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ktbslhjdt0mm85u2r1dj.jpg)

Or even: 
![Perl var](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c99vbjetgqi9qmw4iakv.png)

## Glue
Perl people help everyone:
![Empathy](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jva28ywh1xcv6kzeq39f.jpg)

## Do you know some others...?
Please share! :heart:
Quizizz
Published: 2022-03-15 17:01:34

##Questions
##1.
Siz turgan papkadan 1 ta oldingi papkaga qaytish komandasini kiriting!
```
code ..
```
##2.
Siz turgan papkaning manzilini ko'rsatuvchi komanda..
```
pwd
```
##3.
Bugungi sana nomini (dd-mm-yyyy) shaklida papka ochish komandasi
```cpp
mkdir $(date '+%d-%m-%Y')
```
##4.
Bugungi sana nomini (yyyy-mm-dd) shaklida ekranga chop etish komandasi
```cpp
echo $(date '+%Y-%m-%d')
```
##5.
Siz Documents papkasida turibsiz Downloads papkasidagi dars1.cpp faylni o'chirish komandasini yozing.
```cpp
rm -rf ~/Downloads/dars1.cpp
```
##6.
terminaldagi papka va (yashirin fayllarni) ham chop etish komandasi ...
```
ls -a
```
##7.
Siz hozir Developer papkasidasiz shu papkadan chiqmasdan Downloads papkasiga otish uchun nima qilish kerak
```cpp
cd ~/Downloads
```
##8.
Terminaldagi barcha papka va fayllarni ko'rsatuvchi komanda nomi nima.
```
ls
```
##9.
C++ kodlarni kompilatsiya qilish uchun qaysi kompilyator ishlatiladi.
```
g++
```
##10.
Siz turgan papkani vscode dasturida workspace (ishchi maydon) sifatida qaysi kompilyator ochadi
```
code .
```
##11.
Joriy papkadagi *main.cpp* faylni kompilyatsiya qilib uni `dastur` nomli faylga dastur sifatida saqlaydigan kommandani kiriting !
```cpp
g++ main.cpp -o dastur
```
##12.
`cat` komandasining vazifasi nima?
##13.
qaysi komanda orqali ochmayotgan papkalarni ham o'chirsa boladi?
```cpp
rm -rf
```
The Clean Architecture In PHP
Tags: php
Published: 2022-03-15 16:57:31

---
title: The Clean Architecture In PHP
published: true
description: 
tags: #php
//cover_image: https://direct_url_to_image.jpg
---

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

- This book is amazing in explaining and applying SOLID principles and many common design patterns.
- The main benefit of the book is it give a quick theoretical introduction then start applying in a really advanced way the clean (onion) architecture.
- Some parts was very brief, So I got help from other resources.
- Other benefit of the book is applying the principles in a small project that getting bigger throughout the book, and it also apply how to trasfer the project from a framework to another to expose the concepts of decoupling. So, you will find it go from Zend, Laravel to Symfony.
- It's a short review as it's more like my impression for a good journey :)