teleren/devto huggingface dataset:
[Redis Hackathon Submission Post Placeholder Title]
Tags: redishackathon
Published: 2022-08-23 18:36:49

[Instructions]: # (To submit to the Redis Hackathon on DEV, please fill out all sections. DELETE ALL NOTES, reminders, and guidelines before publishing.)


### Overview of My Submission
[Note]: # (Share what you built, how you built it, and the inspiration behind the idea! Please make sure the project links to the appropriate GitHub repository, and includes the [MIT](https://choosealicense.com/licenses/mit/), [Apache](https://www.apache.org/licenses/), [BSD-2](https://opensource.org/licenses/BSD-2-Clause), [BSD-3](https://opensource.org/licenses/BSD-3-Clause), or [Commons Clause](https://commonsclause.com/) license and a README.)


### Submission Category: 

[Note]: # (Select between Minimalism Magicians, Microservice Mavens, MEAN/MERN Mavericks, Wacky Wildcards – Descriptions of requirements listed in the announcement post.)

### [Optional: Video Explainer of My Project]

[Note]: # (This is where you can embed the optional bonus video you created to accompany your submission. Ensure your video is published publicly to YouTube and you’ve used the embed tag here to share it with us. By opting to include a video, you will be eligible for BONUS prizes. Learn more in the announcement post.)

### Language Used
[Note]: # (Select the language you used for your project – must be one of the following: C#/ASP.NET Core, Java/Spring, JS/TS/Node.js, Python)


### Link to Code

[Note]: # (Our markdown editor supports pretty embeds. Try this syntax: `{% embed link_to_your_repo %}` to share a GitHub repository)

BTW, your Github code’s README file should contain the details as [per this template](https://github.com/redis-developer/hackathon-docs/blob/main/README.md).

### Additional Resources / Info

[Note:] # (Be sure to link to any open source projects that are using your workflow!)

[Note:] # Screenshots/demo videos are encouraged!

### Collaborators

[Note]: # (Be sure to include the DEV usernames of your collaborators, if any. Prizes for winning projects with multiple collaborators will be sent ONLY to the person who posts this submission and they will distribute the prize evenly.)

[Note]: # (All collaborators with DEV profiles listed here will receive a badge, however, prizes including sticker packs will only be sent to the member who publishes the post, with the person expected to distribute the prizes evenly amongst their collaborators.)

[Reminder]: # (Submissions are due on August 29th, 2022 @ 11:59 PM UTC).

- - - 

[Note]: # (Please ensure  that the footer content below is part of your post when publishing. Please delete this note in parentheses but do not delete the content below.)


* _Check out [Redis OM](https://redis.io/docs/stack/get-started/clients/#high-level-client-libraries), client libraries for working with Redis as a multi-model database._
* _Use [RedisInsight](https://redis.info/redisinsight) to visualize your data in Redis._
* _Sign up for a [free Redis database](https://redis.info/try-free-dev-to)._
Let's talk about Godot
Tags: gamedev, opensource, godot
Published: 2022-08-23 18:35:00

A game engine by the name machinery a project which many chose to write a game in, it closed down and demanded subject to the EULA that all developers who paid for the game must stop and delete thier projects! 😱

So that's an example of an EULA taking everything down with it, it's a disgusting move and I think that's why Open source is so important, I didn't realize until the above, how much Open source means to de-risk a project.

So on to the loveable cult Godot, what is it? Well it's an open source game engine with all the right feels, in a very short space of time you can make excellent 2D games and contrary to reputation 3D games, you could now describe them as beautiful in Godot 4's new special flavour of global illumination I'll let you watch the lectures on that!

GDscript is also a really good language to script in that plays as much a part as the editor and it's a really good experience, don't underestimate it as I did, it's worth your time!

Godots docs are fine also and the YouTube tutorials although fewer, are usually of a far greater quality because of the kinds of people who are attracted to Godot

Overall you can probably make a game with Godot and have a blast doing it, knowing that your project is safe in the communities hands!

Oh yeah, Godots founders actually launched a company recently to help deal with license and handling proprietary Nintendo DS ports etc, so Godot really can make AAA titles, it's official 

Goday Godot
Top 7 Featured DEV Posts from the Past Week
Tags: top7
Published: 2022-08-23 17:58:48

---
title: Top 7 Featured DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week
tags: icymi 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---

_Every Tuesday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week._ 

## How to use HTTP Status Codes
HTTP status codes are short messages that are provided when we interact with a server, showing us what’s happening. See if you’re using those status codes right with @pragativerma18.

{% embed https://dev.to/pragativerma18/youre-not-using-http-status-codes-right-pc6 %}


## Hacking BeReal (On MITM Attacks)

@ozcap wanted to see how much it would be possible to manipulate a social networking app with the help of a software called Mitmproxy. See how it turned out!

{% embed https://dev.to/ozcap/hacking-bereal-a-practical-lesson-on-man-in-the-middle-attacks-10b6 %}


## Prevent Unnecessary Re-Renders in React!

Re-renders are when React needs to update content that has already been displayed. @adevnadia provides some tips on how to prevent this when possible!

{% embed https://dev.to/adevnadia/react-re-renders-guide-preventing-unnecessary-re-renders-21dm %}


## React TS Tips

Here’s an example from @lico as to why you shouldn’t repeat the type when you pass functions as props in React TS and instead use their types.

{% embed https://dev.to/lico/react-ts-dont-repeat-the-type-when-you-pass-functions-as-props-use-their-types-5h6h %}


## 5 Enhancements to your Node App

As you build your app, you may realize it’s growing slower as you add more features. Here are some things you can do to mitigate that effect from @chegerose!

{% embed https://dev.to/chegerose/5-enhancements-that-will-boost-your-nodejs-app-3pj5 %}


## Configuring a codespace for a frontend workshop — & more!

@blackgirlbytes found the solution to the chaos of workshopping and educating beginner developers to code – GitHub Codespaces. There are so many helpful pointers in this tutorial so don't waste another minute before diving in!


{% embed https://dev.to/github/how-to-run-a-frontend-workshop-in-codespaces-2ede %}


## My Dev Workflow on WSL

Windows is not the best choice for programming natively, but that’s why Windows Subsystem for Linux is available. Here’s how @nexxeln decides to set up a workflow on WSL.

{% embed https://dev.to/nexxeln/my-developer-workflow-using-wsl-tmux-and-neovim-55f5 %}


_That's it for our weekly Top 7 for this Tuesday! Keep an eye on dev.to this week for daily content and discussions...and be sure to keep an eye on this series in the future. You might just be in it!_
Alternating Characters
Tags: javascript, hackerrank
Published: 2022-08-23 17:50:36

Alternating Characters-
This question in similar to [Super Reduced String](https://dev.to/zeeshanali0704/super-reduced-string-1g32)
```
function superReducedString(s) {
  let left = 0;
  let right = 1;
  let count = 0;
  while (right <= s.length) {
    if (s[left] === s[right]) {
      count++;
    }
    left++;
    right++;
  }

  return count;
}

console.log("Answere here ====>", superReducedString("AAAA"));

```
useRef, how to make it dynamic?
Tags: react, javascript, programming
Published: 2022-08-23 17:49:37

Why is necessary to know how to make dynamic the `useRef` hook?
Well, is necessary for different reasons for example, sometimes we have components that are created by iterations, and we need to have a reference to access the properties of the element.

```javascript
export default function Component() {
  const list = ["one item", "other item"];
  const accordion = useRef();
  return list.map((item) => (
    <Accordion title="Something" ref={accordion}>
      <p>{item}</p>
    </Accordion>
  ));
}
```
The code above will not work because we are referencing all the items in the iterations with the same `ref`, but how to solve it? Is not as complicated as you may think.

First we have to be aware of the function `createRef()`. The rest is very simple but let's code to have a better explanation.

```javascript
export default function Component() {
  const list = ["one item", "other item"];
  const elementsRef = useRef(list.map(() => createRef()));
  return list.map((item,index) => (
    <Accordion title="Something" ref={elementsRef.current[index]}>
      <p>{item}</p>
    </Accordion>
  ));
}
```
The difference between the first and second code is line number 3, where we solve the `ref` creating a list of references with the size of our list, then when we are using the ref into the component is just as simple as accessing the current property of the variable _elementsRef_ and get the ref with the index of the iteration.
Auto pausing video with document.visibilityState
Tags: javascript, webcomponents, programming, tutorial
Published: 2022-08-23 17:43:00

I recently was watching a video online when an advertisement was playing before the video that I couldn't skip. I recall my solution with fondness

> aha! I'll show that advertiser. I'll just open a new tab for the next 30 seconds that are critical I do something!

To my surprise, the video would stop playing when I switched tabs. As a result of my lost 30 seconds, I created an issue to do the same in our own [video-player web component](https://github.com/elmsln/issues/issues/839).

It was really easy to add thanks in part to:
- LitElement's `firstUpdated` life-cycle that made me aware of when the `video-player` was attached to the DOM
- the `visibilitychange` [event that fires on the document](https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilitychange_event#pausing_music_on_transitioning_to_hidden) when changing tabs or minimizing the browsing window.

Here's the example Mozilla provides that I basically reverse engineered:

```js
document.addEventListener("visibilitychange", () => {
  if (document.visibilityState === 'visible') {
    backgroundMusic.play();
  } else {
    backgroundMusic.pause();
  }
});
```
Switch out "music" for "toggle video" and this was a very easy thing to account for. [Here's the code being walked through in this video](https://github.com/elmsln/lrnwebcomponents/blob/master/elements/video-player/video-player.js#L986-L1012). In the video I also demonstrate some ways to defeat the current implementation.

## Video
{% embed https://youtu.be/yORXfAb2Gvo %}
Terraform Parsing Results of a Bash Command
Published: 2022-08-23 17:37:14

In this example, we will want to take the result of the bash command whoami, and return a variable that Terraform uses as the username which in this example is poweruser.

I found the Terraform documentation to be overly complex and confusing because it requires an input string in valid JSON. Fortunately, this is not so hard to whip up in shell.

NOTE: Many tutorials will suggest using the tool jq, but this just adds more complexity especially if Terraform is run in an arbitrary unix container. Therefore, we'll try to use only standard tools.

Here's the Bash scrip that generates the username in JSON:

```bash
#!/bin/env bash

username=`whoami`

echo "{\"value\": \"$username\"}"
```

Call this whoami.sh and save it in the top level directory of our project.

Here is the output:

```json
{"value": "poweruser"}
```

Here's the Terraform:

```terraform
data "external" "username" {
  program = ["bash","whoami.sh"]
  query = {
    p_env = "whoami"
  }
}
```

In order to use the code use the following as a variable:

```
  username            = data.external.username.result.value
```

The way this works can be seen by looking at the top line of terraform which has "data" then "external" then then name, "username".

Finally, "result.value" are hard coded in Terraform when it parses the json output.

This should help to get data from a trivial shell command into Terraform with slightly less effort. Overall, I did find this to be fairly confusing.

Given time, I'll edit this post and add complete working Terrform code.
Data Integrity in Network Security
Tags: dataintegrity, integrity, network, security
Published: 2022-08-23 17:37:05

Do you know what data integrity in network security is? Data integrity refers to no corruption.


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

Read more at:
https://hecodesit.com/data-integrity-in-network-security/
Building Design Systems with Backlight.dev
Tags: webdev, javascript, beginners, podcast
Published: 2022-08-23 17:34:57


Original: https://codingcat.dev/podcast/2-7-building-design-systems-with-backlight-dev

{% youtube https://www.youtube.com/watch?v=_90Ytn6E4Sk %}

## Questions

1. Can you explain what divRiots is and what you work on?
2. What is Backlight.dev?
3. What are some of the struggles for starting a design system that Backlight is addressing?
4. Demo backlight.dev
5. What frameworks can be used with backlight?
6. How does backlight give you the code once you are done customizing it?
7. Where does the design piece of the design system come in?
8. Is code driven development the future of building design systems?
9. Who is Backlight's target audience, marketers or developers?
10. Do you know about complexity cliffs and what are your thoughts on single components for every use case?

## Additional Links

* Storybookjs - [https://storybook.js.org/](https://storybook.js.org/)
* Monaco - [https://microsoft.github.io/monaco-editor/](https://microsoft.github.io/monaco-editor/)
* Vite - [https://vitejs.dev/](https://vitejs.dev/)
*
Introduction to Data Engineering
Published: 2022-08-23 17:34:28

## What is the role of a data engineer?

The data platform, which consists of the data infrastructure, data applications, data warehouse, and data pipelines, is designed, developed, and maintained by data engineers.
In a large firm, data engineers are typically split up into many sections, each of which works with a particular area of the data platform:

1. Data storage and pipelines: To connect data between systems and support the data warehouse, data warehouse engineers construct batch or real-time data pipelines. Data warehouse engineers typically collaborate closely with data analysts, scientists, or business teams that support a particular business function because the data warehouse is designed to address business challenges.
2. Engineers that specialize in data infrastructure create and manage the distributed systems that serve as a data platform's core base. For instance, the Hadoop clusters utilized by the whole company at Target are maintained by the data infrastructure team.

3. Data applications: Developers of internal data tools and APIs are known as data application engineers. An excellent internal tool may at some point be released as an open-source product by the business. For instance, a data product team at Lyft created the Amundsen data discovery tool, which was open-sourced in 2019.

## A data warehouse is what?

Data analysis is the principal application of a data warehouse, which is a storage system for data from numerous sources. The fact that transactional data is highly standardized and unsuitable for analytics means that it is frequently held in various transactional systems (or, worse yet, as text files) by businesses. The fundamental goal of creating a data warehouse is to store all forms of data in centralized locations in optimum formats for analysis by data scientists. Many databases, including Apache Hive, BigQuery (GCP), and RedShift, work well as data warehouses (AWS).

## What programming languages should I learn if I want to work as
a data engineer?

Python, Java/Scala, and SQL, to sum it up.

You also need to master popular programming languages for full-stack development for the data application track, such as HTML, CSS, and JavaScript.
DataBase vs Data Warehouse
Tags: database, devops, comparison
Published: 2022-08-23 17:33:32

Database and Data Warehouse are not the same at all. The major difference in both management systems is the type of storing data. The need for Data warehouses first occurred in 1970. There are two types of data. 

- Operational Data 
- Strategic Information 

In a Nutshell, the Analysis of data is stored in Data Warehouse and the day-to-day use data is stored in the Database. Let's take a deep dive.

**What's Database ?**
A database is a storage management system of data where we can store terabytes of data or even Penta and zettabyte of data that we can use afterward to perform different actions at any time. The database is also of many types : 

- Structural Database
- Unstructured Database 
- Hierarchical Database
- Graph Database 

**What's Data Warehouse ?**
Data Warehouse is used to store the insights of Business. Data Warehouse holds Strategies and information about the business. Here stores the real-time data. 

**Why not we use Database instead of Data Warehouse:**
Because if we delete the data from the database it can be undone for the future use but in the case of data warehouse, Data cannot be deleted easily and the analysis perform are much faster and accurate while using data Warehouse. We can use different tools to get results of different purpose. Mostly SQL, Python, Power BI are used for extraction of data from the data warehouse. 

**What is the need for Data Warehouse:**

- To get to know about the age group and gender of customers for the specific product
- To know about the demand for the product
- To know about the sales index of the product 

**QUICK DEFINITION OF DATA WAREHOUSE**
Data Warehouse is : 

- Time Variant 
- Integration 
- Non-Versatile
- Subject Oriented 

**_Details:_**
You can store data insight of thousands of years, Integration means data is in Structural Format and your data cannot be changed if it is stored in the warehouse however we can add or delete the data permanently. Subject Oriented means data for specific requirement usage can be managed separately.

Data Warehouse is the important Topic in Data Engineering or Data Science Domain.


Connect with me :
[LinkedIn](https://www.linkedin.com/in/muhammadrmz)
[Github](https://github.com/ZapeeoSheikh/)
Who jumped into Svelte recently from other frameworks ?
Tags: svelte, javascript, webdev, react
Published: 2022-08-23 17:33:22

YouTube decided to suggest me more videos about Svelte knowing that I am lazy and don't like to code the damn react hooks. I am about to make the relevant decision about choosing Svelte or Next JS for my feature projects.

Didn't made any projects with Svelte but some tutorial videos are insisting me to do it. I was like - OMG, It's so easy to code. It's like the answer to our questions as a programmer while doing some complex functionalities with react or other frameworks.

The next step of Svelte is to get utilized by some big tech firms and companies starting job adverts about Svelte developers. Then everyone would try to learn it to get hired.

What are your vision about Svelte ? Did you try it ? Planning to build your next project with it ? Let me know in the comments>
[2022-07-02] AWS ML Weekly Updates
Tags: aws, machinelearning
Published: 2022-08-23 17:30:00


2022-07-02 업데이트 전달 드립니다 !

---

### 커스텀 컨테이너 이미지를 사용하여 RStudio on Amazon SageMaker에 자체 개발 환경 구성하기 블로그 글 소개
Amazon SageMaker의 RStudio는 업계 최초의 클라우드 기반 완전 관리형 RStudio Workbench입니다. 친숙한 RStudio 통합 개발 환경(IDE)을 빠르게 시작하고 작업을 중단하지 않으면서 기본 컴퓨팅 리소스를 조정할 수 있기 때문에 R기반의 머신 러닝 및 대규모 분석 환경을 쉽게 구축할 수 있습니다. SageMaker RStudio는 이미 R 프로그래밍 및 Data Science 툴을 미리 구성된 컨테이너 이미지와 함께 제공합니다. 그러나 종종 IDE 환경을 커스텀 정의해야 합니다. 이제부터 원하는 패키지 및 도구를 사용하여 특정 사용자 커스텀 이미지를 가져와서 클릭 몇 번으로 SageMaker의 모든 RStudio 사용자가 사용할 수 있도록 할 수 있습니다. 

[바로가기](https://aws.amazon.com/blogs/machine-learning/use-a-custom-image-to-bring-your-own-development-environment-to-rstudio-on-amazon-sagemaker/?sc_channel=sm&sc_campaign=Machine_Learning&sc_publisher=LINKEDIN&sc_geo=GLOBAL&sc_outcome=awareness&trk=machine_learning)


---

### AWS AI 및 ML 서비스를 사용하여 시각 또는 의사 소통이 불편한 분들의 접근성 개선하기 블로그 글 소개 

멋진 글이 올라왔네요. AWS는 ML 관련 경험이 없는 개발자를 위해 미리 훈련된 바로 사용할 수 있는 광범위한 인공 지능(AI) 및 기계 학습(ML) 서비스를 제공합니다. 이번 블로그 글에서는 AWS의 인공지능 및 기계학습 서비스를 사용하여 시각 장애 또는 의사 소통 장애가 있는 사람들이 사용하기 편리한 애플리케이션을 구축하는 방법을 소개합니다. Amazon Transcribe, Amazon Polly, Amazon Translate, Amazon Rekognition 및 Amazon Textract와 같은 서비스를 사용하면 라이브 텍스트 기록, 텍스트 음성 변환, 번역, 객체 감지, 이미지에서 텍스트 추출과 같은 기능을 서비스에 손쉽게 추가할 수 있습니다. 

[바로가기](https://aws.amazon.com/blogs/machine-learning/use-aws-ai-and-ml-services-to-foster-accessibility-and-inclusion-of-people-with-a-visual-or-communication-impairment/)

---

[더 많은 AWS ML Weekly Updates 리스트](https://dev.to/yoon/aws-ml-weekly-updates-44nk)
How to find the no of days between two dates in PHP
Tags: php, webdev
Published: 2022-08-23 17:29:00

There are times you would want to work with dates in your application and finding the difference between two dates is quite common. Handling dates in any programming language is always a tedious process so let me make a part of that easy for you in this post.

We are going to use 2 built in functions that PHP provides

1. **strtotime()** - strtotime() converts a date into a [Unix timestamp](https://kb.narrative.io/what-is-unix-time). The type of date formats that are allowed can be found in [PHP's datetime documentation](https://www.php.net/manual/en/datetime.formats.date.php)

2. **round()** - round() is a mathematical function that rounds up a floating point number to its nearest integer e.g round(4.5) = 5, round(3.4) = 3 etc

Let's see how we would use this 2 functions to get what we need

```
<?php
    $start_date = "3rd August 2022";
    $end_date = "15th August 2022";

    // ts means timestamp
    $start_ts = strtotime($start_date);
    $end_ts = strtotime($end_date);

    $diff = $end_ts - $start_ts;

    echo round($diff / 86400); // returns 12, that is 12 days
```

So what exactly is happening?

- We create two variables to store the start & end dates we want to find the difference of.
- The strtotime() method converts the dates into a unix timestamp format. We need to convert these two dates so that we can get the no of seconds from 1st January 1970 to the two dates. This is a very important step.
- We substract the two dates from each other to get the difference in seconds.
- We then divide the difference by 86400. Why 86400?, because that is the number of seconds in a day (60 seconds x 60 minutes x 24 hours). Dividing the difference by the total number of seconds in a day gives us the no of days we are looking for.
- The last step is to round up the final answer into an integer.

You could even take this further and put it inside a function, so that it can be reusable in multiple places

```
<?php
    function dateDiff($start, $end) {
        $start_ts = strtotime($start);
        $end_ts = strtotime($end);
        $diff = $end_ts - $start_ts;

        return round($diff / 86400);
    }
```

This is quite easy and simple to build and has a lot of use cases where it is helpful. Do you have a better way of handling this issue?, i would like to know in the comments.