teleren/devto huggingface dataset:
Room database. Basic entities in Java
Tags: java, android, beginners, tristan
Published: 2022-05-17 15:08:13

###Introduction
- This series is going to be where I put all my Android notes. As I learn something new about Android development I will put in this tutorial series
- Read the full documentation [HERE](https://developer.android.com/training/data-storage/room/defining-data.html#primary-key)

###What is Room?
- The `Room persistence library` provides an abstraction layer over SQLite to allow for more robust database access while harnessing the fill power of `SQLite`.

###What is SQLite?
- As the official SQLite [documentation](https://www.sqlite.org/fullsql.html) states, `do not be mislead by the lite in the name. SQLite is a full featured SQL implementation`. This means that basically all the same rules and queries you can do with SQL you can also do with SQLite. So terms like `table`,`row` or `column` mean the exact same thing as any other SQL based database

- However, using SQLite can result in a lot of boiler plate code that is tedious and error prone. That is where Room comes to the rescue. Room's entire job is the make working with SQLite a whole lot easier.


###Defining entities
- What is an entity? Well, when using the Room persistence library we define entities to represent the objects that we want to store. Each entity corresponds to a table in the associated Room database, and each instance of an entity represents a row of data in the corresponding table. We define an entity by annotating any Java class with the `@Entity ` annotation:
```
@Entity(tableName = "calves")
public class Calf {

    @PrimaryKey(autoGenerate = true)
    private Long id;

    @NonNull
    @ColumnInfo(name="tag_number")
    public String tagNumber;

//Constructor, getters and setters below
}

```
- When we use the `@Entity` annotation all the fields in the class are now mapped to columns in the database table. Each entity that we define must also have at least one field annotated with the `@PrimaryKey ` annotation. This field must be unique as it will act as the identifier in the underlying SQLite database.  Notice that I have `autoGenerate = true` in the primary key field. This tells Android that we want the SQLite database to handle the generation of this unique field, which is great because then we do not have to deal with super complex code trying to keep the id unique.
- You can also notice that we use `@ColumnInfo(name="tag_number")` to change the name of the column and `@Entity(tableName = "calves")` to change the whole table's name in the database.
- Now we have both created a simple and easy to use database Entity with Room


###Conclusion
- Thank you for taking the time out of your day to read this blog post of mine. If you have any questions or concerns please comment below or reach out to me on [Twitter](https://twitter.com/PlebDevTristan).
Fixing the accessibility of Inspection overlays
Tags: a11y, developertools, magnification
Published: 2022-05-17 14:56:02

---
title: Fixing the accessibility of Inspection overlays
published: true
description: Pressing ctrl+alt whilst moving the inspect tool around in Edge 102 makes sure that the information overlay doesn't vanish when you move the mouse
tags: accessibility, developertools, magnification
//cover_image: https://direct_url_to_image.jpg
---

The [Inspect tool](https://docs.microsoft.com/microsoft-edge/devtools-guide-chromium/css/inspect) is a great way to get information about different page elements before selecting then. Once it is enabled, it shows an information overlay as you move from element to element.

![Recording of the inspect tool in action](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bv3fe0z4pt04lir0dsir.gif)

The main problem with the tool is that sometimes it is tough to get the information about the right element, as they are too close together and the information overlay shows the next element once the mouse moved a bit. 

Whilst this can be annoying for any user, it becomes unusable for those who need to zoom the interface. In zoom mode, you magnify part of the screen and the magnification window moves with the mouse cursor. As the mouse cursor moves, the information overlay disappears, so you end up in a frustrating endless loop. 

We got a report of this as an accessibility issue in Microsoft Edge and fixed it. From Edge 102 onwards, you can now press Ctrl+Alt when you have an information overlay active to stop it from disappearing. This makes this tool also usable to screen magnification users as shown in this screencast. It starts with the current interaction and then shows what happens when you press Ctrl+Alt and move the mouse around.

![Information overlay in magnification mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l6it7wt4237u2hjrsti7.gif)

This also makes it easier for all users to get the information of Elements close to another. As an extra, you can also press Ctrl when you move the mouse around to only highlight the different elements and suppress the information overlay. This cuts down on a lot of noise.

![Pressing Ctrl while moving the inspect tool around doesn't show any information overlays](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6zb5p4sgtocjy793506k.gif)
 
This change shows that by fixing an issue for users of assistive technology, you can make it a better experience for everybody.

The problem has also been [filed on the Chromium project](https://bugs.chromium.org/p/chromium/issues/detail?id=1316208&q=owner:me&can=1).
5 things I wish I'd known before becoming a developer
Tags: career, beginners, codenewbie, webdev
Published: 2022-05-17 14:34:45

Two years ago I decided it was time to quit the career I'd be in for over eight years and start my journey to become a developer. Before starting I had many misconceptions about the tech sector, a lot of fear going into something brand new and I worried that I would not succeed at what looked like such an overwhelming and intense career.

Now being in web developer for over a year, I hope I can pass on some of the things I wish I'd known to new aspiring developers in hopes these will ease worries and encourage those who might be on the cusp of starting to code.

**1. Don't feel like you need to learn everything at the beginning, it's a process**
This is something I worried about massively, feeling like I had to learn everything before I could be classed as a 'real developer'. This simply isn't true! As long as you have the right mindset, enjoy solving problems and know how to read documentation, you can be on the road to being a great developer. Every day is a learning day in this job, you could be learning new syntax or a new method one day and the next looking into a completely new framework.

**2. No one person is an expert in everything**
If you're like me and thought number 1 was true, then you probably believe this is true. The tech sector is vast. There are so many different programming languages, frameworks and ways of working that to learn it all would probably take a lifetime. People will have specialities and will know more about what they've chosen, but still won't know it all. The tech world changes day by day, so again, every day you will learn something new.

**3. It's a crazy huge sector with a lot of opportunities** 
Following on from my first two points, I knew this industry was large as I hadn't the foggiest what I wanted to do, or what language I wanted to work with but I think what I didn't appreciate was just how much opportunity there would be. Coding is an almost international language. Once you know a programming language you can work pretty much anywhere in the world.

**4. There is a common link between languages, so don't be scared to learn new one once you've got the *hang* of one**
Although there are lots of differences between languages, once you've learned the basics of one you apply these to another. Of course, there are a lot of quirks that one will have that another doesn't but don't be scared to dive into something new and have a go!

**5. There is a massive community in the tech world and most people are friendly and eager to help others**
In some workplaces, the environment can be quite toxic in that people are wanting to get one up on you and not provide help to support you. I think that within programming, it's a whole different ball game. Of course, people will be thinking of themselves, but they also want to help better you. Whether this is in the office or people online, everyone I've come across so far seems super eager to help. This is great for beginners as there are lots of people to ask and learn from.

*Photo by Christopher Gower on Unsplash*
Building apps based on ChatML
Published: 2022-05-17 14:30:22

Im developing an app in flutter.
The app has around 100 screens.
1 Client liked it, 2nd client wants to change the layout, 10th client wants to change the layout

Then i came to a stop, i cant keep changing screens for every client.

Then came the idea, what if i create an app which works like a guided chatbot?

The app has a homescreen with 3x3 icons
each icons load a URL in webview?

Webview? is supported in app development
but not in a chatbot?

Why not? Thats why im here...
Why cant a Chatbot loadup a URL based on some Click/Intent?
eg: Click -> load url {domain.com/page}

and going further? why cant a chatbot load a specific content from a URL? 
eg: Click -> load url {domain.com/page "shortcodeid"}

there are other options as a solution for this, 
im requesting a feature in dialogflow to have an option load URL and a widget/shortcode/div fragment of a page to be loaded in the app

Security: Yes, the app should not load external domain URL, but only the pages that are embedded in the app
How to save data from real-time database to Firebase and delete it in real-time database?
Tags: vue, firebase, vuefire, programming
Published: 2022-05-17 14:25:35

**Below is my code to be able to save the data in the Firestore. Mais ça ne fonctionne pas**
`saveColis(key) {
        if (this.access == 5 || this.access == 4 || this.access == 3) {
          Swal.fire({
            title: "Has the delivery been made?",
            text: "The delivery will be saved forever!",
            icon: "success",
            showCancelButton: true,
            confirmButtonColor: "#34B76E",
            cancelButtonColor: "#BEBEBE",
            cancelButtonText: "Non",
            confirmButtonText: "Oui",
          }).then(async (result) => {
            if (result.isConfirmed) {
              return db.ref("Colis Requetes").child(key).once("value").then(function (snapshot) {
                  snapshot.forEach(function (childSnapshot) {
                    let childData = childSnapshot.val();
                    dbstore.collection("delivery_completed").add({
                      client_name: childData.client_name,
                      client_phone: childData.client_phone,
                      colis_type: childData.colis_type,
                      contact_recup: childData.contact_recup,
                      created_at: childData.created_at,
                      depart_address: childData.depart_address,
                      dest_address: childData.depart_address,
                      dest_contact: childData.dest_contact,
                      id_colis: childData.id_colis,
                      livreur_id: childData.livreur_id,
                      montant: Number(childData.montant),
                      valeur: Number(childData.valeur),
                      nature: childData.nature,
                      categorie: childData.categorie,
                      payment_method: childData.payment_method,
                      boutique_id: childData.boutique_id,
                      statut: "delivered",
                    });
                    db.ref("Colis Requetes").child(key).remove(),
                      Swal.fire(
                        "Registered delivery!",
                        "The delivery has been registered successfully.",
                        "success"
                      );
                  });
                });
            }
          });
        } else {
          const Toast = Swal.mixin({
            toast: true,
            position: "top-end",
            showConfirmButton: false,
            timer: 5000,
            timerProgressBar: true,
            didOpen: (toast) => {
              toast.addEventListener("mouseenter", Swal.stopTimer);
              toast.addEventListener("mouseleave", Swal.resumeTimer);
            },
          });
          Toast.fire({
            icon: "error",
            title: '<span style="color:#B74334">Unauthorized action!</span>',
          });
      }
    },`
React DevTools - What is considered in Layout Effects' metric?
Tags: reactnative, devtools, react
Published: 2022-05-17 14:17:47

Hello everyone!

I'm using React DevTools to profile our app for performance enhancements. I understand that the 'render' metric informs how much time was taken by the React renderer to prepare the element tree, but there are some commits which report the most processing time as being 'Layout Effects'. I would like to know what that metric really is since I can't really understand which elements are involved or where the layout effects are taking place. Below is a screenshot which we can see that a commit reported ~500ms as layout effects but nothing was rendered:

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

I appreciate your help.

Thanks!
[pt-br] Iniciando na Programação
Tags: beginners, braziliandevs
Published: 2022-05-17 14:03:23

Olá pessoal, meu nome é Talytta e eu decidi começar a postar aqui no dev.to para documentar a minha jornada na programação.

## Sobre come eu comecei

Eu sou de uma cidade bem pequena do RS, e acho que lá por dezembro do ano passado resolvi começar a estudar programação. Comecei pelos vídeos do prof.º Guanabara, e o algoritmo foi me ajudando a encontrar vários outros conteúdos do tipo.

Teve então um processo seletivo na Let's Code, acredito que em fevereiro, voltado para mulheres e eu pensei "Aí está a minha chance de conseguir uma bolsa para estudar". Só que eu não passei, fiquei bem triste, mas logo em seguida teve se eu não me engano a 4º edição da imersão dev da Alura da qual eu participei. Logo depois, eu lembro que estava procurando novos conteúdos e me deparei com um anúncio do **Oracle ONE**, um programa da Oracle em parceria com a Alura voltado para pessoas que qurem começar a estudar programção e não têm condições financeiras para tal. 

Realizei a minha inscrição e tive a grata surpresa de passar no processo. Serão seis meses curso (já se passou um mês), envolvendo trilhas sobre lógica de programação, desesenvolvimento frontEnd e java. Recentemente eu passei em outro processo parecido, então estou estudando em dobro XD. 

Vou compartilhar por aqui um pouco de como eu estudo, como organizo meu tempo, como estudo inglês, entre outras coisas.

## Um pouco sobre mim:

* tenho 21 anos;
* gosto muito de ler (romance, fantasia, distopias, sci-fi, terror);
* amo HIMYM, Two and a Half-Man, Simpsons;
* gosto de jogar no ps4 do meu namorado :)
* adoro escrever mas ao mesmo tempo tenho muita preguiça de fazer isso.
How do I know if it’s burnout I’m feeling or something else?
Tags: discuss, anonymous
Published: 2022-05-17 13:52:00

_This is an anonymous post sent in by a member who does not want their name disclosed. Please be thoughtful with your responses, as these are usually tough posts to write. Email sloan@dev.to if you'd like to leave an anonymous comment or if you want to ask your own anonymous question._

***

I have been a developer for a number of years, working my way from graduate junior to now an experienced senior, I have loved the climb and generally known when it felt right to move onwards and upwards.

A bit of background: I was working for a startup which should have gone live by or roughly around the time the pandemic hit.  The small team thought we had got the system in a place to have been live but the founder was hesitant and when the pandemic hit pulled the plug all together on the project and the company focus switched drastically to a domain I was not familiar with nor ever felt a need to be part of (I'd had bad experiences of this domain before).

It got to the point where my workload pretty much depleted to nothing, yet the company was growing in number and the people who seemed to have been handed responsibility for my work became massive bottlenecks as they didn't know what they were doing. I spent 2 weeks telling the founder the equipment provided for my role was inadequate and yet nothing was done until I asked for one of the cloud dev environments the company was supposed to have rolled out 2 years before but hadn't although it was still on the todos list.

Feeling redundant I sought new employment and successfully gained employment elsewhere. Now on probation I find it hard to get going at the full power I once was at, forever saying nothing because my opinion obviously doesn't mean very much if my last company just glossed over it, I am scared of failing probation and failing the family my energetic and eager approach to my coding career now supports.

Is this burnout? Do I just need to get confidence back by being my best and letting my new team decide its merits for themselves? Do I need to stop worrying I am the sole provider for my family?
Installing Tailwind CSS with Create React App
Tags: javascript, tutorial, react, tailwindcss
Published: 2022-05-17 13:36:56


1

1. **Create your project**

Start by creating a new React project with Create React App v5.0+ if you don't have one already set up.

```
npx create-react-app my-project
cd my-project
```

2.**Install Tailwind CSS**

Install tailwindcss and its peer dependencies via npm, and then run the init command to generate both tailwind.config.js and postcss.config.js.

```
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
```

3. **Configure your template paths**
Add the paths to all of your template files in your tailwind.config.js file.

 

```
module.exports = {
  content: [
    "./src/**/*.{js,jsx,ts,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}
```

4. **Add the Tailwind directives to your CSS**
Add the @tailwind directives for each of Tailwind’s layers to your ./src/index.css file.

```
@tailwind base;
@tailwind components;
@tailwind utilities;
```

5. 
**Start your build process**

Run your build process with `npm run start`.

```
npm run start
```

6. **Start using Tailwind in your project**

Start using Tailwind’s utility classes to style your content.

```
export default function App() {
  return (
    <h1 className="text-3xl font-bold underline">
      Hello world!
    </h1>
  )
}
```

Credit [TailwindCss]( https://tailwindcss.com/docs/guides/create-react-app )
Tutorial Cara Memasang Sentry Monitoring pada Laravel
Tags: laravel, tutorial
Published: 2022-05-17 13:29:30

Pada postingan kali ini aku akan berbagi bagaimana cara memasang sentry error monitoring pada laravel sebelumnya kenalan dulu apa itu sentry

Sentry lebih dari software untuk monitoring error. Sentry juga merupakan software yang dapat digunakan untuk performance monitoring. Platform Sentry dapat membantu developer dalam mendiagnosis, memperbaiki dan mengoptimalkan kenerja kode yang telah dibuat. Dengan Sentry, developer dapat menghemat waktu dan energi. Saat ini, Sentry mendukung lebih dari 30 bahasa pemrograman seperti PHP, Go, Python, Javascript dan masih banyak lagi.

untuk tutorial integrasi dengan Laravel kamu bisa baca disini yaa
[Tutorial Memasang Sentry Monitoring untuk Laravel Project](https://diskusikoding.com/tutorial-memasang-sentry-monitoring-untuk-laravel-project)
Source Code Pro Font in VSCode (macOS)
Tags: webdev, vscode, fonts, programming
Published: 2022-05-17 13:19:20

I've been using the Source Code Pro Font for coding in my VSCode setup (on macOS) for quite some time now. Personally, I've been loving it and would highly recommend it to others.

Setting it up is really easy! I've documented all the [required steps here](https://codingshower.com/using-source-code-pro-font-in-vs-code-on-macos/) that you can follow. It won't take more than 5mins, so go for it!
Payload has been accepted into Y Combinator S22
Tags: startup, javascript, webdev
Published: 2022-05-17 13:05:53

Today, we are thrilled to announce that [Payload](https://payloadcms.com) has been accepted into the Y Combinator S22 batch and has secured its first $500K in investment, which will ensure that our team will be able to continue to build Payload into the most powerful developer-first headless CMS available.

Since we started building Payload in 2018, our mission has been crystal-clear: finally give developers a better choice when it comes to working with a CMS. We've poured our hearts and souls into the architecture of Payload for almost four years, trying to realize our goal. Now, Payload is live and being used around the world. We're so happy to see such positive reception from the developer community, and that positivity fuels us to commit ourselves more and more every day to making Payload as great as it can possibly be.

The team at [Y Combinator](https://ycombinator.com) sees the value in what we've built and understands the potential for Payload to be developers' first choice when they select a headless CMS. They've officially given us a vote of confidence that we have what it takes to complete our mission, accepted us into their S22 batch, and invested $500K in our vision.

With this funding, we're going to catapult Payload to the next level.

**We've got a lineup of extremely exciting announcements coming over the next few weeks**—so keep an eye out for a ton more from our team!
O que é um ORM?
Tags: beginners, braziliandevs, database
Published: 2022-05-17 12:56:13

O mapeamento relacional de objeto (orm), é uma técnica programacional que permite consultar e manipular dados de um banco utilizando um paradigma orientado a objetos. Ao falar sobre orm estamos nos referindo a uma _biblioteca_ que implementa esta técnica de mapeamento de objeto relacional (Object-Relational Mapping), daí a sigla orm.
- A parte Object é aquela que você usa com sua linguagem de programação (python neste caso).
- A parte relacional é um sistema gerenciador de banco de dados relacional (um banco de dados que é) existem outros tipos de bancos de dados, mas o mais popular é o relacional (você conhece tabelas, colunas, pk fk etc, por exemplo, Oracle MySQL, MS-SQL).
- E finalmente a parte de Mapeamento é onde você faz uma ponte entre seus objetos e suas tabelas.

Aqui temos um exemplo fictício.

> Você tem uma classe de livros, deseja recuperar todos os livros cujo autor é "Linus". Manualmente, você faria algo assim:

`book_list = new List();
sql = "SELECT book FROM library WHERE author = 'Linus'";
data = query(sql); // I over simplify ...
while (row = data.next())
{
     book = new Book();
     book.setAuthor(row.get('author');
     book_list.add(book);
}`

> Com uma biblioteca orm ficario assim:

`book_list = BookTable.query(author="Linus");`

A parte mecânica é tratada automaticamente através da biblioteca ORM.

## Como aprender sobre ORM?
Bem, use um. Qualquer que seja a biblioteca ORM que você escolher, todas elas usam os mesmos princípios. Existem muitas bibliotecas ORM por aqui:

- Java: Hibernate.
- PHP: Propel or Doctrine (I prefer the last one).
- Python: the Django ORM or SQLAlchemy (My favorite ORM library ever).
- C#: NHibernate or Entity Framework.

> Se você quiser experimentar uma biblioteca ORM na programação da Web, seria melhor usar uma pilha de estrutura inteira como:

- Symfony (PHP, usando Propel ou Doctrine).
- Django (Python, usando um ORM interno).