teleren/devto huggingface dataset:
Create a video with auto-generated voice-overs with an API call
Tags: python, api, beginners
Published: 2022-04-28 13:52:06

If you want to generate videos with voice-overs and to skip the repetitive tasks of video creation, follow this tutorial.

In this tutorial we are going to call an API with Python.

On the website **[Rollideo](https://rollideo.com/)**, you can launch the video generation directly from the home page, or use the APIs for more automation.

To use the Rollideo APIs:

- **Step 1:** Create an account to get a free API key
- **Step 2:** put your API key in the following code.

```
import requests, json, time

APIKEY = 'YOUR SECRET KEY HERE'
voice1 = "Joanna"

text1 = "A super easy tool to automatically create videos with auto-generated voice-overs and the exact subtitles. Example of a video sequence with " + voice1 +"'s voice."

picture1 = 'https://i.postimg.cc/3r4RL5YX/ocean1.jpg'

data = {
    'text_segments': [
   {
    'api_source_type': 'picture',
    'picture': picture1,
    'textforvideo': text1,  
    'voice_id': voice1  
   }
  ]
}

headers = {'x-api-key': f"{APIKEY}"}
response = requests.post('https://rollideo.com/create/video', headers=headers, json=data)
data2 = response.json()
print(data2)
launched = data2.get("launched", "ko")

if launched == "ok":
    # Use the Polling API endpoint to find out the status the above request /create/video.
    for i in range(1000):
        time.sleep(10)
        print(i)
        response2 = requests.post('https://rollideo.com/task/video', headers=headers, json=data2)
        success = response2.json().get("success", "not yet")
        if success == "ok" or success == "ko":
            print(response2.json())
            break
else:
    print("The launch of the task has failed")
    print(data2.get("message"))
```

With a free account, you can create a video with one sequence.

You can upgrade your account to create longer videos with many sequences.
L2 VARIABLES AND DATATYPES
Tags: beginners, tutorial, python, programming
Published: 2022-04-28 13:38:30





###  WAYS TO USE SINGLE QUOTES , DOUBLE QUOTES AND TRIPLE QUOTES IN A STRING

![LAST.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1649176513418/Ny-lLlGUF.png)

**NOTE -** 
-  Multi - line string can only be stored in triple quotes.

- If you want some inverted commas to be the part of your string then you can use triple quotes.

[L-2 , 50:00](Link)


### METHOD TO IDENTIFY THE DATATYPE OF VARIABLE 
- use type function

![1.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1649218116234/3bfc1MpZI.png)
**NOTE -** 
From datatype of variable 'd' you can clearly figure out that if you store any datatype inside quotes in any variable then that datatype will be considered as string only

### OPERATORS IN PYTHON

 **ARITHMETIC OPERATORS** - These are used to perform arithmetic operations on variables 
ARITHMETIC OPERATORS ARE      +,-,/,* etc

![2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1649219992714/T3Sn2GKAs.png)
**NOTE -**
From the above example we can see that whenever we perform division operation on 2  numbers in python then it returns the answer in float datatype

And dont forget to use the higlighted comma in between otherwise it will show error


 **ASSIGNMENT OPERATORS** - These are used to assign a value to the variable
ASSIGNMENT OPERATORS ARE     =,+=,-=,/=,*= etc


![3.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1649221004673/sP7_IjC8r.png)

**COMPARISON OPERATOR ** - These are used to compare two expressions and tell whether it is true or false . 
COMPARISON OPERATORS ARE    ==,>,>=,<,<=,!=

![1.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1649235795757/wkJaDm5fx.png)

**LOGICAL OPERATOR ** - Logical operators in python are used on conditional statements i.e. on true and false 
Logical operators are      and , or , not 

- **and**   returns true if both the values are true
- **or**     returns true if any one of the values is true
- **not**   makes true , false    and    false , true

![2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1649236804315/LvmdrehD9.png)


### TYPE FUNCTION AND TYPECASTING

![3.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1649238043609/RvW3e76Co.png)

****TYPE CASTING INT TO FLOAT AND STRING****


![4.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1649239609039/U9RR_9i3t.png)

**TYPECASTING FLOAT TO INT AND STRING**

![5.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1649240390760/hdokqprXD.png)

**TYPECASTING STR TO INT AND FLOAT**

![6.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1649240903565/in1Xkn835.png)

**NOTE - **
**If the string contains decimal point then you cannot directly typecaste it into integer datatype , you first need to convert it into float and then to integer**

![7.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1649241597179/u86Rm8aCS.png)

### INPUT FUNCTION
It allows the coder to take input from the users **as a string**

SYNTAX: a=input('enter something')
Power BI Training in Gurgaon | Power BI Course in Gurgaon
Tags: programming, python, css, opensource
Published: 2022-04-28 13:36:23

[Master Power bi tool](https://www.gyansetu.in/courses/power-bi-certification-training-in-gurgao
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0al3d13j17smrbhar0nx.png)n) from Microsoft, pursue Power BI training in Gurgaon  and get ready for a power upgrade to your career. It’s being used in the corporate world for its performance in business analytics, here’s why you should not overlook power bi if you want to advance in the sector of business analytics.

Helps bring data under one roof, provides great visibility, accessibility and organization for reports.

Makes the reports highly interactive as it comes pre loaded with data visuals including map, column, line, bar, matrix.

Databases can be compressed to more than one fifth the size. It ensures that data isn’t outdated, and provides incremental automated refreshes.

Supports advanced data experts as it is easily compatible with R, power bi allows integration of detailed R visualization into the dashboard.

Meets regulatory and security standards without requiring other tools. Users don’t require syntax for search as it facilitates interfaces with natural language search.
 
Placement
Every company will always be dependent on analysts with good updated skills. Job opportunities are very good if you have the skill in you.

Training Duration
Power BI learning will take approx. 2-3 months of the time period. Within a month of course completion, you can get a job.

Faculty
iClass Gyansetu has a good team of faculties working. It’s always advisable to learn from trainers working in corporates, they share their industry experience that is very important to crack interviews.

Contact
Phone No- +91-8130799520/ 9999201478
Website- www.gyansetu.in
Best source to learn Javascript for free in Arabic
Tags: javascript, beginners, arabic, bootcamp
Published: 2022-04-28 13:32:17

Osama El zero made javascript bootcamp on youtube .

You must know:
    HTML
    CSS

The bootcamp has an assignments for each lesson and code notice

[The bootcamp link](https://m.youtube.com/playlist?list=PLDoPjvoNmBAx3kiplQR_oeDqLDBUDYwVv)
What would you improve at your job?
Tags: discuss, productivity
Published: 2022-04-28 13:30:22

What are some things you'd like to improve at work? It could be code related, e.g. automation, refactoring, processes, etc, but it doesn't necessarily need to be developer specific.

Who knows, maybe some folks in the replies will have answers to things you'd like to improve, or if anything it just gets you thinking about things you want to make better. And others might be inspired by your answers to improve things where they work.

Just adding in Jeremy’s follow up question to this discussion as well.

{%embed https://dev.to/jeremyf/comment/1o20n %}

![A woman pointing at a taco saying, "Let's taco 'bout it"](https://media.giphy.com/media/WqLmcthJ7AgQKwYJbb/giphy.gif)

_I'll potentially say the obvious here, but be constructive. Don't use this post as a dumping ground for things that you are unhappy with at work and are looking to vent about._

Photo by <a href="https://unsplash.com/@anthonytori?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Anthony Tori</a> on <a href="https://unsplash.com/s/photos/thinking?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>
How I got better with CSS
Tags: beginners, css, codenewbie
Published: 2022-04-28 13:07:05

Hey everyone 👋, today I want to share with you one (of many) thing that I did which made CSS clicked for me.

When I started out learning CSS I wanted to put what I had learnt into practice. But I am lousy at designing things so while I wanted to do some layouts and designs with CSS, I was lacking for ideas. Looking back now, maybe I should have picked a website and made a clone of its design and layout 🤷, but I think as a beginner it was a little bit intimidating.

So how did I manage to do it?

One day, I saw a video on YouTube where developers were challenging each other to something called [CSS Battle](https://cssbattle.dev). CSS Battle is a website that has various "Art" which is designed purely using CSS, they provide the colour palette for you and all you have to do is recreate the design with as few characters as possible.

I thought, that looks really fun, I enjoy a good puzzle/challenge so I gave it ago. I wasn't too concerned with getting the highest score or using fewest characters, I just wanted to write some CSS.

I remember, I spent the whole day on that website, trying to recreate different designs (CSS Art?). I think, I learnt so many new things about positioning, pseudo-elements, transform, and other various CSS properties I have never heard before. But, I think what kept me on that website was me trying to get 100% match on the designs (it never happened 😥).

I would recommend anyone someone who is struggling to find a method to make CSS stick, to give [CSS Battle](https://cssbattle.dev) a try. I still the "techniques" I learned from when I solved the CSS Battle in my projects today. 

If you made it this far, thank you for reading, here is a big heart for you, created using one `div` and pseudo-elements.

{% codepen https://codepen.io/Katakung95/pen/wvpVbEN %}

###### Have you tried CSS Battle before? What do you think of it?

If you want to get in touch with me, feel free to reach out to me on [Twitter](https://twitter.com/justtanwa).
docx to pdf with Node.js
Tags: node, docx, pdf, convert
Published: 2022-04-28 13:03:30

Most of the npms didnt works for me but this one do the job:

`npm i convert-multiple-files`


convert.ts:
```
import { convertWordFiles } from 'convert-multiple-files';

const docToPdf = async (filePath: string, outputDir: string): Promise<string> => await convertWordFiles(filePath, 'pdf', outputDir);

export {
    docToPdf
};

```

`const outputFile = await docToPdf('file.docx', './outFolder');`
How to make width of Angular youtube-player responsive
Published: 2022-04-28 13:01:49

---
title: How to make width of Angular youtube-player responsive
published: true
description: Angular youtube-player accepts width only in pixels, so this blog post show how to make it responsive
tags: 
//cover_image: https://direct_url_to_image.jpg
---
If you are working with Angular modal for integration of youtube videos, there is a chance that you got stuck just like me on the making size of embedded youtube player full width of the parent. The problem is that the `youtube-player` component accepts width and heigh only as a number, that is as pixels, which is not good for the responsive design. It is nothing complicated but I will just document it for easier finding in the future.

Let’s start by creating a new component that will have a container for the `youtube-player`:

`ng g component components/yt-player`

In `yt-player.component.html` add container with ref and `youtube-player`

```html
<div #youTubePlayer>
  <youtube-player
    [width]="videoWidth"
    [height]="videoHeight"
    [videoId]="videoID"
  ></youtube-player>
</div>
```

and in `yt-player.component.ts` add this code:

```tsx
export class YtPlayerComponent implements AfterViewInit {
  @ViewChild("youTubePlayer") youTubePlayer: ElementRef<HTMLDivElement>;

  videoHeight: number | undefined;
  videoWidth: number | undefined;

  @Input("videoID") videoID: string;

  constructor(private changeDetectorRef: ChangeDetectorRef) {}

  ngAfterViewInit(): void {
    this.onResize();
    window.addEventListener("resize", this.onResize.bind(this));
  }

  onResize(): void {
    // you can remove this line if you want to have wider video player than 1200px
    this.videoWidth = Math.min(
      this.youTubePlayer.nativeElement.clientWidth,
      1200
    );
    // so you keep the ratio
    this.videoHeight = this.videoWidth * 0.6;
    this.changeDetectorRef.detectChanges();
  }
}
```

The code is basically self-explanatory, you have reference on the container of youtube-player, in `afterViewInit` you set `videoHeight` and `videoWidth`, to correspond to the width of the container. We set up an event listener in the case of size changes to update the width and height. And in the end, we add `@Input('videoID') videoID: string` so we can pass the id to the youtube-player component. So we can use it like this:

`<yt-player videoID="oHg5SJYRHA0"></yt-player>`

Thank for reading and if you have any suggestions, please leave a comment.
No BS Guide to setup Unity for AR
Tags: beginners, ar, unity3d, arcore
Published: 2022-04-28 12:54:20

Have you ever scoured the internet to properly set up your unity environment for ARCore development and found yourself wasting a lot of time just to get it ready because of a lack of centralized resources and/or guides for the same? Trust me, I know the pain.

Ergo, I wrote up a no-bullshit guide to set up Unity for AR. It is a quick and complete guide that can get you ready to bring your creations to life without wasting time hassling with the settings. In just 5 minutes, you will be ready to create your own metaverse, if you will.

{% embed https://medium.com/@thisisKushagra/no-bs-guide-to-set-up-unity-for-ar-ec9ab770f8ae %}
The Pros & Cons of Monorepos
Tags: programming, scm, git, github
Published: 2022-04-28 12:38:18

Should you "go mono"? 

It's a question that lots of companies in the dev community are discussing. 

Developing large-scale codebases with multiple teams, can be a big headache. When a product reaches a certain size, developers often attempt to split it into multiple parts to address separation of concerns. But this 'multi-repo' approach has an impact on the overall developer experience, which is why teams are increasingly interested in a monorepo approach.

Our team wrote wrote a great article exploring the key concepts behind monorepos, including what they are, where they fit, and where they don’t. Check it out [here](https://livecycle.io/blogs/monorepos/).
Another CSS Art from Demon Slayer
Tags: showdev, css, html, webdev
Published: 2022-04-28 12:28:11

The last CSS Art I made was so real that he start talking! He was so nervous and screaming everywhere:

### "Nezuko!! Where is Nezuko?!"

---

Stay calm **Tanjiro**, **Nezuko** is here  👇

{% codepen https://codepen.io/t_afif/pen/abEeMyY %}

Another CSS-Only illustration to be added to the list of my previous ones:

###<center>[CSS Art](http://css-only.art/)</center>

--- 

It's on twitter if you want to spread the word 📣📣

{% twitter 1519636083260424192 %}

---

**Tanjiro** : "Nezuko, let's go!"

**Nezuko** : "Hum!!"

![Nezuko and tanjiro](https://media.giphy.com/media/ggR8oaGvhUbtndQSR4/giphy.gif)

----

### <center>You want to support me?</center>

[![buy me a coffee](https://cdn.buymeacoffee.com/buttons/default-orange.png)](https://www.buymeacoffee.com/afif)

### <center>OR</center>

[![Become a patron](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/db3jtgy2i5l4w8slkps5.png)](https://www.patreon.com/temani)
best Business Blog
Published: 2022-04-28 12:23:32

Brainnb is simply a wonderful industry resource for information that should prove useful to you no matter your level of experience or field! I truly believe it's the best blog worldwide when it comes to crypto Currency and I wholly endorse this blog when it comes to the [business niches so you](https://brainbnb.com/) can be assured of getting your regular dose of helpful insights whether they're related specifically to If you're looking for a blog which is prime in quality specifically related to Gaming, then look no further.
Create a Clock using Python
Tags: python
Published: 2022-04-28 12:21:18

You can create a simple Clock using Python and in this post we use tkinter to create the GUI for our clock. Firstly download the fonts from the link [here](https://www.dafont.com/ds-digital.font) and install it in your system if you want to have the same font like in this post.

Now that you've installed the fonts, copy the following code and save it in your system. Try to run the code and your Clock will be displayed.

```
from tkinter import * 
from tkinter.ttk import *

from time import strftime 

root = Tk()
root.title("Clock")

def time():
    string = strftime("%H:%M:%S %p")
    label.config(text=string)
    label.after(1000, time)

label = Label(root, font=("ds-digital", 50), background="black", foreground="cyan")
label.pack(anchor="center")
time()

mainloop()
```

The clock is shown below:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/731iga46dccwv5929mhy.png)
Cara Mudah Mengekstrak Array Ke Variabel Dengan Javascript
Tags: javascript, beginners, programming
Published: 2022-04-28 11:59:46

Hai teman-teman 👋

Kali ini saya akan membagikan cara mudah untuk melakukan ekstraksi array ke variabel. Biasanya, untuk melakukan ekstraksi array kita membuat variabel dan diisi dengan mengakses indeks arraynya seperti contoh berikut:

```javascript
const arr = [10, 20, 30, 40, 50];

const value1 = arr[0];
const value2 = arr[1];

console.log(value1);
console.log(value2);
```

Contoh di atas sudah benar, akan tetapi dapat lebih ringkas lagi juga tidak perlu mengakses indeks satu-persatu. Berikut kode pemrogramannya:

```javascript
const arr = [10, 20, 30, 40, 50];
const [value1, value2] = arr;

console.log(value1);
console.log(value2);
```

Lebih ringkas bukan? Nilai dalam array akan tersimpan dalam variabel sesuai urutan indeksnya.

Demikian yang dapat saya bagikan, apabila ada yang perlu dikoreksi silahkan share di kolom komentar. 😁
My Frequently Used git Commands
Tags: git, github, productivity, discuss
Published: 2022-04-28 11:43:41

On the mid of 2020, I started learning and using git and it's commands. Till now, I continued least 1 contribution to any of my public repo.

There are some commands that I frequently use.

*  **git clone <repo-url> <directory>**

Helps to clone a particular repository provided the `repo-url` into the specified `<directory`>.

*  **git status**

Helps to view the status of the project or repo including staged, unstaged, and untracked files.

*  **git add <file>**

Helps to add a particular directory or files that have the changes.

*  **git add .**

Helps to add all the files in the currently directory that have the changes.

*  **git commit -m "<message>"**

Helps to commit all staged changes. We can replace `<message>` with good commit messages so that everyone can understands what the change we have done.

*  **git commit --amend**

Helps to amend the commit messages if the commit is done only in the local repository and not been pushed.
We can type this command and press enter which then opens a text editor where we provide the new commit message.

* **git push**

Helps to push the local repository changes to the remote repository.

*  **git pull**

Helps to incorporates changes from a remote repository into the current branch. If the current branch is behind the remote, then by default it will fast-forward the current branch to match the remote. 

*  **git init**

Helps to start a new repository locally.

*  **git remote add <name> <url>**

Helps to add a new remote repository providing the `<url>`.


![Git](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hvju0mwl4pqqtafnjy2j.gif)


These are very very common git commands that are being used by me in a regular basis.
What are the commands you guys are using regularly? Please free feel to share so I can also learn new things from all of you.
Getting Started with the Blazor Carousel Component
Tags: blazor, webdev, dotnet
Published: 2022-04-28 11:25:11

A quick overview on how to create and configure the Syncfusion Blazor Carousel component in a Blazor WebAssembly app using Visual Studio. Using the Blazor Carousel component, you can display a series of images with content and links like a slide show. In this video, you will learn how to add a simple Blazor Carousel to a Blazor WebAssembly app, and how to bind a data source to it. 

Product Overview: https://www.syncfusion.com/blazor-components/blazor-carousel

Explore our tutorial videos: https://www.syncfusion.com/tutorial-videos

Download this example from GitHub: https://github.com/SyncfusionExamples/getting-started-with-blazor-carousel-component

{% youtube v_lVXs-3yRw %}
D3js, CSS styles
Tags: d3js, css, javascript, d3
Published: 2022-04-28 11:21:38

I have to work with a creating of some charts for some statistics.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wv670zty75gelmpd3zyt.png)

The data are comming from a JSON REST API. For one of the requests I have to count the occurencies of new articles for every single day. I have met many problems being for the first time when I work with D3js library ([https://d3js.org/](https://d3js.org/)) which seems to be the best way to build charts in Javascript. And it is a very nice solution for that. But, I've been hit by some issues. For instance, I could't change the color of my texts on the chart. I've been trying to change the style for color but it didn't work. 

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

The problem was solved whe I found out that I souldn't use:
`.style("color", "#87A3C3")`

The right solution for this problem is: 
`.attr("fill", "#87A3C3")`

So, use **attr** instead of **style**!
Every developer should be aware of the following GitHub repositories.
Tags: programming, javascript
Published: 2022-04-28 11:18:54

Free programming books. Programming books that are available for free. The repo is now managed by the Free Ebook Foundation, a non-profit dedicated to encouraging the creation, distribution, preservation, and sustainability of free ebooks.https://github.com/EbookFoundation/free-programming-books

Coding interview university. A complete computer science study plan to become a software engineer. https://github.com/jwasham/coding-interview-university

JavaScript questions.There's a huge list of JavaScript questions and answers here.https://github.com/lydiahallie/javascript-questions

FreeCodeCamp.freeCodeCamp.org is a welcoming environment where you may learn to code for free. It is run by a donor-supported charity with the goal of assisting millions of busy individuals in making the shift to technology. The freeCodeCamp community has assisted over 40,000 people in landing their first developer job.
The full-stack development and machine learning education offered by FreeCodeCamp is fully free and self-paced. Thousands of interactive coding challenges are available to help anyone improve their coding skills. https://github.com/freeCodeCamp/freeCodeCamp

See you soon.