teleren/devto huggingface dataset:
Why stable coins in Defi
Published: 2023-02-10 13:35:29

 Cryptocurrencies are well known for their high volatility, they can change in price easily, in order to protect user funds from this fluctuation in market price, Stablecoins were created.

**What is a Stable Coin?**


A stablecoin is a type of cryptocurrency that is pegged to other stable assets like US Dollars.

Stablecoins maintain this peg through reserves of dollars, other cryptos, or a mix of both kept in U.S-controlled bank accounts.

**Use cases of  Stablecoins.**


Apart from being used as a hedge (protection) against crypto market volatility, they are also used for generating passive income through staking or lending.

**Types  of some popular stablecoins**

1)	Tether (USDT),
2)	USD
3)	USDC
4)	Euro Coin (EUROC)
5)	Binance Dollar(BUSD)
 
**How are Stablecoins maintained?**


Stablecoins are maintained by 3 major methods.

1)	**Fiat or commodity-backed stablecoins.**


In this method, all stablecoins in circulation are backed by an equivalent of the value in fiat currency or cash equivalents, 1 USD equivalent is held on reserve in U.S bank accounts owned by the issuer, and monthly these reserves are audited.
for example  USDT

Tether is a centralized, fiat-collateralized stablecoin.


2) **Cryptocurrency-backed stablecoins.**

This method is also known as The decentralized method
It involves pegging stablecoins through crypto-collateralization.
Stablecoins are backed by reserves of other cryptocurrencies.


Due to the fluctuation of the crypto market, stablecoins are usually overcollateralized to help maintain the peg.
for example, Dai which is a decentralized stablecoin is collateralized at 150%, every 1 Dai in circulation is backed by 1.5x its equivalent value in Ethereum.

3)	**Algorithm-backed statblecoins**

These are stablecoins pegged through smart contracts that automatically execute to manipulate the circulating supply depending on market conditions.
Create a folder if not exist
Tags: tutorial, php, laravel, beginners
Published: 2023-02-10 13:30:37

We create a directory is not exist using the File::makeDirectory() function.

The function takes four arguments:

- $path: This is a string that represent the path of the directory/folder we want to create.
- $mode: This is used to set the permission for the directory. it is a four- digit integer.
- $recursive: This is used to specify if the recursive mode is set. it is a Boolean value.
- $force: this is optional. when set, you may create a file in the path even if the directories in the path does not exist. it takes a Boolean value.

For example, assume we want to create a folder called 'tutorial' in the public path in Laravel. Note: the public path is also the public folder.

```
$path = public_path('tutorial');
//check if folder exist in path
if (!File::isDirectory($path)) {
    File::makeDirectory($path, $mode = 0777, true, true);
} else {
    logger('folder exist already');
}
```

Note: there are different path function Laravel provides.
- base_path(): create the folder in the application root directory
- public_path(): create the folder in the public directory (public/).
- storage_path(): create the folder in the storage directory (storage/).
- app_path(): create the folder in the app directory (app/).
How to make an effect typewriter
Tags: javascript, reactj
Published: 2023-02-10 13:29:48


When I first opened chatgpt, I was interested in seeing typewriters, and then I became curious about typewriters and searched for various sources. Using Javascript, I try to implement this. and then

## What is typewriter
A typewriter is a mechanical device that is used to type text on a screen. Several keypad buttons have letters, numbers, and symbols on their surfaces, which are pressed to write characters on a screen that moves beneath the rollers.

## Typewriters: why use them
By making visitors focus on a single character for a designated period of time, this effect can enhance user engagement with web content and the page.

## Example

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

## code
Here's an example of how you can create a typewriter effect in React:

1. Create a state to store the current text to be displayed on the screen:

```javascript
  const [displayedContent, setDisplayedContent] = useState("");
  const [index, setIndex] = useState(0);
```

2. Create an variable content & speed to store the texts that you want to display one by one:

```javascript
  let content = 'please visit suraji.my.id'
  let speed = 100
```

3. Use the useEffect hook to handle the animation:

```javascript
  useEffect(() => {
    const animKey = setInterval(() => {
      setIndex((index) => {
        if (index >= content.length - 1) {
          clearInterval(animKey);
          return index;
        }
        return index + 1;
      });
    }, speed);
  }, [content.length, speed]);

  useEffect(() => {
    setDisplayedContent(
      (displayedContent) => displayedContent + content[index]
    );
  }, [content, index]);
```

4. Use the state in your component's render method to display the current text:

```javascript
return <div>{displayedContent}</div>;
```

This code will display the texts one by one with a typing effect, with a delay of 100ms pause between each text. You can adjust the delay and pause times to suit your needs.

## Conclusion
By making visitors focus on a single character for a designated period of time, this effect can enhance user engagement with web content and the page.
Resolvendo problemas no HackerRank: Somando array com elementos longos
Tags: javascript, beginners
Published: 2023-02-10 13:25:33

Olá, seja bem vindo a mais uma etapa do Resolvendo problemas no Hacker-Rank,nessa sessão iremos resolver a soma de arrays. Veremos agora!

**A Very Big Sum -**

- Neste desafio, você deve calcular e imprimir a soma dos elementos de um array, lembrando que alguns desses inteiros podem ser muito grandes.

- aVeryBigSum has the following parameter(s):
int ar[n]: an array of integers .
Return
long: the sum of all array elements

```
5
1000000001 1000000002 1000000003 1000000004 1000000005
```
O problema pede que façamos a soma desses valores, dando resultado:

```
5000000015
```

Então, vejamos a resolução:

```
function aVeryBigSum(ar) {
    // Write your code here
    return aVeryBigSum = ar.reduce((acum,value)=> acum + value);
}
```

Os parâmetros ar estão guardando os valore. Foi se passado um `.reduce` para que ele pegue um valor acumulado que ainda não veio, e um valor atual. A soma desses, irá fornecer o nosso resultado esperado, pois iremos guardar todo o resultado no `acum` e somando ao novo valor que chega.

Vejamos o valor fornecido com base no código acima:


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


**Soluções alternativas**

function aVeryBigSum(ar) {
  // Write your code here
  let sumResult = 0;

  for (let index = 0; index < ar.length; index++) {
    sumResult += ar[index];
  }

  return sumResult;
}

O resultado será o meso, substituindo apenas o reduce, por uma laço `for`que adicionará mais 1 ao anterior em index.


Com isso concluímos mais um episódio, e nos vemos na próxima!!!
This Week In Python
Tags: python, discuss, thisweekinpython
Published: 2023-02-10 13:20:49


**Fri, February 10, 2023**


This Week in Python is a concise reading list about what happened in the past week in the Python universe. 

**I have received some good suggestions for this week's content. Thank you.**

**Did I miss anything from the Python universe this week? What did you read or tried out?**


## Python Articles


- [Standout Features in Django 4.2](https://fly.io/blog/standout-features-in-django-4-2/)
- [It is becoming difficult for me to be productive in Python](https://avi.im/blag/2023/refactoring-python/)
- [Three Python trends in 2023](https://blog.jerrycodes.com/python-trends-in-2023/)
- [13 tips and techniques for modern Flask apps](https://pgjones.dev/blog/modern-flask-2023/)
- [What Django Deployment is Really About](https://james.walters.click/what-django-deployment-is-really-about.html)


## Projects


- [django-htmx-patterns](https://github.com/spookylukey/django-htmx-patterns/) – Sharing patterns I use with Django and htmx
- [pocketpy](https://github.com/blueloveTH/pocketpy) – C++17 header-only Python interpreter for game engines 
- [lug](https://github.com/trytoolchest/lug) – Run Python functions locally or in the cloud. Built for computational science
- [flatliner-src](https://github.com/hhc97/flatliner-src) – Convert python programs into one line of python code
- [hypermodern-python](https://github.com/cjolowicz/hypermodern-python) – Companion repository for the Hypermodern Python article series

**Did I miss anything from the Python universe this week? What did you read or tried out?**
tsParticles 2.9.0 Released
Tags: javascript, typescript, webdev, showdev
Published: 2023-02-10 13:19:26

## tsParticles 2.9.0 Changelog

### New Features

- Creating confetti 🎉🎊 bundle, easier confetti animations usage. Removed `confetti` function from the preset, this bundle replaces this feature. The readme with instructions can be found [here](https://github.com/matteobruni/tsparticles/tree/main/bundles/confetti#readme)
- Creating fireworks 🎆🎇 bundle, easier fireworks animations usage. The readme with instructions can be found [here](https://github.com/matteobruni/tsparticles/tree/main/bundles/fireworks#readme)

### Minor Changes

- Added version to the `Engine` object.
- Added `color` and `colorOffset` properties to `split` options.
- Changed default particles `number` value to `0`, the previous default value was meaningless. You must specify a number now, it's easier to implement `emitters` plugin since you can declare just the `emitters` property without specifying `0` particles. If you need any number, you declare it ignoring the default value.

--

## v3.0

Probably this will be the last `v2.x` version, except some bug fixes needed before `v3.0` will be released.

You can read more about the upcoming `v3.0` in the post linked below

{% link https://dev.to/tsparticles/preparing-tsparticles-v3-5bai %}

--

## Social links

- [Discord](https://discord.gg/hACwv45Hme)
- [Slack](https://join.slack.com/t/tsparticles/shared_invite/enQtOTcxNTQxNjQ4NzkxLWE2MTZhZWExMWRmOWI5MTMxNjczOGE1Yjk0MjViYjdkYTUzODM3OTc5MGQ5MjFlODc4MzE0N2Q1OWQxZDc1YzI)
- [WhatsApp](https://chat.whatsapp.com/KQyHc9UEbRc2qlqNQR2J5c)
- [Telegram](https://t.me/tsparticles)
- [Reddit](https://www.reddit.com/r/tsParticles/)

---

{% github matteobruni/tsparticles %}
Crystal Reports
Tags: uyumsoft
Published: 2023-02-10 13:16:33

`HTML </br>`

`//{REPORT_TABLE.ITEM_CODE} + '</br>' + {REPORT_TABLE.ITEM_NAME} + '</br>' + {REPORT_TABLE.ITEM_NAME_MANUAL} + '</br>' + {REPORT_TABLE.NOTE_D}`

`in`

if {@HESAP_KOD} in ["D", "A"]
Simple command-line counter with file storage in R
Tags: r, programming, beginners
Published: 2023-02-10 13:12:10

---
title: Simple command-line counter with file storage in R
published: true
description: In the counter example series we create simple programs that can increment a counter.
tags: R, programming, beginners
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-02-10 13:09 +0000
series: counter
canonical_url: https://code-maven.com/simple-counter-with-r
---

I have been learning R and preparing [examples for R](https://code-maven.com/slides/r/). One of the fun small script I created is also part of the <a href="https://code-maven.com/counter">counter example series.


```r
filename = "count.txt"
count = 0

if (file.exists(filename)) {
    as.numeric(readLines(filename)) -> count
}

count <- count + 1

cat(count, end="\n")

fh <- file(filename, "w")
cat(count, end="\n", file = fh)
close(fh)
```

After [installing R](https://cran.r-project.org/) we can run this script by typing in

```
Rscript counter.R
```

In R there are at least 3 ways to assign a value to a variable. One can use the boring `=` sign as we have in the first two assignments.
We can also use the left arrow `<-` and we can also use the `->`. In this script I used all 3, just to demo them. I think in a real script I'd stick to boring `=`, but as I can see code written by others, they also like to use the other signs.

The `file.exists` and the `readLines` functions seem to have very descriptive names.

The `as.numeric` function converts a string or "characters" as they are called in R to a number or "numeric" as it is referred to in R.

`cat` is a similar to `print`, but as I understand it is more generic function. Among other things it does not "number" the output lines. It also accepts various parameters such as the `end` parameter and the `file` parameter.

The `file` function with the `w` parameter opens the file for writing and returns a filehandle. We then use `cat` and direct its output to the file. At the end we `close` the file.
SOLID Sucinto
Tags: solid, cleancode, arquitetura, architecture
Published: 2023-02-10 12:47:37

## SOLID

S - princípio da responsabilidade única
> cada classe só pode ter uma responsabilidade.

---

O - princípio do “aberto/fechado”
> uma classe deve ser fechada a mudanças e aberta a extensão. Isso quer dizer que você deve conseguir modificar ou evoluir o comportamento do sistema sem modificar as classes.

---

L - princípio da substituição de Liskov
> um objeto deve poder ser substituído por qualquer um de seus descendentes ou derivados sem comprometer o funcionamento do sistema.

---

I - princípio da segregação de interfaces
> programe orientado à interfaces e não a implementação. Faça classes que te permita fazer manutenção modificando apenas os membros privados sem mexer nos públicos ou na interfaces.

---

D - injeção de dependência
> outros objetos que uma classe ou método precisa devem ser criados fora dela e passados como parâmetro pro construtor, ou por um método, e nunca criado dentro dela, pra evitar acoplamento (cite frameworks que você conheça, como o Simple Injector no C#). Outro conceito relacionado a isso é inversão de responsabilidade (IoC - Inversion of Concenrs em inglês).
Lista de Colinhas para Devs
Tags: career, programming, cheatsheet
Published: 2023-02-10 12:39:25

Inspirado naqueles PDF de cheat sheet (colinha) que geralmente tem de Markdown, Git ou outras tecnologias eu resolvi fazer uma série de colinhas para devs consultarem no trabalho ou estudar para entrevistas. 

Algumas direções que eu quero tomar nesse projetinho: 
1 - tem que ser sucinto, o mais resumido possível
2 - tem que ser em pt-BR pra ajudar os novatos e quem não tem inglês

Por favor me ajudem a expandir e melhorar as colinhas. Se encontrarem algum erro ou desinformação. Erro de português ou se precisar resumir ainda mais. 

Quem quiser dar sugestões de colinhas, manda aí a sugestão. 

Quem precisar de uma tradução de um artigo ou manual em inglês manda aí que eu dou um jeito. 

Com o tempo eu vou melhorando a colinha e jogando links novos aqui. Por enquanto temos esses abaixo: 

- [SOLID Sucinto](https://dev.to/vitorrubio/solid-sucinto-mp6)
What’s New in Laravel 10: Latest Features and Updates
Tags: newfeatures, updates, programming, features
Published: 2023-02-10 12:29:56

The core team at Laravel is committed to going above and beyond to make it the top choice of business owners in light of the constantly expanding market demand for excellent services and upgrades. With Laravel 10 as the most recent investment in their brand, they are here with this intention. To encourage developers and company owners to update their current Laravel apps, I am here to tell you about What's New in Laravel 10 and the newest features and updates.

Laravel 9 will receive scheduled bug patches through August 8, 2023, and security fixes through February 6, 2024, according to the official Laravel News Page. Until August 6, 2024, and February 4, 2025, respectively, Laravel 10 is anticipated to receive bug fixes and security updates.

## What's New in Laravel 10?
It is advised to use version limitations like "10.0" when referring to the framework or its constituent parts in an application or package because the core team behind the framework is constantly striving to improve what it offers to its users. This is due to the possibility that updated and subsequent versions will include notable modifications. Additionally, Laravel 10 has made significant improvements to help product owners. Let's examine these features: 

- Dropped Support for PHP 8.0
- Presented the Laravel Pennant
- Simple Process Management
- By default, invokeable validation rules
- Skeleton code for an application with type declarations
- Taken out dispatchNow ()

## Should You Upgrade to Laravel 10?
It's crucial to remember that Laravel is an open-source framework, meaning you own the codebase each time you install a new instance on your device. You can use the app in your older version also. You will, however, be in charge of independently maintaining the performance. Prioritizing stability over framework improvement is advised. Upgrade to Laravel 10 only if you want to:

- Your current Laravel app is reliable and working as it should.
- The upgrade will improve the functionality of your software by adding a crucial feature or fixing a severe problem.
- Before executing the upgrade in the production environment, you extensively tested your app.

## Conclusion
This introduced Laravel 10's new features, upgrades, and prerequisites. If you are a business owner concerned about updating your current Laravel application to [Laravel 10](https://www.bacancytechnology.com/blog/whats-new-in-laravel-10), or if you are thinking about a new project and wonder if Laravel is the perfect option for your needs, Hire Laravel Development Company.
"Hello me, meet the real me"
Published: 2023-01-17 02:38:12

Hello! I will use this space as my blog to share thoughts on different subjects (mostly related to work but not only).

The purpose here is not to dive deep into complex subjects but to try to put into words some of the many perspectives I have regarding some topics. I've always believed that one of the best options to guarantee that you have learned something is to write our talk as much as you can about the subject. However, we avoid this very important phase of learning and foul our brain saying "Yeah yeah, you already got it, NEXT!" [1]

One of the many things that inspire me was Flavio Clesio's blog [2] and his talks. The topics and the way that he approaches them - showing his high knowledge about how to introduce, start the discussion, and highlight each trade-off involved - really grab my attention from the beginning to the end. Another one was this post [3] regarding a switch from Data Science to an MLE role that pointed out many of my arguments to make my career switch too. Yeah, last but not least, this "passive-aggressive" post [4] also motivated me haha.

This is also an opportunity to force me on writing in English - despite not having the intention of writing all posts in English - because it is on my daily routine but right now it is now as instantaneous as I would like. I expect this practice to help me organize my thoughts clearly and effectively.

Ah, and about the headings, yeah ... I am a big fan of Megadeth ;D


[1] https://www.amazon.com.br/How-We-Learn-Surprising-Happens/dp/0812984293
[2] https://flavioclesio.com/
[3] https://ryxcommar.com/2022/11/27/goodbye-data-science/
[4] https://startafuckingblog.com/
How to design Unique shapes using TailwindCSS
Tags: webdev, tailwindcss, css, programming
Published: 2023-02-10 12:15:20

CSS is used for more than just styling elements. CSS shapes enable web designers to create custom paths such as triangles, circles, and polygons. ⚪️, 🔷, 🔺, ⭐️, ◾️.

This way, you’re not forced to insert a transparent-background floating image only to be disappointed by a rectangular box around it.

This article will design various shapes using TailwindCSS and a few functional shapes and values.

Tailwind CSS can be used to create various shapes using its pre-defined classes.

You can make shapes such as circles, squares, triangles, and more using the .rounded-* classes for rounded shapes and the .w-* and .h-* classes for width and height.

Additionally, you can create shapes using the :before and :after pseudo-elements with the content property set to an empty string and the border property set to create the desired shape.

And you’ll see how simple a task like this can be if you sharpen your skills and practice regularly.

For a detailed implementation guide, check out our [canopas blog](https://blog.canopas.com/how-to-make-unique-shapes-using-tailwindcss-18a85523bc15).
Challenge #1: 🥩 Decentralized Staking App
Tags: web3, blockchain, solidity, javascript
Published: 2023-02-10 12:07:07

## Tasks to be done

🦸 A superpower of Ethereum is allowing you, the builder, to create a simple set of rules that an adversarial group of players can use to work together. In this challenge, you create a decentralized application where users can coordinate a group funding effort. If the users cooperate, the money is collected in a second smart contract. If they defect, the worst that can happen is everyone gets their money back. The users only have to trust the code.

## My Review

This challenge was fun, I got to work with `interacting with external contracts`, creating and emitting `events`, setting `contructor`, creating and using `modifiers`, setting up a `time relative system`, `payable functions` and the `special function receive`. This challenge felt more like a CP (competitive programming) problem statement where a story / situation is explained and we need to write the code for the situation. This challenge is great for beginners since it teaches you about things like event, modifiers and much more which is at the core of solidity 🎯

## Important links

- [Speed Run Ethereum](https://speedrunethereum.com/challenge/decentralized-staking)
- [Deployed webapp](https://kevinj-sre-c1.surge.sh/)
- [Deployed contract](https://goerli.etherscan.io/address/0x71e41994f258bfce08cd455e6cc58fb7121902f6)
- [Project source code](https://github.com/kevinjoshi46b/speedrunethereum/tree/master/challenge-1-decentralized-staking)
Configure your Windows to work with Azure Active Directory
Tags: azure
Published: 2023-02-10 12:01:29

Lets learn with an already created Azure Active Directory.

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

This is "studentambassadors" active directory created by Microsoft.

Here if we go to the devices, you can see how many devices has been connected.


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

Then I can provide my studentambassadors mail provided by Microsoft.

Once done, 
you can now see the mail connected.

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

Now go to your Pcs search bar and search "About".

You can see your devices name, right?
For me , it is .
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iy01r68k7v05zqkualjb.png)


Lets now check in the active directory if they have my device connected to it or not.


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

Here it is!

So, this is how employees connect their devices to the Azure Active Directory.


▶️ Benefits:

You can access all the benefits provided by your admin in no time as you have connected your devices to the Azure Active Directory.


<img src="https://media.giphy.com/media/26ufdipQqU2lhNA4g/giphy.gif">