teleren/devto huggingface dataset:
My first post on Dev!
Tags: discuss, beginners, programming
Published: 2022-03-28 05:34:53

Hey folks, I'm **Justice**.

I am a **front-end developer**, who has a great passion for programming and loves to create things for the web. I enjoy working on new projects and pushing the boundaries of what's possible with code. I am always looking to learn new skills and techniques, so feel free to reach out if you need help with anything.

In **my spare time**, I enjoy reading about new programming techniques 📖, experimenting with new technologies 👩‍💻, and playing video games 🎮.

I'm not an expert and I probably still have a lot to learn, but I have decided to **share my experience** with the Dev community. In my time as a developer, I've learned that collaboration is key. By sharing what I know and working together, we can all improve our skills and help each other grow. So don't hesitate if you need help!

Thanks for taking the time to read this.
Laravel 8 - How To Get Routes in Controller
Tags: howto, laravel, php, javascript
Published: 2022-03-28 05:30:13

Originally posted @ https://codeanddeploy.com visit and download the sample code: https://codeanddeploy.com/blog/laravel/laravel-8-how-to-get-routes-in-controller

In this post, I will share how to get the Laravel 8 routes inside a controller. If you need to get the routes and register them to your permissions then this is for you or maybe another checking you need in your Laravel project.


```php
use Illuminate\Support\Facades\Route;

/**
 * Display a listing of the resource.
 *
 * @return \Illuminate\Http\Response
*/
public function index()
{
    $routes = Route::getRoutes();
    foreach ($routes->getRoutes() as $route) {
        echo $route->getName(). '<br>';
        echo $route->getActionName(). '<br><br><br>';
   }
}
```

And the result will be like this below:

![laravel-8-how-to-get-routes-in-controller](https://ecn-storage.s3.us-west-2.amazonaws.com/articles/laravel-8-how-to-get-routes-in-controller-bEfmrj4ZFTx980.webp?ctm=1630839561)

I hope this tutorial can help you. Kindly visit here https://codeanddeploy.com/blog/laravel/laravel-8-how-to-get-routes-in-controller if you want to download this code.

Happy coding :)
How to survive the StackOverflowgeddon
Tags: json, cv, career, opensource
Published: 2022-03-28 05:16:26

> _Full disclosure - I built [getmanfred.com/stackoverflowgeddon](https://www.getmanfred.com/stackoverflowgeddon)_



As you probably already know, next March 31st, [Stack Overflow will discontinue Developer Stories](https://meta.stackoverflow.com/questions/415293/sunsetting-jobs-developer-story), their own flavour of online CV.

**4.7 million developers will be affected**, and the professional data they maintained during seven years will be lost forever if they don't find a backup. The only solution Stack Overflow has provided is to download your CV... as a PDF file 🤦‍♂️

You can find some good options out there to retrieve your data and even get it back online:

* You can import your DevStory to [File/New/Job](https://www.filenewjob.com/candidates) but you won't have a copy of your data and you have to register first :/
* [developerstory.dev](https://developerstory.dev/stackoverflow) exports your DevStory as a generic JSON file but you have to authenticate with your Stack Overflow account first.
* [devstory.fyi](https://devstory.fyi/) allows you to:
     * Download your DevStory as a JSON file (with the JSON Resume open-source format), but the downloaded JSON is not valid as is.
     * Import your DevStory data to get an online version.
* Finally, Manfred has developed [an open-source solution](https://www.getmanfred.com/stackoverflowgeddon). You can:
     * Download your data as a valid JSON file (with the MAC open-source format)
     * Download the open-sourced code used to scrap your data.
     * Import your DevStory data to get your online version and much more features (eg. **you can sync your data in Manfred with one of your repos on GitHub** and LinkedIn will be the next platform to follow)

[![An example of an online CV on Manfred](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ykd9kv2vxmttv0bacuzs.png)](https://www.getmanfred.com/stackoverflowgeddon)

Some developers ask themselves about the benefits of maintaining an online CV when they have job offers every day on LinkedIn. The point is **if we want to manage our career on our own or let LinkedIn work it by us**. If we want to look for the best opportunities for us or let LinkedIn decide which options are worth it.
Staircase Problem solution hacker rank
Tags: hackerrank, dsa, patters
Published: 2022-03-28 05:13:55

Staircase detail
This is a staircase of size n =4

.....#
....##
...###
.####

Its base and height are both equal to n . It is drawn using # symbols and spaces. The last line is not preceded by any spaces.
Write a program that prints a staircase of size n.


## Function Description

Complete the staircase function in the editor below.
staircase has the following parameter(s):

_int n: an integer_

## Print

Print a staircase as described above.

## Input Format

A single integer, , denoting the size of the staircase.

## Output Format

Print a staircase of size  using # symbols and spaces.

_Note: The last line must have  spaces in it._


```
#include <iostream>
using namespace std;

int main()
{
    int n ;
    cin >>n;

    for (int i = 1; i <= n; i++)
    {
        for (int j = 0; j < n - i; j++)
        {
            cout << " ";
        }

        for (int k = 0; k < i; k++)
        {
            cout << "#";
        }
        cout << endl;
    }

    return 0;
}
```
Min-Max-Sum hacker rank solution
Tags: solution, hackerrank, dsa
Published: 2022-03-28 05:03:41

Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers.


Example :-

arr = [1,3,7,5,9]

minimum sum is  and the maximum sum is 1+3+5+7 = 16  and the maximum sum is 3+7+5+9 =24

The function prints

> 16 14


## **code :-**

```
void miniMaxSum(vector<int> arr) {
     long long int sum =0;int maxVal=arr[0],minVal=arr[0];
    
    
    for(int i=0;i<5;i++){
        sum += arr[i];
        minVal = min(minVal,arr[i]);
        maxVal = max(maxVal,arr[i]);
    }
    
    long long int minSum = sum - maxVal;
    long long int maxSum = sum - minVal;
    
    
    cout << minSum << " "<< maxSum << endl;

}

```
Diagonal Difference HackerRank solution
Tags: cpp, proble, ds
Published: 2022-03-28 04:57:29

Given a square matrix, calculate the absolute difference between the sums of its diagonals.
For example, the square matrix  is shown below:

> **1  2  3 
>   4  5  6
>   9  8  9**

The left-to-right diagonal = 1 + 5 + 9 = 15 The right to left diagonal = 3 + 5 + 9 = 17, Their absolute difference is |15-17| = 2.


## in c++

```
int diagonalDifference(vector<vector<int>> arr,int n) {
    
    int lft=0,rit=0;
    
    for(int i=0;i<n;i++){
        lft += arr[i][i];
        rit += arr[(n-i)][(n-i)];
    }
    
    return abs(rit-lft);

}

```
This is my website
Tags: mywebsite, frontend, openforwork, gatsby
Published: 2022-03-28 04:57:22

Hi, I'm recently changing careers and am starting a new career in tech, specifically I'm looking into Front End development.  I have a background in architecture and customer service, and have had many jobs in many areas, from painting houses, set dresser on a film studio, bar tender to architecture designing a petrol station (remotely) in Africa and flight attendant.  2020 was not nice to any of us and I saw myself changing careers sooner that I was expecting, I was already looking into changing careers in tech but was taken there way before I was ready. 
After being made redundant as flight attendant, I saw myself looking forward to start a new career in tech, I have had tried it before a little bit, but realised that that time long ago, I lacked structure and was jumping all over the place wanting to know everything, so I learn a little :(
This time I decided to have a different approach and enrolled in a full stack development bootcamp, get some structure, some knowledge and somewhere to start from. So here I am... looking for jobs already.
And now I present you my website, it is not a finished product, but at least I have a little online presence. I plan on working on a better design and making it a bit more interactive, so please feel free to any feedback you might have. 

https://rodrigohdiaz.gatsbyjs.io
DeepGram AI ChatBot
Tags: hackwithdg, deepgram, hackathon, ai
Published: 2022-03-28 04:34:18

**Overview of My Submission**

Through our interactive chatbot chat, we help you have discussions about impactful topics: climate change, politics, sustainability... 
You name it, we've got it covered. 
So chat, learn and build up your confidence, to get the experience of a native speaker and be able to discuss those topics that can help you make a positive change in the world around you.


**Submission Category:**

Whacky Wildcards


**Link to Code on GitHub**

`https://github.com/Tejender1521/Deepgram-AI-ChatBot.git`

**System Setup/Installation Guide**

Go to terminal and run `$ python --version`

If you don't have python installed then view installation guide from here https://www.python.org/

To follow the upcoming steps you must have Deepgram(https://deepgram.com/why-deepgram/) and OpenAI(https://openai.com/) account, and further create your API key credentials that is used in further steps.
```
$ git clone https://github.com/Tejender1521/Deepgram-AI-ChatBot.git
$ cd Deepgram-AI-ChatBot
$ pip install -r requirements.txt
$ python app.py
```
Note: If the forementioned method does't work then you can simply install using setup.py
Your app should now be running on localhost:5000.

**Tech Stack Used**
DeepGram
OpenAI
Python
Flask
Vanilla.js


**Additional Resources / Info**

![Home](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hnw1o5m3txh3m4q2u3x6.png)
![Chat](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9wkn09qy65x29a8arrtk.png)

![About](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d32pr7qq97qu0ipqxmhs.png)
![AI Chat Bot 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m8o8d0alqz3fo8ce33hm.png)
![AI Chat Bot 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0lux20isr40vf930wbol.png)

—

**Conclusion**
We have tested this on several research groups and the results were positive. We really believe that through this technology nd with the help of DeepGram one can improve their communication skills significantly.
18 amazing 🤩 GitHub repositories that will help you 🪄 make a Beautiful Project
Published: 2022-03-28 04:25:26

<h1 style="background-color: white; box-sizing: border-box; color: #09090
9; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 1.75em; font-weight: var(--fw-bold); line-height: var(--lh-tight); margin: calc(var(--content-rhythm) / 2) 0; padding: 0px;">Introduction</h1><p style="background-color: white; box-sizing: border-box; color: #090909; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 18px; margin: 0 0 var(--content-rhythm) 0;">Today I would like to give examples of good GitHub repositories that will help you implement complex animations, as well as useful functions in your projects.</p><p style="background-color: white; box-sizing: border-box; color: #090909; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 628px; margin: 0 0 var(--content-rhythm) 0;">So let's get started&nbsp;</p><p style="background-color: white; box-sizing: border-box; color: #090909; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 18px; margin: 0 0 var(--content-rhythm) 0;"><br /></p><p style="background-color: white; box-sizing: border-box; color: #090909; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 18px; margin: 0 0 var(--content-rhythm) 0;">Read More: <b><a href="https://www.google.com/url?sa=t&amp;source=web&amp;rct=j&amp;url=https://www.codelivly.com/10-awesome-github-repos-every-web-developer-should-know/&amp;ved=2ahUKEwiw1e_qpqbzAhU78HMBHVvBAWkQFnoECBAQAQ&amp;usg=AOvVaw1YdY91hlP3suK6HGMF0MXW" target="_blank">18 amazing 🤩 GitHub repositories that will help you 🪄 make a Beautiful Project</a></b></p>
Tailwind CSS in HTML starter via NPM
Tags: tailwindcss
Published: 2022-07-07 15:35:38

---
title: Tailwind CSS in HTML starter via NPM
published: true
date: 2022-03-28 04:15:00 UTC
tags: TailwindCSS
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/azib0l1t22x1e52sizny.jpeg
canonical_url: https://anlisha.com.np/blog/tailwind-css-in-html-starter-via-npm/
---

Tailwind CSS is a utility-first CSS framework. This article includes steps to install Tailwind CSS in HTML via package manager and how to properly process Tailwind CSS. Although it requires a bit more setup, it is definitely the best way to make use of all of the features that Tailwind CSS can provide.

**Step 1 — Initialize package.json**

```
npm init -y
```

_Note: The -y flag will say yes to all questions_

**Step 2— Install Tailwind CSS**

```
npm install -D tailwindcss@latest
```

_-D option if to save package to peerDependencies_

**Step 3— Include Tailwind CSS directives**

Now that Tailwind CSS is installed, the next step is creating a `tailwind.css` file and add the following code to inject the Tailwind CSS directives.

```
@tailwind base;
@tailwind components;
@tailwind utilities;
```

**Step 4— Setup Tailwind configuration file**

The configuration file makes it easy to customize the classes in Tailwind CSS by changing any fonts, color, spacing, etc.

```
npx tailwindcss init
```

A minimal configuration file named `tailwind.config.js` is generated.

```
module.exports = {
 content: ["./index.html"], // Paths to all template files
 theme: {
  extend: {},
 },
 plugins: [],
}
```

**Step 5— Processing Tailwind CSS**

We’ll be using TailwindCSS CLI to build the CSS. In the following command `./assets/scss/tailwind.css` is the input, and the built-css output will be placed in `./assets/css/tailwind.css`.

```
npx tailwindcss -i ./assets/scss/tailwind.css -o ./assets/css/tailwind.css --watch
```

Also we can add the following script into `package.json` to easily build CSS with command `npm run dev` .

```
"scripts": {
"dev": "tailwindcss -i ./assets/scss/tailwind.css -o ./assets/css/tailwind.css --watch",
}
```

**Step 6— Link Tailwind CSS into HTML**

Create an `index.html` file; Add the following code in HTML template head section.

```
<!-- index.html -->
<link rel="stylesheet" href="./assets/css/tailwind.css" />
```

**And This is it. Enjoy!**

The post [Tailwind CSS in HTML starter via NPM](https://anlisha.com.np/blog/tailwind-css-in-html-starter-via-npm/) first appeared on [Anlisha Maharjan](https://anlisha.com.np/blog).
controlling motor with PWM?
Tags: electricalelectronic, controlling, motor, pwm
Published: 2022-03-29 03:39:43

---
title: controlling motor with PWM?
published: true
date: 2022-03-28 03:47:12 UTC
tags: ElectricalElectronic,controlling,motor,PWM
canonical_url: https://stackallflow.com/electrical-electronics/controlling-motor-with-pwm/
---

I am using a [RCS-Model-M2313 R/C Servo](https://stackallflow.com/reference/38987) and I have managed to create a PWM. My problem is that my motor doesn’t react as I was expecting. I would like to control the motor angle with the duty cycle but it doesn’t work.  
 Indeed, with a 28% duty cycle, a 550 Hz frequency, 1.7V offset, a 3.3V signal from my MCU I can control it to come back to the same position. I have powered the servo with a 3.7 tension.  
 When I change the duty cycle, the motor turn but doesn’t stop anymore.

The datasheet doesn’t give any information, I really need your advices.  
 Thank you.  
 Regards,  
 Mattew

## Accepted Answer:

Your frequency is way too high, or conversely, you are not waiting long enough between pulses. You should be sending a 1 to 2 ms pulse every 20 to 50 ms. Note that this means 50 Hz maximum.

Also, your “1.7 V offset” makes no sense. These pulses should generally be 0 to 5 V digital signals. I followed the link you provided, but that only goes to a product sell page not a datasheet, so we can’t tell exactly what voltage levels the digital signal must be. When in doubt with hobby servo units, use 5 V logic.

Try a 1 ms pulse every 20 ms. That should send the arm to one end. Then try 2 ms every 20 ms. That should send the arm to the other end. Try it with the 3.3 V signal straight out of your processor and see if that works. If it doesn’t, make it a 0-5 V signal instead. That really should work if everything else is hooked up right. If you don’t have a level translator chip, you can rig up something with a NPN transistor and pullup resistor. That will invert, but just invert the processor output to compensate. A HCT (note the T) logic gate powered at 5 V can also be used as a 3.3 V to 5 V converter.

Are you sure the processor power is properly filtered so that the current spikes the motor draws doesn’t effect it? A schematic and scope traces with a clear description of what happens in each case would help a lot.

#Electronic #controlling #motor #PWM

The post [controlling motor with PWM?](https://stackallflow.com/electrical-electronics/controlling-motor-with-pwm/) appeared first on [Stack All Flow](https://stackallflow.com).
VS Code Tip of the Week: Advanced Collapsing Code Blocks
Tags: vscode, vscodetips
Published: 2022-03-28 04:07:54

This week's tip of the week is all about collapsing code blocks. You can click on the fold caret icon beside a code block to expand collapse it, but did you know if you hold the <kbd>ALT</kbd> (<kbd>⌥</kbd> on Mac) while clicking the fold caret icon, it will collapse all code blocks except the one you just clicked on?

{%embed https://twitter.com/steveruizok/status/1506931899507388418 %}

Thanks to Steve Ruiz from the Twitters for the tip!
90 % of Javascript Developer fail to answer these code snippets (Asked in Interview) Part-1
Tags: javascript, computerscience, webdev, beginners
Published: 2022-03-28 04:06:46

**Q1. Guess the output?**

let x = true
setTimeout (()=>{
x= false
})
while (x)
{
console.log(“hello”)
}

Output:
Hello

Hello ….will go on printing

**Reason**: In this case, the value of x is true in the global scope and as we know that javascript is a single thread language, the setTimeout is an asynchronous operation so it will go in the task queue and wait for its chance for execution so now we go to “while loop “ the value of x is true so it satisfies the given condition in the while loop now it will print continuously “hello” and after 2 seconds the setTimeout is ready for execution but the call stack is not empty, it is already running the while loop so setTimeout will not get any chance of execution

**Q2 Guess the output?**

let x = true
let count =0;

setTimeout(()=>{
x= false;
},2000)

setInterval(()=>{
if(x)
{
console.log(count++)
}
},200)

Output:

0
1
2
3
4
5
6
7
8

the cursor will be not free on the output screen

**Reason**:In this case, the setTimeout and setInterval is an asynchronous operation so first, it calls the setInterval
,setInterval will print the value of count every 200 milliseconds and then after 2-second setTimeout
will invoke and setInterval condition get dissatisfied, it will print up to 8 and execution will continue

Please Do Like, Follow and Share, Thank you

visit [blog.braincuber.com](https://blog.braincuber.com) for more quality content
Down With the Sickness
Tags: opensource
Published: 2022-03-28 00:42:01

I am a little late this week with my blog. I usually write these things on Thursday, or Friday night. This week however I was hit hard by a sickness, late Thursday night. It is now Sunday night and I am finally feeling somewhat normal. Still a bit sore but the light sensitivity, fever, and headaches are all gone so I figured now would probably be a good time to get caught up on my work. 


## Release 2.9


In last weeks [blog](https://dev.to/tddr/the-end-draws-near-553k) I talked about what my plan was for release 2.9. My main areas of concern was finishing the migration to make use of the images stored in our Docker registry. The other area I was planning on taking on was to slim down those images in the registry by using [Docker-Slim](https://github.com/docker-slim/docker-slim).

I was able to submit a [PR](https://github.com/Seneca-CDOT/telescope/pull/3265) for migrating to use the docker based images. The only problem with the PR is that it is not testable, but with a couple reviews we took an educated guess at what needs to happen.

We to another educated guess with my second [PR](https://github.com/Seneca-CDOT/telescope/pull/3285) of the week. This one had me updating the autodeployment webhook to use our custom deploy tag that dynamically gets set depending on if it's staging or production. Again, this one is not testable in the local environment, so around 4-6 of us got together one night and tested it out on staging. After testing it out and smashing out some bugs, I made one final [PR](https://github.com/Seneca-CDOT/telescope/pull/3303) for the week that was just bringing the changes we made while testing live on staging, into the main branch. 

## Release 3.0-alpha

As you may have noticed, I did not get around to slimming the images like I had planned. This was because updating the autodeployment webhook was deemed to be a higher priority than slimming the images so I devoted my time to make sure that I could get that landed in time for 2.9.

Other than slimming the images, I believe there are still a few last steps needed before I can say that the registry is fully operational, but I am well on my way to being able to say I owned this registry.
Video editing software?
Tags: beginners, discuss, help
Published: 2022-03-28 04:00:35

Hi guys, I want to ask you a question. I want to run a video tutorials about some audio programming stuff, but don't know which editor is best. I tried to use this [video editor for PC](https://www.movavi.com/videoeditor/), but my trial license has expired, maybe you guys know free analogs of this program?