teleren/devto huggingface dataset:
Hello world... Uh! That was obvious.
Tags: firstpost, firstyearincode
Published: 2022-08-05 18:56:00

Hey Guys,

so this is me. Writing my first Blogpost ever. I never thought about blogging or anything like that. But here I am. Writing. Feels kinda weird.

So... Hello.

What is important to know about me? My name is Caroline. I'm from Germany and I'm a physician. But this is not what this piece of web should be about. This blog is about my journey to learn how to code. But one after another...

Back in school I always was interested in science. I loved Chemistry and Biology, I loved Maths and Physics but I never ever set a foot into a computer science (or 'Informatik' as it is called in Germany) class. However. Since I was about 10 years old I wanted to become a Doctor. So every decision I made about subjects, courses or activities at school I focused on this special dream. And I succeeded.

I got into medical school in 2011, finished with my "Staatsexamen" and got my license to practice medicine in 2018. I worked at two hospitals for quite 2.5 years. But even before COVID hit, I felt kinda drained. All my colleagues (who I still adore so so much) studied harder, worked harder and improved their skills much better than I did. I never experienced this feeling before. So in February of 2021 I decided to take a step back from working at the hospital and joined a german company as a Physician in Training of Occupational Health.


At this time I came in touch with Webdevelopment through my boyfriend who works in Tech. Through my work I was looking beyond the horizon more and more. So when he was working late when I was already at home I thought "What is he still doing? Why is he working so hard? How can he stare to a monitor for so long?". So instead of waiting for him to finish work and procrastinate while binging Netflix I asked him about what he is doing all day long and as I did not understand a word of what he was talking about I said the sentence which changed my journey: "Honey, I do not understand a word you just said but I want to. So can you teach me how to do this?" So we decided together on a book about HTML and CSS and I coded along the sections of the book. But while working full time and writing my doctoral dissertation there was not much time and the book did not really hooked me. But in June 2022 I found "FreeCodeCamp by Quincy Larson" created an account and resume my goal: Learning how to code. Meanwhile I completed my first Certificate in Responsive Web Design (HTML and CSS). Now I am working on the next Course on that platform about JavaScript Algorithms and Data Structures and also deepen my knowledge about the background of HTML and CSS. Instead of watching Life Style Vlogs I watch Videos about programming on Youtube and soak up everything I can about tech...

This is my start of something knew and I am thrilled to share it with you.
How to Loop through nested JSON object in JavaScript recursively
Tags: javascript, programming, codenewbie, beginners
Published: 2022-08-05 18:22:00

{% youtube my4EKQvR2w0%}
in this video i have explained how you can traverse a nested JavaScript object with the help of recursion

here is the code 

```js
let obj = {
  name: "raj",
  roll: 892,
  id: {
    idName: "raj",
  },
  section: {
    sectionName: "raj",
    alias: {
      name: "raj",
    },
  },
};

let changeName = (obj) => {
  for (let i in obj) {
    if (obj[i] == "raj") {
      obj[i] == "abhishek";
    } else {
      changeName(obj[i]);
    }
  }
};

changeName(obj);

console.log(obj);

```

result: 

```js

{
  name: 'raj',
  roll: 892,
  id: { idName: 'raj' },
  section: { sectionName: 'raj', alias: { name: 'raj' } }
}
```
Step into JIRA
Tags: jira, introduction, projectmanagement
Published: 2022-08-05 18:14:28

**J**IRA is an application which developed by Atlassian to support Project Management, Track Issues and bugs. 


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

At present we can see that many companies tend to use JIRA as their Project Management tool. The reasons for that is;

1. JIRA facilitates everything that need to manage projects and teams properly.

2. It Provides Countless add-ons to further enhance the functionality.

3. Users can customize the application according to their preferences like;

- customize workflow 

- Add Custom issue Type              

- Add Fields

- Design Issue Operations screen 

 

If a person needs to work with JIRA , have to create a account in Atlassian via login into below link.

https://id.atlassian.com/signup

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

There are some various kinds of products in JIRA. Such as

- Jira Core

It allows to track issues by using customizable workflow

- Jira Software

It provides extra agile functionality which can track software projects when use agile methodologies.

- Jira Service Desk

It is a service which is use to support projects .By this users can have much better experience because this helps to ask for help and solve the matters and agents can interact with their users also. 

- Jira Ops

This is a incident management Tool and it helps to produce centralized alerts and notify the right person at the high time.

Furthermore, other products are like these.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lhe9fsyanaesdowz2d1i.jpeg)
Iterable Unpacking in Python #PyTip02
Tags: python, programming, codenewbie, beginners
Published: 2022-08-05 17:59:00

Python provides an awesome variety of sequential data structures. The most common of them are `list` and `tuple`. These sequences are sometimes used to store records, which later needs to be unpacked. 

When unpacking the values from a sequence you may encounter error like-`ValueError: too many values to unpack`. In this short post I will share a short PyTip to avoid this error.


## Problem

Create a file or run the below code in the Python REPL.
```
primes = [2, 3, 5, 7, 11]
first, second, third = primes
```

The above code will produce the following error.
```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: too many values to unpack (expected 3)
```
The above error states that to unpack your iterable, your iterable size must be three. 

## Solution
To solve this problem [PEP 3132](https://peps.python.org/pep-3132/) was proposed. Now, write the following code in Python REPL to see **Extended Iterable Unpacking** in action.

```
>>> primes = [2, 3, 5, 7, 11]
>>> first, second, third, *_ = primes
>>> print(first, second, third, _)
2 3 5 [7, 11]
```

In the above output you can see that `*_` syntax caught all the excess values from the iterable. The `_` variable could be anything of your choice, it doesn't have to be an underscore. Additionally, "*_" may be used anywhere in the statement. Consider the example below to get the idea.

```
>>> primes = [2, 3, 5, 7, 11]
>>> first, *_ , last = primes
>>> print(first, last, _)
2 11 [3, 5, 7]
```

I find this feature extreamly useful and hope you find it useful too. Thanks for the reading today's PyTip.
First blog post...ever {object pointers}
Tags: javascript, beginners
Published: 2022-08-05 17:49:00

Hello! Warm welcome to my very first blog post as an aspiring software developer - where I'm currently learning to code at the Flatiron School. I aim to use this blog to track my growth and progress in the coding world.

Full disclosure: I probably know about as much of coding as a brand-new driver knows what's under the hood of her car. I simply know how to get from point A to point B -- make the code do what I want it to -- but nothing on how to make the car use gas more efficiently or what parts it's even using at all.

To get an idea of where I'm at, one thing I realized most recently - that was a big stepping stone for me - is the ability to assign a variable to an already-defined object (as a pointer) in order to make modifications to said object in a different scope.

To illustrate:

```javascript
let variable = {}; /* first, globally defining an empty object to
be used later */

/* The "parent function" that defines an object in it's own
scope and calls the function passed in as an argument to modify
said object */
function parentFunction(functionName) {
    const dataObj = {
        key1: "I want to change this value.",
        key2: "I want to keep this value.",
    };

    variable = dataObj; /* re-assigning (or pointing) our empty
object to the defined object */

    functionName(variable); /* calling the callback function and
passing our variable to be updated */

    console.log(dataObj); /* this is just to see what's in our
defined object after the callback function's been called */
};

//Callback function that changes a value of an object
function callbackFunction(object) {
    object.key1 = "This value has been changed.";
};

parentFunction(callbackFunction); //invoking the parent function
```
Then, in our console log, we'll see our defined-object has been updated to:

```javascript
{
  key1: 'This value has been changed.',
  key2: 'I want to keep this value.'
}
```
Note: the argument that was passed into the callback function was the `variable` variable and not the actual `dataObj`. Yet the changes persisted on the `dataObj`, because `variable` acts as a **pointer** instead of a separate object. This was a breakthrough for me as the thought came to my head as I was trying to fall asleep one random night. Hope it can be of use to any new developers that come across this!

Also, quick note on another trick I learned:
To replace the `space` character in a string with another character, simply use:
```javascript
string.replace(/\s/g,"<add character you want to replace with>")
```

Thanks for reading!
TOP 4 Easiest Way To Align Div Center
Published: 2022-08-05 17:39:36

There are four way to align div horizontally and vertically center
1 - margin

2 - position

3 - flex

4 - grid

##Align div by margin property
Horizontally align div with css margin property and it not align div in vertically center

```
<html>
  <head>
    <style>
      #parent-div{
        margin:20px;
        width:400px;
        height:150px;
        border:1px solid black;
      }
      #child-div{
        width:80px;
        height:80px;
        border:1px solid blue;
        margin:0 auto;
      }
    </style>
  </head>
  <body>
    <div id='parent-div'>
      <div id='child-div'></div>
    </div>
  </body>
</html>
```

##Align div by position property

Div align center with horizontally and vertically by css position property 

```
<html>
  <head>
    <style>
      #parent-div{
        margin:20px;
        width:400px;
        height:150px;
        border:1px solid black;
        position:relative;
      }
      #child-div{
        width:80px;
        height:80px;
        border:1px solid blue;
        top:50%;
        left:50%;
        transform:translate(-50% ,-50%);
        position:absolute;
      }
    </style>
  </head>
  <body>
    <div id='parent-div'>
      <div id='child-div'></div>
    </div>
  </body>
</html>
```
##Align div center by flex property 

flex property use to align div horizontally and vertically center . flex is easy method above two align method

Note : when align div by css flex property ,  you need to apply flex property to its parent div

```
<html>
  <head>
    <style>
      #parent-div{
        margin:20px;
        width:400px;
        height:150px;
        border:1px solid black;
        /* flex property apply */
        display:flex;
        justify-content:center; /* use for horizontally center */
        align-items:center; /* use for vertically center */
      }
      #child-div{
        width:80px;
        height:80px;
        border:1px solid blue;
      }
    </style>
  </head>
  <body>
    <div id='parent-div'>
      <div id='child-div'></div>
    </div>
  </body>
</html>
```
##Align div center by grid property

Css grid also use to align div center from vertically and horizontally

Note : when align div by css grid property ,  you need to apply grid property to its parent div like css flex property

```
<html>
  <head>
    <style>
      #parent-div{
        margin:20px;
        width:400px;
        height:150px;
        border:1px solid black;
        /* grid property apply */
        display:grid;
        justify-items:center; /* use for horizontally center */
        align-items:center; /* use for vertically center */
      }
      #child-div{
        width:80px;
        height:80px;
        border:1px solid blue;
      }
    </style>
  </head>
  <body>
    <div id='parent-div'>
      <div id='child-div'></div>
    </div>
  </body>
</html>
```
Learn more artical related to Web Dev also visit
🔥 If you are a developer, you must know how CORS works 🔥
Tags: javascript, cors
Published: 2022-08-05 17:25:00

Here’s a high-level flow on how browsers initiate that extra “preflight” request to determine whether they have permission to perform cross-origin requests.

What is CORS anyway? CORS stands for Cross-Origin Resource Sharing, and it’s a protocol that allows servers to receive requests from different domains.

Developers often make external API requests to fetch data from external servers. Sometimes these servers could be from different domains too.

Example:
👉 My app in kelcho.com making a GET request to kelcho.com is a same-origin request
👉 My app in kelcho.com making a GET request to google.com is a cross-origin request

But these cross-domain requests are restricted by the browser ❌

Once developers have configured CORS on the server to accept requests from other domains the browser will kick in a preflight check ✅

It is to verify whether resource sharing is allowed on the destination server. The preflight request uses the HTTP method OPTIONS.

I’ll post a detailed visual guide on how it works under the hood soon✌️

Keep growing. Keep learning💪
Discord API and what it needs
Tags: python, javascript, api
Published: 2022-08-05 17:16:00

As a discord bot developer, I somewhat like the new slash commands discord provides, but there must be a better way to manage their permissions. As most of us know, discord introduced a better way to manage webhooks and app interrogations which leads to the admins of a discord server to manage the permissions for each slash command. That is cool and all, but shouldn't this be automated by the bot. For security risks, the server owner can agree and edit those depending on their needs
Resources(R.string) in viewModel in Android
Tags: android, codequality, mvvm, strings
Published: 2022-08-05 17:09:19

I would like to share a technique to access the strings in view model that works well. 
So there are multiple ways to access the string in view model but they have there own advantages and disadvantages.
We have options like 

1. Hardcode a string in code but this will not help in case of reusability and string localisation
2. Use the context of an activity but in mvvm its bad practice to use context direct in view model
3. Return the string resource id which is integer and in activity get the actual string but this will increase the efforts 

Let's move toward the solution 
In MVVM and hilt will have addition benefits to overcome above issue. 

We will add the StringResourcesProvider.kt

```
@Singleton
class StringResourcesProvider @Inject constructor(
    @ApplicationContext private val context: Context
) {
    fun getString(@StringRes stringResId: Int): String {
        return context.getString(stringResId)
    }
}
```

Define the view model to get the string

```
@HiltViewModel
class AuthViewModel @Inject constructor(
    private val stringResourcesProvider: StringResourcesProvider
) : ViewModel() {
    ...
    fun validate() {
        val username: String = stringResourcesProvider.getString(R.string.username)
    }
    ...
}
```
In this way we can access the string in view model or any other places.

Thanks for reading my post. 
Happy codding
How to achieve backward compatibility in your Nodejs code?
Tags: node, javascript
Published: 2022-08-05 16:51:00

To achieve backward compatibility, sometimes we have to write separate code for different 𝗡𝗼𝗱𝗲𝗷𝘀 versions.

This happens as a result of APIs getting deprecated and others emerging as their official replacements.

Fortunately, there are ways to handle this issue. Today I'll be talking about one.

The 𝗽𝗿𝗼𝗰𝗲𝘀𝘀 module provides you with the runtime version of your 𝗡𝗼𝗱𝗲𝗷𝘀 that is currently executing your script. With this piece of info, we could conditionally serve/run code based on the version we get.

A popular library called 𝘀𝗲𝗺𝘃𝗲𝗿 makes version number comparisons super simple, hence why it's used here.

If you pay close attention to my posts, you should notice that I didn't write 𝗻𝗼𝗱𝗲:𝗽𝗿𝗼𝗰𝗲𝘀𝘀 this time; since it's a new concept that wasn't available in versions below 8.

Did you learn something new today?

Like and share this post, and follow me for more!

![conditional node code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vsr2srkmpjyx6rwkmkq3.png)
Build a String Telephone in Nodejs
Tags: node, javascript
Published: 2022-08-05 16:49:00

I think it's time for a practical fun tip!

Did you know you could pipe the standard input stream to the standard output stream using the 𝗽𝗶𝗽𝗲 method?

This let's you get a mirroring effect; where whatever you type will be echoed back to you on the terminal.

Give it a try yourself!

Hopefully this will get me to talk about streams in my future posts, as they are so underrated in the 𝗡𝗼𝗱𝗲𝗷𝘀 community.

Did you learn something new today?

Like and share this post, and follow me for more!

![pipe streams](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xs325o6pnaalbq6hbk3v.png)
What Are JavaScript Events?
Tags: javascript, programming, tutorial, beginners
Published: 2022-08-05 16:47:42

## JavaScript Events

   **JavaScript events** can be defined as something the user does in a website or browser. This can be a multitude of different things such as clicking a button, closing the browser, hovering over an element on the browser, etc. 

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

## Event Listeners

   JavaScript is capable of detecting or listening for the events taking place in a browser. For example, when a user clicks on a specific button, JavaScript can pay attention to the user's click and do something after the click like displaying text or an image. 

To tell JavaScript to listen for an event, we can use the method, **addEventListener()**, on an element.

```
eventTarget.addEventListener('click', function() {
   console.log('You clicked me!');
});
```
In the example above, the addEventListener() is being added onto the element we select. This can be a button we have created like the example below, a variable containing the wanted element, etc. 

```
const button = document.createElement('button');
button.addEventListener('click', function() {
   console.log('You clicked me!');
});
```

The event listener takes in two arguments with the first being the event we want JavaScript to listen for. In this case, it was the 'click' event but it can be a mouseover, keydown, drag, scroll, or any of the other various DOM events. The second argument is the function which tells JavaScript what to do once the event has been completed. In the example above, the browser's console will print the statement, 'You clicked me!' 

Now, that you have learned the basics of JavaScript events and using event listeners, you can try to create your own event and event listener!


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/du917jkyt2rvo5mwp33r.gif)
Python, Flask, Elasticsearch - search service and query builder - the last, 7th Part of Tutorial
Published: 2022-08-05 16:41:32

Hi, the 7th article devoted to the theme: “How to work with ElasticSearch, Python and Flask” already ready for reading. We will speak about search service, query builder and filter design pattern. All details are here: "[Python, Flask, Elasticsearch - search service and query builder](https://sergiiblog.com/python-flask-elasticsearch-search-service-and-query-builder/)". That is then last part of tutorial. Thank you for being with  me whole that time and welcome to my course if you want to get know more: "[Udemy course: ElasticSearch as you have never known it before](https://www.udemy.com/course/elasticsearch-as-you-have-never-known-it-before/?referralCode=1B10488521797E430D22)"
Automatic dual git config
Tags: git, webdev, tutorial, codenewbie
Published: 2022-08-05 16:37:00

## Introduction

Do you use the same computer for both personal and professional projects?
Do you have one git account for pro and one for personal? 
Then follow this short guide and have everything set up for automatic git config switch. 

## What’s the idea

We will tell git through a configuration file to use the correct user info like name and email based on the path we are currently on when using git commands.

I use this setup on mac but it should work on Linux too.

I use VSCode as my IDE and its CLI to open and edit my files.

## Realization

### First step

Open your git config file

```bash
code ~/.gitconfig
```

### Second step

This is where the magic will works 

```
[include]
	path = ~/pro-git.conf
[includeIf "gitdir:~/perso/"]
	path = ~/perso-git.conf

[pull]
	rebase = true
```

- first include is the generic configuration used.
- second include with an if is a condition that tells git to use another specific conf when you are inside a specific directory.
- A little extra I recommend is to set pull rebase to true inside your git config but that’s not related to what we are doing now. Check on the web for a clear explanation for this point!

As you can see I have 2 files at my root, 1 for each use case, pro and perso. Those files contain the related user info for each use case.

### Third step

Fill in the information of your user inside both config files.

```
[user]
	name = Personal User
	email = personal@email.com
```

and same for the pro file.

As you guessed this is reproducible for more than 2 users and config.

There are things to learn about writing a proper git config and what’s possible with it, this documentation gives a lot of information about it !

[https://git-scm.com/docs/git-config#_configuration_file](https://git-scm.com/docs/git-config#_configuration_file)

Hope this helps you set up your computer for efficient work with git on all your projects!
DigitalCrafts Project - BenjiKnows
Published: 2022-08-05 16:35:00

BenjiKnows is the DigitalCrafts FullStack Project created by Amanda Hargrove and Olivia Campbell. 


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

[BenjiKnows](https://benji-codes.herokuapp.com/) is a pet tracking application that allows a user to create profiles for each of their pets and then add activities for each animal. 


The inspiration for this project was Olivia's dog Winnie getting an ear infection and Olivia forgetting if she had given Winnie her ear drops. By using BenjiKnows, Olivia can now create an "event" in the application every time she gives Winnie ear drops. 

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

You might be wondering - why is it called BenjiKnows? Amanda's pet bearded dragon is named Benji and he is the mascot for their group, BenjiCodes. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/obik6tkx7hzwwce8x5ly.png)
how to use kedro.versioning in latest version of kedro?
Tags: kedro
Published: 2022-08-05 16:32:15

I have previously used kedro version 0.17.6 in my project.Now i have upgraded my version to 0.18.2.But in latest version of kedro there is no module of kedro.versioning.So i am getting a error that module is not founded.Can anyone please suggest something