teleren/devto huggingface dataset:
Resolvendo problemas no HackerRank: A grade de pesquisa
Tags: javascript, beginners, programming
Published: 2023-04-28 16:38:45

Olá, seja bem vindo a mais um Resolvendo problemas no HackerRank: No caso de hoje, vamos movimentar uma grade com resultados. Vejamos mais informações com a explicação e sua resolução.

**The Grid Search -**

Dada uma matriz de cadeias de dígitos, tente encontrar a ocorrência de um determinado padrão de dígitos. Nas matrizes de grade e padrão, cada string representa uma linha na grade. Por exemplo, considere a seguinte grade:

```
1234567890  
09 876543 21  
11 111111 11  
11 111111 11  
2222222222  
```
A matriz padrão é:

```
876543  
111111  
111111
```

O padrão começa na segunda linha e na terceira coluna da grade e continua nas duas linhas seguintes. Diz-se que o padrão está  presente  na grade. O valor de retorno deve ser  YES ou  NO, dependendo se o padrão for encontrado. Nesse caso, retorne  YES.

Descrição da função

Complete a  função gridSearch  no editor abaixo. Ele deve retornar  YES se o padrão existir na grade ou  NO não.

gridSearch tem o(s) seguinte(s) parâmetro(s):

- string G[R]:  a grade para pesquisar
- string P[r]:  o padrão a ser procurado

Vejamos o código em execução:

```
function gridSearch(G, P) {
    // Write your code here
  for(let i=0; i<=G.length-P.length; i++){
    for(let j=0; j<=G[0].length-P[0].length; j++){
        var k = 0;
    while ( G[i+k].slice(j,j+P[0].length) == P[k] ){
           k++;
        if(k == P.length) return 'YES';
    }
  }
}
  return 'NO';
}
```

O código usa dois loops for aninhados para percorrer todas as posições possíveis na matriz G onde o padrão P pode ser encontrado. O primeiro loop for itera pelas linhas de G, enquanto o segundo loop for itera pelas colunas de G.

Dentro dos loops for, uma variável k é definida como zero para acompanhar o progresso na comparação entre G e P.

Em seguida, um loop while é usado para comparar as partes relevantes de G e P. A condição do loop while verifica se a fatia da matriz G é igual à linha correspondente de P.

Se o loop while chegar ao final do padrão P, ou seja, se k for igual ao comprimento de P, isso significa que o padrão P foi encontrado em G. Nesse caso, a função retorna a string 'YES'.

Se o código não encontrar o padrão P em nenhuma posição possível na matriz G, a função retorna a string 'NO' após percorrer todos os elementos.

O resultado será:

```
2
10 10
7283455864
6731158619
8988242643
3830589324
2229505813
5633845374
6473530293
7053106601
0834282956
4607924137
3 4
9505
3845
3530
15 15
400453592126560
114213133098692
474386082879648{-truncated-}

Expected Output
- YES
- NO
```
Assim, concluímos mais um _Resolvendo problemas no HackerRank:_ até a próxima.
Introducing Tracetrail - The API Debugging Tool You Need
Tags: node, javascript, webdev, typescript
Published: 2023-04-28 16:31:26

Do you ever find yourself struggling to debug your API? Do you spend countless hours trying to locate issues and decipher payloads transferred between your client and server? If so, then you need Tracetrail - the API debugging tool that will change your life.

Tracetrail is more than just an npm package. With Tracetrail, you can finally wave goodbye to the tedious task of debugging, regenerating error responses and say hello to a streamlined process that will leave you wondering how you ever managed without it.

Tracetrail makes debugging simple by recording input and output payloads, allowing you to easily locate issues and get insights into your API's performance. Its user-friendly interface makes navigating through the recorded payloads a breeze, so you can spend less time searching for problems and more time building your application.

To get started with Tracetrail, all you need to do is install the package using npm:

```bash
npm install tracetrail
```

Once installed, you can start using Tracetrail in your project. Initialize it with the MongoDB database's URL to store the recorded payloads:

```
import { TraceTrail } from 'tracetrail'
import express from 'express'

const traceTrail = new TraceTrail('mongodb://localhost:27017/TraceTrail')
```

Add the Tracetrail middleware to your Express application using the traceTrail.MiddleWare method:

```
app.use(traceTrail.MiddleWare)
```
And that's it! Tracetrail will automatically start recording the payloads and make your debugging process a breeze.

But wait, there's more! Tracetrail also comes with a built-in UI that allows you to view the recorded payloads easily. 


![Tracetrail UI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u7mhqppa1tuip1dzm9m9.jpg)


With just a few lines of code, you can add the Tracetrail UI to your application:

```
app.use('/tracetrail', traceTrail.UI())
```

This will create a new route in your application that will display the Tracetrail UI, so you can easily navigate through the recorded payloads and gain valuable insights into your API's performance.

In conclusion, Tracetrail is not just another npm package; it's a superhero that will save you from the tedious task of debugging. With its simple installation, user-friendly interface, and built-in UI, Tracetrail is a must-have for any developer working with APIs. 

So what are you waiting for? Install Tracetrail today and say goodbye to your debugging woes!
Creating demos for your web applications
Tags: demos, projects, webdev, jobsearch
Published: 2023-04-28 15:57:13

Recording a demo for your application can be an effective way to showcase its features to recruiters and potential users. It'll help them better understand how your project works and what it can do. Highlighting the key features and giving visual representation can help you stand out and increase your chances of landing a job during your search.

## Here are a few tips:

**1. Create a script**

creating a script or giving yourself guidelines to follow will make the recording process 10x's easier. I'll ensure that you cover everything that you want presented.

**2. Opening**

Make sure to introduce yourself before starting. Give a greeting, state your name, the name of the project as well as a brief description of what it is and why you chose it.

**3. Demonstration**

Make sure to speak clearly and at a steady pace, highlight each feature and if you want, include any stretch goals that you may have.

**4. Closing**

 When wrapping up make sure to repeat your name and the name of the project as well as reiterating what the project does. Then end it by thanking the viewer for their time.

**5. Keep it short**

Try to keep your demo short, aim for a video that is no longer than five minutes long.

**Example: **

**_<u>Opening </u>_**

Hello! My name is **[YOUR NAME HERE]** and this project is called **[PROJECT NAME HERE]**! **[A BRIEF DESCRIPTION OF THE WEBSITE]**.


_**<u>Middle </u>**_

**[HOW DID YOU COME UP WITH THIS IDEA?]
**

**[  DEMO WEBSITE ]**


_**<u>
Closing </u>**_

In the future, I would really like to [STRETCH GOALS] But other than that that’s all I have! 

again my name is [YOUR NAME HERE] and my project is called [NAME OF WEBSITE AND BRIEF DESCRIPTION]! And Thank you for your time! 

**6. Screen recording tool**

Loom is a great tool for creating demos and is easy to use! You are able to download it on your computer as well as make it a Chrome extension for quick and easy access. It also allows you to trim and edit your videos if needed. 

## Conclusion

Recording demos for your projects can be an effective way to showcase your skills and help you stand out.
Best way to get feedback on productivity tools for developer
Tags: beginners, programming, productivity
Published: 2023-04-28 15:47:17

Hello, I'm an undergraduate student majoring in computer science in Korea and It's my first time to post on reddit. ( Sorry for bad english)

I have come up with an idea for a productivity tool for developers, and I would like to gather diverse feedback from global developers. 

Are there any common or effective ways to do this?

Thanks!!
process.env.NODE_ENV.
Tags: javascript, programming, webdev, node
Published: 2023-04-28 15:38:46

There is a built-in environment variable called NODE_ENV. You can access it from process.env.NODE_ENV. This variable changes based on what mode you are currently in. When you run npm start, it is equal to ‘development’, when you run npm test it is equal to ‘test’, and when you run npm run build it is equal to ‘production’. This variable is special as it can be used to access different environment configurations based on your mode.
Lyra: El futuro de los negocios y los beneficios de la integración de las Fintech en el mundo eCommerce
Published: 2023-04-28 15:36:39

En el mundo durante los últimos cinco años, la dinámica del mercado global de comercio electrónico ha estado en un nivel increíblemente destacado, con una tasa de crecimiento anual promedio del 25 % según [Statista ](https://www.belloamanecer.mx/)y en Chile según datos de la CCS en 2020 el comercio online de bienes se duplicó, en 2021 combinando bienes y servicios las ventas rozaron por [primera ](https://www.provincialnoticias.cl/)vez los US$ 12 mil millones, el año pasado, producto de la condición país y del ajuste posterior al fuerte crecimiento, las ventas online de bienes tuvieron su primer retroceso en la historia, pero las de servicios lograron recuperarse a tasas [incluso ](https://www.impactodiario.cl/)del 90%, un logro gigantesco luego de las dramáticas pérdidas en plena [pandemia](https://www.elpuntonoticias.mx/).
Conducir sueños
Published: 2023-04-28 15:35:40

El 17 de abril de 2023 arrancó la Cumbre Mundial de Concesionarios Dongfeng en Wuhan, [provincia ](https://www.belloamanecer.mx/)de Hubei, China. Más de 100 personas de más de 30 países y regiones, entre ellos Chile, Noruega, Arabia Saudita y Vietnam, asistieron a la [Cumbre](https://www.provincialnoticias.cl/), aprendiendo sobre la estrategia de desarrollo de negocios en el extranjero de Dongfeng, los logros de investigación y desarrollo tecnológico, la planificación de productos, etc., [construyendo ](https://www.impactodiario.cl/)aún más el consenso, [profundizando ](https://www.elpuntonoticias.mx/)la cooperación y el desarrollo común.
What was your win this week?
Tags: discuss, weeklyretro
Published: 2023-04-28 15:19:25

---
title: What was your win this week?
published: true
description: Looking back on this past week, what was something you were proud of accomplishing?
tags: discuss, weeklyretro
---

Hey everybody 👋

Hope all you folks enjoy your weekends!

Looking back on this past week, what was something you were proud of accomplishing?

All wins count — big or small 🎉

Examples of 'wins' include:

- Starting a new project
- Fixing a tricky bug
- Cooking up a delicious meal 🍛

---

![A group of Pokemon jump up together in celebration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlundpe6e1bv8av3xnh1.gif)
Hat jemand Erfahrung mit Reinigungsdiensten für Airbnb-Unterkünfte?
Published: 2023-04-28 15:19:07

Ich vermiete eine Airbnb-Unterkunft und suche nach einem zuverlässigen Reinigungsdienst, der zwischen den Gästen reinigen kann. Es ist wichtig, dass die Wohnung jedes Mal gründlich gereinigt wird, damit die Gäste eine positive Erfahrung machen und auch die Sauberkeit gewährleistet ist. Hat jemand Erfahrungen mit Reinigungsdiensten für Airbnb-Unterkünfte?
How to earn from youtube
Published: 2023-04-28 14:10:09

Monetize your videos: YouTube offers the YouTube Partner Program (YPP) which allows you to monetize your videos with ads. To be eligible for YPP, your channel must have at least 1,000 subscribers and 4,000 watch hours in the past 12 months. Once you're approved, you can monetize your videos by allowing ads to be displayed on them.
See the blog on [saukrit.com](https://saukrit.com/mrbeast-net-worth/) there you will get most popular youtuber net worth

Use affiliate marketing: Affiliate marketing allows you to earn a commission by promoting other people's products. You can include affiliate links in your video descriptions to promote products that are relevant to your audience.

Sell merchandise: If you have a loyal following, you can sell merchandise like t-shirts, hats, and stickers. You can use services like Teespring or Merch by Amazon to create and sell your merchandise.

Offer sponsored content: Brands may be willing to pay you to create sponsored content for them. Make sure to disclose sponsored content to your audience and only work with brands that align with your values.

Offer services: If you have a specific skill set, you can offer services like consulting or coaching. You can promote your services on your channel and use your videos to establish yourself as an expert in your field.

Crowdfund your content: You can use platforms like Patreon or Kickstarter to crowdfund your content. This allows your viewers to support you on an ongoing basis and helps you to create more content.
How do eco-friendly custom cereal boxes benefit both the environment and the business?
Tags: customcerealboxes, cereal, cerealpackagingboxes, theerealbox
Published: 2023-04-28 15:11:18


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

## **Introduction**

Explanation of the importance of eco-friendly packaging for custom cereal boxes
Overview of the benefits for both the environment and the business

## **Environmental Benefits of Eco Friendly Custom Cereal Boxes**

Explanation of how eco-friendly yellow cereal box help reduce waste and conserve resources
Discussion of the importance of using sustainable materials for custom cereal boxes
Examples of eco-friendly packaging designs and technologies that can reduce environmental impact

## **Business Benefits of Eco-Friendly Custom little cereal boxes**

Explanation of how eco-friendly [custom cereal boxes wholesale](https://hellocustomboxes.co.uk/product/cereal-boxes/) or little cereal boxes can improve a company's reputation and brand image
Discussion of the potential cost savings and increased efficiency associated with eco-friendly packaging
Examples of companies that have successfully implemented eco-friendly packaging practices and seen positive business results.

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

## **Case Studies of Successful Eco-Friendly Custom Cereal Box Implementation**

Overview of companies that have successfully implemented eco-friendly packaging for single serve cereal boxes or custom cereal Analysis of the benefits and challenges of their implementation
Lessons learned and key takeaways for other businesses considering eco-friendly packaging options

## **Conclusion**

Recap of the environmental and business benefits of eco-friendly cereal packaging boxes
Call to action for businesses to prioritize sustainability in their packaging practices
Refactoring Code for Improved Readability, Functionality and Efficiency
Published: 2023-04-28 15:11:00

As a Software Engineer, we strive to write clean, legible, and easy to maintain code.  In many cases the initial code is not necessarily this way, therefore we use the method of “Refactoring” to clean things up.  A personal example of this can be found in the JavaScript snippet below.
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k592bglisocb66tes1fu.png)

Here we have a cluster of five separate functions to perform fetch() GET requests to various URL’S.  Each function pulled a full season of tv episodes and passed them to the same repeated functions.  Not only were these hard to read and maintain but also caused functionality issues as they were not always guaranteed to fire in chronological order.  Knowing this wasn’t going to provide users with a positive experience, we searched for a better solution.

Low and behold, we came across JavaScripts “Promise.all” method which proved to be the perfect solution for this situation.  As you can see in the refactored code below we were able to take five confusing/repetitive functions and condense them down into a few concise code blocks.

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

Let’s explain how; Promise.all takes an array as an argument (in this case allSeasons – an array of tv show “seasons”) and allows you to pass data down through your fetch calls as you would in a typical .then statement.   The nifty part here is the response is not provided until all fetch calls are resolved (which solved our timing issues with the GET requests).   Then using the .map() method, we create a new array converted into .JSON format.  We are then able to use the forEach method to hand off the individual season's episodes to the spotlightEpisode, renderSeason, and HandleNavClick functions.

In conclusion refactoring and restructuring code is a major part of the software engineering journey and provides a way to produce clean, efficient code with an increased level of maintainability.
AI TRiSM
Tags: ai, chatgpt, technology, storybytes
Published: 2023-04-28 14:32:03


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

Next time you wonder if you can trust ChatGPT or any other model, find a team to implement AI TRiSM practices and tools to answer that critical question. There’s no reason you have to operate in the dark. As AI models proliferate, we expect AI TRiSM methods and tools will be more commonly adopted by teams across the enterprise involved in AI. The AI TRiSM framework helps identify, monitor and reduce potential risks associated with AI technology in organisations - including the buzzy generative and adaptive AIs. By using this framework, organisations can ensure compliance with all relevant regulations and data privacy laws. The rule of Wild Wild West still runs the Regulations and data privacy rules. An adaption to the law or personal data protection isn’t, unfortunately, always the first step the AI Giants do follow. Often, it’s all about the Penalty first, Adaption second. According to Gartner, organisations that introduce AI TRiSM into business operations of AI models can see a 50% improvement in adoption rates due to the model’s accuracy. The four pillars, Explainability, Operations, Security and Privacy, build trust with its customers while benefiting from artificial intelligence's upcoming technologies. The AI TRiSM market is still new and fragmented, and most enterprises don’t apply TRiSM methodologies and tools until models are deployed.  That’s shortsighted because building trustworthiness into models from the outset - during the design and development phase - will lead to better model performance.
Props in React ✨
Published: 2023-04-28 14:14:18

Props (properties) are for communication among components. Think of it like an argument to functions. So this allows us to pass data between components using said props. 

- One thing to remember about passing props is that it is a unidirectional flow, the order should be: Parent ➡️ Child

## Let's try to pass some data down with props!
So we'll say that our "App.js" is our parent function. (Typically this is on top of your component hierarchy)

Here we'll also import our child component. So let's call it Header.
Our goal here is to make Header more dynamic.

Let's make a quick component hierarchy just so we can remember where we're at because things can get messy quick.


├── App
│   ├── Header

Nothing too crazy here yet, but remember to stop and think about what component parents which. This will be very important in making your workflow a lot less painful.


_Don't forget to import React_

## App.js 
```
import React from 'react'
import Header from './Header'

function App() {
    return (
    <div>
        <Header />
    </div>
    );
}

export default App;
```
So this is how App is currently looking. I want to give it some props to pass down.  

- The syntax for creating props for a component is the same syntax as for writing attributes for an HTML tag. 

```
import React from 'react'
import Header from './Header'

function App() {
    return (
    <div>
        <Header greeting="Hello" name="Mely"/>
    </div>
    );
}

export default App;
```
Now we have some props to pass down! Header now has access to the information we have stored in the attributes. 

- Note: Coolest thing about props is that they can be any data type, in this example it is a string data type.

Let's use this data in our Header component. 

## Header.js
```
import React from 'react'

function Header(props) {
    return (
    <div>
        <h2>{props.greeting}!, my name is {props.name}.</h2>
    </div>
    );
}

export default Header;
```
Header takes in the props as an argument to the React function. You can gain access to the data by using dot notation. 
- Syntax of passing down the data is {props.insertNameOfPropHereLol}

If dot notation is just too much for your keyboard, we could also pass down props using destructuring. Destructuring makes it possible to unpack the value into its own distinct variables.

## Header.js
```
import React from 'react'

function Header({greeting, name}) {
    return (
    <div>
        <h2>{greeting}!, my name is {name}.</h2>
    </div>
    );
}

export default Header;
```
The new syntax for the Header's argument is to wrap the specific props we want to pass down in a curly bracket{}. This makes our code so much easier to read and know what's going on. 

We did it!! We passed down information using props :)


[In depth on destructuring ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment)
[React Props Explained with Examples](https://refine.dev/blog/react-props/)
[Components and Props](https://legacy.reurlactjs.org/docs/components-and-props.html)
AR➡️Analyst➡️Software Engineer
Tags: beginners, wecoded, webdev
Published: 2023-04-28 14:13:57

I took a major step towards changing career paths. I have always dabbled in coding, customizing my personal websites and learning the basics. I never saw it as a possible career path until now. A light bulb 💡 went off one day. I have been "dabbling" in code since before graduating high school almost 15 years ago😮‍💨. 

It wasn't until I left my Accounts Receivable Specialist job of almost 10 years that I knew I wanted something different. My new analyst job provided me with a couple of work from home days but I needed more. I was most productive working in my own home. I had the setup perfect. No distractions. I was happy working in my own element. I hated the analyst work though. So I took a leap of faith and I am now working my way through a bootcamp geared towards women. 

I did research for about a month, looking at all types of options to learn coding. The price of tuition ranged from free all the way to tens of thousands of dollars🙄. I already have actual student loan debt so putting a lot of money into this interest was NOT an option. I settled on SheCodes mainly because of their focus on women. I have always been a feminist and while they don't promote feminist issues, it touched my heart a little. 

I just finished the SheCodes Basics workshop. It took me 2 weeks instead of the 3 they pace you at. It was fairly easy (with the exception of Javascript). I have a long ways to go but I am excited about my journey. This blog post will be a marker for my progress. I am giving myself 6-8 months to learn the languages needed to get a Junior Developer job. 

Lets go!💪🏾