teleren/devto huggingface dataset:
#day 11 of solving 450 questions[34/450]
Published: 2022-03-30 19:40:04

Questions solved:
[three-way-partitioning](https://practice.geeksforgeeks.org/problems/three-way-partitioning/1#)

#two pointer approach.
#left=left-1 increment only if find <a , right = max , 
decrement only if find<b , swap(a[l],a[i])-> do same for right .
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/crh1orz7gzej0qx8mtkm.png)



[rotate-string](https://leetcode.com/problems/rotate-string/submissions/)

Beautiful Solution :
**len(s)==len(goal) and goal in s+s**

0(n) possible through KMP (not learned yet)



As I am going to begin with LinkedList: Wanted to freshen up on OOPS concept(has been a long time since last used it)

`species='mammal'

class Dog():
    def __init__(self,breed,name):
        self.breed=breed
        self.name=name

1. init can be thought as constructor for the class
2. it will be called automatically when u create instance of a class
3. self->represents as  instance of the object itself.
4. attribute 
5. we take in the argument 
6. assign it using self.attrivute_name
7. operations/acitons----->method is a fn that is inside of class that will work with object in some way
    def bark(self,number):
        print("WOOF! my name is {} and my number is {}".format(self.name,number))
        

my_dog=Dog('lab','Frankie')

- notice this we are getting an error as we havent given any positional argument
- because we are expecting breed parameter
- so lets pass one
- notice that attributes , never have () that because attributes it not something you execu
- it is something you call back
 


print(my_dog.breed,my_dog.name)

my_dog.bark(10)
#called method


class circle:
    #clas sobject attribute
    
    def __init__(self):
        self.pi=3.15
    def circumference(self,radius):
            return radius*self.pi*2
        

C=circle()
C.circumference(2)`
React js Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API
Tags: react, reactnative, warning
Published: 2022-03-30 19:38:41

Recently i have been working in a React js project its show me an warning in my Browser Console which is like below screen shot:

![ReactDOM.render is no longer supported in React 18](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9kp771c0jfhue8ilc8l7.PNG)
don't worry i will Show you How to Solve this type of warning.
When react js warning **ReactDOM.render is no longer supported in React 18**
is happen then my index.js file is look like bellow screenshot:

![ReactDOM.render is no longer supported in React 18](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5uqd0mzte0iaa0p8lplt.png)
to solve the **ReactDOM.render is no longer supported in React 18** Warning i just change my index.js file. after changed index.js file now my index.js is look like below Screen shot:

![ReactDOM.render is no longer supported in React 18-Solution](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n0cfuhg7cu8jf50pgbuj.png)
That's it now the warning is gone. so finally Browser console is look like:

![ReactDOM.render is no longer supported in React 18-Solution](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yivprz0dvdlcr6rud8rc.PNG)
Thank you
Happy Coding
.
osman forhad
Full-Stack Developer💻 (Mobile App & Web App)
developer.osmanforhad@gmail.com
Instance Methods vs. Class Methods: What's the Difference?
Tags: ruby, instance, class, methods
Published: 2022-03-30 19:37:50

If you are starting your journey to becoming a software engineer, you will be introduced to Ruby at some point. If you find yourself struggling to differentiate between instances and class methods, this blog will hopefully help shed some light on the key differences between the two.

Fist, let me explain what a class is. Ruby is an object-oriented programming language, right? A class is a blueprint from which objects, or instances are created. For example, if you had a class called MLB_team (MLB = Major League Baseball), each MLB team would be an instance of that class. Here is a diagram to assist:

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

Each instance, or team would have their own set of data depending on what columns are set up in the table - a topic for a different day. Some column examples might look like this:
_____________________________________________________________
**MLB_team instance** -> _team_name, team_manager, team_location, total_wins, total_losses, stadium_capacity, world_series_wins, world_series_losses, etc..._
_____________________________________________________________
Now that we know what instances and classes are, now let me explain what methods are. A method is a set of expressions that return a value, very similar to a function in JavaScript.

The first key difference - syntax. Instance methods are called on the instances. Class methods are called on the class and declared using the "self" keyword, seen below.

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

Instance methods can be used to add, update and display information corresponding to the specific instance, whereas class methods can be used to query select information from all of the instances in the class. 

In short, class methods are big-picture, looking at all the data in the class - every instance included. Instance methods are more specific, only looking at the specific instance.
Curious about content-driven micropayments? You may want to join the Web Monetization Community
Tags: forem, meta, webmonetization, webdev
Published: 2022-03-30 19:36:10

---

series: Forem Community Highlights

---

Did you know you can monetize your DEV posts and get a drip of micropayments from some of your traffic?

It’s something we enabled on Forem about a year and a half ago, and while this continues to be an experiment which will need adoption to impact your bottom line, it is maturing and finding new and interesting use cases. Today, I’m excited to share that there’s a Forem _dedicated to going deeper in this technology_.

First, more info about “monetizing your DEV posts” if that confused you:

{% embed https://dev.to/devteam/you-can-now-web-monetize-your-dev-posts-but-don-t-get-your-hopes-up-too-quickly-goc %}

***

## **Meet [the Web Monetization Community](https://community.webmonetization.org/)**

Along the themes of why any Forem should exist alongside DEV, Web Monetization Community allows folks to go deeper with _this particular technology_ which is not mainstream yet. This community is a [Grant for the Web](https://www.grantfortheweb.org/) initiative — so if you are curious, you should definitely consider the opportunity to apply for a grant and work with this technology in that capacity.

Intrigued?[Join this Forem now](https://community.webmonetization.org/enter) and poke around.

***

One last thing. You’ll notice **"Sign up with Forem"** as an option alongside GitHub and email. This is a service we now offer to most seamlessly navigate the ecosystem and manage your identity. We want you to be able to bring your full self without having to bring your full data, so making this distributed ecosystem as straightforward as possible in the long run is really important. Create a [Forem account](https://account.forem.com/) and connect it with your DEV account [via your settings](https://dev.to/settings). 🙂

Happy coding!
Marketplace Partner Spotlight: What’s New from the Last Quarter of 2021
Tags: security, productivity, programming
Published: 2022-03-30 19:32:41

### Check out the integrations our ecosystem partners are building
#### <br>
Extensibility is one of our core capabilities at Auth0, which is why we built the Auth0 Marketplace, making it easier than before to discover the integrations you need to solve identity. The Auth0 Marketplace allows us to easily connect customers with our integration partners and allow you to customize a unique identity solution. Our partners are tapping into the nearly endless possibilities for customized integrations, and we’re excited to see this list continue to grow.

So to celebrate all the awesome integrations and to inspire you as well, we’re going to start sharing the newest integrations we’ve launched recently:

##### 1. Berbix Verify
##### 2. TrueBlue
##### 3. authID.ai Verified™
##### 4. Signicat Express Auth
##### 5. Logz.io
##### 6. Circle

#### <br>
Be on the lookout each month as we announce the latest integrations coming out of our extensive partner ecosystem. In the meantime, check out our current list of partners and integrations at [marketplace.auth0.com](http://marketplace.auth0.com/).

Are you interested in building an integration with us? Visit [auth0.com/integrate](http://auth0.com/integrate) to get started.

[Read more...](https://auth0.com/blog/marketplace-partner-spotlight-whats-new-from-the-last-quarter-of-2021/?utm_source=content_synd&utm_medium=sc&utm_campaign=auth0)
Mufi Concept Toy-Lang
Tags: programming, computerscience
Published: 2022-03-30 19:29:14

I've been considering implementing my own toy language (which I hope I can expand to a more production) once I finish reading reading Robert Nystorms [Crafting Interpreters](http://craftinginterpreters.com). This language similar to `clox` in the book will be written with a byte-code compiler in either C or Rust. My current idea is to go C, and down the line start porting it to Rust if I'd like, so how does the language look like?

Well it will be an OOP Language, so it will feature things like classes, and follow a C-style syntax. Let's look at a sample program to get a better idea: 

```
class Foo{
   var member1;
   var member2;
   func new(val1, val2){
      member1 = val1;
      member2 = val2;
   }
}

func main(){
   var foo = new Foo(5, 4);
}
```

This is a rough idea, but again this is all concept and can easily change. I will probably start off as a dynamic typing, but as a preference I'd like to make the language statically typed, and have separate mutable and immutable bindings like `var/const`. This language will have a garbage compiler (a mediocre one), and will start with a builtin standard library. 

I already made a little logo for the language, comment your thoughts about this project, and contributors are welcomed to join this interesting, and pain with the fun project. 


![Mufi-Lang Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bac9xat1sszkwz0epp87.png)
Top 3 Git repositórios (GitHub, GitLab, Bitbucket)
Tags: github, git, webdev, tutorial
Published: 2022-03-30 19:25:47

Aprenda a utilizar o Git, GitHub, Gitlab, Bitbucket com vídeos explicativos e objetivos.


#01 - Aprenda o básico do git
{% embed https://www.youtube.com/embed/8Ul6A8ShWq0 %}

#02 - GITHUB GITLAB BITBUCKET
{% embed https://www.youtube.com/embed/glSHkU2I3TY %}

#03 - GIT E GITHUB PARA INICIANTES como criar um projeto
{% embed https://www.youtube.com/embed/g81FK-06bs0 %}

#04 - COMO USAR O GIT E O GITLAB NA PRÁTICA
{% embed https://www.youtube.com/embed/un8CDE8qOR8 %}

#05 - COMO CRIAR PIPELINE NO GITLAB
{% embed https://www.youtube.com/embed/nkOC7saeGJk %}

#06 - APRENDA COMO UTILIZAR O BITBUCKET O que é Git
{% embed https://www.youtube.com/embed/4o5QyatRCSo %}

#07 - APRENDA COMO UTILIZAR O BITBUCKET PIPELINE
{% embed https://www.youtube.com/embed/t4FIcbrN0eY %}
Myfe - 30/03/22
Tags: python, gamedev, opensource, programming
Published: 2022-03-30 18:24:51

So I started working on the main code of the game, which is on Python.
I'm using MongoDB as the database.

## Code

So I made a collection to hold the degrees stats (I had already defined `usersdb`:
```py
degreescol = usersdb.Degrees
```

Then I made a function to get all the degrees a user is either preparing for or have completed:
```py
def getdegrees(username):
  myquery = { "Username": username }
  mydoc = degreescol.find(myquery)
  jobs = []
  for x in mydoc:
    jobs.append(x)
  return jobs
```

Then I made 2 functions: one for only getting the degrees a user is preparing for, and the other for only getting the degrees they have finished:
```py
def getpreparingdegrees(username):
  myquery = { "Username": username }
  mydoc = degreescol.find(myquery)
  jobs = []
  for x in mydoc:
    jobs.append(x)
  preparing = []
  for x in jobs:
    if x['Status'] == False:
      preparing.append(x)
  return preparing

def getfinisheddegrees(username):
  myquery = { "Username": username }
  mydoc = degreescol.find(myquery)
  jobs = []
  for x in mydoc:
    jobs.append(x)
  preparing = []
  for x in jobs:
    if x['Status'] == True:
      preparing.append(x)
  return preparing
```

Then I made a new Python file called `lists.py` to store some  lists, the first two being jobs and degrees:
```py
jobs = []
degrees = []
```

## Jobs and Degrees

Then I decided to think of some jobs which you could get degrees for.
First I thought of the job of a crytographer, which could be an easy job to code as I could just base it on decoding and encrypting things. 
So in the `jobs` list in `lists.py`, I added the element `"cryptographer"`, and in the `degrees` list in `lists.py`, I added the element `"cryptography"`.

Then I got clueless on what other jobs to add, so if you have any ideas on what job or degree I could have, and what type of questions or skills could be in the skill, comment below.

Thanks for reading and next time I'll be blogging about coding the `cryptography` degree!
10 Essential Lessons from 10 Software Engineering Leaders
Tags: productivity, devops, career, leadership
Published: 2022-03-30 18:10:44

Success in engineering leadership is not easy to define.

The journey of an engineering leader is a rocky one, where you have to navigate the ups and downs of building a company and growing a team while delivering impact to your end-users.

A few months ago, Eiso Kant and Jason Warner started a podcast for Engineering Leaders called [Developing Leadership](https://www.developingleadership.co/). Almost 20 episodes in, and the lessons shared by our guests have been invaluable to our listeners.

Building high-performance teams, creating a company culture that scales, and why your software delivery pipeline shouldn’t stop with engineering, here are 10 lessons from the Engineering Leaders we’ve had the pleasure of speaking to.

[For more context on these 10 lessons, you can read the full post on our blog.](https://athenian.com/blog/10-essential-lessons-from-10-software-engineering-leaders)

## 1. Engineering, Product and Design need to work together. 

🚀 Jonathan Nolen, VP of Engineering at LaunchDarkly 

## 2. Engineering Leadership is all about people. Technology is secondary. 

🚀 Anton Drukh, Tech Executive Mentor, and former VP of Engineering at Snyk 

## 3. If you want to build a high-performance team, organization, and culture, you need to start with yourself.

🚀 Sam Lambert, CEO of PlanetScale

## 4. Your Software Delivery Pipeline shouldn’t stop with engineering.

🚀 Wade Arnold, Co-Founder & CEO of Moov Financial 

## 5. Focus on removing the biggest blockers to your success. 

🚀 Emil Eifrem, Co-Founder & CEO of Neo4j

## 6. People don’t want to receive corrective feedback, but if you don’t give it they will get frustrated with you. 

🚀 Katie Wilde, VP of Engineering of Ambassador Labs

## 7. Want to be a better leader? Write more. 

🚀 Michael Lopp, aka Rands in Repose

## 8. You should probably be spending more time recruiting.

🚀 Erik Bernhardsson, Founder of Modal Labs and former CTO of better.com 

## 9. Culture is the most important thing to get right early on.

🚀 Sam Alba, Co-Founder of Dagger and former VP of Engineering at Docker

## 10. Make sure your people are comfortable, delivering and that there’s a strong purpose to what they do, or they will leave. 

🚀 Nuno Antunes, Senior Director of Engineering at Datadog

Make sure you check out [the full blog post](https://athenian.com/blog/10-essential-lessons-from-10-software-engineering-leaders) to get the full context for these advice tidbits, and [listen to the podcast](https://www.developingleadership.co/) for the full interviews!
Starting Something New
Tags: new, webdev, beginners, motivation
Published: 2022-03-30 18:07:58

## Introduction
Let me start by introducing myself. Hi, I'm Karanjot Singh, a developer, student and a tech enthusiast. This is my first blog post, so please ignore any mistake I have done. Also any recommendation is more than welcome in the comments.


## Why I'm writing blogs
So, this blog is actually about why I'm writing blogs, in fact even this blog. So recently I have started a YouTube Channel [CODE Infinite](https://www.youtube.com/channel/UCsI_4RAaiFSGEWeoT4wxjOA). Although I'm new to creating content to teach other people but I know that there are many people who want to learn from written content rather than videos. Everyone has his/her preferences so I'm not saying that one is better. 

As I have seen writing a blog has many advantages both for readers who'll be viewing the blog and for writers.
- First of all some people learn better by reading
- Written content is easier to go through again. Like if you have already learned a skill and you want to revise it, it would be easier to read than to watch the whole video again.
- As a content creator its much easier to write than to make a video, so I would be able to cover more topics in advance by writing than creating video.
- I can also create blogs related to stuff I'm learning daily as a log or notes or whatever you want to call it.

Now I'm not saying that these are the only advantages or these things can't be done by videos. These are just the reason why I'm starting to create blogs.

## My Plans
Now since this is [dev.to](https://dev.to), so its obvious that I'll be posting programming related stuff. So I have plans to post content related to following:
- Tutorials
- TWIL: This Week I Learned
- Cheatsheets
- And other stuff

---
Cover Photo by [Ross Findon](https://unsplash.com/@rossf?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on <a href="https://unsplash.com/s/photos/new?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>

---
Thank you so much for reading my blog.
Know more about me @ [karanjotsingh.com](https://karanjotsingh.com)
Subscribe to my YouTube Channel [CODE Infinite](https://www.youtube.com/channel/UCsI_4RAaiFSGEWeoT4wxjOA)
Also follow me on [Dev.to](https://dev.to) at [karanjot_s](https://dev.to/karanjot_s)
Create Google Calender Events using the Google API and Service Accounts in Node.JS
Tags: node, gcalendar, google, api
Published: 2022-03-30 18:06:40

If you ever wanted to create Google Calendar Events in NodeJS without having to use OAuth2 (and thus not having to ask users for their permissions), then this article is just for your.

To do so we will employee so-called Google Cloud "Service accounts" which allow to interact with the API as an application.

## Setup

1. Go to the Google Cloud Console and create a new project.
1. Enable the [Calendar API](https://console.cloud.google.com/marketplace/product/google/calendar-json.googleapis.com)
1. [Create a service account](https://developers.google.com/workspace/guides/create-credentials#create_a_service_account)
1. In your calendar where you want to create events, go to the settings and share the calendar with [the e-mail of your service account](https://console.cloud.google.com/iam-admin/serviceaccounts) (Make sure to set the permissions to **"Make changes to events"**)
1. [Create and save the credentials JSON for your created account](https://developers.google.com/workspace/guides/create-credentials#create_credentials_for_a_service_account) into your Node.JS project

## Code

First you need to install `googleapis` and `google-auth-library` in your Node.JS project. Then just plug in the function below to create a new event 🙂

Make sure that you set the calendar ID of the calendar where you want to create the events and that your downloaded `credentials.json` is in the right place.

{% embed https://gist.github.com/PedroHase/f2cce3ce7902b3896a0559e99d3c8e5b %}

P.S.: Using this approach you can also interact with any other Google Services. Just make sure that your service account has the right permissions and or that the APIs are enabled and the correct scopes are set 😉.
Win a Custom FutureStack LEGO® Kit!
Tags: lego
Published: 2022-03-30 17:34:25

Howdy, y'all. 👋 New Relic is giving away this exclusive custom-made LEGO® kit to 200 lucky people! Want a chance to win one? It only takes two steps:
1. Register for FutureStack 2022 happening in Las Vegas [here](https://www.futurestack.com/VyPOLB?RefId=R-DEV).
2. Download the Cvent Events app from the App Store, search for FutureStack, and log in.

Yes, it's really that simple! We hope to see you all at FutureStack. 

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


[Terms and Conditions](https://custom.cvent.com/45DAD2F9A315493B9A2149EC10A001E3/files/961044a104fc457b8ff7044767064ac6.pdf)
Day-54 Training At Ryaz
Tags: webdev, beginners, programming, node
Published: 2022-03-30 17:09:39

- Date:30/03/2022
- Day:Wednesday

Today, I started at about 10:00 am as I was struggling with working of jwt tokens so, as yesterday due to some error in the index.js file so, the post request was also not sent successfully so, today I started with solving the problem and finding the root cause of it so, after having various attempts I was unable to do this but in the last half of day I got the solution about this so, I was done with the working of index.js file and after solving this problem with several testing I was succsfull to send jwt tokens with the or along with the post request so, now the work left over is the testing of authorisation part from the postman itself so, as this problem is solved now it would be done in little amount of time so, this way my day ended up and the authorization part would be completed by tomorrow.
.forEach vs .map: A Short Summary
Published: 2022-03-30 17:05:22

Two very important array iteration methods that you will be seeing when using java are .forEach and .map, both going through an array and enacting a function on each element. But how do they differ in usage and purpose? In this post, I will be explaining key differences and elements that differ these two methods.

First is _.forEach_, an iteration method that will call a function for each element in an array. One important thing to note is that _.forEach_ will go through every single element in the array it is used on without mutating it. There are three five parameters to use in _.forEach_, with two of them being required to run the function, these two being the function that is going to be run onto the array and _currentValue_, the value/array that the function is being run on.

The three optional parameters here are the index of the current element _index_, the array of the current element if you are working on something that is nested, _arr_ and _thisValue_ which will pass the parameter entered as its _this_ value.

Moving onto _.map_, _.map_ will, just like .forEach, call a function onto an array, but the real question is... which array? To which I answer, a copy, of course!

_.map_ creates a copy of the original array and calls a function onto every element in said copy. One difference that stands out from _.forEach_ is that _.forEach_ creates a copy of the array, which is useful for preventing accidental mutations or changes in the array. And while I said earlier that _.forEach_ doesn't change the array, that was a bit of a lie. Any callback function provided in _.forEach_'s parameter may cause a mutation depending on what you want the function to do.

_.map_ takes the same parameters as _.forEach_, which at first fooled me when I was in the process of learning iteration methods for arrays. Understand that when you use _.map_, the array that you iterate over is a copy of the original, preventing the data modified from being applied to the original array and returning that modified copy, whereas _.forEach._ iterates the function over that exact array.