teleren/devto huggingface dataset:
Introduction to Elixir
Tags: elixir, introduction, newbie, beginners
Published: 2023-04-01 19:22:39

## What is Elixir?
Elixir is a dynamic, functional programming language that is designed for building scalable and fault-tolerant applications.
It runs on the Erlang virtual machine, which provides powerful concurrency and distribution capabilities.

## Why Elixir?
Elixir is a great choice for building applications that require high concurrency and fault tolerance, such as web applications, distributed systems, and real-time communication systems.


It is also designed to be easy to learn and use, with a simple and intuitive syntax that makes it accessible to developers of all skill levels.

## Key features of Elixir
Elixir has a number of key features that make it a popular choice for developers, including:

Immutability: Elixir values are immutable by default, which helps to prevent bugs and makes it easier to reason about your code.

Pattern matching: Elixir uses pattern matching extensively, which allows you to write concise and expressive code.

Macros: Elixir has a powerful macro system that allows you to write code that generates other code, making it easy to create reusable abstractions.

Concurrency and Parallelism: Elixir provides built-in support for concurrency and parallelism through its lightweight processes, which are similar to threads but have much lower memory overhead. This makes it easy to write code that can handle multiple tasks simultaneously.

## Getting started with Elixir
To get started with Elixir, you will need to [install](https://dev.to/calbertora/installing-elixir-2ga8) the Elixir compiler and set up your development environment.

Once you have done that, you can start exploring the language by writing simple programs, using online resources and tutorials to guide you.

---

Thanks for reading! My goal is to make Elixir accessible and easy to understand for everyone. If you have any questions or feedback, please don't hesitate to reach out. And be sure to check back regularly for more articles on https://dev.to/calbertora, as I strive to make each post as clear and readable as possible.
We Are Moving to Rust
Tags: news, rust, cpp, reductstore
Published: 2023-04-01 19:21:44

Initially, I chose to use C++ for the early editions of [ReductStore](https://www.reduct.store) because of my experience with the language. This allowed me to quickly create a functional time series database for binary data. However, as our platform expanded to include Windows and MacOS, I found myself struggling to manage the C++ infrastructure as the codebase grew. This made it
difficult for me to focus on enhancing the product's functionality and unique features, as I had to ensure compatibility across multiple platforms while managing numerous dependencies.

<!--more-->

## Benefits of using Rust for our project

After considering several options, we have decided to move our code base to Rust. Rust is a modern and efficient systems programming language that offers many advantages over C++. Its memory safety features ensure that programs are free of null pointer dereferences, buffer overflows, and other common security vulnerabilities. In addition, Rust's package manager (Cargo) simplifies dependency management and facilitates cross-platform application development. With its focus on performance and reliability, we believe that Rust will enable us to build a more stable and scalable product while reducing the risk of runtime errors.

## Migration plan

Rather than rewrite the entire code base at once, we decided to take a module-by-module approach to our migration process. Our strategy is to combine C++ and Rust using the efficient cxx.rs library. We will perform rigorous testing at every step of the way to ensure a seamless transition. At this time, building for Windows and MacOS has been disabled,
as it is not practical to invest time in outdated infrastructure. Once the migration is complete, we plan to cross compile with Rust for enhanced functionality.
Vue Third Party Modules
Tags: notification, billing, reporting, mfa
Published: 2023-04-01 19:09:49

Hi All,
Looking for feedback from the community. We are building a SAAS application and looking for third party modules that we can integrate with our solution, preferably free, easy to upgrade and customize.
1. User Notification (Send notification, based on rules set by the users)
2. Billing (Monthly Billing, Subscription, rate, taxes, totals etc. convert to pdf would be good)
3. Reporting/Data/Analytics (Create, tabular, graph, chart type reports)
4. MFA (Multifactor Authentication) using codes via text or email.
Thank you for your feedback,
AJ
OSDC-2023-assignment4
Tags: osdc, git, github
Published: 2023-04-01 18:45:24

---
title: OSDC-2023-assignment4
published: true
description: 
tags: osdc, git, github
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-04-01 17:43 +0000
---

##Quick review of the lecture at the course [OSDC](https://osdc.code-maven.com/)
We get familiar with the [PyDigger](https://pydigger.com/) website, and learned about the different metadata which is important to have in the details of the various projects, for example, license, author name, a summary of the project, and so on.
We looked at pypi page of [numpy](https://pypi.org/project/numpy/) 
We found that the [mrflagly](https://pydigger.com/pypi/mrflagly) project was missing the author field from the meta-data, so we sent PR, and learn about [pyproject.toml](https://python-poetry.org/docs/pyproject/)
@szabgab  mentioned the recommended books listed at the bottom of the [OSDC](https://osdc.code-maven.com/)  main page. Especially [Uncurled by Daniel Stenberg, author of curl](https://un.curl.dev/).

###Assignment###
Our assignment was to Find 5 projects via [PyDigger](https://pydigger.com/) that have no author, not license, or no VCS. Add the missing information and send a PR.
And in this way contribute to the projects

I hope to contribute to the following projects:

[vortexpy](https://github.com/Synerty/vortexpy/pull/1)
[stormlock](https://github.com/tmccombs/stormlock/pull/1)
[unformat](https://github.com/hanjinliu/unformat/pull/1)
[MathTranslate](https://github.com/SUSYUSTC/MathTranslate/pull/24)
[crypt-dir](https://github.com/khanh101/crypt-dir/pull/1)
[frontend](https://github.com/hacs/frontend/pull/645)

By Added licenses to the metadata file (i.e. pyproject.toml, setup.py  to appear in the website pypi.org
How to Change Hostname on Ubuntu 22.04
Tags: linux, ubuntu, tutorial, devops
Published: 2023-04-01 18:40:42


## What is a hostname?

A hostname is a label or name that is assigned to a device on a computer network. It is used to identify and locate the device in the network. Hostnames are typically human-readable names that correspond to an IP address, which is a numerical label that identifies a device's location on the network. Hostnames are commonly used in internet addresses, email addresses, and other network-related applications. In a local network, a hostname may be used to identify a computer or server within the network.

Changing the hostname on Ubuntu 22.04 is a simple process that can be completed in a few steps. The hostname is the name of the computer that is used to identify it on the network. This guide will provide step-by-step instructions on how to change the hostname on an Ubuntu 22.04 system.

### Prerequisites

-   Access to the command line / terminal window
-   Root privileges

### Step 1: Check the Current Hostname

Before you can change the hostname, it is important to know the current hostname of the system. To view the current hostname, open a terminal window and type the following command:

```bash
hostname
```

The output will display the current hostname of the system.

### Step 2: Change the Hostname

Now that you know the current hostname of the system, you can change it to the desired hostname. To do so, open a terminal window and type the following command, replacing  `newhostname` with your desired hostname:

```bash
hostname newhostname
```

### Step 3: Update the Hosts File

Next, you need to update the  `/etc/hosts`  file. This file contains a list of hostnames and IP addresses that are used to identify the system on the network. To open the file, type the following command:

```bash
sudo nano /etc/hosts
```

Update the  `127.0.0.1`  line to use the new hostname. For example, if your new hostname is  `myhost`, the line should look like this:

```bash
127.0.0.1 myhost
```

Save and close the file when you are done.

**Read This:** [Execute Bash Script Directly From a URL on Linux](https://techvblogs.com/blog/execute-bash-script-directly-from-url)

### Step 4: Reboot the System

Finally, you need to reboot the system for the changes to take effect. To do so, type the following command:

```bash
sudo reboot
```

After the system has rebooted, open a terminal window and type the following command:

```bash
hostname
```

The output will display the new hostname of the system.

### Conclusion

In this guide, you learned how to change the hostname on an Ubuntu 22.04 system. You first checked the current hostname, then changed the hostname, updated the hosts file, and rebooted the system. With these steps, you can easily change the hostname on an Ubuntu 22.04 system.
27 berufliches Vorwärtskommen: Ein gerader Berufsweg – Ende gut, alles gut.
Tags: deutsch, career, austausch, 1min
Published: 2023-04-01 18:23:00

Moin Moin,

nachdem du einen [guten Karrierestart hingelegt→](https://dev.to/amustafa16421/22-berufliches-vorwartskommen-ein-gerader-berufsweg-der-anfang-552f) hast, möchte ich dich dazu ermutigen ein [gutes Ende vorzubereiten→](https://dev.to/amustafa16421/25-berufliches-vorwartskommen-ein-gerader-berufsweg-das-ende-2n37).

Ein _unschönes_ Ende kann sich dadurch auszeichnen, dass man Entscheidungen bereut – zum Beispiel folgende drei:
- Zu viel Zeit mit Arbeiten verbracht zu haben
- Zu geringe Risiko-Bereitschaft an den Tag gelegt zu haben
- Zu wenig Glückseligkeit und Genuss im Leben gehabt zu haben

( Quelle: [PsychologieTV↗](https://youtu.be/B2SepffT2Yg?t=78), Video sollte beim Zeitpunkt 01:18 starten. Dauer ab Einstiegspunkt ungf. 2 Minuten )

Wie stark würdest du die einzelnen Punkte bereuen?
Wie sähe eine 5-Sternebewertung bei dir aus, in der fünf Sterne den höchsten Grad an Reue ausdrücken?


Beste Grüße,
Mustafa
Use ChatGPT locally!
Tags: chatgpt, openai, opensource, ai
Published: 2023-04-01 17:55:05


If you ever want a local chatgpt like a chatbot that is not affected by the capacity problem that the chatgpt has or you want to ask him something that he is unwilling to answer, you need to hire about this.


![Chat Example](https://github.com/ido-pluto/catai/raw/main/demo/chat.gif)

There is an open source project called [CatAI](https://github.com/ido-pluto/catai), it uses the open source model of meta called llama to create a local AI assistant with cool chat UI.

It can answer everything without a second thought.

## Usage

It is very simple, first let's install the model:

```bash
npm i -g catai
```

Then we choose the model to download, for this example let's install the 7B model.

```bash
catai install 7B
```

Then let's start using it with the simple command:
```bash
catai serve
```

Good luck!
A Beginner's Guide to React Redux Toolkit: Simplify Your State Management
Tags: react, redux, webdev, javascript
Published: 2023-04-01 17:43:43

React Redux Toolkit is a popular library that can help you simplify your state management in React applications. In this post, we'll explore what React Redux Toolkit is, why you might want to use it.

What is React Redux Toolkit?

React Redux Toolkit is a set of utilities and helpers that can help you write Redux logic in a simpler and more efficient way. It provides a standardized way to define reducers, actions, and selectors, and includes a powerful toolset for creating and managing slices of state.

Why use React Redux Toolkit?

There are several benefits to using React Redux Toolkit:

It simplifies your code: With React Redux Toolkit, you can write cleaner and more concise code, reducing boilerplate and making your code more maintainable.

It provides a standard structure: React Redux Toolkit provides a standard structure for your Redux logic, making it easier to organize and understand your code.

It includes powerful tools: React Redux Toolkit includes a set of powerful tools, such as createSlice and createAsyncThunk, that can help you create and manage slices of state.

React Redux Toolkit can help you simplify your state management in React applications. By providing a standard structure and powerful tools, it can help you write cleaner, more maintainable code. Give it a try in your next React project and see how it can improve your development experience!
An Open Letter to JavaScript
Tags: webdev, javascript, programming
Published: 2023-04-01 17:09:21

Dear JavaScript,

I hope this letter finds you in good health and spirits. I'm writing to you to express my mixed feelings about our relationship.

You see, JavaScript, you are a very powerful and versatile language. You can run on any browser, on any device, on any platform. You can do amazing things with the web, with data, with graphics, with games, with AI, and more. You have a huge and vibrant community of developers who love you and create awesome libraries and frameworks for you.

But JavaScript, you also have some quirks that make me scratch my head and wonder what you were thinking. You have a weird type system that sometimes makes no sense. You have a confusing syntax that sometimes makes me write bugs. You have a strange scoping and hoisting mechanism that sometimes makes me lose track of variables. You have a quirky coercion and equality system that sometimes makes me question your logic. You have a callback hell and a promise hell that sometimes make me want to scream.

JavaScript, you are a language of paradoxes. You are simple yet complex, elegant yet messy, expressive yet cryptic, flexible yet rigid, forgiving yet unforgiving. You are a language that I love and hate at the same time.

So JavaScript, I guess what I'm trying to say is that I appreciate you for what you are, but I also wish you could be better. I hope you don't take this letter the wrong way. I'm not trying to break up with you or anything. I just want to share my honest feelings with you.

Please don't change too much or too fast. Please don't break my code or my heart. Please don't make me regret choosing you or staying with you.

Please just be yourself, JavaScript. The good, the bad, and the ugly.

Sincerely,

Your faithful (but frustrated) developer

---

**_NOTE:_** If you found this helpful. Like and share. Thanks, Happy Learning!

### Let's connect 💜

You can follow me on [Twitter](https://twitter.com/MrDanishSaleem), [Instagram](https://www.instagram.com/mrdanishsaleem/), [LinkedIn](https://www.linkedin.com/in/mrdanishsaleem/) & [GitHub](https://github.com/mrdanishsaleem/)

### Support Me

If you like this post. Kindly support me by [Buying Me a Coffee](https://www.buymeacoffee.com/mrdanishsaleem)
Deploying FastAPI app on Vercel Serverless
Tags: python, serverless, fastapi, webdev
Published: 2023-04-01 16:52:26


There are good chances that I don’t explain what is vercel if you’re a javascript developer but for python folks out there, vercel is a cloud computing platform focused on serverless hosting solutions for web applications. It’s especially popular among developers using frontend frameworks like Next.js, Nuxt.js, and SvelteKit.

This article aims to act as a quick guide if you want to deploy a FastAPI application serverless leveraging python runtime. Moreover, vercel is free so 🤞.

Primarily, you need these three files set up in your application.

*   **_requirements.txt:_** This file will have all your dependencies. Run:  
    `pip freeze > requirements.txt` in your dev environment to get this file.
*   **_vercel.json:_** This file contains information for vercel to set up your runtime when deploying.
*   **_main.py:_** This python file can be named differently but it should contain the FastAPI app.

```
# main.py  
from fastapi import FastAPI  
  
app = FastAPI() # This is what will be refrenced in config
```

Assuming the given file structure:

```
root_dir  
        - main.py  
        - requirements.txt  
        - vercel.json
```

add this in `vercel.json`

```
{
  "builds": [
    {
      "src": "main.py",
      "use": "@vercel/python"
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "main.py"
    }
  ]
}
```

If your application structure is different, change `build.src` and `routes.dest`to point to the python file containing the root application `app.`  
After your app is ready, push the source code to GitHub for seamless automatic future deployments with vercel.

Visit [vercel](https://vercel.com) and create an account if you don’t already have one.  
Create a new application and connect it to the appropriate GitHub repo.  
Additionally in the environment variable section, you might need to configure the port. Copy and paste `PORT=8000` in the key field. If you have other environment variables that your application expects like database config, feel free to add those here too.

Hit deploy and in moments, your API is up and running.

**Demo Application**
====================

[https://vercel-fastapi-deployment.vercel.app](https://vercel-fastapi-deployment.vercel.app/)

Source Code
===========

[https://github.com/mabdullahadeel/vercel-fastapi-deployment](https://github.com/mabdullahadeel/vercel-fastapi-deployment)

Until next time 👋.
Connect Dodaddy Domain to EC2 server
Published: 2023-04-01 16:20:49


1. Go to **Route 53 service**

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

2. Add Domain Name in Hosted Zone
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pbiqqi4bcn9l4leri5cr.png)

3. This Record List we have to add in Godaddy or any other Domain Provider
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xroz0qfjkrnplinuabs2.png)


4. Go to Godaddy or any other Domain Provider Panel. Go to NameServer setting
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/96dujrm5v22hdq4uqut6.png)

5. Add AWS name server here. This will get from step 3
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xzbdojvpzdjil2hld57m.png)


6. Create A record for EC2 server

- Here enter Public IP of EC2 server
- This will take upto 24 hours for reflect. 
- If still domain not connect then try clearing cache.
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0gsl34g8p2k0tc4601s.png)
Array & Hashing: Group Anagrams
Tags: leetcode, programming, javascript
Published: 2023-04-01 16:19:01

How to group anagrams in same group? 

```
Input: strs = ["eat","tea","tan","ate","nat","bat"]
Output: [["bat"],["nat","tan"],["ate","eat","tea"]]
```
Anagram mean that the words will have same length and same number of character occurrence.

`eat` can be rearranged to `tea`, `ate`

## My Recommended Solution

- Lets take `eat` for example.
- Count the number of characters in it. That would be `e = 1`, `a = 1`, `t = 1`. So the key for eat would be `e1a1t1`.
- We need to find other words which having same key.
- In this case we can store this to a data structure called `Hash Map`. Then the key of the hash map will be the one which we create with number of characters of the word and value will be an Array.
- Once we created a key then we can add it to the hash map. Then the result would like this

```
{
"e1a1t1": ["eat"]
}
```
- In this case getting the key's character order is a challenging thing. What I'm suggesting is to create an array with 26 size (number alphabets). 
- Initialize it with zero 
```
[0,0,0,0,0,....0,0,0,0]
```
- We can use this array to create a key. Which should be equal for word with same number of characters.
- For Example, if we take `eat`. Then the array will looks like,
```
[ 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 ]
```

- From this we can create a key by stringifying the array `'1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0'` 

#### How do we know the index in the array to increment the count of a particular character?

Every alphabets has an ASCII value. 
`a => 97, for e => 101, t => 116`

If you closely look at this numbers, We can see a way to get the corresponding array index. Find it.

After looping through every words we will have a hash map with grouped anagrams. The values of all the keys of the hash map is the answer.

Happy Coding,
Bibin Jaimon
[Desafio] - 10 Desafios Simples de System Design: Resolução 4/9 (Instrumentar Serviços para Métricas de Negócio em Tempo Real)
Published: 2023-04-01 16:12:47

> Conteúdo original em https://twitter.com/zanfranceschi/status/1642197411853643776

---

Ei dev,

Discussão sobre a resolução do Desafio 4/9 dos 10 Desafios Simples de System Design que postei recentemente.

"Instrumentar Serviços para Métricas de Negócio em Tempo Real"

↓

https://twitter.com/zanfranceschi/status/1638232593400487936

---

Essa desafio pode ser difícil dependendo do que e qual precisão necessária do monitoramento. Por exemplo, usar ferramentas de métricas como o Prometheus pra monitorar valores financeiros precisos não é uma boa ideia porque a coleta das métricas pode não ser completa (amostragem).

---

Usar ferramentas convencionais de coleta de métricas para métricas de negócio pode ser útil para detecção de anormalidades com base em valores aproximados. Por exemplo, a quantidade aproximada de pedidos por hora em um e-commerce.

---

Esse desafio cita o termo "instrumentar". Geralmente, a gente instrumenta aplicações (e/ou contêineres, servidores, etc.) para métricas que não são de negócio e sim para métricas mais técnicas como uso de CPU, espaço em disco, memória, etc.

---

Por isso, se você tem alguma experiência nesse área, pode ter questionado prudentemente a frase "instrumentar para métricas de negócio".

Uma abordagem comum para métricas de negócio em quase tempo real é fazer polling em bancos de dados e/ou se conectar a hubs de eventos.

---

Polling em banco de dados pode ser uma abordagem um pouco mais intrusiva pois pode gerar concorrência significativa de recursos computacionais da operação do negócio.

Se conectar a hubs de eventos, como p.ex. Kafka ou RabbitMQ, não é intrusivo, mas pode ser bem mais complexo.

---

Monitorar seu negócio te coloca em grande vantagem pois pode diminuir muito o tempo de resolução de problemas.

No passado, fiz uma thread sobre observabilidade que fala, entre outras coisas, sobre métricas e o porquê de não se usar logs para métricas – dá uma olhada.

https://twitter.com/zanfranceschi/status/1547350969070936064

---

Aproveitando sua atenção, um assunto relacionado que pode ser interessante nesse domínio é SRE. Existe um livro bem clássico sobre o assunto – "Site Reliability Engineering".

É isso! Espero que tenha curtido a thread!

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