teleren/devto huggingface dataset:
Free Resources to learn Django
Tags: django, webdev, discuss
Published: 2022-06-08 15:23:00

Personally I followed this resources to learn Django

## YouTube channels

👉 CodingEntrepreneurs
👉 Dennis Ivy
👉 CodeWithHarry 
👉 Geeky Shows
👉 Code Keen
👉 Very Academy
👉 Code With Stein

## Blogs/Website
👉 [Official Django Doc](https://www.djangoproject.com/)
👉 [LearnDjango](https://learndjango.com/)
👉 [Simple is Better Than Complex](https://simpleisbetterthancomplex.com/)

Sometime I just search project on Django on YouTube and I follow them because project based learning works like a charm ✨

And yeah for any library (like django-allauth) doc is best resource to learn.

And our best friend StackOverflow is always there to help 😁

And if you know any other resources please share with me. I love to explore them too <3

Free learning resources: [GitHub](https://github.com/SoniArpit/my-learning-resources) (you can contribute there)

Follow me for more :)
Twitter: [@awwarpit](https://www.twitter.com/awwarpit)
PID, D as in Derivative
Tags: opensource, tutorial, microservices, luos
Published: 2022-06-08 15:35:38

Today we will talk about the last effect: the derivative effect in a PID.

⏩ https://www.luos.io/blog/pid-d-as-in-derivative

The previous posts were dealing, sometimes painfully, sometimes smoothly, with proportional and integral effects into the coded feedback loop control of an electronic system.
Getting Your Conference Talk Proposal Accepted 🎙
Tags: podcast, career, devrel, productivity
Published: 2022-06-08 15:31:20

Ever wonder what it takes to get your conference talk accepted? In this episode of DevDiscuss we talk to experts on every side of this process. If you ever want to speak at a conference, the first step is getting accepted. 

This episode features @aphoenix, @pachicodes and @tracypholmes. **Please give it a listen and subscribe!**


## Listen on Apple Podcasts

{% embed https://podcasts.apple.com/us/podcast/s9-e5-getting-your-conference-talk-proposal-accepted/id1513053883?i=1000565618942 %}

## Listen on Spotify

{% embed https://open.spotify.com/episode/6PGVKsMoKm7YkIp2Lsn2sp?si=Tlic_PNXS_KpOw9YTnVv6g %}

## [Or listen right here on DEV](https://dev.to/devdiscuss/s9e5-getting-your-conference-talk-proposal-accepted)

***

**And again, if you like the episode, definitely subscribe to the show. It's a great season!**

Happy CFP writing!
Maximum Total Importance of Roads
Tags: leetcode, dsa, theabbie
Published: 2022-06-08 15:30:39

You are given an integer `n` denoting the number of cities in a country. The cities are numbered from `0` to `n - 1`.

You are also given a 2D integer array `roads` where `roads[i] = [ai, bi]` denotes that there exists a **bidirectional** road connecting cities `ai` and `bi`.

You need to assign each city with an integer value from `1` to `n`, where each value can only be used **once**. The **importance** of a road is then defined as the **sum** of the values of the two cities it connects.

Return _the **maximum total importance** of all roads possible after assigning the values optimally._

**Example 1:**

![](https://assets.leetcode.com/uploads/2022/04/07/ex1drawio.png)

**Input:** n = 5, roads = \[\[0,1\],\[1,2\],\[2,3\],\[0,2\],\[1,3\],\[2,4\]\]
**Output:** 43
**Explanation:** The figure above shows the country and the assigned values of \[2,4,5,3,1\].
- The road (0,1) has an importance of 2 + 4 = 6.
- The road (1,2) has an importance of 4 + 5 = 9.
- The road (2,3) has an importance of 5 + 3 = 8.
- The road (0,2) has an importance of 2 + 5 = 7.
- The road (1,3) has an importance of 4 + 3 = 7.
- The road (2,4) has an importance of 5 + 1 = 6.
The total importance of all roads is 6 + 9 + 8 + 7 + 7 + 6 = 43.
It can be shown that we cannot obtain a greater total importance than 43.

**Example 2:**

![](https://assets.leetcode.com/uploads/2022/04/07/ex2drawio.png)

**Input:** n = 5, roads = \[\[0,3\],\[2,4\],\[1,3\]\]
**Output:** 20
**Explanation:** The figure above shows the country and the assigned values of \[4,3,2,5,1\].
- The road (0,3) has an importance of 4 + 5 = 9.
- The road (2,4) has an importance of 2 + 1 = 3.
- The road (1,3) has an importance of 3 + 5 = 8.
The total importance of all roads is 9 + 3 + 8 = 20.
It can be shown that we cannot obtain a greater total importance than 20.

**Constraints:**

*   `2 <= n <= 5 * 104`
*   `1 <= roads.length <= 5 * 104`
*   `roads[i].length == 2`
*   `0 <= ai, bi <= n - 1`
*   `ai != bi`
*   There are no duplicate roads.

**SOLUTION:**

    from collections import defaultdict
    
    class Solution:
        def maximumImportance(self, n: int, roads: List[List[int]]) -> int:
            roadctr = defaultdict(int)
            for a, b in roads:
                roadctr[a] += 1
                roadctr[b] += 1
            total = 0
            bigcities = sorted(range(n), key = lambda c: roadctr[c])
            for i in range(n):
                total += (i + 1) * roadctr[bigcities[i]]
            return total
Why are CSS frameworks so used?
Tags: discuss, webdev, css
Published: 2022-06-08 15:29:17

##Why are CSS frameworks so used?

I mean, **why***??? 🤣

I don't particularly love them, they give me the idea of _forcing myself_ into useless schemes but I am open-minded 😬 and therefore **I would like to know which of you uses one of it** and what are the actual benefits, obviously in addition to those we all know.

Here are some statistics on the use of CSS frameworks:

![Usage Statistics and Market Share of CSS Frameworks for Websites June 2022](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/abgtmu4bn9k28ej3kjxt.png)

As many as **20% of all websites** (ALL) use a framework. 😮 **80% of these use bootstap.**

_Source:_ [https://w3techs.com/technologies/overview/css_framework](https://w3techs.com/technologies/overview/css_framework)

---

##Okay, come on, it's your turn now.
###let me change my mind. 😎

Why you usually use a CSS framework?
What advantage do you find in using a CSS framework? 
And which one you prefer?
Supplementing your Studying with Mock Interviews
Tags: career, programming, codenewbie
Published: 2022-06-08 15:25:11

Everyone knows you need to do practice problems when studying for coding interviews. Leetcode and [Cracking the Coding Interview](https://fangprep.substack.com/p/dont-buy-cracking-the-coding-interview?s=w) are at the top of every future FAANG employees list when it comes to study resources.

But, people seem to always neglect the other key skills required to land the job. In this post, I’ll break down what these skills are, offer some guidance on how to get started, and share a resource for free mock interviews.

Read the full article: [https://www.hackpack.io/blog/mock-interviews/mock-coding-interviews-important](https://www.hackpack.io/blog/mock-interviews/mock-coding-interviews-important)

### Join the Community

Looking for a study partner? [Hackpack](https://www.hackpack.io/) is the most active community. of engineers studying for programming interviews. We hold each other accountable, provide support, and fight burnout to study more efficiently and get the job faster.

You can apply on the site.

[Big Tech Interview Tips Newsletter](https://fangprep.substack.com/)

[Other Mock Interview Resources](https://www.hackpack.io/blog/mock-interviews)

[Programming Interview Prep Events (Upcoming: Q&A with Senior Meta Engineer)](http://[%3Chttps//discord.gg/VQkMr234zk?event=970275330294153257%3E%5D(%3Chttps://discord.gg/VQkMr234zk?event=970275330294153257%3E))
What is Programming Language ?
Tags: beginners, programming, programminglanguage
Published: 2022-06-08 15:17:35

## **Introduction**
Programming languages are used to create and control computer programs. They are written in a specific syntax and use special instructions to tell the computer what to do. There are many different programming languages, but they all have some common features.

Programming languages are designed to make it easier for computer programmers to write code. The most common programming languages are C, C++, Java, and Python. They enable programmers to create programs that can control the execution of other programs.

## **What is Programming Language**
Programming languages are the building blocks of software. They are the source code that a computer uses to carry out instructions. A programming language is a set of specific rules that the computer uses to process text.

There are many different types of programming languages, but all share some common features. All programming languages use symbols to represent words and numbers, for example, and they all have a way of specifying how these symbols should be used.

Programming languages can be divided into two main categories: imperative and declarative. Imperative programming languages require you to specify exactly what you want the computer to do with your code. Declarative programming languages allow you to state simply what you want the computer to do, without having to specify every step in detail.

## **How A Top Programming Language should be**
A Top [Programming Language](https://hindiassistant.com/programming-language-in-hindi/) should be powerful and versatile, able to meet the needs of modern software development. Here are the eight features that will make a language stand out: 

-Efficient execution: The language should be fast and efficient, allowing developers to get their work done quickly.
-Robustness: The language should be robust, able to handle unexpected situations without crashing.
-Comprehensive libraries: The language should have comprehensive libraries that can help developers solve common problems.
-Flexible syntax: The syntax of the language should be flexible, allowing for easy learning and writing code. 
-Easy integration with other languages: The language should be easy to integrate with other languages, making it easy for developers to work with other tools and platforms.
How to create a server with Node, Fastify and MongoDB
Tags: javascript, tutorial, node, beginners
Published: 2022-06-08 15:17:12

Fastify is more and more popular and more performant than Express. I decide to learn Fastify to use it in a real project. All information about Fastify, you can find [here](https://www.fastify.io/)

1) I create a directory fastifyBooks

```
mkdir fastifyBooks
cd fastifyBooks
npm init
```

2) When npm is initialized I can install fastify:

```
npm i fastify
```

3) It's time to create directory src in fastifyBooks and there I create my entry file app.js Here I will write my server.

```
mkdir src
cd src
touch app.js
```
4) Now I can use festify and I create a server in app.js

```
import Fastify from 'fastify'


const fastify = Fastify({
  logger: true
})


fastify.get('/', function (request, reply) {
    reply.send({ hello: 'world' })
  })


fastify.listen(3000, function (err) {
    if (err) {
      fastify.log.error(err)
      process.exit(1)
    }
    else{
        console.log("server is on port 3000")
    }
})

```
In this file, I use ES6 not CJ so I have this error when I want to start a server: 

```
SyntaxError: Cannot use import statement outside a module
```
So I fix a bug, in package.json I put this line of code:

```
"type": "module",
```
And now my server works: 


![working server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d3p0tilo4uo320wm4oca.png)

5) But I want also MongoDB in my little project so I install it:

```
npm install mongoose
```
6) In the directory fastifyBooks I create a directory config where I will put the file db.js

```
mkdir config
cd config
touch db.js
```
7) And I write a function to connect DB with server:

```
import mongoose from 'mongoose'
const db = "databaseàmoi";
const passwordDb="monpass"
const URI =`mongodb+srv://Deotyma:${passwordDb}@cluster0.uncn9.mongodb.net/${db}?retryWrites=true&w=majority`;


const MongoDBbooks = {
    initialize: () => {
        try {
            const client = mongoose.connect(URI, 
                { 
                    useNewUrlParser: true, 
                    useUnifiedTopology: true
                })


            client.then(() => {return console.log(`successfully connected to DB: ${db}`)})
            .catch((err)=> {console.log(err)})
        } catch(err) {
             throw Error(err)
        }
    }
}


export default MongoDBbooks;
```
7) Now I need to import it to app.js:

```
import MongoDBbooks from '../config/db.js';
```
the path is very important. 

And now when I need to modify function witch run a server like that: 

```
const start = async()=>{
    try{
        fastify.listen(3000);
        MongoDBbooks.initialize();
    }
    catch(error){
        fastify.log.error(err)
        process.exit(1)
    }
}
start();

```
At the same moment, I start a server and I initialise a connection with DB.

Now my application is ready for routes.
Mobile App trends
Tags: mobile, discuss
Published: 2022-06-08 15:07:37

I have been web developer for a bit more than 2 years, but never got a chance to make anything for the mobile ( applications for iOS 🍎 & Android 🤖).

Was wondering what kind of technologies are you using, what's best to start with? I do work primarily with ReactJS so is that means ReactNative is the way to go? Or maybe there is better tools ?

I'm more interested in building for both platforms, but single framework. ( at-least for now, even thought Swift looks kind of interesting).
Robot Return to Origin
Tags: leetcode, dsa, theabbie
Published: 2022-06-08 15:00:47

There is a robot starting at the position `(0, 0)`, the origin, on a 2D plane. Given a sequence of its moves, judge if this robot **ends up at** `(0, 0)` after it completes its moves.

You are given a string `moves` that represents the move sequence of the robot where `moves[i]` represents its `ith` move. Valid moves are `'R'` (right), `'L'` (left), `'U'` (up), and `'D'` (down).

Return `true` _if the robot returns to the origin after it finishes all of its moves, or_ `false` _otherwise_.

**Note**: The way that the robot is "facing" is irrelevant. `'R'` will always make the robot move to the right once, `'L'` will always make it move left, etc. Also, assume that the magnitude of the robot's movement is the same for each move.

**Example 1:**

**Input:** moves = "UD"
**Output:** true
**Explanation**: The robot moves up once, and then down once. All moves have the same magnitude, so it ended up at the origin where it started. Therefore, we return true.

**Example 2:**

**Input:** moves = "LL"
**Output:** false
**Explanation**: The robot moves left twice. It ends up two "moves" to the left of the origin. We return false because it is not at the origin at the end of its moves.

**Constraints:**

*   `1 <= moves.length <= 2 * 104`
*   `moves` only contains the characters `'U'`, `'D'`, `'L'` and `'R'`.

**SOLUTION:**

    class Solution:
        def judgeCircle(self, moves: str) -> bool:
            x, y = 0, 0
            for m in moves:
                if m == "U":
                    y += 1
                elif m == "D":
                    y -= 1
                elif m == "R":
                    x += 1
                elif m == "L":
                    x -= 1
            return (x, y) == (0, 0)
Sequential Digits
Tags: leetcode, dsa, theabbie
Published: 2022-06-08 14:30:36

An integer has _sequential digits_ if and only if each digit in the number is one more than the previous digit.

Return a **sorted** list of all the integers in the range `[low, high]` inclusive that have sequential digits.

**Example 1:**

**Input:** low = 100, high = 300
**Output:** \[123,234\]

**Example 2:**

**Input:** low = 1000, high = 13000
**Output:** \[1234,2345,3456,4567,5678,6789,12345\]

**Constraints:**

*   `10 <= low <= high <= 10^9`

**SOLUTION:**

    import bisect
    import math
    
    class Solution:
        def sequentialDigits(self, low: int, high: int) -> List[int]:
            nums = "123456789"
            n = len(nums)
            a = int(1 + math.log10(low))
            b = int(1 + math.log10(high))
            op = []
            for l in range(a, b + 1):
                for i in range(n - l + 1):
                    curr = int(nums[i:i + l])
                    if curr >= low and curr <= high:
                        bisect.insort(op, curr)
            return op
Wednesday Links - Edition 2022-06-08
Tags: java, jvm, testing, junit
Published: 2022-06-08 14:29:57

Testing Clean Cleaner Cleanup (4 min)🧹
https://inside.java/2022/05/27/testing-clean-cleaner-cleanup/

Exhaustive JUnit5 Testing with Combinations, Permutations, and Products (6 min)🔀
https://minborgsjavapot.blogspot.com/2022/06/exhaustive-junit5-testing-with.html

Improved Ergonomics (4 min)🏄
https://egahlin.github.io/2022/05/31/improved-ergonomics.html

The Case Against Logging (5 min)🪵
https://blog.sebastian-daschner.com/entries/the-case-against-logging

Developers disassemble! Use Java and hsdis to see it all (26 min)⚙️
https://blogs.oracle.com/javamagazine/post/java-hotspot-hsdis-disassembler
How to Kill a Local Host in Linux
Published: 2022-06-08 14:24:46

Sometimes when you try to run a port through terminal, you may end up getting errors like 'address already in use'.

I get this even when I disconnect the host. Although it happens sometimes only. Follow this steps to Kill the local Host.

**Step 1:**
Open Your Linux Terminal

**Step 2:**
Types this command below.
`sudo lsof -iTCP:3000 -sTCP:LISTEN`
*Please note that*: type your port address instead of `3000`

**Step 3:**
You get an output similar to this.
```
COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
node    25215  user    20u  IPv6 240148      0t0  TCP *:hbci (LISTEN)
```
note that _PID_

**Step 4:**
type `kill 25215`

Voila, you killed it :)
Laravel 8 Form Class Not Found
Tags: laravel, laravel8, php, form
Published: 2022-06-08 14:15:16

In this article, we will solve laravel 8 form class not found error, many times we have received errors like laravel 8 class 'form' not found.

We have received this error message because the laravel 8 version made changes in their library file, you can solve this issue by using the "laravelcollective/html" package. laravelcollective/html package will provide you with HTML and FORM class helper.

laravelcollective/html is provide html textbox, radio button, select box, checkbox, and many more with laravel. They provide a different methods to use those input fields we need to add this facade class 'collective\html\form\facade' if not added. Using the below command you can install the latest and supported version of "laravel collective html"

So, let's see class form not found in laravel 8, laravel 8 class 'form' not found, class 'collective\html\form\facade' not found, laravel collective/html

For laravel 8 form class not found run below command.

```
composer require laravelcollective/html
```

---
 
**_[Read Also : How to Get Current URL in Laravel](https://techsolutionstuff.com/post/how-to-get-current-url-in-laravel)_**

--- 

If you are using 5.x version then you need to add the below code in the app.php file.

```
'providers' => [
    ...
    Collective\Html\HtmlServiceProvider::class,
    ...
  ],
'aliases' => [
      ...
      'Form' => Collective\Html\FormFacade::class,
      'Html' => Collective\Html\HtmlFacade::class,
      ...
  ],
```

If you are using a lower level laravel collective version like v5.6 or below then add code like below.

Go to your project's composer.json file to require laravelcollective/html.

```
composer require "laravelcollective/html":"^5.8.0"
```

Now, add your new provider to the provider's array of config/app.php.

```
'providers' => [
    // ...
    Collective\Html\HtmlServiceProvider::class,
    // ...
  ],
```

---
 
**_[Read Also : Google Line Chart Example in Laravel 8](https://techsolutionstuff.com/post/google-line-chart-example-in-laravel-8)_**

--- 

After that, add two class aliases to the aliases array of config/app.php

```
'aliases' => [
    // ...
      'Form' => Collective\Html\FormFacade::class,
      'Html' => Collective\Html\HtmlFacade::class,
    // ...
  ],
```

---
 
You might also like :

- **_[Read Also : Routing - Laravel 7/8 Routing Example](https://techsolutionstuff.com/post/routing-laravel-7-8-routing-example)_**

- **_[Read Also : Laravel whereBetween Query Example](https://techsolutionstuff.com/post/laravel-wherebetween-query-example)_**

- **_[Read Also : How To Create Dynamic Pie Chart In Laravel 8](https://techsolutionstuff.com/post/how-to-create-dynamic-pie-chart-in-laravel-8)_**
How to Get Current URL in Laravel
Tags: laravel, php, url, laravel8
Published: 2022-06-08 14:15:05

In this article, we will see how to get the current URL in laravel. if you want to get the current page URL in laravel 8 then we can use many methods such type current(), full(), request(), url(). Here I will give you an example of laravel get current URL. In this example, I have used helper and function.

So, le's see  laravel 8 get current url, get current page url in laravel 8, get full url in laravel 8, find current url in laravel 8, laravel 8 get url path, how to get current url in laravel controller, how to get current url in laravel blade

> full() with Helper and Query string parameters

```
$currenturl = url()->full();

dd($currenturl);
```
 
---

**_[Read Also : Laravel 8 Socialite Login with Facebook Account](https://techsolutionstuff.com/post/laravel-8-socialite-login-with-facebook-account)_**

---
 
> current() with Helper

``` 
$currenturl = url()->current();

dd($currenturl);
```
 
> using Request

``` 
$currenturl = Request::url();

dd($currenturl);
```
 
---

**_[Read Also : Laravel 8 Autocomplete Search from Database](https://techsolutionstuff.com/post/laravel-8-autocomplete-search-from-database)_**

---
 
> current() with Facade

``` 
$currenturl = URL::current();

dd($currenturl);
```
 
> full() with Facade and Query string parameters

``` 
$currenturl = URL::full();

dd($currenturl);
```

--- 

**_[Read Also : Google Line Chart Example in Laravel 8](https://techsolutionstuff.com/post/google-line-chart-example-in-laravel-8)_**

---
 
> Get Previous URL in Laravel :

```
$pre_url= url()->previous();

dd($pre_url);
```
 
> Get Current Route in Laravel :

``` 
$cur_route = Route::current()->getName();

dd($cur_route);
```
 
You might also like :

- **_[Read Also : Laravel orderBy, groupBy and limit Example](https://techsolutionstuff.com/post/laravel-orderby-groupby-and-limit-example)_**

- **_[Read Also : Laravel 8 Yajra Datatable Example Tutorial](https://techsolutionstuff.com/post/laravel-8-yajra-datatable-example-tutorial)_**

- **_[Read Also : How To Increase Session Lifetime In Laravel](https://techsolutionstuff.com/post/how-to-increase-session-lifetime-in-laravel)_**