teleren/devto huggingface dataset:
codewars: Even Fibonacci Sum
Published: 2022-12-15 03:12:53

This kata I used a pattern common in fibonacci even numbers. In fibonacci series, every number is a factor of some Fibonacci number.
<table border="1" cellspacing="0" cellpadding="5" class="collapse">
<tbody><tr style="font-size:smaller;color:blue"><td> </td><th>i</th><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td><td>11</td><td>12</td><td>...</td></tr>
<tr class="blue"><td> </td><th>Fib(i)</th><td>2</td><td>3</td><td>5</td><td>8</td><td>13</td><td>21</td><td>34</td><td>55</td><td>89</td><td>144</td><td>...</td></tr>
<tr><td rowspan="5">F<br>a<br>c<br>t<br>o<br>r<br>s</td><th>2=Fib(3)</th><td>:heavy_check_mark:</td><td>❌</td><td>❌</td><td>:heavy_check_mark:</td><td>❌</td><td>❌</td><td>:heavy_check_mark:</td><td>❌</td><td>❌</td><td>:heavy_check_mark:</td><td>Every 3<sup>rd</sup> Fib number</td></tr>
<tr><th>3=Fib(4)</th><td>❌</td><td>:heavy_check_mark:</td><td>❌</td><td>❌</td><td>❌</td><td>:heavy_check_mark:</td><td>❌</td><td>❌</td><td>❌</td><td>:heavy_check_mark:</td><td>Every 4<sup>th</sup> Fib number</td></tr>
<tr><th>5=Fib(5)</th><td>❌</td><td>❌</td><td>:heavy_check_mark:</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td><td>:heavy_check_mark:</td><td>❌</td><td>❌</td><td>Every 5<sup>th</sup> Fib number</td></tr>
<tr><th>8=Fib(6)</th><td>❌</td><td>❌</td><td>❌</td><td>:heavy_check_mark:</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td><td>:heavy_check_mark:</td><td>Every 6<sup>th</sup> Fib number</td></tr>
<tr><th>F(k)</th><td colspan="10">...</td><td> F(all multiples of k) </td></tr>
</tbody></table>

As you can see every **third** number is a multiple of **two**. So the approach we are going to use is to find fibonacci of multiples of **three**.

```js
/** num is the number we are going to use to find
    n-th fibonacci. this time we are going to be 
    finding fibonacci of multiples of 3. sum holds
    the sum of all even numbers. prev is holding
    the value from fibonacci calculation 
**/
function solution(max) {
  let num = 3;
  let sum = 0;
  let prev = fibo(num);
  while(prev < max) {
     sum += prev;
     num += 3;
     prev = fibo(num);
  }
  return sum;
}
/* Here I used memoized fibonacci algorithm to reduce time
   and improve efficiency of our algorithm */
function fibo(n, memo={}) {
  if (n < 2) return n;
  if(memo[n]) return memo[n];
  memo[n] = fibo(n - 1, memo) + fibo(n - 2, memo);
  return memo[n];
}
```
Feeling Unimportant and undervalued at work?
Tags: productivity, career, discuss
Published: 2022-12-15 02:30:41

Recently I came to know, someone in my network feeling the same way.

It can be your deception that you're unimportant and undervalued at work. I would recommend you speak with your boss, communication makes it clear. There could be miscommunication or misunderstanding.

If you feel unimportant and undervalued at work, It's time to step up and take an action.

It's essential that everyone takes steps to ensure they're equipped with the right skill set and knowledge to secure a better job. There is always an option for better. Spend some time to make your skills better.

While it can be difficult to break free from an existing unfulfilling role, there are some things you can do to empower yourself and create more options. Firstly, make sure you have an up-to-date CV with experience and any qualifications which may help open doors for new roles.

Secondly, network - attend events or join online groups related to your industry as this can be great for connecting with potential employers and like-minded people. Check out meetup groups in your local area. There are a lot of networking events happening in Sydney.

Thirdly, if possible try to broaden your skill set by taking courses or volunteering - this will give you more chances at finding something worthwhile when looking for work. This will give you a kind of satisfaction and you will enjoy what you love,

Finally, don't forget about the importance of self-care, Nothing is more important than you. You are the one that's important, You're the one that matter,

It's important to recognize when something isn't working out and take action before burnout sets in! Stay informed about your rights as an employee – know labour laws in your state/country, we have FairWork in Australia – so that you can ensure that you’re not being taken advantage of at work.

Speak up if something isn’t right; getting help from your friends or taking legal action if necessary can provide some much-needed relief from oppressive conditions in the workplace.

And remember to do some research about the company before joining. Most of the time you can see reviews about your current/future companies at Indeed.com or other job search sites.

I would appreciate it if you could share your thoughts in the comments.

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

[Read Full here](https://www.linkedin.com/posts/dharbendra_work-people-communication-activity-7008931969346527232-n47c)
empathy in these times
Published: 2023-01-21 04:09:05

---
title: empathy in these times
published: true
date: 2022-12-11 06:58:41 UTC
tags: 
canonical_url: https://write.as/kelvintaywl/empathy-in-these-times?pk_campaign=rss-feed
---

![I am here in Taipei for 2 weeks](https://i.snap.as/rCw2b3D6.jpeg)

I survived a [17% reduction (layoff) at CircleCI last week](https://circleci.com/blog/ceo-jim-rose-email-to-circleci-employees/). As soon as the CEO letter was published, many recruiters reached out.

I can understand that. However, one email irked me bad, that I had to respond in curt.

Without naming the company and the actual person, here is the snippet in raw form:

> We learned about the CircleCI lay-offs on Linkedin via your post and [redacted]'s post. It looks like you are not affected, which is great news, but with such incident striking instability for a previously believed to be COVID-proof and recession-proof business, would it have spiked some of your interests to hear out available jobs in the market?
> 
> So feel free to refer us [redacted], any other colleague you may know in CircleCI affected by the lay-offs, or anyone in Japan open for a job change in Software Engineering.

In these times, we see many tech companies reducing their workforce. These are sudden events for people affected; No one wants to be in such positions. As a recruiter, _please please_ **please** give your words some more thought before pressing “send”.

If your team is looking for amazing engineers and people in Japan and beyond, please check out this link of our CircleCI alumni:[https://docs.google.com/spreadsheets/u/0/d/1A\_1uk6qP\_a0C2bwKcvV7G-meypWCgW-giK9O2UG8p\_k/htmlview](https://docs.google.com/spreadsheets/u/0/d/1A_1uk6qP_a0C2bwKcvV7G-meypWCgW-giK9O2UG8p_k/htmlview)

[buy Kelvin a cup of coffee](https://www.buymeacoffee.com/kelvintaywl) ☕
SPVM::Sys 0.31 is released
Tags: perl, spvm, beginners, programming
Published: 2022-12-15 01:56:01

<a href="https://metacpan.org/pod/SPVM::Sys">SPVM::Sys</a> 0.31 is released.

## New Features and Enhancement

<a href="https://github.com/yuki-kimoto/SPVM-Sys/blob/master/Changes">Changes</a>

```
0.31 2022-12-15
  [Build Process Improvement]
    * Added --meta option to Makefile.PL
  [Build Process Bug Fix]
    * Fixed the SPVM module dependency in Makefile.PL
      [Before]
      PREREQ_PM => {
        'SPVM'              => '0.9665',
      },
      [After]
      CONFIGURE_REQUIRES => {
        'SPVM'              => '0.9665',
      },
  [Test Improvement]
    * Improve the workflow of Github Actions.
```

## For Programming Beginners

SPVM::Sys is a SPVM module to use system calls such as File I/O, Socket, and User Manipulation.

SPVM is a static-typed programming language that can be installed from Perl/CPAN.
Com CSS tudo fica mais elegante!
Published: 2022-12-15 01:19:49

O CSS é uma linguagem de estilo que é usada para dar aparência a páginas da web. É a sigla para **_Cascading Style Sheets_**, que em português significa Folhas de Estilo em Cascata.

CSS é usado em conjunto com o HTML para criar páginas da web atraentes e bem estruturadas. Ele é responsável por definir o layout, o estilo de fonte, as cores e outros aspectos visuais de uma página da web.

Um documento CSS é composto por regras que especificam como um elemento HTML deve ser exibido. Cada regra é composta por um seletor, que identifica o elemento HTML alvo, e um conjunto de declarações, que especificam as propriedades e os valores que devem ser aplicados ao elemento.

**Veja um exemplo de um documento CSS simples:**



```
h1 {
  font-size: 24px;
  color: blue;
  text-align: center;
}

p {
  font-size: 16px;
  color: black;
  text-align: justify;
}
```
Neste exemplo, as regras definem as propriedades de fonte para os elementos `<h1>` e `<p>`. A primeira regra especifica que os títulos `<h1>` devem ser exibidos em azul, com tamanho de fonte de **24 pixels** e alinhados no centro. A segunda regra especifica que os parágrafos `<p>` devem ser exibidos em preto, com tamanho de fonte de 16 pixels e justificados.

O CSS é uma linguagem poderosa que permite criar layouts complexos e aplicar estilos sofisticados às páginas da web. Ele também permite a reutilização de estilos em várias páginas, o que facilita a manutenção de sites grandes.

Esperamos que este artigo básico sobre CSS tenha esclarecido um pouco sobre esta importante linguagem de estilo. Aprender CSS é um passo importante para criar páginas da web atraentes e bem estruturadas.
Descomplicando o HTML
Tags: html, frontend, webdev, iniciante
Published: 2022-12-15 01:07:12

O HTML é uma linguagem de marcação que é usada para criar páginas da web. É a sigla para Hypertext Markup Language, que em português significa Linguagem de Marcação de Hipertexto.

HTML é um dos principais pilares do desenvolvimento web, junto com o CSS e JavaScript. Ele é responsável por estruturar o conteúdo de uma página da web, como texto, imagens, vídeos e outros elementos.

Um documento HTML é composto por elementos, que são marcados por tags. Por exemplo, a tag `<p>` é usada para marcar um parágrafo, enquanto a tag `<img>` é usada para inserir uma imagem.

A estrutura básica de um documento HTML é composta por uma tag `<html>` que inclui dois elementos principais: o `<head>`, que contém informações sobre o documento, e o `<body>`, que contém o conteúdo que será exibido na página.

Veja um exemplo de um documento HTML simples:


**```
<!DOCTYPE html>
<html>
  <head>
    <title>Título da página</title>
  </head>
  <body>
    <h1>Título principal</h1>
    <p>Este é um parágrafo.</p>
    <img src="imagem.jpg" alt="Descrição da imagem">
  </body>
</html>
```**

O HTML é uma linguagem fácil de aprender, mas pode ser usada para criar páginas da web complexas com muitos recursos interativos. É importante ressaltar que o HTML sozinho não é suficiente para criar páginas da web bonitas e bem estruturadas. Ele deve ser combinado com o CSS e o JavaScript para dar mais estilo e funcionalidade às páginas.

Esperamos que este artigo básico sobre HTML tenha esclarecido um pouco sobre esta importante linguagem de marcação. Aprender HTML é o primeiro passo para entrar no mundo do desenvolvimento web e criar páginas da web incríveis.
Criando um bloqueador de IP com python
Tags: braziliandevs, beginners, security, python
Published: 2022-12-15 01:06:50

Várias vezes já me questionei de como dar um Block em um IP específico, com isso tive a ideia de criar um bloqueador de IP.

Para criar um bloqueador de IP com Python, você pode utilizar a biblioteca `iptables`, que fornece acesso ao utilitário de linha de comando `iptables` do Linux. O primeiro passo é instalar a biblioteca iptables com o seguinte comando:

```python
pip install iptables

```
Em seguida, você pode criar um script Python que leia um arquivo de texto com uma lista de IPs que devem ser bloqueados e adicione regras no firewall para bloquear esses IPs. O código para fazer isso pode ser o seguinte:

```python
import iptables

# lê o arquivo de texto com a lista de IPs
with open('ips_bloqueados.txt') as f:
    ips = f.readlines()

# adiciona uma regra no firewall para cada IP na lista
for ip in ips:
    iptables.append('INPUT', '-s', ip, '-j', 'DROP')

```
Lembre-se de que essa solução funcionará apenas em sistemas Linux que utilizem o utilitário `iptables`. Em outros sistemas operacionais ou com firewalls diferentes, pode ser necessário utilizar outras soluções.
Introducing the mirror command in ReductStore CLI version 0.3.0
Tags: news, database, tutorial, reductstorage
Published: 2022-12-15 00:53:22

We are excited to announce the release of [Reduct CLI](https://github.com/reductstore/reduct-cli/) version 0.3.0, which includes the new `mirror` command for copying data between buckets. This command allows you to easily transfer data between two buckets, regardless of whether they are on the same storage engine or on different storage engines.

To use the mirror command, simply specify the source and destination buckets as follows:

```
rcli alias add server-1
rcli alias add server-2
rcli mirror server-1/bucket server-2/bucket
```

You can also specify a time interval for mirroring data using the `--start` and `--stop` flags. For example:

```
rcli  mirror --start 2022-11-06T20:10:30 --stop 2022-11-06T20:14:30  server-1/bucket server-2/bucket
```

This will only copy data from the source bucket that was created or modified within the specified time interval. This can be useful if you only want to transfer a specific subset of data from the source bucket.

We hope you find the new `mirror` command to be helpful. Please let us know if you have any feedback or suggestions for future releases.
How to fix "Name source files using `lowercase_with_underscores`" error in Flutter
Tags: flutter
Published: 2022-12-15 00:18:22


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


If you are here is because you have the `Name source files using lowercase_with_underscores` error in Flutter. How to solve it? 

Easy. Click on the [link](https://dart-lang.github.io/linter/lints/file_names.html) you see in the error. That page tells that names like `SliderMenu.dart`, `filesystem.dart` or `file-system.dart` are bad. You should be using underscores, like `slider_menu.dart` or `file_system.dart`. 

Once you change the name of the file, Flutter will be happy.
Adding a Pull Request Template to Your GitHub Repo
Tags: github, git, pullrequest
Published: 2023-09-09 01:18:27

---
title: Adding a Pull Request Template to Your GitHub Repo
description: How to pre-fill the blank description with helpful prompts.
published: true
date: 2022-12-15 00:00:00 UTC
tags: GitHub, git, pullrequest
canonical_url: https://michaeluloth.com/github-repo-pr-template/
cover_image: https://res.cloudinary.com/ooloth/image/upload/c_scale,w_2160,f_auto,q_auto/v1671128799/mu/blank-page.jpg
---

If you spend time wondering what to write in the blank “Description” field every time you open a pull request, adding a PR template to your repo will speed you up.

By pre-filling that “Description” field with a few quick prompts to answer, you’ll always know what to write and your reviewers will always get the info they need.

## How to add a PR template

1. Create a folder called `.github` at the root of your repo
2. Create a file called `.github/pull_request_template.md`
3. Use [GitHub’s Markdown syntax](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) to add any prompts you think will be useful to that file

That’s it! Each time you open a pull request, the description section will now be pre-filled with your template.

## What to include in your template?

Feel free to add any prompts you like! I prefer to keep it simple:

```
## ✅ What

<!-- A brief description of the changes in this PR. -->

## 🤔 Why

<!-- A brief description of the reason for these changes. -->

## 👩‍🔬 How to validate

<!-- Step-by-step instructions for how reviewers can verify these changes work as expected. -->

## 🔖 Related links

- [Jira task](<!-- link -->)
- [Slack thread](<!-- link -->)
```

(The comments are only visible while editing.)

## Don’t overdo it

Whatever you do, don’t make your PR template too long. If you notice your team generally skips certain prompts, don’t hesitate to remove them.

Only include prompts that actually save everyone time. If your reviewers consistently ask which ticket your PRs relate to, adding a ticket link prompt to the template is probably a good idea. But adding 50 well-intentioned checkboxes will only cause your team to skip the template entirely.

So, keep it short. 😊

## Further reading

- [Creating a pull request template for your repository](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository) • GitHub Docs
- [GitHub Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) • Adam Pritchard
- [Writing on GitHub](https://docs.github.com/en/get-started/writing-on-github) • Github Docs
- [Create a GitHub PR Template](https://egghead.io/lessons/github-create-a-github-pr-template) • egghead.io
Criando um CRUD simples com FastAPI
Tags: braziliandevs, python, beginners, tutorial
Published: 2022-12-14 23:57:38

Depois de muito tempo resolvi me aventurar criando uma API com FastAPI.

Bom, para criar um CRUD (sigla para Create, Read, Update e Delete, que são as operações básicas de um sistema de gerenciamento de banco de dados) com o FastAPI, você precisará seguir os seguintes passos:

1. Instale o FastAPI e as dependências necessárias utilizando o seguinte comando:

```python
pip install fastapi
pip install uvicorn
pip install sqlalchemy
pip install databases

```

2. Crie um arquivo main.py e adicione o seguinte código:

```python
from fastapi import FastAPI
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from databases import Database

# cria uma conexão com o banco de dados
engine = create_engine('sqlite:///banco_de_dados.db')

# define o objeto base
Base = declarative_base()

# define a classe que representa a tabela
class Tabela(Base):
    __tablename__ = 'tabela'

    id = Column(Integer, primary_key=True)
    nome = Column(String)
    idade = Column(Integer)

# inicializa o FastAPI
app = FastAPI()

# cria a tabela no banco de dados
Base.metadata.create_all(engine)

# cria uma sessão com o banco de dados
Session = sessionmaker(bind=engine)

# cria uma instância do banco de dados
db = Database(engine)

```

3. Adicione os endpoints para as operações CRUD da seguinte maneira:

```python
# endpoint para criar um novo registro
@app.post('/tabela')
async def criar_registro(nome: str, idade: int, session: Session = Depends(get_db)):
    registro = Tabela(nome=nome, idade=idade)
    session.add(registro)
    session.commit()

# endpoint para ler os registros da tabela
@app.get('/tabela')
async def ler_registros(session: Session = Depends(get_db)):
    resultado = session.query(Tabela).all()
    return resultado

# endpoint para atualizar um registro
@app.put('/tabela/{id}')
async def atualizar_registro(id: int, nome: str, idade: int, session: Session = Depends(get_db)):
    registro = session.query(Tabela).get(id)
    registro.nome = nome
    registro.idade

```

Com isso temos uma pequeno exemplo de como é feita uma API em FastAPI.

Com essa tecnologia podemos criar muitas coisas.

:)
Is Chat GPT going to take over our jobs ?
Published: 2022-12-14 23:47:11

Hey Guys,

Just sharing that the #2: December edition post for My Techy bites newsletter is out. It contains:

- Design tokens
- ChatGPT demo and thoughts
- Hooked, the book that shows how to build habit forming products
- Playwright - End to End testing took from Microsoft

Here's a link to the post{% embed https://sachitm.substack.com/p/3-december-edition %}

Like, share and subscribe to the newsletter if you like it.

Thanks
😢Top 3 mistakes to avoid when starting a NEW blog
Tags: webdev, beginners, career, discuss
Published: 2022-12-14 23:40:35

**Mistake #1:** Going solo

Blogging is NOT a one-man job.  
  
You can NOT succeed if you’re the ONLY one working on your blog.  
  
Blogging requires a lot of tasks, such as;

*   **Topic research**
    
*   **Content creation**
    
*   **Blog post editing and optimization**
    
*   **Email marketing**
    
*   **Networking with other bloggers regularly**
    
*   **Finding the proper monetization strategies**
    
*   **Regularly analyzing your website’s SEO and your competitors**
    
*   **And the list goes on**
    

  
`You can’t do ALL these tasks alone.`  
  
It’s OKAY to work hard for the first year (when you’ve no budget to outsource blogging tasks). But once your blog starts generating income, invest all the money back into growing your blog (not on buying your favorite smartphone, bike, car, etc.).  
  
**Mistake #2:** Not being consistent  
  
Are they still blogging? Not even 1% of them!  
  
To succeed in blogging, you must be consistent with your posting schedule. Consistency is key when it comes to running a successful blog.  
  
By regularly publishing new content, you can build a loyal audience and establish your blog as a go-to source for information in your niche.  
  
**Mistake #3:** Ignoring SEO  
  
Search engine optimization (SEO) is the *#1* factor in running a successful blog.

  
`SEO traffic converts BETTER.`  
  
Here are some key things to consider when it comes to SEO;  
  

*   Use keywords strategically in your blog post titles, headings, and throughout the content of your post.
    
*   Creating 10x better content than your competitors
    
*   Optimizing your images using descriptive file names and alt tags. You can also use a free plugin like Rank Math.
    
*   Building backlinks through guest posts, blog comments, Quora answers, etc.
    
*   Regularly update your blog posts. It's essential to keep your blog up-to-date and free of broken links and outdated information to provide a top-notch experience for your readers.
    
 
By learning from these mistakes and avoiding them, you can build a blog that earns thousands of dollars every month.  
  
  
To your success.
SvelteKit 1.0 Has Been Released! 🥳
Tags: svelte, sveltekit, javascript
Published: 2022-12-14 22:55:18

After two years in development, [SvelteKit](https://kit.svelte.dev/) has finally reached 1.0. As of today, it’s the recommended way to build Svelte apps of all shapes and sizes.

Read the full announcement [here](https://svelte.dev/blog/announcing-sveltekit-1.0)

{% youtube N4BRVkQVoMc %}
Day 663 : Back To Basics
Tags: hiphop, code, coding, lifelongdev
Published: 2022-12-14 22:46:35

_liner notes_:
- Professional : Today the team had a retrospective and talked about things. Really good catching up with everyone. Spent the rest of the day working on Web Components.

- Personal : Last night, I went through some tracks for the radio show. Looked into some of the work I previously did on a side project. Also watched the latest "Chainsaw Man" and went to bed.

![Overhead view looking down into the top of a lot of trees in Puerto Rico](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ub14tf1ik0hpqvsgirv8.jpg)

Going to go through some more tracks for the radio show. Svelte Kit v1 just got released today. I'll be checking it out  also and take it back to basics when I first tried it out when it was called Sapper. I just looked and there's a new episode of "Mob Psycho III". Going to watch that before bed.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube aJaKVwgbo2g %}