teleren/devto huggingface dataset:
Comparing DevOps and MLOps
Tags: devops, machinelearning, beginners
Published: 2022-06-11 22:05:49

A popular practice in developing and operating large-scale software systems is [DevOps](bpbonline.com/search?q=DevOps&type=product), which provides the benefits such as shortened development cycles, increased deployment velocity, and dependable releases.

Similar practices apply as an [Machine Learning](bpbonline.com/collections/machine-learning) system is a software system that helps guarantee you to reliably build and operate ML systems at scale.

The following, however, are the ways in which ML systems differ from other software systems:

**Skills to work in a team: **The team’s focus in an ML project which includes data scientists or ML researchers, is on exploratory data analysis, model development, and experimentation, and these team members cannot build production—class services as they are not experienced, software engineers.

**Application development:** Because ML is experimental in nature, you should attempt as many features, algorithms, modeling methodologies, and parameter settings as possible to identify what works best for the problem. The challenge is keeping track of what worked and what did not while maximizing code reusability and maintaining reproducibility.

**Application testing:** Compared with testing other software systems, an ML system is more involved. You need data validation, trained model quality evaluation, and model validation in addition to typical unit and integration tests.

**Application deployment:** Deploying an offline-trained ML model as a prediction service deployment is not as simple in ML systems. A multi-step pipeline may be required by you to deploy ML systems so as to automatically retrain and deploy the model. This requires you to automate steps that were manually done before deployment by data scientists to train and validate new models, as this pipeline adds complexity.

**Application production:** Due to constantly evolving data profiles as also due to suboptimal coding, ML models may reduce performance. The models can decay in more ways than conventional software systems, and this degradation needs to be considered by you. Therefore, when values deviate from your expectations, you need to track summary statistics of your data and monitor the online performance of your model to send notifications or rollback.

In continuous integration of source control, unit testing, integration testing, and continuous delivery of the software module or the package, ML and other software systems are similar. In ML; however, there are a few notable differences:
- CI is not only about testing and validating code and components but also about testing and validating data, data schemas, and models.
- CD is not only about a single software package or a service but also a system (an ML training pipeline) that should automatically deploy another service (model prediction service).
- CT is concerned with automatically retraining and serving the models, and it is a new property that is unique to ML systems.

Hope this was helpful.
Lunes de música... ¿Qué estás escuchando? 🎵 (13-junio)
Tags: spanish, music, discuss, monday
Published: 2022-06-13 19:44:53

> **"El amor es amistad tocada como pieza musical"**
_Joseph Campbell_

La música es parte importante de la vida de la mayoría de las personas y una vida no basta para poder escuchar todas las canciones que quisiéramos o conocer a todos los artistas, solistas o bandas.

Últimamente mis gustos musicales han sido muy estáticos y siento que necesito abrir mis horizontes y poder conocer nueva música interesante. 

Este post es la septima entrega de una serie semanal que lanzaré todos los lunes para que como comunidad podamos compartir y por qué no conocer nuevas melodías. 🎶

Puedes compartir tus sugerencias usando los *liquid tags* de Dev.to, por ejemplo:

* Para compartir un video desde youtube:
```js
{% youtube dQw4w9WgXcQ %} // dQw4w9WgXcQ es el id del video
```

* Para compartir una canción desde spotify:
```js
{% spotify https://open.spotify.com/track/7GBwTrOpTtsLdJN3Dc0U1C?si=ea737b51f47043b6 %} 
```

Mi sugerencia para esta semana es del artista francés Jacques y el tema La vie de tous les jours 
 
{% spotify https://open.spotify.com/track/0ED0BaSvU2z8ATD6W3QBWB?si=c95cc04b05f94823 %}

---

La versión original de este post esta escrito por mi amigo 
@michaeltharrington ve y salúdalo de mi parte con una canción 🎵

{% link https://dev.to/michaeltharrington/music-monday-what-are-you-listening-to-may-23-104p %}

Los respectivos créditos a él por ser tan buena onda. 

{% user michaeltharrington %}

Y dime, ¿qué estás escuchando ahora? Te leo en los comentarios.
What is Blockchain?
Tags: blockchain, programming, web3, beginners
Published: 2022-06-13 19:35:19

Blockchain is a popular word in the depths of the Internet recently. In this article, I will try to expose what the famous Blockchain is and what it can be useful for.

_This article was translated from Polish using Google Translate. The original post can be found on my blog at [https://blog.budzynskimaciej.pl](https://blog.budzynskimaciej.pl/post/blockchain-p1/)._

## Data structures

At the beginning, it is necessary to explain what data structures are to be able to understand what blockchain is. Data structures, in general, are a way of organizing, managing, and storing data in a computer's memory. More specifically, a data structure is a collection of data values, the relationships between them, and the functions or operations that can be applied to the data. Different data structures serve different purposes, such as relational databases that use B-tree indexes to retrieve data, and some compiler implementations use hash tables to look up identifiers. The data structures include:

- Record, also known as a structure or a tuple (e.g. a point with coordinates X, Y)
- Tables
- List (one or two way)
- Object
- Tree
- Hash table
- Graph

and many, many more of the different variations of the above data structures.

## Blockchain

Blockchain is a data structure. Specifically, it is a kind of one-way list containing strongly interconnected blocks using cryptography. Each block contains the previous block hash, timestamp, and transaction data. The exception is the so-called Genesis Block. It is the first block to form a chain of links with other blocks. The assumption of the blockchain is resistance to data modification and easy verification if the data has not been counterfeited. Modification of any block results in the generation of completely different hashes for subsequent blocks, which allows you to easily verify that the data has not been counterfeited.

## What is it for and who is it for?

Currently, the use of blockchain is primarily the support of various transactions, such as:

- Stocks
- Currencies
- Trade

The main application of this data structure can be seen in cryptocurrencies such as Bitcoin. In the next articles I will try to implement an example blockchain.
Linux for Development
Tags: linux, programming, experience, life
Published: 2022-06-13 19:30:58

I am Joseph Sunday and will talk about of my experience with Linux and programming, I start this journey 3 years ago, my first approach was with Windows Subsystem for Linux (WSL), specifically Ubuntu, nothing special, I execute some commands in my spare time, are very useful when are a developer and some tool don't work in your machine, vscode have a plugin to work with WSL and this are very useful to work into project inside of ubuntu, I feel like a hacker typing commands in the console.
This experience with Linux push me to try more, with windows and dualboot on my machine, i had to adapt to use linux in my daily workflow, find alternatives to programs that use in windows, I adapted so much to linux, that it is now my main system.
Find Players With Zero or One Losses
Tags: leetcode, dsa, theabbie
Published: 2022-06-13 19:30:49

You are given an integer array `matches` where `matches[i] = [winneri, loseri]` indicates that the player `winneri` defeated player `loseri` in a match.

Return _a list_ `answer` _of size_ `2` _where:_

*   `answer[0]` is a list of all players that have **not** lost any matches.
*   `answer[1]` is a list of all players that have lost exactly **one** match.

The values in the two lists should be returned in **increasing** order.

**Note:**

*   You should only consider the players that have played **at least one** match.
*   The testcases will be generated such that **no** two matches will have the **same** outcome.

**Example 1:**

**Input:** matches = \[\[1,3\],\[2,3\],\[3,6\],\[5,6\],\[5,7\],\[4,5\],\[4,8\],\[4,9\],\[10,4\],\[10,9\]\]
**Output:** \[\[1,2,10\],\[4,5,7,8\]\]
**Explanation:**
Players 1, 2, and 10 have not lost any matches.
Players 4, 5, 7, and 8 each have lost one match.
Players 3, 6, and 9 each have lost two matches.
Thus, answer\[0\] = \[1,2,10\] and answer\[1\] = \[4,5,7,8\].

**Example 2:**

**Input:** matches = \[\[2,3\],\[1,3\],\[5,4\],\[6,4\]\]
**Output:** \[\[1,2,5,6\],\[\]\]
**Explanation:**
Players 1, 2, 5, and 6 have not lost any matches.
Players 3 and 4 each have lost two matches.
Thus, answer\[0\] = \[1,2,5,6\] and answer\[1\] = \[\].

**Constraints:**

*   `1 <= matches.length <= 105`
*   `matches[i].length == 2`
*   `1 <= winneri, loseri <= 105`
*   `winneri != loseri`
*   All `matches[i]` are **unique**.

**SOLUTION:**

    import bisect
    from collections import defaultdict
    
    class Solution:
        def findWinners(self, matches: List[List[int]]) -> List[List[int]]:
            played = defaultdict(int)
            won = defaultdict(int)
            for winner, loser in matches:
                won[winner] += 1
                played[winner] += 1
                played[loser] += 1
            answer = [[], []]
            for player in played:
                lost = played[player] - won[player]
                if lost == 0:
                    bisect.insort(answer[0], player)
                elif lost == 1:
                    bisect.insort(answer[1], player)
            return answer
Forestry and Hugo
Tags: go, hugo, forestry, programming
Published: 2022-06-13 19:29:35

I haven't written here for a long time, but it's worth refreshing this blog a bit. Today's post will be short, and in the post I'm going to present the integration of Hugo with the Forestry.io platform.

_This article was translated from Polish using Google Translate. The original post can be found on my blog at [https://blog.budzynskimaciej.pl](https://blog.budzynskimaciej.pl/post/forestry-and-hugo/)._

## What is Forestry.io?

Simply put, Forestry.io is the visual editor of our website. With Forestry.io, the ability to publish and edit pages using a web browser is added.

## Integration

Integrating Hugo with Forestry.io is simple. Just log in to [https://app.forestry.io/](https://app.forestry.io/) using our Github account and fill in the data requested by the website. After integration, just log in, go to the tab with posts and add or edit them with the Markdown visual editor. And that's all for today.

This post was added using [https://app.forestry.io/](https://app.forestry.io/)
What was your win LAST week?
Tags: discuss, weeklyretro
Published: 2022-06-13 19:29:17

---
title: What was your win LAST week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: discuss, weeklyretro
cover_image: https://cl.ly/188e843c2985/download/Image%202019-02-15%20at%202.36.37%20PM.png
---

Hey folks!

Sorry for leaving out the weekly wins thread _again_ last week! 😱 

To be clear, this is not a purposeful new pattern, just a mishap.

But hey, it's never too late to celebrate your wins. Let's talk about what you're proud of from LAST week.

All wins count — big or small 🎉

Examples of 'wins' include:

- Starting a new project
- Fixing a tricky bug
- Planting something new in your garden... or whatever else might spark joy ❤️ 

---

I'm looking forward to reading what you accomplished **last** week 🎉 


![Britney Spears Oops I Did It Again video clip](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uq1jbge2ha3k95crn3gx.gif)
Beautifying strings, or how to format strings in Python
Tags: python, beginners, tutorial, programming
Published: 2022-06-13 19:21:54

There are two methods of formatting strings in python. This situation continued until Python 3.6 came along with the advent of f-strings. Today I will try to discuss all formatting methods, and give an example of their use.

_This article was translated from Polish using Google Translate. The original post can be found on my blog at [https://blog.budzynskimaciej.pl](https://blog.budzynskimaciej.pl/post/string-in-python/)._

## The code we will work with

We will use a few simple variables that I will try to display using each of the available formatting methods.

```python
first_name = "John"
last_name = "Doe"
born_year = 1978
current_age = 40
dict = {'text':'One', 'value': 1}
```

## Old formatting with '%' sign

This formatting has been in Python for a long time. Currently, this method is not recommended by the Python documentation as it has some drawbacks and may cause problems with the display of tuples and lists. Below is an example of using this formatting:

```python
print("Hello %s %s. Your born year is %d. You are %d years old", first_name, last_name, born_year, current_age)
```

What does% s mean? It just tells the interpreter that we want to read a string. Available modifiers:

- `%s` - A string (or any object that has a repr method, e.g. an array))
- `%d` - Whole numbers
- `%f` - Floating point numbers
- `%.(X)` - A floating point number with a precision of X decimal numbers
- `%X` - An integer represented in hexadecimal notation

## Format with `str.format()`

This option was introduced in Python 2.6. This is an improved formatting relative to %-formatting. Thanks to `str.format()`, the fields we intend to substitute are represented by the characters `{}`. Example:

```python
print("Hello {2} {3}. Your born year is {1}. You are {0} years old.".format(current_age, born_year, first_name, last_name))
```

We can also display the content of dictionaries by unpacking them:

```python
print("{text} is {value}.".format(**dict))
```

## The new way, or f-Strings in Python 3.6

The introduction of f-Strings has made formatting even easier. Example:

```python
print(f"Hello {first_name} {last_name}. Your born year is {born_year}. You are {current_year} years old")
```

That's it, f-strings are executed at runtime. You just enter a variable defined earlier in `{}`. You can also use expressions, e.g .:

```python
print(f"{2 * 6}")
```

This code will output the value of the expression 2 * 6, which is 12. You can also call functions:

```python
name = "jane"
print(f"{name.capitalize()}")
```

The above code will display the text: `Jane`. We can also display the content of dictionaries:

```python
print(f"{dict['text']} is {dict['value']}.")
```

As you can see, it is worth using f-Strings, because they increase our productivity and do not obscure the code. They are also a bit faster to execute than %-Strings and `str.format()`.
Two Sum IV - Input is a BST
Tags: leetcode, dsa, theabbie
Published: 2022-06-13 19:00:46

Given the `root` of a Binary Search Tree and a target number `k`, return _`true` if there exist two elements in the BST such that their sum is equal to the given target_.

**Example 1:**

![](https://assets.leetcode.com/uploads/2020/09/21/sum_tree_1.jpg)

**Input:** root = \[5,3,6,2,4,null,7\], k = 9
**Output:** true

**Example 2:**

![](https://assets.leetcode.com/uploads/2020/09/21/sum_tree_2.jpg)

**Input:** root = \[5,3,6,2,4,null,7\], k = 28
**Output:** false

**Constraints:**

*   The number of nodes in the tree is in the range `[1, 104]`.
*   `-104 <= Node.val <= 104`
*   `root` is guaranteed to be a **valid** binary search tree.
*   `-105 <= k <= 105`

**SOLUTION:**

    # Definition for a binary tree node.
    # class TreeNode:
    #     def __init__(self, val=0, left=None, right=None):
    #         self.val = val
    #         self.left = left
    #         self.right = right
    class Solution:
        def inorder(self, root, k):
            if root and not self.possible:
                self.inorder(root.left, k)
                if (k - root.val) in self.exists:
                    self.possible = True
                self.exists.add(root.val)
                self.inorder(root.right, k)
        
        def findTarget(self, root: Optional[TreeNode], k: int) -> bool:
            self.possible = False
            self.exists = set()
            self.inorder(root, k)
            return self.possible
Benefits of cloud computing.
Published: 2022-06-13 18:53:39

1. **Trade upfront expense for variable expenses**
    1. Upfront expenses refer to data centers, physical servers, and other resources that you would need to invest in before using them.
    2. Variable expense mean you only pay for computing resources that you consume
2. **Stop spending money to run and maintain data centers.**
3. **Stop Guessing capacity**
    1. With cloud computing, you don’t have to predict how much infrastructure capacity you will need before deploying an application. 
4. **Benefit from massive economics of scale**
    1. By using cloud computing, you can achieve a lower variable cost than you can get on your own.
        
        Because usage from hundreds of thousands of customers can aggregate in the cloud, providers, such as AWS, can achieve higher economies of scale. The economy of scale translates into lower pay-as-you-go prices.
        
5. **Increase speed and agility**
6. **Go global in minutes**
    1. The global footprint of the AWS Cloud enables you to deploy applications to costumers around the world quickly, while providing them with low latency. This means that even if you are located in a different part of the world than your customers, customers are able to access your applications with minimal delays.
Cloud computing TL;DR
Published: 2022-06-13 18:52:01


**Cloud computing:** Is the on-demand delivery of IT resources over the internet with pay-as-you-go pricing.

**On-demand delivery:** indicate that the cloud has the resources you need, when you need them. You don't need to tell us in advance that you're going to need them.

### Deployment models for cloud computing

1. **Cloud-based deployment:** You can migrate existing applications to the cloud, or you can design and build new applications in the cloud.
    1. Run all parts of the application in the cloud.
    2. Migrate exiting applications to the cloud.
    3. Design and build new applications in the cloud.
2. **On-premises deployment:** It is also known as a *private cloud* *deployment.* In this model, the resources are deployed on premises by using virtualization and resource management tools.
    1. Deploy resources by using virtualization and resource management tools
    2. Increase resource utilization by using application management and virtualization technologies
3.  **Hybrid deployment:** Cloud-bases resources are connected to on-promises infrastructure. 
    1. Connect cloud-based resources to on-premises infrastructure
    2. Integrate cloud-bases resources with legacy IT applications.
How to use Redis without installing it in Windows/Linux
Tags: redis, redisla
Published: 2022-06-13 18:31:43

Very often we feel the need of key-value pair database for our projects. However, using our main database for this purpose can be really tedious and an unnecessary task.

During such times the only solution that comes to our mind is **Redis!**.

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. One can make use of Redis whenever there is need of key-value pair database.

**Example**: One good example of using the Redis is to store the status of some action, like if someone makes a request of password reset then we can allow the password reset only in next 5 min after the request is made. Now to maintain the status for this 5 minute we can make use of Redis. We can store some sort of key associated with this user which can auto expire in 5min.

## Using Redis

Having said that, let's see how we can make use of Redis in our projects without any installations.

One the major obstacles while working with Redis is that you need to install it in your machine and then launch the Redis server to use it. This can be done easily with Linux based system but unfortunately it can't be done that easily in Window's machine as Redis is not officially supported on windows ( as per my knowledge ) so you need to do some workaround like WSL, etc.

### Redis Cloud
Just head on to `https://app.redislabs.com/` and make your account on redis labs page.

It offers a free plan which includes **30MB** of space ( which is enough for storing key-value pairs for small projects ) and 1 dedicated database

Screenshot of Making the Database
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p7e5aoxx2n4jdzajvhfu.png)

Upon successful creation of database we get to see following dashboard
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlvo6lovq2csagvz2mbd.png)

Just Click on the database and copy the following credentials
- Public endpoint
This is of the format: `host:port`
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5rdrkpf6rjno69popq0x.png)
- Default user password
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cycjvzibwacx5719l2ra.png)

Now since we have these credentials we can connect to our database and use Redis as usual. 

Below is the example with Python. I have saved the credentials in environment file. One can directly put the credentials below. Eg: In place of os.getenv("REDIS_HOST") directly put the host url.

```py
import redis
red = redis.Redis(
    host=os.getenv("REDIS_HOST"),
    port=os.getenv("REDIS_PORT"), 
    password=os.getenv("REDIS_PASSWORD")
)

red.set("key", "value")
print(red.get("key")

```
Header text colorise and animate effects
Tags: codepen, webdev, javascript, css
Published: 2022-06-13 18:31:14

Color fonts are a real thing. However ...

This demo does not use color font technology, nor does it attempt to replicate color font functionality. Instead it demonstrates the application of color design and animation to any text on the web page, typically in HTML header elements, through the use of Scrawl-canvas snippet JS modules.

https://codepen.io/kaliedarik/project/editor/AzWnNa
Remove All Occurrences of a Substring
Tags: leetcode, dsa, theabbie
Published: 2022-06-13 18:30:41

Given two strings `s` and `part`, perform the following operation on `s` until **all** occurrences of the substring `part` are removed:

*   Find the **leftmost** occurrence of the substring `part` and **remove** it from `s`.

Return `s` _after removing all occurrences of_ `part`.

A **substring** is a contiguous sequence of characters in a string.

**Example 1:**

**Input:** s = "daabcbaabcbc", part = "abc"
**Output:** "dab"
**Explanation**: The following operations are done:
- s = "da**abc**baabcbc", remove "abc" starting at index 2, so s = "dabaabcbc".
- s = "daba**abc**bc", remove "abc" starting at index 4, so s = "dababc".
- s = "dab**abc**", remove "abc" starting at index 3, so s = "dab".
Now s has no occurrences of "abc".

**Example 2:**

**Input:** s = "axxxxyyyyb", part = "xy"
**Output:** "ab"
**Explanation**: The following operations are done:
- s = "axxx**xy**yyyb", remove "xy" starting at index 4 so s = "axxxyyyb".
- s = "axx**xy**yyb", remove "xy" starting at index 3 so s = "axxyyb".
- s = "ax**xy**yb", remove "xy" starting at index 2 so s = "axyb".
- s = "a**xy**b", remove "xy" starting at index 1 so s = "ab".
Now s has no occurrences of "xy".

**Constraints:**

*   `1 <= s.length <= 1000`
*   `1 <= part.length <= 1000`
*   `s`​​​​​​ and `part` consists of lowercase English letters.

**SOLUTION:**

    class Solution:
        def removeOccurrences(self, s: str, part: str) -> str:
            n = len(part)
            while part in s:
                i = s.index(part)
                s = s[:i] + s[i+n:]
            return s