teleren/devto huggingface dataset:
Cloud-Native Network Automation Framework
Tags: googlecloud, cloudnative, networkautomation, kubernetes
Published: 2022-06-03 18:35:04

Google 𝘾𝙡𝙤𝙪𝙙 founded the 𝙉𝙚𝙥𝙝𝙞𝙤 𝙥𝙧𝙤𝙟𝙚𝙘𝙩 in April 2022.

The 𝙉𝙚𝙥𝙝𝙞𝙤 𝙘𝙤𝙢𝙢𝙪𝙣𝙞𝙩𝙮: 
(1) launched with 24 founding organizations and has now grown 2X since launching. 
(2) included new participating organizations like:
- Vodafone, 
- Verizon, 
- Telefónica, 
- Deutsche Telekom, 
- KT, 
- HPE, 
- Red Hat, 
- Windriver, 
- Tech Mahindra, and others. 
(3) contained over 150 𝙙𝙚𝙫𝙚𝙡𝙤𝙥𝙚𝙧𝙨 𝙖𝙘𝙧𝙤𝙨𝙨 𝙩𝙝𝙚 𝙜𝙡𝙤𝙗𝙚 participated in the community kickoff meeting hosted by The Linux Foundation on May 17, 2022

Google 𝘾𝙡𝙤𝙪𝙙 is collaborating with:
(1) 𝙘𝙤𝙢𝙢𝙪𝙣𝙞𝙘𝙖𝙩𝙞𝙤𝙣 𝙨𝙚𝙧𝙫𝙞𝙘𝙚 providers, 
(2) 𝙣𝙚𝙩𝙬𝙤𝙧𝙠 𝙛𝙪𝙣𝙘𝙩𝙞𝙤𝙣 vendors, and 
(3) 𝙘𝙡𝙤𝙪𝙙 𝙥𝙧𝙤𝙫𝙞𝙙𝙚𝙧𝙨 

in 𝙉𝙚𝙥𝙝𝙞𝙤 by:

(1) 𝙒𝙤𝙧𝙠𝙞𝙣𝙜 𝙬𝙞𝙩𝙝 𝙩𝙝𝙚 𝙘𝙤𝙢𝙢𝙪𝙣𝙞𝙩𝙮 𝙩𝙤 𝙧𝙚𝙛𝙞𝙣𝙚 the cloud-native automation architecture, and define a common data model based on the :
- 𝙆𝙪𝙗𝙚𝙧𝙣𝙚𝙩𝙚𝙨 𝙍𝙚𝙨𝙤𝙪𝙧𝙘𝙚 𝙈𝙤𝙙𝙚𝙡 (𝙆𝙍𝙈) and 
- 𝘾𝙤𝙣𝙛𝙞𝙜𝙪𝙧𝙖𝙩𝙞𝙤𝙣 𝙖𝙨 𝘿𝙖𝙩𝙖 (𝘾𝙖𝘿) approach. 
(2) 𝘾𝙤𝙣𝙩𝙧𝙞𝙗𝙪𝙩𝙞𝙣𝙜 𝙩𝙤 𝙩𝙝𝙚 𝙙𝙚𝙫𝙚𝙡𝙤𝙥𝙢𝙚𝙣𝙩 of an open, fully functional reference implementation of this architecture.
(3) 𝙊𝙥𝙚𝙣 𝙨𝙤𝙪𝙧𝙘𝙞𝙣𝙜 𝙨𝙚𝙫𝙚𝙧𝙖𝙡 𝙠𝙚𝙮 𝙗𝙪𝙞𝙡𝙙𝙞𝙣𝙜 𝙗𝙡𝙤𝙘𝙠𝙨, such as 
- kpt, 
- Porch and 
- ConfigSync. 

Thanks to Ankur Jain and Randolph Chung for their blog post
𝘼𝙘𝙝𝙞𝙚𝙫𝙞𝙣𝙜 𝙘𝙡𝙤𝙪𝙙-𝙣𝙖𝙩𝙞𝙫𝙚 𝙣𝙚𝙩𝙬𝙤𝙧𝙠 𝙖𝙪𝙩𝙤𝙢𝙖𝙩𝙞𝙤𝙣 𝙖𝙩 𝙖 𝙜𝙡𝙤𝙗𝙖𝙡 𝙨𝙘𝙖𝙡𝙚 𝙬𝙞𝙩𝙝 𝙉𝙚𝙥𝙝𝙞𝙤
https://cloud.google.com/blog/topics/telecommunications/network-automation-csps-linus-nephio-cloud-native

𝙎𝙩𝙖𝙮 𝙩𝙪𝙣𝙚𝙙 𝙗𝙮 𝙛𝙤𝙡𝙡𝙤𝙬𝙞𝙣𝙜
https://www.linkedin.com/feed/hashtag/?keywords=did_you_know_that

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

https://www.linkedin.com/posts/mahmoudrabie2004_didabryouabrknowabrthat-google-cloud-activity-6938557085584400384-MRMk?utm_source=linkedin_share&utm_medium=member_desktop_web
What is async and defer and how you can use them to load your web app faster
Tags: webdev, performance, beginners, html
Published: 2022-06-03 18:34:56

No one likes a slow website? do they? 

But the question is, how do we make our website more optimized, especially when it's dependent on large stylesheets?

Well, this blog post has the answer.

But first, let's understand how things work behind the scene...

While loading a webpage, the browser sends a request for each and every external JavaScript file. If there are 3 external JavaScript files, then the browser will send 3 requests. This impacts the loading time of the webpage.

And for that, in HTML5, we've the "async" and "defer" attributes for the "script" element.

But how do they help us in improving the performance of our website?

The async attribute tells the browser to load the JavaScript file asynchronously. That means, the browser does not have to wait for the file to finish downloading before it continues parsing the HTML.

The defer attribute also tells the browser to load the JavaScript file asynchronously, but there's a difference. With the defer attribute, the browser downloads the file during HTML parsing, but waits to execute it until after the HTML parser has finished.

Both async and defer have the same impact on the loading time of the webpage. So, which one should you use?

If you use the async attribute, then the browser will execute the JavaScript code as soon as it's downloaded. This might be fine if the code is very simple. But if the code is more complex, there's a risk that it might impact the loading of other resources on the page.

While if you use the defer attribute, then the browser will execute the JavaScript code only after the HTML parser has finished. So, if there are other resources that need to be loaded, the browser will finish loading those first before it executes the JavaScript code.

In general, it's best to use the defer attribute. That way, you can be sure that your JavaScript code will not impact the loading of other resources on the page.

Below is the syntax for both:

```
//Usual script tag
<script       src="myscript.js"></script>

//Script tag which is calling the resources with async
<script async src="myscript.js"></script>

//Script tag which is calling the resources with defer
<script defer src="myscript.js"></script>
```

So what are you waiting for, fire up the editor and try it all yourself.

Feel free to comment with what you have learnt or any queries that you've.
Mental Model For SQL Joins
Tags: sql, beginners, programming, webdev
Published: 2022-06-03 18:24:55

## SYNTAX
```
SELECT *  
FROM table1 
JOIN table2
    ON table1.id = table2.id;
```
Just replace JOIN with LEFT JOIN/ FULL OUTER JOIN, etc if using a different join.

## Join / Inner Join
1. loop through each row in table1
2. for each row in table1, loop through table2
3. push a new row made up of all the columns in table1 and table2 into the new table if and only if table1.id === table2.id
4. return the new table

## Left / Right Join (table1 LEFT JOIN table2)
1. loop through each row in table1
2. for each row in table1, loop through table2
3. push a new row made up of all the columns in table1 and table2 into the new table if table1.id === table2.id
4. If table2 has been looped through and no row has been added, add a new row with all the columns in table1 and null for all the columns in table2 to the new table.
5. return the new table

## FULL OUTER JOIN (table1 FULL OUTER JOIN table2)
1. do a table1 LEFT JOIN table2
2. do a table1 RIGHT JOIN table2
3. combine the two tables returned above and remove the duplicate rows.
4. return the combined table

## CROSS JOIN / CARTESIAN JOIN
1. loop through each row in table1
2. for each row in table1, loop through table2
3. push a new row made up of all the columns in table1 and table2 into the new table
4. return the new table

Note that CROSS JOIN is essentially JOIN without a ON clause.
Minimum Number of Operations to Convert Time
Tags: leetcode, dsa, theabbie
Published: 2022-06-03 18:00:42

You are given two strings `current` and `correct` representing two **24-hour times**.

24-hour times are formatted as `"HH:MM"`, where `HH` is between `00` and `23`, and `MM` is between `00` and `59`. The earliest 24-hour time is `00:00`, and the latest is `23:59`.

In one operation you can increase the time `current` by `1`, `5`, `15`, or `60` minutes. You can perform this operation **any** number of times.

Return _the **minimum number of operations** needed to convert_ `current` _to_ `correct`.

**Example 1:**

**Input:** current = "02:30", correct = "04:35"
**Output:** 3
**Explanation:**
We can convert current to correct in 3 operations as follows:
- Add 60 minutes to current. current becomes "03:30".
- Add 60 minutes to current. current becomes "04:30".
- Add 5 minutes to current. current becomes "04:35".
It can be proven that it is not possible to convert current to correct in fewer than 3 operations.

**Example 2:**

**Input:** current = "11:00", correct = "11:01"
**Output:** 1
**Explanation:** We only have to add one minute to current, so the minimum number of operations needed is 1.

**Constraints:**

*   `current` and `correct` are in the format `"HH:MM"`
*   `current <= correct`

**SOLUTION:**

    class Solution:
        def convertTime(self, current: str, correct: str) -> int:
            bhh, bmm = [int(x) for x in current.split(":")]
            ehh, emm = [int(x) for x in correct.split(":")]
            diff = (ehh - bhh) * 60 + (emm - bmm)
            ctr = 0
            while diff > 0:
                if diff >= 60:
                    ctr += diff // 60
                    diff = diff % 60
                elif diff >= 15:
                    ctr += diff // 15
                    diff = diff % 15
                elif diff >= 5:
                    ctr += diff // 5
                    diff = diff % 5
                else:
                    ctr += diff
                    break
            return ctr
Find Unique Binary String
Tags: leetcode, dsa, theabbie
Published: 2022-06-03 17:30:36

Given an array of strings `nums` containing `n` **unique** binary strings each of length `n`, return _a binary string of length_ `n` _that **does not appear** in_ `nums`_. If there are multiple answers, you may return **any** of them_.

**Example 1:**

**Input:** nums = \["01","10"\]
**Output:** "11"
**Explanation:** "11" does not appear in nums. "00" would also be correct.

**Example 2:**

**Input:** nums = \["00","01"\]
**Output:** "11"
**Explanation:** "11" does not appear in nums. "10" would also be correct.

**Example 3:**

**Input:** nums = \["111","011","001"\]
**Output:** "101"
**Explanation:** "101" does not appear in nums. "000", "010", "100", and "110" would also be correct.

**Constraints:**

*   `n == nums.length`
*   `1 <= n <= 16`
*   `nums[i].length == n`
*   `nums[i]` is either `'0'` or `'1'`.
*   All the strings of `nums` are **unique**.

**SOLUTION:**

    class Solution:
        def findDifferentBinaryString(self, nums: List[str]) -> str:
            n = len(nums)
            nums = set(nums)
            for num in nums:
                for i in range(n):
                    curr = num[:i] + str(1 - int(num[i])) + num[i + 1:]
                    if curr not in nums:
                        return curr
Capitalize the Title
Tags: leetcode, dsa, theabbie
Published: 2022-06-03 17:00:42

You are given a string `title` consisting of one or more words separated by a single space, where each word consists of English letters. **Capitalize** the string by changing the capitalization of each word such that:

*   If the length of the word is `1` or `2` letters, change all letters to lowercase.
*   Otherwise, change the first letter to uppercase and the remaining letters to lowercase.

Return _the **capitalized**_ `title`.

**Example 1:**

**Input:** title = "capiTalIze tHe titLe"
**Output:** "Capitalize The Title"
**Explanation:**
Since all the words have a length of at least 3, the first letter of each word is uppercase, and the remaining letters are lowercase.

**Example 2:**

**Input:** title = "First leTTeR of EACH Word"
**Output:** "First Letter of Each Word"
**Explanation:**
The word "of" has length 2, so it is all lowercase.
The remaining words have a length of at least 3, so the first letter of each remaining word is uppercase, and the remaining letters are lowercase.

**Example 3:**

**Input:** title = "i lOve leetcode"
**Output:** "i Love Leetcode"
**Explanation:**
The word "i" has length 1, so it is lowercase.
The remaining words have a length of at least 3, so the first letter of each remaining word is uppercase, and the remaining letters are lowercase.

**Constraints:**

*   `1 <= title.length <= 100`
*   `title` consists of words separated by a single space without any leading or trailing spaces.
*   Each word consists of uppercase and lowercase English letters and is **non-empty**.

**SOLUTION:**

    class Solution:
        def capitalizeTitle(self, title: str) -> str:
            words = title.split()
            words = [word.lower() for word in words]
            words = [(word[0].upper() + word[1:]) if len(word) > 2 else word for word in words]
            return " ".join(words)
Day-101 Training At Ryaz
Tags: webdev, beginners, programming, discuss
Published: 2022-06-03 16:56:22

- Date:3/06/2022
- Day:Friday

Today, I started at about 10:30 am as I was in progress to complete the bidding project so today I started with the left over task firstly I started with filling up all the upcoming of project as the frontend of my project was not upto the mark so, today I tried to fill up all the gaps so, I added one button as for read me and attached an alert message for it to be as warning as to bid wisely so, after this I added four basic note that the user would read and get to know about the project and I get some changes in price column and after this I did some changes in css in the front page and also changed the front image so, this way I get all this work to be in row this way my day ended up and I get to learn many new things.
Disable Request-Forgery Protection
Published: 2022-06-03 16:47:18

**NOTE**: I wrote this blog post some time ago for Phase 4 of my Flatiron School SE program.

While setting up the api for my project, I came across an interesting bug. Naturally, for my JS front-end to be able to make fetch requests to the Rails back-end, I needed to enable cross-origin resource sharing. Now, I'd typically just go into the CORS config file and allow all origins with the wildcard:

```ruby
# config/initializers/cors.rb

Rails.application.config.middleware.insert_before 0, Rack::Cors do
  allow do
    origins '*'

    resource '*',
      headers: :any,
      methods: [:get, :post, :put, :patch, :delete, :options, :head]
  end
end
```

Interestingly, I was still getting errors saying that fetch requests from my front-end were being blocked. After a great deal of googling and digging through Rails pull requests on github, I stumbled upon section 7.2 of the Action Cable Rails guide—wherein I discovered the following piece of code:

```ruby
# config/environment/development.rb

config.action_cable.disable_request_forgery_protection = true
```

This line of code disables and allows requests from any origin. An array of strings can also be passed in to specify from which origins requests may be accepted. 

So enabling CORS requires not only adjusting the cors.rb file, but also going into development.rb and setting `disable_request_forgery_protection` equal to **true**. 

**Tangentially-related side note**: some time ago, I came across an article talking about the need to keep a "developer journal." For now, my developer journal is just a document with a list of errors I come across and links to articles that helped me fix them. It helps prevent the same bugs from occurring again and provides a repo of information I can dig into later for deeper understanding of certain topics.

Once my backend was set up, I was able to start making AJAX requests. AJAX stands for Asynchronous Javascript And XML—although AJAX requests can be formatted as plain text or JSON. 

When an event occurs (e.g., pressing a button), JS creates an XMLHttpRequest object that is sent to the web server (i.e., the Rails api). The server processes the request, and sends the response which is read and acted on by JavaScript. 

JSON, by the way, is JavaScript Object Notation. Our Rails api "speaks" Ruby and the browser "speaks" JavaScript. Hence, the api converts Ruby objects into JSON (using serializers) before sending them to the frontend, so that the JS-speaking browser can then understand and use the data.

That's a pretty simplified understanding, but it was what I needed to enable back-and-forth communication between the client-side of my application and the server.
Python syntax learning 1: Convert float to int
Tags: python, beginners, syntax
Published: 2022-06-03 16:32:05

Inspired from [yesterday exercise](https://dev.to/mathewchan/daily-exercise-2-string-3n7o) , I search for is there any other way to convert a object from float to integer?
The following is my findings:
and small conclusion at the end
## There are four syntax available:
1. int()
2. math.trunc()
3. math.floor()
4. math.celi()

## Method 1. int()
Syntax:
```python
int(x)
```
### Parameter:
x can be a string or number
but only one.
example 1
The string can only be an integer number
```python
str1 = "5" 
int(str1)
```
example 2
If the parameter is not a string, it can have decimal point
```python
str2 = 5.12  
int(str2)
```
The following code will cause error:

```python
str1 = "5,6" # more than one number in a string
str2 = "4.8" # the number in string must in integer
int(str1)
int(str2)
```


### What object will int()be return?
an int object will be returned
which cut off all the number after decimal place
example 1.
```python
str1 = "5"
int(str1)
```
will have an output
`5`
example 2
```python
str2 = 5.12
int(str2)
```
will have an output 
`5` 

---

## Method 2. math.trunc()
- need to import math module before use
### Syntax

```python
import math

math.trunc(x)
```
### Parameter
- math.trunc()only takes number as parameter
e.g.

```python
math.trunc(5.123)
```
### What object will math.trunc() return?
- an integer will returned
- which will cut off all the fractional part after decimal place
- same as int()

example
```python
import math

num2 = 5
int2 = math.trunc(num2)
print(int2)
```
will have an output
`5`

---

## Method 3. math.floor()
- need to import math module before use
### Syntax

```python
import math

math.floor(x)
```

### Parameter
math.floor() can only take number as parameter

### What object will math.floor() return?
an integer will returned.
The number will be round down
- that is the largest integer less than or equal to x

example
```python
import math

num2 = 5.9
int2 = math.floor(num2)
print(int2)

num3 = 5.1
int3 = math.floor(num3)
print(int3)
```
both num2 and num3 will have an output
`5`
---
## Method 4. math.ceil()
- need to import math before use
```python
import math

math.celi(x)
```
### Parameter
math.celi() can only take number as parameter

### What object will math.floor() return?
an integer will returned.
The number will be round up.
- that is the smallest integer greater than or equal to x

example
```python
import math

num2 = 5.9
int2 = math.floor(num2)
print(int2)

num3 = 5.1
int3 = math.floor(num3)
print(int3)
```
both num2 and num3 will have an output
`6`

## Conclusion
- int() is the most flexible way to convert float object to integer, but will suffer from data lose, same as meth.trunc().
- math.floor() and math.celi() can minimize data lose in the conversion if use properly.
N-ary Tree Preorder Traversal
Tags: leetcode, dsa, theabbie
Published: 2022-06-03 16:30:39

Given the `root` of an n-ary tree, return _the preorder traversal of its nodes' values_.

Nary-Tree input serialization is represented in their level order traversal. Each group of children is separated by the null value (See examples)

**Example 1:**

![](https://assets.leetcode.com/uploads/2018/10/12/narytreeexample.png)

**Input:** root = \[1,null,3,2,4,null,5,6\]
**Output:** \[1,3,5,6,2,4\]

**Example 2:**

![](https://assets.leetcode.com/uploads/2019/11/08/sample_4_964.png)

**Input:** root = \[1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14\]
**Output:** \[1,2,3,6,7,11,14,4,8,12,5,9,13,10\]

**Constraints:**

*   The number of nodes in the tree is in the range `[0, 104]`.
*   `0 <= Node.val <= 104`
*   The height of the n-ary tree is less than or equal to `1000`.

**Follow up:** Recursive solution is trivial, could you do it iteratively?

**SOLUTION:**

    """
    # Definition for a Node.
    class Node:
        def __init__(self, val=None, children=None):
            self.val = val
            self.children = children
    """
    
    class Solution:
        def preorder(self, root: 'Node') -> List[int]:
            if not root:
                return []
            children = []
            for node in root.children:
                children += self.preorder(node)
            return [root.val] + children
Peerlist | Made with Next JS
Published: 2022-06-03 16:25:57

![Peerlist | Made with Javascript | Next JS](https://res.cloudinary.com/madewithjavascript/image/upload/v1653508024/large_peerlist_made_with_next_js_18f01e4805.png "Peerlist | Made with Javascript | Next JS")


### Your most meaningful professional network

> Peerlist is a community of working professionals focused on building a personal brand, sharing professional content, and finding peers to collaborate with.
> 
> Peerlist is a community-led professional network for people in tech with powerful work profiles at its core. A Peerlist profile can be used as a simple resume or a complete portfolio to showcase your work from Github, Dribbble, Product Hunt, and many more.

## Check out more such amazing projects on our website

[Made with Javascript](https://madewithjavascript.club)

## Want us to feature your project

[Submit your Project to Made with Javascript](https://madewithjavascript.club/submit-project)


You can also write to us for any of your queries at:

[Email Made with Javascript](mailto:madewithjavascript@gmail.com)

## Project already shared on our social media handles.

| SocialMedia | SharedLink |
| ----------- | ---------- |
| Twitter | [Peerlist on Twitter](https://twitter.com/withjavascript/status/1532759260572131329?s=20&t=RzkmEFnu4_2mP2rPVAMTQw)
 |
| Medium | [Peerlist on Medium](https://medium.com/@madewithjavascript/peerlist-made-with-next-js-d5a16435cfe2)
 |
| Facebook | [Peerlist on Facebook](https://www.facebook.com/madewithjavascript/posts/pfbid02hsMwUZXpzt9hEK9fjuWjMH1B7yeWnaDkMB3qfWfrsS2H4XTUGJb8MZy5PrZD8mkjl)
 |
| Tumblr | [Peerlist on Tumblr](https://www.tumblr.com/blog/view/madewithjavascript/686055340985417728?source=share)
 |
| LinkedIn | [Peerlist on LinkedIn](https://www.linkedin.com/feed/update/urn:li:activity:6938525475354906624)
 |
| Pinterest | [Peerlist on Pinterest](https://pin.it/42RZr1c)
 |


Filled Under:

 - [Made with Javascript](https://madewithjavascript.club)    
 - [Made with Next JS](https://madewithjavascript.club/categories/next-js)

Make sure to give this post ❤ 50 ❤ hearts, click the 🦄 unicorns 🦄 and follow 👉 @madewithjavascript 👈 for more such awesome showcases. Show you love for the people who have worked so hard!