teleren/devto huggingface dataset:
Role-Based Access Control Using Dependency Injection (Add User Roles)
Tags: fastapi, python, webdev, api
Published: 2024-06-24 15:52:49

In this video, we’re setting up role-based access control for our FastAPI project. Role-based access control control allows users to perform actions in an application basing on their role. 

We create roles for users and admins, and then check these roles for every API endpoint. This way, we protect our API endpoints so only users with the right role can do certain things. We use dependency injection to implement this.

{%youtube _k2M-LpxId8%}
Stop click-baiting me to use your workflow
Tags: programming, productivity, coding, softwaredevelopment
Published: 2024-06-24 15:47:22

As I've been learning how to code, I've noticed that many developers, especially those in web development, often have strong opinions about the "right" way to do things. The sheer volume of content can be overwhelming, particularly for new developers who are still finding their footing. One of the most pervasive and annoying trends in this realm is "click-baiting" - using sensational or misleading headlines to lure developers into adopting certain tools or workflows. It's time we address this issue head-on.

My question is, will following their advice benefit my workflow for the project I'm currently working on?

If you find a new way to solve a problem that already has multiple solutions, congratulations! 


![congratulation meme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pahtrgboa4414w24yar4.jpg)

It's great to share what you've learned, but it's not so great to be told what we should be doing.

If you're new to coding, have been learning for a few months, or haven't even started your first job, just focus on what works for you. If jQuery works for you right now, then use jQuery. Don't feel pressured to learn react.js just because everyone else is using it. Here is a life TIP: Not every one will work for big tech companies or those using the most cutting-edge tools. Many of us will work for small or lesser-known companies that still find jQuery useful.

Focus on learning to code, solving problems, and staying focused on your goal, which is getting a job, not learning every JavaScript tool ever created.

I hope this message helps if you're feeling overwhelmed. There's a lot to learn, so focus on what works for you.
Buy verified cash app account
Tags: webdev, javascript, beginners, programming
Published: 2024-06-24 15:45:39

Buy verified cash app account
Cash app has emerged as a dominant force in the realm of mobile banking within the USA, offering unparalleled convenience for digital money transfers, deposits, and trading. As the foremost provider of fully verified cash app accounts, we take pride in our ability to deliver accounts with substantial limits. Bitcoin enablement, and an unmatched level of security.


Contact Us / 24 Hours Reply
Telegram:dmhelpshop
WhatsApp: +1 ‪(980) 277-2786
Skype:dmhelpshop
Email:dmhelpshop@gmail.com
Exploring the "legendary-dollop" Repository: An SVG Generator
Tags: svg, github, generator, basic
Published: 2024-06-24 15:43:42

The **legendary-dollop** repository, created by [charudatta10](https://github.com/charudatta10), is an intriguing project that generates SVGs. Whether you're designing banners, badges, or other visual elements, this tool can be a valuable addition to your toolkit.

## Key Features

1. **SVG Generation:**
   - The primary purpose of this repository is to create SVGs programmatically.
   - SVGs (Scalable Vector Graphics) are versatile, resolution-independent images that can be easily customized and scaled without loss of quality.

2. **Built with Python:**
   - The project is implemented in Python.
   - It leverages the Flask web framework for serving the SVGs and uses Waitress as the production server.

## Getting Started

1. **Installation:**
   - You have two options:
     - **Binary Installation:**
       - Download the binary file from the [releases](https://github.com/charudatta10/legendary-dollop/releases) section.
       - Double-click the binary to run the application.
     - **Source Installation:**
       - Clone the repository using:
         ```
         gh repo clone charudatta10/legendary-dollop
         ```
       - Explore the code and set up your development environment.

2. **Usage:**
   - The main entry point is `api/app.py`.
   - Customize the SVG generation logic according to your needs.
   - Refer to the [README](https://github.com/charudatta10/legendary-dollop/blob/main/README.md) for detailed instructions.


## Conclusion

The **legendary-dollop** repository provides a straightforward way to create SVGs dynamically. Whether you're a designer, developer, or hobbyist, give it a try and unleash your creativity!

Explore the repository: [charudatta10/legendary-dollop](https://github.com/charudatta10/legendary-dollop)

Happy SVG crafting! 🎨🚀
Como Transformar-se em uma Máquina de Aprender: Um Guia Pragmático
Published: 2024-06-24 15:37:07

**Disclaimer**

Esse post foi concebido pela IA Generativa em cima da transcrição do episódio original no Canal Dev Eficiente. Foi feita uma revisão rápida para adequação do conteúdo. [Você pode assistir o vídeo completo no próprio canal. ](https://www.youtube.com/watch?v=Cw9mcZSQDrY&list=PLVHlvMRWE0Y7_5jsAtVs44ZUNDOr5csx-&index=53)

## A Regra do Jogo

A regra básica é simples: quem estuda mais tende a chegar mais longe. Ter um método pragmático de estudo, que pode ser aplicado a qualquer coisa que você queira aprender, é essencial. Embora nosso foco aqui seja o viés profissional, esse método pode ser aplicado a hobbies e outras áreas de interesse.

## A Importância de Ser uma Máquina de Aprender

Ser uma máquina de aprender é uma habilidade cada vez mais desejada pelo mercado. Isso faz diferença na sua carreira, permitindo que você se movimente e se adapte a novos lugares. Eu, pessoalmente, construí essa habilidade ao longo do tempo, estudando bastante e desenvolvendo um método eficaz.

## Elementos de um Objetivo de Aprendizagem

**Objetivo Bem Definido:** Um objetivo de aprendizagem deve ser específico. Por exemplo, em vez de "quero aprender Spring Boot", defina "quero construir cruds super básicos com Spring Boot".

**Nível de Profundidade:** Estabeleça o nível de profundidade que deseja alcançar. Você quer entender, explicar ou ser capaz de construir algo? Cada nível exige um grau diferente de prática e compreensão.

**Ferramentas e Tecnologias:** Defina quais tecnologias e ferramentas você usará. Por exemplo, "quero construir crudes super básicos utilizando Spring Boot e Spring Data JPA".

**Contexto de Utilização:** O contexto em que você usará essa habilidade é crucial. Por exemplo, "preciso dessa habilidade para concorrer a vagas de dev júnior em empresas que me pedem para demonstrar conhecimento em quadros de qualquer cor".

**Critérios de Aceite:** Estabeleça critérios de aceite para saber quando atingiu seu objetivo. Por exemplo, "considero que estou pronto quando uma pessoa plena avaliar e confirmar que estou bem". Você pode estabelecer múltiplos critérios de aceite. 

## Conclusão

Se você quer estudar de maneira mais eficaz, acelerar seu desenvolvimento profissional e aumentar sua adaptabilidade, considero que este método pode ser muito útil. Qualquer dúvida, deixe um comentário e eu estarei aqui para ajudar.
ClientException with SocketException: Failed host lookup
Published: 2024-06-24 15:21:02

hi, i put  <uses-permission android:name="android.permission.INTERNET"/> in my AndroidManifest.xml, but id i call my api android show this error:

ClientException with SocketException: Failed host lookup: 'xxx.www.it' (OS Error: No address associated with hostname, errno = 7)


any Help?
Br max
NETWORK REQUEST FAIL
Published: 2024-06-24 15:04:40

Hi @everyone, please i have an issue and i don’t know if anyone here has faced something like that before. Error is “network request fail” while working on this mobile app, it was actually working at first but since i have connected to the supabase and running locally with Docker, I have been having the issue of “NETWORK REQUEST FAIL” please how can i resolve this ?
VerifyVault Beta v0.2.2 Released - Alternative to Authy
Tags: 2fa, authenticator, security, privacy
Published: 2024-06-24 15:01:50

🚀 **VerifyVault Beta v0.2.2 Released!** 🚀

Key Updates:

- Bugs fixed 🐞
- Updated user guide 📘
- Improved program navigation 🧭
- Code organization enhancements 🛠️

Upgrade your experience with VerifyVault's latest version today:
📂 Repository: [VerifyVault on GitHub ](https://github.com/VerifyVault)
📦 Download EXE: [Beta v0.2.2](https://github.com/VerifyVault/VerifyVault/releases/tag/Beta-v0.2.2)

_VerifyVault is an open source 2 Factor Authenticator for Desktop_
You're not in the right place if...
Tags: softwareengineering, engineer, career, job
Published: 2024-06-24 14:54:05

1. **Lack of Support from Management**:
   Your manager does not provide the necessary guidance or opportunities to help you grow professionally. Without their support, it becomes challenging to develop new skills or advance in your career.

2. **Credit for Work Taken by Senior**:
   Your senior colleague often presents the work you have completed as their own, taking credit for your efforts and contributions. This undermines your achievements and can negatively impact your career progression.

3. **Team Members Hindering Recognition**:
   Your team members actively prevent you from receiving the recognition you deserve for your hard work and accomplishments. This lack of acknowledgment can be demotivating and can affect your job satisfaction.

4. **Insufficient Time for Task Completion**:
   You are not allocated enough time to complete tasks effectively, leading to rushed work and potentially lower-quality results. This can create stress and hinder your ability to perform to the best of your abilities.

5. **Lack of Team Cohesion**:
   Your team does not function cohesively and fails to work collaboratively. This lack of teamwork can lead to inefficiencies, misunderstandings, and a less productive work environment.

Anything I missed? Please mention that in the comments.
Stop Using JSON.parse(JSON.stringify(object)) for Deep Cloning! Try This Instead
Tags: webdev, javascript, beginners, programming
Published: 2024-06-24 14:51:08

I am writing this article because I recently posted an article regarding Shallow Copy and Deep Copy. I wanted to jot down what I was doing until now and highlight a better approach for deep cloning objects, especially when dealing with nested keys containing non-string or non-number data.

Previously, I was using the method `JSON.parse(JSON.stringify(object))` for deep cloning. However, this approach often falls short when the nested key has different data types, requiring manual assignment for those particular key values.

Thanks to @jonrandy and @jahid6597 for shedding light on a better solution introduced in 2022: the `structuredClone()` function. This global function uses the structured clone algorithm to create a deep clone of an object, handling various data types more effectively.

The `structuredClone()` method also supports transferable objects. In such cases, the transferable objects in the original value are transferred rather than cloned to the new object. These transferred objects are detached from the original and attached to the new object, making them inaccessible to the original object.

Example 

![JSON object](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5gl6deqefblcs6q1tu2l.png)

Below, we use JSON.parse and JSON.stringify for cloning the object. 
However, notice that when it's logged, the 'eighth' key is not shown.

![JSON Parse Cloneing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/34fb7vvhrex0gul0if34.png)

To address the above issue, we can use the structuredClone() global function for a deep copy.

![Clone example using structuredClone()](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1erym7xdh1yu9dzc0as6.png)

The `structuredClone()` method is supported by modern browsers and can handle transferable objects efficiently.

For more details, please refer to the [official documentation](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone).
Number of Closed Islands | LeetCode
Tags: leetcode, java, beginners, algorithms
Published: 2024-06-24 14:43:00

``` java
class Solution {
    public int closedIsland(int[][] grid) {
        
        int row = grid.length;
        
        int col = grid[0].length;
        
        int countIsland = 0;
        
        
        for(int i=0; i<row; i++){
            for(int j=0; j<col; j++){
                if(grid[i][j]==0 && dfs(grid, i, j)){
                    countIsland++;
                }
            }
        }
        
        return countIsland;
    }
    
    
    boolean dfs(int grid[][], int i, int j){
        if(i<0 || j<0 || i>=grid.length || j>=grid[0].length)
            return false;
        
        if(grid[i][j]==1 || grid[i][j]==2)
            return true;
        
        grid[i][j] = 2;
        
        boolean up = dfs(grid, i+1, j);
        boolean down = dfs(grid, i-1, j);
        boolean left = dfs(grid, i, j+1);
        boolean right = dfs(grid, i, j-1);
        
        return up && down && left && right;
    }
}
```

Thanks for reading :)
Feel free to comment and like the post if you found it helpful
Follow for more 🤝 && Happy Coding 🚀

If you enjoy my content, support me by following me on my other socials:
https://linktr.ee/tanujav7
One simple solution for leetcode problem 14
Tags: beginners, programming, tutorial, cpp
Published: 2024-06-24 14:42:52


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


**First let us figure out  what should i do,we need find the common prefix for all strings in the vector**

So we just need compare the char in the same position for each string
But how to denote the particular char in the particular string in a vector?
Let us use the example 1 for a explanation
So if we wanna denote the 'r' in the 'flower' ,we can use strs[0][5] to refer 'r'
So now we get the methods to make a comparison for each char,if it is the same we save it into the result string 
but we also need to notice if it exit in the position of a string
We use the code to check :if(strs[j][i]=='\0')


so the full code is:

```
class Solution {
public:
    string longestCommonPrefix(vector<string>& strs) {
        //first we define a string for storing the result
        string commonprefix="";
        int condition=1;
        for(int i=0;i<strs[0].size();i++){
            char currentchar=strs[0][i];
        
            for(int j=1;j<strs.size();j++)
            {
                //should require two conditions :the position of the string is not NULL and same with currentchar,here we use the contrary condition for understand easily.
                if(strs[j][i]=='\0'||strs[j][i]!=currentchar){
                    return commonprefix;
                }
            }
            commonprefix.push_back(currentchar);
        }
        return commonprefix;
    }
};
```
Thank you for reading!
Backpex - a highly customizable admin panel for Phoenix LiveView applications
Tags: elixir, backend, admin, liveview
Published: 2024-06-24 14:40:02

Hello everyone!

I am excited to share our heart project Backpex with you.

After building several Phoenix applications, we realized that we were repeating ourselves when it came to building administration panels. We were writing the same CRUD views, search and filter functionality over and over again. We wanted a tool that would allow us to quickly scaffold these views and focus on building the core functionality of our applications.

The tool we wanted had to be able to serve as a simple backend administration panel in one project, while being the core of the application in another.

We looked at existing solutions, but found that none of them offered the flexibility and customization we were looking for, especially in terms of live updates and LiveView features. We decided to develop Backpex to solve this problem and provide a highly customizable administration panel for Phoenix LiveView applications. Backpex should not only be a simple administration interface for developers, but also a good-looking UI for end users.

Even though Backpex already offers a lot of features, there is still a lot to do. We also have many ideas for future work. That’s why we are very open for contributions and appreciate any help. We have just released a public roadmap 58 and created some issues that are open for contributions on GitHub (see “good-first-issue” label).

We really want to hear what you would like to see next and what is missing. We’d love to hear your feedback!

[Hex Package](https://hex.pm/packages/backpex)

[GitHub - naymspace/backpex](https://github.com/naymspace/backpex)

[Live Demo](https://backpex.live/)
Childproof Jars: Safe and Secure Storage Solutions for THC Products
Tags: secure
Published: 2024-06-24 14:25:19

childproof jars.png
Childproof Jars Secure Storage for Your THC Products



Are you looking for a safe and secure storage solution for your THC products 

Look no further than pill bottle

These jars are specially designed to keep your products secure and inaccessible to small children 

We will discuss the advantages of using childproof jars the innovation behind their design how to use them their quality and service and their various applications 



Advantages of Childproof Jars



Childproof \bottles of medicine offer many advantages over traditional storage solutions 

First and foremost these jars are designed to be tamper-resistant and feature a locking mechanism that prevents small children from accessing the contents 

This is necessary because THC products can be dangerous if accidentally ingested by children 

Additionally childproof jars are light-resistant which helps to preserve the potency of the products by limiting exposure to light 

They are also available in a variety of sizes and colors making them suitable for different product types and personal preferences 



Innovation Behind Childproof Jars



Childproof jars are the result of innovative design and careful engineering 

These jars feature a lid with a locking mechanism that is difficult for small children to open but easy enough for most adults to access 

The lid is made of high-quality plastic or glass which makes it durable and long-lasting 

These jars are also designed to be opaque which helps to limit exposure to light and preserve the quality of the contents 



How to Use Childproof Jars



Using childproof jars is easy and straightforward 

Simply remove the lid by pressing down on the locking mechanism and twisting it counterclockwise 

Once the lid is removed you can access the contents of the jar 

To close the jar simply push down on the lid and twist it clockwise until it is secure 



Quality and Service of Childproof Jars 



Childproof air tight jar are made from high-quality materials and are designed to be durable and long-lasting 

They are also backed by excellent customer service and support 

Many companies offer warranties and guarantees on their products ensuring that you are satisfied with your purchase 

Additionally these jars are easy to clean and maintain making them a reliable storage solution for all your THC products 



Applications of Childproof Jars 



Childproof jars are suitable for a variety of THC products including flower edibles concentrates and tinctures 

These jars are available in different sizes colors and materials making them customizable to meet your specific needs 

Whether you are a personal user or a dispensary owner childproof jars are a safe and reliable storage solution for all your THC products
Welcome to the Future!
Tags: webdev, chatgpt
Published: 2024-06-24 14:19:11

In conclusion, the launch of InnovateHub marks the beginning of an exciting journey filled with endless possibilities. We're thrilled to welcome you to this new frontier and can't wait to see the incredible things you'll achieve here. The future is bright, and with InnovateHub, you're equipped to shine even brighter. Join us today and be a part of something truly extraordinary. Welcome to InnovateHub – where your ideas take flight and the future is [now](https://g.co/kgs/72xGhYB)!
String in JavaScript.!
Published: 2024-06-24 14:18:38

**String**

string matinli malumotlarni saqlash uchun mo'ljallangan va ularni  **_double quotes_** va **_single quotes_**  lar ichiga yozib hosil qilish mumkin.!
misol uchun: 





```
let jsName = 'JavaScript';
console.log(jsName);
// natija - JavaScript
```

```
let lorem_ = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
console.log(lorem_);
// natija - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
```



Keyinchalik 2016 yildan, ES6 dan boshlab stringlarni  Template usulda hosil qilish imkoniham mavjud bo'ldi, template string quyidagi usulda hosil qilinadi.!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3i7izhcjrlbkktutwvqb.png)
Avalanche Photo Diodes for Automotive LiDAR Systems
Tags: diodes
Published: 2024-06-24 14:18:11

screenshot-1708567083343.png
Are you tired of always having to keep your eyes on the road? There must be something that can help make your driving experience a lot safer. Luckily, we have the technology we need to make it possible - the Avalanche Photo Diodes (APDs) for Automotive LiDAR Systems.



Benefits of Avalanche Photo Diodes

The avalanche photodiode detector strategies may help detect hurdles, traffic, pedestrians, and also other cars. They can also run in a variety of weather, that makes it perfect for your automobile or truck. LiDAR systems utilizing this technology can recognize things within real time, which will help keep you using your vehicle secure at all times.

Innovation at its Most Useful

The APDs are notable because of their high sensitiveness allowing them to identify possibly the change which is tiniest in environmental surroundings. This enables the ingaas avalanche photodiode  system's technology to instantly process the situations in comparison to other old-generation technologies. They shall make completely sure your security in almost every the weather.

Keeping You Safe

One of the main top features of having these apd is safety. The optical phase modulator system applying this technology can recognize things within real-time, such as for example pedestrians and also other vehicles. By having these features arranged in your vehicle, it'll be feasible to hold the tactile arms into the wheel while driving, which is to be crucial in ensuring the security of everyone in to the car.

Easy-to-Use Application

Using these APDs in LiDAR systems for automobiles is easy. The device is installed in your car, and you will utilize it similar to other navigation computer software installed in your very own vehicle while driving. It's simple and easy user-friendly to navigate. With the APDs running, you'll be at simplicity in just about any situation which is driving flake out while driving.

Quality Service

As soon as you purchase apd and LiDAR systems, you recognize you might be getting a cutting-edge item supported by its top-notch solution. of experts is focused on supplying the customer solution which is best possible. They will respond to all questions you could have, resolve issues quickly and effortlessly, and also is going to be readily available for you at any time concerning the time.





If you are looking for a way to make your driving experience safer, you can't go wrong with the APDs for Automotive LiDAR Systems. The innovative technology, high-quality service, easy-to-use application and, most importantly, the safety you receive from these products make them well worth the investment. So, invest in the avalanche photo diodes and secure peace of mind while driving.