teleren/devto huggingface dataset:
Agile - Story Point Estimation
Tags: agile, devops, scrum, iamsureshayyanna
Published: 2022-06-18 05:06:07

**What are story points?**
Firstly, Agile estimation is the process to estimate the effort required to complete a task.

A story point is an arbitrary measure of effort required to implement a user story; it's a number that tells the team how hard the story is. “Hard” can be related to complexity, unknowns, and/or effort.

<u>**Estimation Guidelines**</u>
Story Point values are based on a Fibonacci sequence (1,2,3,5,8,13,21,...)
Story point estimates should take into account technical complexity & effort to complete.
Story point estimates should account for the total effort to reach done, not just code complete. Both code review and QA testing can take considerable time and should be accounted for.
The lowest point value that can be assigned is 1, don't dabble in fractions of a story point.
Stories with an estimate larger than 8 should be refined and broken into multiple stories.
Time spent on different parts of the development process should be measured in hours & days.
When in doubt about the value of a ticket, play conservatively and go with the higher value.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/625mwvdl15qmcbvz237j.png)
 
**<u>Breakdown by Time Spent</u>**
The table below is provided as a guideline of the total effort put forth during Development, Code Review, and QA testing for a given point value. Duration values are shared as uninterrupted/distraction-free time; time spent on a ticket may exceed the value shown due to switching context throughout a given sprint (meetings, shifting priorities, etc)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tpw9k5un7qbg38u9crst.png)

**<u>The Process of Story Point Estimation:</u>**
Step 1: Choose an estimation matrix (Fibonacci series).
Step 2: Identify user stories or other relevant items for estimation.
Step 3: Select reference points using prev. experience.
Step 4: Identify the risks, size, and complexity of the selected estimation item(s).
Step 5: Discuss and estimate.
Step 6: Set up deadlines

**Story Points are Not,**
- Estimate of time
       Very difficult to estimate time, hard to get right
       Story points trade off precision to make estimating easier
- Exact end dates
- Exact time spent
- Time tracking
- For comparing the team's output
        Story points are, by definition, relative and unique to each team

Thus, comparing one team's velocity to another team's velocity is pointless(pun intended)

For in-depth details about Scrum: [https://scrumguides.org/scrum-guide.html]
Divisor Game
Tags: leetcode, dsa, theabbie
Published: 2022-06-18 05:00:45

Alice and Bob take turns playing a game, with Alice starting first.

Initially, there is a number `n` on the chalkboard. On each player's turn, that player makes a move consisting of:

*   Choosing any `x` with `0 < x < n` and `n % x == 0`.
*   Replacing the number `n` on the chalkboard with `n - x`.

Also, if a player cannot make a move, they lose the game.

Return `true` _if and only if Alice wins the game, assuming both players play optimally_.

**Example 1:**

**Input:** n = 2
**Output:** true
**Explanation:** Alice chooses 1, and Bob has no more moves.

**Example 2:**

**Input:** n = 3
**Output:** false
**Explanation:** Alice chooses 1, Bob chooses 1, and Alice has no more moves.

**Constraints:**

*   `1 <= n <= 1000`

**SOLUTION:**

    class Solution:
        def DG(self, n: int) -> bool:
            if n in self.cache:
                return self.cache[n]
            for x in range(1, n):
                if n % x == 0 and not self.DG(n - x):
                    self.cache[n] = True
                    return True
            self.cache[n] = False
            return False
        
        def divisorGame(self, n: int) -> bool:
            self.cache = {}
            return self.DG(n)
جارو شارژی
Tags: beginners, css, html, github
Published: 2022-06-18 04:52:48

[جارو شارژی](https://moboniaz.com/product-category/home-accessories/handheld-vacuum/)
یکی از مهم ترین وسایل الکترونیکی مهم در نظافت خانه که بسیار نظافت را برای شما عزیزان آسان کرده است جارو های شارژی می باشد، در واقع جاروی شارژی در کار های مختلف که مربوط به نظافت هستند باعث سهولت در استفاده و همچنین سرعت بخشیدن به کار و ایجاد کم تر درگیری جسمی بدن شما می باشد، همچنین با پیشرفت روز افزون این نوع وسایل برقی شما می توانید جایگزین جاروهای برقی پر سر و صدا از جارو های شارژی استفاده کنید. همان طور که می دانید از جارو های شارژی به منظور استفاده آسان برای پاک کردن لکه ، کثیفی، موهای حیوانات به هر آلودگی دیگر پر کاربرد می باشد، ما را در این مقاله همراهی کنید تا درباره جارو شارژی اطلاعات مفید در خدمت شما عزیزان قرار بدهیم.
Principios Básicos de Redux
Tags: javascript, redux, node
Published: 2022-06-18 04:48:20

En Redux existen conceptos que es importante conocerlos y por eso hoy hablaremos sobre ellos.

## Redux: Actions
En Redux existen las _Actions_ que no son más que las definiciones de Acciones que realizara nuestro reducer para manipular el estado de nuestra aplicación. Por ejemplo:
``` javascript 
export const SET_LOGIN_USER ='SET_LOGIN_USER';
```

Como podemos notarlo la _Action_ es lo que queremos ejecutar, puedes definir cuantas _Actions_ se requieran, pero ten cuidado porque podrían llegar a ser difíciles de manejar en caso de no utilizarlos correctamente.

## Redux: Action Creators
Las _ActionCreator_ son las funciones que nos ayudan a crear una _Action_ estas hacen que recibamos un objeto y lo transformemos a un objeto de redux, el cual tiene una `type` y un `payload`.

Asumamos que hemos creado un archivo con nombre _actionTypes_, el cual importaremos en nuestro archivo _actionCreator_.

```javascript
import * as ActionTypes from './actionTypes'
export const SetUserLogin = (userAccount)=> {
   return {
      Type: ActionTypes.SET_LOGIN_USER,
      payload: {
         userAccount
      }
   }
}
```

## Redux: Reducers
Finalmente, el concepto que le da esencia a Redux, los reducers, estos no son más que funciones puras, igual que los anteriores, pero que son las que hacen que nuestra implementación de Redux, llegue a feliz término.

Los reducer combinan las _ActionTypes_ y permiten a nuestra aplicación modificar su estado. Para este ejemplo tendremos siempre en cuenta que hemos creado el archivo `actionTypes`.

```javascript
import * as ActionTypes from './actionTypes';

const userDefaultState = { userId: '', userName: '', isLogged: false }

export const userLoginReducer = (state = userDefaultState, action) => {
    switch (action.type) {
        case actionTypes.SET_USER_LOGIN:
            let user = action.payload.userAccount;
            state = {...state, userId: user.userId, userName: user.userName, isLogged: user.isLogged }
            return state;
        default:
            return state;
    }
}
```

Como observamos, el _reducer_ ejecuta la _action_ que ha sido disparada _dispatch_ desde un componente por nuestro usuario.

De este modo ya hemos visto los tres elementos necesarios para implementar Redux. Hasta la próxima.

_**¡Happy Hacking!**_
Custom Sort String
Tags: leetcode, dsa, theabbie
Published: 2022-06-18 04:30:39

You are given two strings order and s. All the characters of `order` are **unique** and were sorted in some custom order previously.

Permute the characters of `s` so that they match the order that `order` was sorted. More specifically, if a character `x` occurs before a character `y` in `order`, then `x` should occur before `y` in the permuted string.

Return _any permutation of_ `s` _that satisfies this property_.

**Example 1:**

**Input:** order = "cba", s = "abcd"
**Output:** "cbad"
**Explanation:** 
"a", "b", "c" appear in order, so the order of "a", "b", "c" should be "c", "b", and "a". 
Since "d" does not appear in order, it can be at any position in the returned string. "dcba", "cdba", "cbda" are also valid outputs.

**Example 2:**

**Input:** order = "cbafg", s = "abcd"
**Output:** "cbad"

**Constraints:**

*   `1 <= order.length <= 26`
*   `1 <= s.length <= 200`
*   `order` and `s` consist of lowercase English letters.
*   All the characters of `order` are **unique**.

**SOLUTION:**

    class Solution:
        def customSortString(self, order: str, s: str) -> str:
            pos = {}
            for i, c in enumerate(order):
                pos[c] = i
            return "".join(sorted(s, key = lambda c: pos.get(c, 0)))
Minimum White Tiles After Covering With Carpets
Tags: leetcode, dsa, theabbie
Published: 2022-06-18 04:00:44

You are given a **0-indexed binary** string `floor`, which represents the colors of tiles on a floor:

*   `floor[i] = '0'` denotes that the `ith` tile of the floor is colored **black**.
*   On the other hand, `floor[i] = '1'` denotes that the `ith` tile of the floor is colored **white**.

You are also given `numCarpets` and `carpetLen`. You have `numCarpets` **black** carpets, each of length `carpetLen` tiles. Cover the tiles with the given carpets such that the number of **white** tiles still visible is **minimum**. Carpets may overlap one another.

Return _the **minimum** number of white tiles still visible._

**Example 1:**

![](https://assets.leetcode.com/uploads/2022/02/10/ex1-1.png)

**Input:** floor = "10110101", numCarpets = 2, carpetLen = 2
**Output:** 2
**Explanation:** 
The figure above shows one way of covering the tiles with the carpets such that only 2 white tiles are visible.
No other way of covering the tiles with the carpets can leave less than 2 white tiles visible.

**Example 2:**

![](https://assets.leetcode.com/uploads/2022/02/10/ex2.png)

**Input:** floor = "11111", numCarpets = 2, carpetLen = 3
**Output:** 0
**Explanation:** 
The figure above shows one way of covering the tiles with the carpets such that no white tiles are visible.
Note that the carpets are able to overlap one another.

**Constraints:**

*   `1 <= carpetLen <= floor.length <= 1000`
*   `floor[i]` is either `'0'` or `'1'`.
*   `1 <= numCarpets <= 1000`

**SOLUTION:**

    class Solution:
        def minTiles(self, floor: str, numCarpets: int, carpetLen: int, i, n) -> int:
            key = (i, numCarpets)
            if i >= n:
                return 0
            if key in self.cache:
                return self.cache[key]
            if numCarpets <= 0:
                val = floor[i:].count("1")
                self.cache[key] = val
                return val
            a = float('inf')
            if floor[i] == "1":
                a = self.minTiles(floor, numCarpets - 1, carpetLen, i + carpetLen, n)
            b = self.minTiles(floor, numCarpets, carpetLen, i + 1, n)
            if floor[i] == "1":
                b += 1
            val = min(a, b)
            self.cache[key] = val
            return val
        
        def minimumWhiteTiles(self, floor: str, numCarpets: int, carpetLen: int, i = 0) -> int:
            self.cache = {}
            return self.minTiles(floor, numCarpets, carpetLen, 0, len(floor))
745. Leetcode solution in CPP
Tags: cpp
Published: 2022-06-18 03:40:02



```
class WordFilter {
 public:
  WordFilter(vector<string>& words) {
    for (int i = 0; i < words.size(); ++i) {
      const string& word = words[i];
      vector<string> prefixes;
      vector<string> suffixes;
      for (int j = 0; j <= word.length(); ++j) {
        const string prefix = word.substr(0, j);
        const string suffix = word.substr(j);
        prefixes.push_back(prefix);
        suffixes.push_back(suffix);
      }
      for (const string& prefix : prefixes)
        for (const string& suffix : suffixes)
          keyToIndex[prefix + '_' + suffix] = i;
    }
  }

  int f(string prefix, string suffix) {
    const string key = prefix + '_' + suffix;
    if (keyToIndex.count(key))
      return keyToIndex[key];
    return -1;
  }

 private:
  unordered_map<string, int> keyToIndex;
};

```
Find Pivot Index
Tags: leetcode, dsa, theabbie
Published: 2022-06-18 03:30:39

Given an array of integers `nums`, calculate the **pivot index** of this array.

The **pivot index** is the index where the sum of all the numbers **strictly** to the left of the index is equal to the sum of all the numbers **strictly** to the index's right.

If the index is on the left edge of the array, then the left sum is `0` because there are no elements to the left. This also applies to the right edge of the array.

Return _the **leftmost pivot index**_. If no such index exists, return -1.

**Example 1:**

**Input:** nums = \[1,7,3,6,5,6\]
**Output:** 3
**Explanation:**
The pivot index is 3.
Left sum = nums\[0\] + nums\[1\] + nums\[2\] = 1 + 7 + 3 = 11
Right sum = nums\[4\] + nums\[5\] = 5 + 6 = 11

**Example 2:**

**Input:** nums = \[1,2,3\]
**Output:** -1
**Explanation:**
There is no index that satisfies the conditions in the problem statement.

**Example 3:**

**Input:** nums = \[2,1,-1\]
**Output:** 0
**Explanation:**
The pivot index is 0.
Left sum = 0 (no elements to the left of index 0)
Right sum = nums\[1\] + nums\[2\] = 1 + -1 = 0

**Constraints:**

*   `1 <= nums.length <= 104`
*   `-1000 <= nums[i] <= 1000`

**Note:** This question is the same as 1991: [https://leetcode.com/problems/find-the-middle-index-in-array/](https://leetcode.com/problems/find-the-middle-index-in-array/)

**SOLUTION:**

    class Solution:
        def pivotIndex(self, nums: List[int]) -> int:
            n = len(nums)
            if n == 1:
                return 0
            total = sum(nums)
            curr = 0
            if curr * 2 == total - nums[0]:
                return 0
            for i in range(n - 1):
                curr += nums[i]
                if curr * 2 == total - nums[i + 1]:
                    return i + 1
            return -1
Bienvenido a mi blog
Tags: firstpost, webdev, tutorial
Published: 2022-06-18 03:21:26

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwubyhn3nif54p90bzhu.jpg)
Hola, bienvenido a mi primera entrada. Aquí trataré de publicar sobre temas relacionados con la programación y el desarrollo web. También me gustaría publicar sobre otros temas de tecnología e informática que me parezcan interesantes.
Espero que mis lectores disfruten de mi contenido y puedan aprender algo nuevo. ¡Gracias por su visita!
Build Array from Permutation
Tags: leetcode, dsa, theabbie
Published: 2022-06-18 03:00:41

Given a **zero-based permutation** `nums` (**0-indexed**), build an array `ans` of the **same length** where `ans[i] = nums[nums[i]]` for each `0 <= i < nums.length` and return it.

A **zero-based permutation** `nums` is an array of **distinct** integers from `0` to `nums.length - 1` (**inclusive**).

**Example 1:**

**Input:** nums = \[0,2,1,5,3,4\]
**Output:** \[0,1,2,4,5,3\]
**Explanation:** The array ans is built as follows: 
ans = \[nums\[nums\[0\]\], nums\[nums\[1\]\], nums\[nums\[2\]\], nums\[nums\[3\]\], nums\[nums\[4\]\], nums\[nums\[5\]\]\]
    = \[nums\[0\], nums\[2\], nums\[1\], nums\[5\], nums\[3\], nums\[4\]\]
    = \[0,1,2,4,5,3\]

**Example 2:**

**Input:** nums = \[5,0,1,2,3,4\]
**Output:** \[4,5,0,1,2,3\]
**Explanation:** The array ans is built as follows:
ans = \[nums\[nums\[0\]\], nums\[nums\[1\]\], nums\[nums\[2\]\], nums\[nums\[3\]\], nums\[nums\[4\]\], nums\[nums\[5\]\]\]
    = \[nums\[5\], nums\[0\], nums\[1\], nums\[2\], nums\[3\], nums\[4\]\]
    = \[4,5,0,1,2,3\]

**Constraints:**

*   `1 <= nums.length <= 1000`
*   `0 <= nums[i] < nums.length`
*   The elements in `nums` are **distinct**.

**Follow-up:** Can you solve it without using an extra space (i.e., `O(1)` memory)?

**SOLUTION:**

    class Solution:
        def buildArray(self, nums: List[int]) -> List[int]:
            return [nums[num] for num in nums]
Translator Voicebot in VRChat 2
Tags: vr, vrchat, ai
Published: 2022-06-18 03:00:02

## What's this?

- Voicebot that implemented speech-to-speech translation in VRChat
  - https://youtu.be/DVAsHKrHV0Q


## System

- ASR, Translation: googletrans
  - https://pypi.org/project/googletrans/
- TTS: gtts
  - https://pypi.org/project/gTTS/

- Sound Pipeline
  - application -> speaker -> dialog.py -> mic -> application
  - Direct loop also exists.. (application -> speaker -> mic -> application)

- (TBD) Release the scripts in GitHub
  - Need to clean the codes and write documents..


## Prerequisites

- Ubuntu 18.04.5 LTS
- Voice chat application (VRChat for example)


## Setup

`
$ sudo apt install portaudio19-dev pavucontrol python-xlib scrot
$ git clone https://github.com/Lunran/sts.git
$ cd sts
$ python3 -m venv venv
$ . venv/bin/activate
$ pip install --upgrade pip
$ pip install -r requirements.txt
`


## Usage

- Run VRChat
  - Open "Settings", "Audio Volume"
    - Mute "UI/Menu", "World" and "Avatars" 
- Run the script
  - refer to "$ python dialog.py -h" for details
Add Two Numbers II
Tags: leetcode, dsa, theabbie
Published: 2022-06-18 02:30:37

You are given two **non-empty** linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.

You may assume the two numbers do not contain any leading zero, except the number 0 itself.

**Example 1:**

![](https://assets.leetcode.com/uploads/2021/04/09/sumii-linked-list.jpg)

**Input:** l1 = \[7,2,4,3\], l2 = \[5,6,4\]
**Output:** \[7,8,0,7\]

**Example 2:**

**Input:** l1 = \[2,4,3\], l2 = \[5,6,4\]
**Output:** \[8,0,7\]

**Example 3:**

**Input:** l1 = \[0\], l2 = \[0\]
**Output:** \[0\]

**Constraints:**

*   The number of nodes in each linked list is in the range `[1, 100]`.
*   `0 <= Node.val <= 9`
*   It is guaranteed that the list represents a number that does not have leading zeros.

**Follow up:** Could you solve it without reversing the input lists?

**SOLUTION:**

    # Definition for singly-linked list.
    # class ListNode:
    #     def __init__(self, val=0, next=None):
    #         self.val = val
    #         self.next = next
    class Solution:
        def add(self, l1, l2, carry = 0):
            if l1 or l2:
                l1val = l1.val if l1 else 0
                l2val = l2.val if l2 else 0
                currval = l1val + l2val + carry
                curr = ListNode(val = currval % 10)
                curr.next = self.add(l1.next if l1 else None, l2.next if l2 else None, carry = currval // 10)
                return curr
            else:
                if carry > 0:
                    return ListNode(val = carry)
                return None
            
        def reverse(self, head):
            curr = head
            prev = None
            while curr:
                nxt = curr.next
                curr.next = prev
                prev = curr
                curr = nxt
            return prev
        
        def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
            l1 = self.reverse(l1)
            l2 = self.reverse(l2)
            return self.reverse(self.add(l1, l2, carry = 0))
Automatic Python Code Format with GitHub Actions
Tags: python, github, ci, formatter
Published: 2022-06-18 02:28:19

This post introduces a method for beautifying Python Code with GitHub Actions. The method utilizes three tools: autopep8, Black, isort. In addition, a Pull Request, which contains formatted codes is created by GitHub Actions.

The YAML file shows the configuration of the automatic code formatter. 

```yaml
name: Format Python Code
on: push
jobs:
  python-code-format:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v4
        with:
          python-version: "3.10"
          architecture: "x64"
      - name: Display Python version
        run: python --version
      - name: Install packages
        run: pip install black autopep8 isort
      - name: Formatter
        run: |
          black .
          autopep8 --recursive --in-place --aggressive --aggressive .
          isort .
      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v3
        with:
          commit-message: Auto code format
          title: Fixes by format action
          body: This is an auto-generated PR with fixes.
          labels: automated pr
          branch: python-code-format-patches
```

The summary of this configuration file is shown as follows:

- Setup Ubuntu 20.04
- Setup Python 3.10
- Install Python packages (black, autopep8, isort) by pip
- Formatting Python Codes
- Create Pull Request

The CI works as follows:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hfe5zwphcaxikb0flk0t.png)
Power of Two
Tags: leetcode, dsa, theabbie
Published: 2022-06-18 02:00:48

Given an integer `n`, return _`true` if it is a power of two. Otherwise, return `false`_.

An integer `n` is a power of two, if there exists an integer `x` such that `n == 2x`.

**Example 1:**

**Input:** n = 1
**Output:** true
**Explanation:** 20 = 1

**Example 2:**

**Input:** n = 16
**Output:** true
**Explanation:** 24 = 16

**Example 3:**

**Input:** n = 3
**Output:** false

**Constraints:**

*   `-231 <= n <= 231 - 1`

**Follow up:** Could you solve it without loops/recursion?**SOLUTION:**

    class Solution:
        def isPowerOfTwo(self, n: int) -> bool:
            if n <= 0:
                return False
            if n == 1:
                return True
            return not (n & 1) and self.isPowerOfTwo(n >> 1)
Pelo direito de ser medíocre
Published: 2022-06-18 01:58:40

> Significado de Medíocre
> adjetivo: De qualidade média, mediana; que não é bom nem mau: obra medíocre. Sem criatividade nem originalidade; banal: projeto medíocre. Característica do que é comum, ordinário, trivial: comentário medíocre.substantivo masculino Algo ou alguém que não tem grande valor intelectual. Quem não é capaz de realizar algo. Pessoa desprovida de talento ou que está abaixo da média. Etimologia (origem da palavra medíocre). Do latim mediocris.

Título chamativo com palavra um pouco forte para dizer que você é mediano não? Pois então, eu gostaria de trazer um desabafo e uma reflexão para vocês que estiverem lendo esse texto, lembrando que não existe verdade absoluta e o meu texto inclusive são só questionamentos atrás de respostas, que podem ser “verdades” ou “mentiras”, mas são só respostas…

Recentemente em um grupo que participo vi um rapaz divulgando necessitar de desenvolvedoras FERAS na tecnologia X para uma vaga remota para Califórnia, e é sobre esse aspecto de ser FERA ou da necessidade da mesma que me pego pensando, na expectativa e na visão de quem eu poderia considerar a desenvolvedora FERA, quais os requisitos que não foram especificados para tal seria considerada FERA? E se a pessoa que for preencher a vaga não for FERA, e se ela for uma pessoa medíocre, ela conseguiria produzir o mesmo efeito de alguém FERA? E como iria saber se sou FERA ou medíocre? Apenas preenchendo a vaga? E se não conseguisse permanecer seria uma FERA medíocre? Quais são as expectativas minhas, suas ou as dos outros quanto o ser FERA ou ser medíocre na atividade?

É bem sabido que vivemos num mercado selvagem, que a lei do mais forte impera, que no mundo nada tem sido justo (e tudo isso na visão de quem?). Na realidade Brasileira do mercado em que estou inserida já vi gente ser contratada porque foi meritocraticamente amigo(a) do(a) dono(a) da empresa fulana. Mas tudo bem, afinal, se esta pessoa era FERA e correspondia as expectativas de quem a contratou, qual seria nossa escolha, né?

A verdade é que a realidade existem pessoas de todos os tipos, e as expectativas que criamos nascem a parte de um contexto NOSSO, é o que NÓS esperamos do outro, e isso quase sempre estará errado, porque avaliamos o mundo com uma perspectiva interna, e a expectativa que criamos a partir disso pode sim ser terrivelmente não correspondida, ou quem sabe muito mais do que correspondida, e até mesmo nos surpreender. Mas para tudo isso acontecer é preciso conhecer? É preciso tempo? É preciso aprender a ver o mundo com outros olhos? É preciso se cobrar mais? É preciso se cobrar menos? É preciso as pessoas terem o direito de serem FERAS? É preciso as pessoas terem o direito de serem medíocres? O que é preciso afinal?



Originalmente postado em Medium: Pelo direito de ser medíocre