teleren/devto huggingface dataset:
NVM Commands Cheat Sheet
Tags: node, nvm, cheatsheet
Published: 2023-11-26 20:44:34

I keep forgetting these commands. So, let's put is all together. 

## Installing

- Follow installation steps: 

[nvm-sh/nvm](https://github.com/nvm-sh/nvm#installing-and-updating)


## List Available Releases

```shell

nvm ls-remote
nvm ls-remote | grep -i "latest"
nvm ls-remote | grep i "<node_version>"
```
## Install a Node Version

```shell
nvm install <node_version>
```

## List Installed Versions

```shell
nvm ls
```

## Aliasing

- Set a specific version as default
```shell
nvm alias default <node_version>
```

- Set a user defined alias to a node version

```shell
nvm alias <alias_name> <node_version>
```

- Remove the alias name

```shell
nvm unalias <alias_name> 
```

## Switch to a version (Use)

```shell
 # don't have to match exact number. `nvm use 16`
nvm use <node_version>
# or use the latest   
nvm use --lts
```

## Get path to installed node

```shell
# /Users/pratikthapa/.nvm/versions/node/v20.10.0/bin/node
nvm which node 
```

## Uninstall a Version of NodeJs

```shell
nvm uninstall <node_version> # a specific version
nvm uninstall --lts # Uninstall the latest LTS release
```

## Help

```shell
nvm --help # get help documents
```
STL Standard Template Library
Published: 2023-11-26 20:38:02




(STL) is a set of C++ template classes to provide common programming data structures and functions such as 
_lists, stacks, arrays,_ etc. 

It is a library of **container classes, algorithms, and iterators**. 

It is a generalized library and so, its components are parameterized. Working knowledge of template classes is a prerequisite for working with STL.

(STL) is a collection of algorithms, data structures, and other components that can be used to simplify the development of C++ programs

(STL) Provide to write generic, reusable code that can be applied to different data types. This means that you can write an algorithm once
-----------------------------------------------------------------
STL has 4 components:

**Algorithms
Containers
Functors
Iterators**

_**1. Algorithms**_
The header algorithm defines a collection of functions specially designed to be used on a range of elements. They act on containers and provide means for various operations for the contents of the containers.

1. Algorithm
2. Sorting
3. Searching
4. Important STL Algorithms
5. Useful Array algorithms
6. Partition Operations
7. Numeric
8. valarray class



**_2. Containers_**
Containers or container classes store objects and data. There are in total seven standards “first-class” container classes and three container adaptor classes and only seven header files that provide access to these containers or container adaptors.

Sequence Containers: implement data structures that can be accessed in a sequential manner.

1. vector
2. list
3. deque
4. arrays
5. forward_list( Introduced in C++11)
Container Adaptors: provide a different interface for sequential containers.

1. queue
2. priority_queue
3. stack
Associative Containers: implement sorted data structures that can be quickly searched (O(log n) complexity).

1. set
2. multiset
3. map
4. multimap
Unordered Associative Containers: implement unordered data structures that can be quickly searched

1. unordered_set (Introduced in C++11)
2. unordered_multiset (Introduced in C++11)
3. unordered_map (Introduced in C++11)
4. unordered_multimap (Introduced in C++11)


**_3. Functors_**

The STL includes classes that overload the function call operator. Instances of such classes are called function objects or functors. Functors allow the working of the associated function to be customized with the help of parameters to be passed. Must Read – Functors

**_4. Iterators_**

As the name suggests, iterators are used for working on a sequence of values. They are the major feature that allows generality in STL. Must Read – Iterators

#stl #c++ #data_structre #algorithm #standart_tempalte_library
Building Accessible Animations with prefers-reduced-motion
Tags: a11y, css, webdev
Published: 2023-11-26 20:17:09

Animations can be beautiful, but some animations can also be [triggering](https://developer.mozilla.org/en-US/docs/Web/Accessibility/Seizure_disorders) for some users, and that's why electronic devices provide ways to turn off animations, e.g:

- Android => Settings > Accessibility > Remove Animations
- iOS => Settings > Accessibility > Motion
- Windows 10 => Settings > Ease of Access > Display > Show animations in Windows
- Windows 11 => Settings > Accessibility > Visual Effects > Animation Effects
- MacOS => System Preferences > Accessibility > Display > Reduce motion

To ensure the animations in our web application respect these settings, we need to make use of the `prefers-reduced-motion` CSS feature to detect the user settings and carry out appropriate actions. In the example below, we have a simple button that by default has a pulse animation;

```html
<button class="btn btn--animated">Fancy Animation</button>
```

```css
@keyframes pulse {
  50% {
    transform: scale(1.2);  
  }
  
  to {
    transform: scale(1);
  }
}

.btn {
  background: #577FAE;
  color: #FFF;
  padding: 10px 20px;
  margin: 30px;
  border: none;
}

.btn--animated {
  animation: pulse 1s linear infinite;
}
```

To disable any animation if the user has it turned off using the `prefers-reduced-motion` feature, we can add the following block to our CSS;

```css
@media (prefers-reduced-motion) {
  .btn--animated {
    animation: none;
  }
}
```

And that's it, with just a few lines of code, we're able to make our animated button accessible, which is sufficient to pass the [WCAG Criterion 2.3.3](https://www.w3.org/WAI/WCAG21/Understanding/animation-from-interactions.html)
StackOverflow is dying,,
Tags: webdev, programming, javascript, ai
Published: 2023-11-26 19:40:30

Hey everyone, it's November 2023, and I've got some out-of-this-world news for you – aliens are real! Yep, according to some folks who used to work for the government, they found bodies of the pilots who flew these alien spaceships. But that's not even the wildest part – they also discovered some super weird code inside these space vehicles.

![Image of weird code among alien crowds](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uq6ea1g93lwzz5y7wr7y.png)

This code was so bizarre that they posted it on a website called Stack Overflow, where programmers usually go for help. But here's the twist – it got taken down because it looked too much like another coding language. If you're a bit older, you might remember Stack Overflow as the place to be for coding assistance.

![Image of alien crowsfeared about new updates](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7a2uvkmrgbmszxbw4dux.png)

But here's the scoop: Stack Overflow isn't as popular as it once was. In the last eight months, fewer people have visited the site. So, why is this happening? Well, there's this thing called artificial intelligence, or AI. It's like a super-smart computer that can answer coding questions.

Guess what? Stack Overflow created its own AI called Overflow AI. This AI can come up with answers based on all the questions and answers people have posted on Stack Overflow over the years. So now, some programmers are scratching their heads, wondering, "Why bother answering questions when AI can do it for me?"

![Image of AI running through the buildings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ry2csfl7xuqwoqjsglae.png)

This drop in Stack Overflow's popularity is kind of like what happens in nature. Imagine a hungry and stressed-out snake in the desert; it might start eating itself out of desperation. But of course, that can't go on forever. And it's not just Stack Overflow – other big AI models, like GPT-4, have already used up a lot of the data from Stack Overflow to train themselves.

---

## Summary
So, it seems like we're entering a new era where AI is taking over. It's a bit like a big change, similar to when people found out about aliens. Funny how these things happen around the same time. 


_**Tools you may like to use: Figma**_
_Figma AI Design Copilot is a future tech and Figma is already one of the most popular tools for UI/UX designers and developers. Many of them use Figjam (part of Figma) for whiteboard collaboration with other team members. You can [sign up from here](https://psxid.figma.com/pq1612tcamkx)._

![Figma](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/87nc2uw0z4r0ypybyutz.png)


**My Socials:** [Linkedin](https://www.linkedin.com/in/codewithshahan) | [X](https://twitter.com/shahancd)


**[Buy Me a Coffee](https://www.buymeacoffee.com/codewithshahan)**    

Thanks for taking the time to read this article. Stay tuned for the latest updates on programming.
Organizando os Livewire Components
Tags: php, laravel, livewire
Published: 2023-11-26 18:45:27

Olá, nesse pequeno post eu quero compartilhar como organizo a criação dos componentes livewire nos meus projetos.

Se você não conhece o Livewire, basicamente, ele faz parte do ecossistema [Laravel ](https://laravel.com/)e serve para criar componentes reativos sem precisar usar (ou muito pouco) javascript, dando "super-poderes" a classe em PHP. Você pode dar uma lida na [documentação](https://livewire.laravel.com/docs/quickstart) para entender melhor.

Bom, já faz quase dois anos que trabalho diretamente com aplicações Laravel que utilizam o Livewire para construir monolitos. O Livewire ajuda a criar toda a reatividade no _front-end_ sem sairmos do bom e velho PHP.

A criação de um componente Livewire é fácil, após termos [instalado](https://livewire.laravel.com/docs/installation) ele no projeto, conseguimos fazê-lo por um comando do artisan.

`php artisan make:livewire CreatePost`

O resultado será uma classe do nosso componente e uma **view.blade.php** correspondente a essa classe.

_Eis que chegamos no ponto central deste post ..._

Diferentemente dos _Controllers _"normais" do Laravel, a documentação do Livewire não adota, ou melhor, não oferece nenhum padrão arquitetural para organizarmos nossos componentes. Na documentação do Laravel, por exemplo, nós conseguimos ver as sugestões dos [Resource Controllers](https://laravel.com/docs/10.x/controllers#resource-controllers) que nos guiam em como nomear nossos métodos e organizar nossas rotas.


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

Foi a partir desse modelo que comecei a padronizar a criação dos meus componentes conforme os _resource controllers_. Deixando claro, que isso é uma sugestão. Caso você adote algo diferente ou não concorde, tudo bem!

Voltando ao exemplo do Post, eu o faria da seguinte maneira:


`php artisan make:livewire Post\Create`

O resultado seria:

**app/Livewire/Post/Create.php**

```
<?php
 
namespace App\Livewire\Post;
 
use Livewire\Component;
 
class Create extends Component
{
    public function render()
    {
        return view('livewire.post.create');
    }
}
```
**resources/views/livewire/post/create.blade.php**
```
<div>
    <h1> My Component! </h1>
</div>
```
E seguiria o mesmo raciocínio para os outros recursos, por exemplo **show ** e **index**.

`php artisan make:livewire Post\Show`
`php artisan make:livewire Post\Index`

Isso me ajudou a organizar melhor a estrutura do meu projeto já que já era familiarizado com os trabalhos dos _resource controllers_ e espero que possa ser interessante para você também. Deixa nos comentários se você concorda ou não e me da sugestões de organização do código.

Um abraço!
Discriminated Unions
Tags: 100daystooffload, programming, types, datastructures
Published: 2023-11-26 18:42:31

[Discriminated unions](https://en.wikipedia.org/wiki/Tagged_union) are a powerful data structure to use when modelling a domain in an application.

The name of this data type varies between programming languages, for instance:

* F# calls it [Discriminated unions](https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/discriminated-unions)
* OCaml calls it [Variants](https://v2.ocaml.org/manual/coreexamples.html#s:tut-recvariants)
* TypeScript calls it [Tagged Union Types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) some times, and other times discriminated unions
* Haskell calls it [Algebraic data types](https://wiki.haskell.org/Algebraic_data_type)

Pattern matching and discriminated unions are great together and makes it really easy to express complex models in the code.

Here is a simple example to make a boolish type in F#:

```fsharp
type Answer = Yes | No

let response answer =
    match answer with
    | Yes -> "Correct answer"
    | No -> "Wrong answer"
```

One popular example in OOP is to show inheritance with a `Shape` class. Here is an example but with discriminated unions instead:

```fsharp
type Shape =
    | Circle of float
    | Rectangle of float * float
    | Square of float

let calculateArea shape =
    match shape with
    | Circle(radius) -> Math.PI * radius * radius
    | Rectangle(width, height) -> width * height
    | Square(side) -> side * side
```

In other words:

> Use discriminated unions  for concise and type-safe representation of complex data structures, promoting clarity, pattern matching, and compiler-enforced correctness.

Happy hacking!
Python Applications
Tags: course, training, python, certification
Published: 2023-11-26 18:40:47

Python is a versatile programming language that is widely used in various domains. Here are some common Applications of Python:
1.	Web Development:
•	Frameworks like Django and Flask are popular for building web applications.
•	Python can be used for both server-side and client-side scripting.
2.	Data Science and Machine Learning:
•	Python is extensively used for data analysis, visualization, and machine learning.
•	Libraries like NumPy, pandas, Matplotlib, and scikit-learn are commonly used in this domain.
3.	Artificial Intelligence:
•	Python is widely used in AI research and development.
•	Frameworks like TensorFlow and PyTorch are used for building and training neural networks.
4.	Automation and Scripting:
•	Python is excellent for automating repetitive tasks and writing scripts.
•	It's commonly used for system administration and network automation.
5.	Desktop GUI Applications:
•	Python can be used to create desktop applications with GUI using libraries like Tkinter, PyQt, or Kivy.
6.	Game Development:
•	Python is used for developing simple to moderately complex games.
•	Pygame is a popular library for game development in Python.
7.	Network Programming:
•	Python is used for writing network scripts and applications.
•	The socket library allows for low-level networking operations.
8.	Database Applications:
•	Python can be used to interact with various databases, both relational and NoSQL.
•	SQLAlchemy is a popular library for working with databases in Python.
9.	Scripting for Software Applications:
•	Many software applications allow scripting using Python.
•	Blender, a 3D computer graphics software, is an example.
10.	Cybersecurity:
•	Python is used for ethical hacking, penetration testing, and various cybersecurity tasks.
•	Frameworks like Scapy and libraries like Requests are commonly used.
11.	Educational Tools:
•	Python is used as a teaching language in many educational institutions.
•	Platforms like Jupyter Notebooks are widely used for interactive teaching and learning.
12.	Scientific Computing:
•	Python is used in scientific research and engineering for tasks like simulations and data analysis.
•	Libraries like SciPy and SymPy are commonly used in this domain.
13.	IoT (Internet of Things):
•	Python is used in developing applications for IoT devices.
•	MicroPython is a version of Python designed for microcontrollers.
14.	Financial and Trading Applications:
•	Python is used for financial modeling, algorithmic trading, and quantitative analysis.
•	Libraries like Pandas and NumPy are often used for financial data analysis.
15.	Healthcare and Bioinformatics:
•	Python is used in healthcare for data analysis, imaging, and bioinformatics.
•	Biopython is a set of tools for biological computation in Python.
Python's simplicity, readability, and the vast ecosystem of libraries make it suitable for a wide range of applications across different industries. Its versatility and community support contribute to its popularity in various fields.
Recovery from Cryptocurrency Scam or Frauds
Published: 2023-11-26 18:32:54

Bitcoin has skyrocketed in popularity, becoming the digital darling of the financial world. But with great popularity comes great vulnerabilities. Hackers, phishing scams, and technical glitches can all conspire to separate you from your beloved cryptocurrency. That's why understanding the importance of bitcoin recovery is crucial – it's like having a safety net for your digital gold. Losing Bitcoin isn't just a minor inconvenience; it can have some serious consequences. Think of missed investment opportunities, sleepless nights, and endless "what-ifs." Plus, let's not forget the potential cost – losing your bitcoin is like dropping a wad of cash down a drain – it stings. That's why it's essential to grasp the risks involved and take the necessary steps to recover your lost Bitcoin. Efficiency is crucial when you're racing against the clock to find your misplaced Bitcoin. You may be sure they won't waste any time with Daniel Meuli Web Recovery. Their recuperation procedure is intended to be quick and efficient so you can quickly get back on track and start counting your bitcoin. The journey to recovering your lost Bitcoin starts with an initial assessment and information gathering. Daniel Meuli Web Recovery will dive deep into the details to understand the scope of your loss and gather any relevant information needed to begin the recovery process. Think of it as the detective phase, minus the trench coat and fedora. After the assessment, it's time to put on the thinking cap and analyze the situation. Daniel Meuli Web Recovery will utilize its expertise to identify potential recovery solutions tailored to your specific circumstances. It's like having a brainy sidekick who knows just what to do to get you out of a tight spot. Now comes the exciting part – executing the recovery plan. Daniel Meuli Web Recovery will put its tools and techniques into action, navigating the digital maze to retrieve your lost Bitcoin. It's like watching your favorite heist movie, except instead of stealing, they're returning what's rightfully yours. For help, call Daniel Meuli web recovery via:

hireus At danielmeulirecovery.pro
Or Vist https: // danielmeulirecovery.pro/
Telegram (@) Danielmeuli
Danielmeuliweberecovery (At) email . come
Thank you.
How to Create a Python virtual environment
Tags: python, productivity, tutorial, beginners
Published: 2023-11-26 18:05:36

### install virtualenv

- First, it's better to check if **virtualenv** is already installed. this can be done by running the following command:

```
virtualenv --help
```

- If you encounter an error message like "command not found," it indicates that **virtualenv** is not installed and you need to install it. Otherwise, the usage and options are displayed.

- To install it, use the command:

```
pip install virtualenv
```

### Create a Virtual Environment:
- To create a new virtual environment, simply execute:

```
virtualenv name_of_virtual_envirement
```

A directory of the name <name_of_virtual_envirement> will be then created:

### Activate the virtual environment 

- to activate the virtual environment, navigate to the directory and execute the following:

```
source bin/activate
```

### To deactivate it
- To exit the virtual environment, simply run:

```
deactivate
```

### How does it work

- Once you're in the Python virtual environment any Python packages you install using pip are local to the environment, i.e.: They won't affect your global Python installation.
- To view the packages installed in your virtual environment, you can:

- First, install a package, for example:

```
pip install discord
```

- then:

```
pip freeze
```

- the name of the package, its dependencies, and respective versions should appear
- you can also save your environment packages in a requirement.txt file using the following command:

```
pip freeze > requirement.txt
```

- Later, if you want to install all the dependencies of your project in a single step, you can use:

```
pip install -r requirements.txt
```
Flowers Name in Hindi, English, Marathi, Tamil
Published: 2023-11-26 18:00:43

There are many species of flowers found in the world, out of which we have given the most popular 100 Flowers Name in Hindi on this blog. Along with this, here we have also given Flowers Name in all the languages like English Marathi Tamil with photos which will help you. Will help a lot in understanding the names of flowers better.

Flowers have a great importance in our life. We need flowers in worship. Medicines are also made from flowers which cure many diseases. Most of the people recognize flowers by their fragrance but in this post 100 [Flowers Name in Hindi](https://flowername.in/). After reading this and seeing the given photo, you will be able to identify any flower just by looking at it.

Rose

Rose is the most popular flower in the world. There are five types of rose flowers: red, yellow, white, pink, orange and they have many names like red rose, yellow rose, pink rose, orange rose etc. Red rose is the most liked. Is

2

Lotus

Lotus flower is a plant that grows in water. This flower comes in many colors like red, pink, orange and white etc. Lotus flower is grown a lot in these countries like India, Sri Lanka, Nepal, Thailand and Japan. This flower is considered very important in Hindu religion. This flower is used in many religious festivals.

3

Sunflower

Sunflower is a colorful flower which is found in yellow, red, orange, brown and maroon colors. This flower looks very beautiful in these colors. Oil is extracted from the seeds of sunflower flower. This flower is used in making soap, shampoo and cream. Many diseases are also treated by making medicines from the leaves of this flower.
Flowers Name in Hindi & English (100+ फूल के नाम)
Published: 2023-11-26 17:52:38

Flowers Name in Hindi & English (100+ फूल के नाम) Variety species of flowers name with pictures help you learn & increase your knowledge. [Flowers name](https://flowername.in/) (फूल के नाम) is easy to help to understand the name in easy ways.

Flowers play an essential role play in our life Flowers Smell & beauty relax our mind feel very good & energetic through flowers. Flowers are used in many different types of medicine. Our world has 400,000+ varieties of different kinds of flower species. All queries like 5,10,15,20 flowers names are Solved in this article if you want more information about flower parts.

Phoolon ke Naam list pdf with the picture is also Provide then you want then don’t miss them, and the youtube video also provides help to pronounce names in audio-video format.

Annual Flowers	Annual flowers are blooming only once a year. In other words, annual flowering plants have a long blooming period and only one growing season. Additionally, they are categorized according to the season in which they bloom as follows:         Summer annual flowers
Fall annual flowers
Winter annual flowers
Perennial flowers	Flowers that bloom continuously, or those that may survive for a number of growing seasons, are known as perennials.
Biennial flowers	Plants that bloom twice a year are said to be biennials. In the first season, these plants develop stems, leaves, and roots, and in the second season, they produce flowers, fruits, and seeds.
Shrub flowers	Shrubs with flowers are used as ornaments. They serve as groundcovers or as fencing plants.
Tree flowers	Tree flowers are those which grow on trees.
100 Flower Names List in English and Hindi with Images
All 100 Flower names are given below in the form of a table and pictures are also included so that students won’t get confused.... Read more at: