teleren/devto huggingface dataset:
GUI Youtube video downloader using python, tkinter and pytube.
Tags: python, youtube, programming, beginners
Published: 2022-04-26 11:25:07

here is the source code for GUI youtube video downloader with python
``` py
# GUI youtube video downloader using python, pytube, tkinter
from email import message
from tkinter import *
from tkinter import messagebox
from tkinter import ttk
from turtle import width
import pytube


# Creating window
window=Tk()
window.title("Youtube Video Downloader")
window.geometry("400x200")
window.resizable(0, 0)


labelframe=ttk.Frame(window)
label=ttk.Label(labelframe, text="Youtube Video Downloader", font=('Arial', 20))
label.grid(row=0, column=0)
labelframe.grid(row=0, column=0, padx=25, pady=10)

centerframe=ttk.Frame(window)
urllabel=ttk.Label(centerframe, text="Enter Video Url: ")
text_box=ttk.Entry(centerframe, width=40)
download_button=ttk.Button(centerframe, text="Download Video")

urllabel.grid(row=0, column=0)
text_box.grid(row=0, column=1)
download_button.grid(row=1, column=1, pady=15)
centerframe.grid(row=1, column=0, pady=15)

def download_video():
    try:
        url=text_box.get()
        yt=pytube.YouTube(url)
        video=yt.streams.filter(only_video=True).first()
        video.download()
        messagebox.showinfo("Download Success", "Video Downloaded Successfully")
    except:
        messagebox.showerror("Error", "Please Enter Valid Url")

download_button.config(command=download_video)

window.mainloop()
```
Final Output:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ey5zdqbzzppi0rjpsrf1.png)
Did uploading a 6MB file bring down my Ghost site on Digital Ocean?
Tags: digitalocean, ghost, 504
Published: 2022-04-26 11:07:13

Woke up to a 504 error this morning. It's hosted on Digital Ocean, so I reached out to support. While their response was prompt, the answer wasn't exactly helpful -

> As a self-managed infrastructure as a service (IaaS) provider, we do not have access to your servers so I cannot see your environment. The answer will depend on your webserver and/or database configuration. 

They then includes a bunch of not-very-helpful-generic-504-articles from the internets.

## So what went wrong with my Ghost site overnight?

I hadn't changed anything on my website, so I knew it probably had nothing to do with webserver/database configurations. A lot of the articles pointed me to the console, but I couldn't even access the console through digital ocean dashboard though. It threw an error of - "Timed out while waiting for handshake".

I then ran into [this post](https://gloathost.com/blog/how-to-restart-your-ghost-site-on-digital-ocean) (How to restart your Ghost site on Digital Ocean) from [Dan Rowden](https://twitter.com/dr). That gave me a hint that I should look into forcefully restarting my Ghost site. Another quick google search, and I ran into this post - [2 Ways To Reboot a Droplet on DigitalOcean](https://nuweb.blog/reboot-a-droplet-on-digitalocean/).

## Restarting a Droplet on Digital Ocean

To summarize - There are two ways to reboot a Droplet on DigitalOcean, these are:

1. **Gracefully**: Similar to that of restarting your machine through the Restart or Shut Down commands.
2. **Forcefully**: Similar to holding down the power button on your machine and then powering it back on again.

The graceful way wasn't working out in this case, since I couldn't even access the console. So, I went the forceful way.

1. Visit the Power tab in the Droplet.
2. Click the Power Cycle button in the Power Cycle section
3. Wait for confirmation message and wait a few minutes for the Droplet to reboot.

**That fixed it.** I could access the console, and the website came right back up.

![Restarting Digital Ocean Droplet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q19quxl7t4jwvwzm0l35.png)
 

## So why did this happen?
During my troubleshooting, I came across [this post](https://www.digitalocean.com/community/questions/504-gateway-timeout-memory-error) on Digital Ocean community, pointing to memory issues being one of the causes for a 504 errors.

This reminded me that I was trying to upload a large size image (>6MB) to my Ghost site yesterday. That was taking forever to load, and timed out each time I tried it. I now wonder if that process consumed most of the RAM, and the server essentially ran out of memory. Rebooting the server must have reset the memory. That makes sense to me. I will go with that argument, and vow never to upload a 6MB PNG to my Ghost site!
Where can I find a transcription service?
Published: 2022-04-26 10:50:29

It is possible to seek referrals and conduct a business search and contact those who have high market visibility, good track performance, and services. The transcription services can be in the following languages:

1. Portuguese transcription services

2. Spanish audio transcription

3. Chinese video transcription

4. German audio to text converter online

5. Russian transcription

6. Greek transcription services

7. Hindi transcription online

8. Farsi transcription

9. [Dutch transcription](https://scriptscomplete.com/Dutch-Transcription-Services.php
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/57yx3sutc8jjbz637qvs.jpg))
Report test results to slack or microsoft teams
Tags: slack, teams, test, results
Published: 2022-04-26 10:27:36

Sharing the test results to the right places at the right time is very important when you are working in a high velocity organisations.

And also having the right platform where teams can discuss transparently on the test failures is also equally important.

These test results come in different forms like **JUnit**, **TestNG**, **xUnit** and many more from testing tools like **Selenium**, **Cypress** or **RestAssured**. Similarly organisations use different communication platforms like **Slack**, **Microsoft Teams**., etc for sending different kinds of alerts.

## Test Results Reporter

[Test Results Reporter](https://test-results-reporter.github.io) is a command line tool that solves this problem elegantly. It allows us to publish test results to different entities. Even it allows us to customise the report to include hyperlinks, reportportal analysis, mentioning users based on a on-call schedule and more.

{% github test-results-reporter/reporter %}

## Sample Reports

### Slack

![slack](https://github.com/test-results-reporter/test-results-reporter.github.io/blob/main/docs/assets/images/slack/slack-hyperlinks.png?raw=true)

### Teams

![teams](https://github.com/test-results-reporter/test-results-reporter.github.io/blob/main/docs/assets/images/teams/teams-report-portal-analysis.png?raw=true)
100 Days of Code: The Complete Python Pro Bootcamp for 2022 - Day 10 (Calculator)
Published: 2022-04-26 10:11:23

#Exercise 10.1 - Days in month
Instructions
In the starting code, you'll find the solution from the Leap Year challenge. First, convert this function is_leap() so that instead of printing "Leap year." or "Not leap year." it should return True if it is a leap year and return False if it is not a leap year.

You are then going to create a function called days_in_month() which will take a year and a month as inputs, e.g.

days_in_month(year=2022, month=2)
And it will use this information to work out the number of days in the month, then return that as the output, e.g.: 28

The List month_days contains the number of days in a month from January to December for a non-leap year. A leap year has 29 days in February.

```python
def is_leap(year):
  if year % 4 == 0:
    if year % 100 == 0:
      if year % 400 == 0:
        return True
      else:
        return False
    else:
      return True
  else:
    return False

def days_in_month(year, month):
  month_days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
  if month >12 or month <1:
      return "Invalid month"
  if is_leap(year) and month ==2:
      return 29
  return month_days[month -1]
  
  
#🚨 Do NOT change any of the code below 
year = int(input("Enter a year: "))
month = int(input("Enter a month: "))
days = days_in_month(year, month)
print(days)
```
#Project 10 - Calculator
````python
from replit import clear
from art import logo
print(logo)

#Calculator
def add(n1, n2):
  return n1 + n2
  
def subtract(n1, n2):
  return n1 - n2
  
def multiply(n1, n2):
  return n1 * n2
  
def divide(n1, n2):
  return n1 / n2

operations = {
  "+": add,
  "-": subtract,
  "*": multiply,
  "/": divide,
}

def calculator():
  num1 = float(input("Whats the first number?: "))
  for symbol in operations:
    print(symbol)
  
  should_continue = True
  
  while should_continue:
    operation_symbol = input("Pick an operation: ")
    num2 = float(input("Whats the next number?: "))
    calculation_function = operations[operation_symbol]
    answer = calculation_function(num1, num2)
    
    print(f"{num1} {operation_symbol} {num2} = {answer}")
  
    if input(f"Type 'y' to continue calculating with {answer}: type 'n' to start a new calculation: ") == "y":
      num1 = answer
    else:
      should_continue = False
      clear
      calculator()

calculator()
```
15 Exciting PHP Project Ideas & Topics For Beginners [2022]
Published: 2022-04-26 10:09:42

## The best way to learn a top programming languages is through projects. 

They allow you to try out your knowledge of the subject while challenging your creativity. So, if you are a PHP beginner, the best thing you can do is work on some real-time PHP projects.

We,  believe in a practical approach as theoretical knowledge alone won’t be of help in a real-time work environment. In this article, we will be exploring some interesting PHP projects which beginners can work on to put their PHP knowledge to test. In this article, you will find 15 top PHP project ideas for beginners to get hands-on experience in PHP.
But first, let’s address the more pertinent question that must be lurking in your mind: why to build PHP projects?

https://medium.com/@carleii_dev/15-exciting-php-project-ideas-topics-for-beginners-2022-82097c81f978
Install SQL Server command-line tools
Tags: sql, ubuntu, sqlserver, installation
Published: 2022-04-26 09:46:02

After successful installation of SQL Server in ubuntu, we need a way to access it trough the terminal. This post illustrates steps you can take to make this possible
## Prerequisites:
- Account with sudo privileges
- Successful installation of SQL Server in Ubuntu

## Procedure:
**Step 1: Open terminal**
Use the shortcut Ctrl + alt + t to open the terminal
**Step 2: Update and install curl (Optional)**
```
sudo apt update && sudo apt install curl
```
![update](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wkmad4uxwzq3zode6445.png)
**Step 3: Import the public repository GPG keys**
```
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
```
![import](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2i7abro6hgkoeh2k81kr.png)
**Step 4: Register the Microsoft Ubuntu repository**
```
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
```
![register](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p6ld1bnmqwri0efm7r5s.png)
 
**Step 5: Update the sources list and install mssql-tools and odbc drivers**
```
sudo apt update 
sudo apt install mssql-tools unixodbc-dev
```
![installdrivers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iztccohv59mouext3a0x.png)
**Step 6: Add mssql-tools to your PATH environment variable**
```
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
```
![addtopath](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uweyu2hrxuj1rkj1nayn.png)
**Step 7: Connect local**
Replace _'YourPassword'_ with the password you set during installation
```
sqlcmd -S localhost -U SA -P '<YourPassword>'
```
**_Congratulations you can now access mssql server in ubuntu_**
How Do Detectable Warning Panels Work?
Tags: detectablewarningpanels, detectablewarningsurface, adadetectablewarning, adaapproveddetectablewarning
Published: 2022-04-26 10:03:13

Warning tiles are slightly heavier than normal tiles, making them easy to spot. They are bigger than other tiles, so if you step on a waning tile, you will notice the difference immediately.
Since they are made of slip-resistant material, it is safe to stand on these tiles. You will not get injured because of slipping and falling when you stand on a warning tile. [Detectable warning panels](https://dwpnow.com/) help guide visually impaired people easily. These panels help the visually impaired walk or run around the place without colliding with another human being. They make footpaths colorful, though this is not their sole purpose.
Acoustic Plywood Wall and Ceiling Panels - Key Ply - Keystone Linings
Tags: keyply, keystonelinin
Published: 2022-04-26 09:54:33

Plywood Wall and Ceiling Panels from Keystone Linings, [Key Ply](https://keystonelinings.com.au/acoustic-plywood-panels-key-ply
), create excellent acoustic atmospheres with an elegant timber batten finish. NCC2016/19 Gp 1 Fire Rated

https://keystonelinings.com.au/acoustic-plywood-panels-key-ply
How to Rename Files in Linux and MacOS Terminal
Tags: linux, webdev, tutorial, bash
Published: 2022-04-26 09:49:31

Renaming files is something that occurs frequently, and in Linux on terminal, there are many ways to rename files. Let's look at some of the main ways you can rename your files on Linux and other Unix based systems like MacOS.

### Linux Commands
If you're brand new to Linux commands, [read my full guide on Linux commands them here.](https://fjolt.com/series/linux-commands)

## Renaming files with the mv Command
The `mv` command moves a file to another place. It can also be used to move a file to the same location, and simply change it's name. For example, if you wanted to rename a file called `file-1.txt` to `file-2.txt`, you would first [cd](https://fjolt.com/article/linux-cd-command) into that directory, and run the following:
```shell
mv file-1.txt file-2.txt
```

This technically "moves" the file, but in reality the end result is that the file is renamed and in the same location.

## Renaming multiple files
If you want to rename more than one file at once, we can't just use the `mv` command. For that, we need to loop through each file we want to rename. We can use this in conjunction with the `find` command to find all the files that fit our criteria easily. For example, the below will find all .txt, .csv and .html files, and turn them into .js files:
```
for f in $(find . -name '*.txt' -or -name '*.csv' -or -name '*.html'); do 
    mv $f ${f%.*}.js
done
```

Let's look at how this works in a little more detail:
- We run a `for` loop, `for f in $()`. This will find all files, where it matches what is inside `$()`. In this example, it finds anything with the file type **.txt**, **.csv**, or **.html**. [You can learn more about find here](https://fjolt.com/article/linux-find-command).
- For each of the matching files, we run the `mv` command. We run `mv $f ${f%.*}.js`.
- `$f` is the current matching file we are looping through. 
- `${f%.*}.html` is saying rename any file with any extenstion (`{f%.*}` could be `{f%.html}`, `{f%.csv}`, etc), and change its name to the file name with our new extension, `.js`.

After that, you'll have successfully moved all files.
Install SQL Server in Ubuntu
Tags: ubuntu, sql, installation, sqlserver
Published: 2022-04-26 09:42:35

Microsoft SQL Server is one of the most prominent databases in the industry today. In this post, I will show you how to install it on Ubuntu.
## Prerequisites
- Account with sudo privileges

## Procedure:

**Step 1: Open terminal**
Use the shortcut Ctrl + alt + t to open the terminal

**Step 2: Import the public repository GPG keys**
```
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
```
![import](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x4xp0h1s3sd90qhk7012.png)
**Step 3: Register the Microsoft SQL Server Ubuntu repository for SQL Server 2019**
```
sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list)"
```
![download](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qd3r0efv950esyb2oun8.png)
**Step 4: Install SQL Server**
```
sudo apt update && sudo apt install -y mssql-server
```
![install](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ua118vhksl0qew69z5o1.png)
**Step 5: Follow the prompts to choose your edition, accept license terms and set the SA password.**
```
sudo /opt/mssql/bin/mssql-conf setup
```
![setup](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7zl3xtywe25mk02xgu2g.png)
**Step 6: Verify that the service is running**
```
systemctl status mssql-server --no-pager
```
![status](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72oab51ku3jh907ih8or.png)

## Next Step:
[Install SQL Server command-line tools](https://dev.to/seffu/install-sql-server-command-line-tools-2ffp)
SwiftUI — Complex navigation made easier with UIPilot
Tags: swift, navigation, ios, programming
Published: 2022-04-26 09:38:30


Recently, I’ve been engaged on an iOS app that makes use of [SwiftUI](https://blog.canopas.com/swiftlint-integration-in-xcode-and-gitlab-ci-1ae9ef6e5d85), which is a tremendous factor that’s occurred to iOS growth in latest instances. 

Having already labored on declarative frameworks on android (Jetpack compose), flutter and net (Vue.js, React), I used to be very completely satisfied to see an analogous framework on iOS rather than conventional crucial UIKit.

In this post, we will implement very complex navigation using UIPilot as shown below and then we will give a thought about the complexity of that doing using NavigationView and NavigationLink

Check out SwiftUI navigation library [github.com/canopas/UIPilot](https://github.com/canopas/UIPilot) for easy navigation.

To learn more, read the [Complex navigation made easier with UIPilot](https://blog.canopas.com/swiftui-complex-navigation-made-easier-with-uipilot-5b33279f3476)
React Design Pattern: Compound Components
Tags: codesandbox, react, designpattern, french
Published: 2022-04-26 09:38:13

Ce design pattern est assez simple à mettre en place: on a un component parent qui a des components enfants et ils sont reliés par un context.

Ce qu'on voit généralement en production, c'est un component parent avec des enfants à qui on passe des props.
Ici, l'approche est différente, c'est un component qui est découpé en plusieurs options: 

<code>
<PreviewModal>
  <PreviewModal.Player />
  <PreviewModal.Info />
  <PreviewModal.Episode />
</PreviewModal>
</code>

Dans notre exemple, on a notre component PreviewModal qui mets à disposition plusieurs options : le player, les infos, les épisodes.
Mais ces options font partie uniquement de la previewModal, parce que ils sont fortement liée par un context.

Inplémentation:

Step 1: Création du context
<code>
const ModalContext = React.createContext(defaultContext);
</code>

Pour l'exemple, j'ai mis en place la forme la plus basique du context, pas de provider value.

Step 2: Création du component parent

<code>
const PreviewModal = ({ children }) => {
  return (
    <>
      <p>Preview Modal like Netflix</p>
      {children}
    </>
  );
};
</code>

Step 3: Connexion des enfants avec le parent

<code>
const { episodes } = useContext(ModalContext);
</code>

Bonus:

<code>
PreviewModal.Player = Player;
PreviewModal.Info = Info;
PreviewModal.Episode = Episode;
</code>

La petite astuce, PreviewModal est un objet js donc on peut lui faire stocker les components.
Je trouve qu'écrire le code de cette manière ça permet de mieux comprendre que la component parents à des "options"


{% codesandbox bx124e %}
Terminal komandalar| Part 3
Published: 2022-04-26 09:12:59

`alias`
alias buyrug`idan biror bir uzun komandaga qiaqacha taxallus berishda foydalanamiz. masalan:
**alias** taxallus="*bir yoki bir nechta buyruq*"
 bu buyruq qaysidir komandaga *taxallus* nomini beradi. va biz bundan faqat bitta sessionda qayta qayta foydalanishimiz mumkin.

`&&`
bir nechta komandani bir vaqtda bajarish uchun komandalar orasiga && belgisini qo'yish kerak.
Setup Seers Cookie Compliance CMP on BigCommerce
Tags: webdev, javascript, discuss, php
Published: 2022-04-26 09:09:11

To integrate Seers CMP properly on your website and manually markup cookie-setting scripts, follow the process below:

**Step 1:**
Login/Signup to [Seers](https://seersco.com/) & Go to [Seers Dashboard](https://seersco.com/business/dashboard)

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

**Step 2:**
Click on [Cookie Consent](https://seersco.com/cookie-consent-banner.html) and Add Domain for Scanning necessary and unnecessary cookies. It might take several minutes to scan your website.


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

**Step 3:**
After scanning, Click on Settings icon and Select:
1. One Standard: One Click Setup for Manual Integration
2. Customized: Advanced Settings


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

Select Manual Integration and Copy the Banner Script:
(Note: Script has a Unique ID) 

`<script data-key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" data-name="CookieXray" src="https://cdn.seersco.com/banners/22768/17303/cb.js" type="text/javascript"></script>
`

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


**Step 4:**
Go to homepage of your BigCommerce website and login.

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

**Step 5:**
Click "Storefront" button in ribbon appearing on left side of website.

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

**Step 6:**
Click on "Script Manager" in sub menu of Storefront.

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

Click on "Create a Script" button.

Next window "Create Script" will open
1. Write "Name of Script" in field below as Seers Cookie Consent Banner and Policy.
2. Write "Description" in field below as GDPR and ePrivacy Compliance with Cookie Policy.
3. Select "Location on Page" where you want Banner to appear in either "Head" or "Footer".
4. Select "Select pages where script will be added" from available options.

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

Scroll down for next step
1. Select "Script type" from options "Script".
2. Paste your script which you will get from seersco in this window.

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

Click "Save" button.

**Step 7:**
[Seers GDPR Cookie Consent](https://seersco.com/cookie-consent-banner.html) will successfully be integrated on site.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1gmq2oarkyd1ph89wx6y.png)
The Big Tech Coding Interview Framework
Tags: programming, computerscience, help, career
Published: 2022-04-26 09:06:24

This is the framework that I used when I was studying for programming interviews. I eventually got offers at Facebook and Google. It was helpful for me to quantify how well I was doing every time I approached a problem. 

If anyone has any thoughts or additions please let me know!

[Google Doc](https://docs.google.com/spreadsheets/d/1gy9cmPwNhZvola7kqnfY3DElk7PYrz2ARpaCODTp8Go/edit?usp=sharing)