teleren/devto huggingface dataset:
Python Failed building wheel for backports.zoneinfo on Linux
Tags: python, linux, windows, shriekdj
Published: 2022-01-23 09:38:53

### Problem
> Python Failed building wheel for backports.zoneinfo For Operating System Other Than Windows Like Linux Or MacOs.

### Details
> The issue is mostly related to retrieving data from OS About Current Time With IANA And `backports.zoneinfo` is pre-builted for Windows And We Have to Build The Package For Linux Or MacOS With Ruby Compiler Or Any Other Language Specified By Error Also.

### First Solution
> Upgrade the `pip` with `wheel` and Try Again Installing.

```bash
pip install --upgrade pip wheel

pip install backports.zoneinfo
```

### Second Solution
> Try Installing the Alternative Package Named `tzdata`. ( Worked for My `fastapi` project. )
>> The Package Supports Python 3 But It's Readme Is Not Updated About the Python 2 Support By Dev IDK Why 🤔.
```bash
pip install tzdata
```

### Third Solution
> Install `Ruby Compiler` From Your System Package Manager and Run The pip code again.
>> Given Below is for `Ubuntu`.

```bash
sudo apt-get install ruby-full

pip install backports.zoneinfo 
```

Give a reaction if any one solutions helped you in any way.
Bye 👋.
Add Stories to your highlights on Instagram without showing it to stories
Tags: instagram, tips, tricks, sh20raj
Published: 2022-01-23 09:04:41

Steps :-
- Just upload a story to Instagram.
- Delete it and it will be stored till 30 days in Recently Deleted Section.
- Restore it After 24 hours.
- It will came to your Archive.
- Then Add it to your highlights.
oVirt Unlock Virtual Disks, VM and Snapshot
Tags: rhev, ovirt, linux, virtualization
Published: 2022-01-23 08:52:10

Beklenmedik durumlarda **oVirt** üzerinden **vm**‘ler ya da **disk**‘ler ya da **snap**‘ler **lock** duruma düşebilir. Bu durumu **cockpit** üzerinden gözlemleyebilirsiniz fakat çözüm için **HostedEngine** makinesine **SSH** atıp **unlock_entity.sh** **script**ini kullanabilirsiniz.

**Lock** durumdaki **vm**, **disk** ya da **snapshot**‘ları aşağıdaki yöntemle **consol** üzerinden de tespit edebilirsiniz.

```javascript
/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh -q -t vm -c
/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh -q -t disk -c
/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh -q -t snapshot -c
```

Akabinde ilgili vm diskini unlock etmek için,
```javascript
/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh -t vm UUID_OF_VM
```
Ya da tüm diskleri unlock etmek için,
```javascript
/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh -t all
```
Genellikle tercih edilmemeli ama db(postgresql) üzerinden de işlem yapılabilir.
```javascript
su - postgres
scl enable rh-postgresql95 bash
psql
\c engine
select snapshot_id,description,status from snapshots where status = 'LOCKED' and vm_id in (select vm_guid from vm_static where vm_name='');
select image_guid,imagestatus from images where vm_snapshot_id = '' and imagestatus != 1;
update snapshots set status = 'OK' where snapshot_id = '';
updates images set imagestatus = 1 where image_guid = '';
```


<br>
<br>
ref:
Helper Utilities: https://www.ovirt.org/develop/developer-guide/db-issues/helperutilities.html
oVirt: Unlock Virtual Disks: https://angrysysadmins.tech/index.php/2018/10/grassyloki/ovirt-unlock-virtual-disks/
Unlock Virtual Disks list: https://bugzilla.redhat.com/show_bug.cgi?id=1678234
How to solve snapshots state ‘LOCKED’ in on Postgres DB: https://noeschanga.wordpress.com/2018/02/09/how-to-solve-snapshots-state-locked-in-ovirt-4-1/
PostgreSql in oVirt(psql enable Ovirt): https://lists.ovirt.org/pipermail/users/2018-April/088432.html
Python String rstrip()
Tags: python, programming, codenewbie, tutorial
Published: 2022-01-25 16:14:44

---
title: Python String rstrip()
published: true
date: 2022-01-23 08:37:02 UTC
tags: #python #programming #codenewbie #tutorial
canonical_url: https://itsmycode.com/python-string-rstrip/
---

The **Python String rstrip()** method is a built-in function that strips trailing characters based on the arguments passed to the function and returns the copy of a string.

Also read [TypeError: can’t multiply sequence by non-int of type ‘str’](https://itsmycode.com/solved-python-cant-multiply-sequence-by-non-int-of-type-str/)

In this article, we will learn about the **[Python](https://www.w3basic.com/python/) String `rstrip()`** method with the help of examples.

## rstrip() Syntax

The Syntax of **`rstrip()`** method is:

```python 
string.rstrip([chars])
```

## rstrip() Parameters

The **`rstrip()`** method takes one parameter, and it’s optional.

- **chars(optional) –** set of characters representing string that needs to be removed from the right-hand side of the string. 

If the chars argument is not passed, the `rstrip()` function will strip whitespaces at the end of the string. 

## rstrip() Return Value

The **`rstrip()`** method returns a copy of the string by stripping the trailing characters based on the arguments passed.

**Note:**  

- If we do not pass any arguments to `rstrip()` function, by default, all trailing whitespaces are truncated from a string.
- If the string does not have any whitespaces at the end, the string will be returned as-is, matching the original string.
- If the characters passed in the arguments do not match the characters at the end of the string, it will stop removing the trailing characters.

## Example 1: Working of rstrip() 

```python 
# Only trailing whitespaces are removed
text1 = ' Python Programming '
print(text1.rstrip())

# Remove the whitespace and specified character at
# trailing end
text2 = ' code its my code '
print(text2.rstrip(' code'))

# Remove the specified character at 
# trailing end
text3 = 'code its my code'
print(text3.rstrip('code'))
```

**Output**

```python 
   Python Programming
       code its my
code its my
```

## Example 2 – How to use rstrip() method in real world? 

In the below example, we have a list of the price in dollars. However the dollar sign is appended at both the trailing and leading end of each element. We can simply iterate the list and remove the dollar symbol at the right hand side using the `rstrip()` method as shown below.

```python 
price = ['$100$', '$200$', '$300$', '$400$', '$500$']
new_price = []
for l in price:
    new_price.append(l.rstrip('$'))

print(new_price)

```

**Output**

```python 
['$100', '$200', '$300', '$400', '$500']
```
Today's Fun Joke For Developers - Daily Developer Jokes
Tags: jokes, dailydeveloperjokes
Published: 2022-01-23 08:00:20

---
title: "Today's Fun Joke For Developers - Daily Developer Jokes"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258fbc6e41.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ You know what the best thing about booleans is?

___A:___ Even if you are wrong, you are only off by a bit.
 -->
My First Week As a front_end  beginner
Published: 2022-01-23 08:35:29


My First Week as a beginner was excited because  I was interested in that I started with Html.
There is no big challenge for that   I started to get a challenge when I  started to learn CSS.
  CSS is Where front_end  started it gives you to know what you can do 
I start with styling
Responsive
Work with team

So experience is like stairs you move on one by one  when you you want to on up stair better way to start on the first move on if you don't it   became difficult to reach to the up stair.
Python String lstrip()
Tags: python, programming, codenewbie, tutorial
Published: 2022-01-25 16:13:35

---
title: Python String lstrip()
published: true
date: 2022-01-23 08:33:33 UTC
tags: #python #programming #codenewbie #tutorial
canonical_url: https://itsmycode.com/python-string-lstrip/
---

The **Python String lstrip()** method is a built-in function that strips leading characters based on the arguments passed to the function and returns the copy of a string.

Also read How to Fix [TypeError: list indices must be integers or slices, not str](https://itsmycode.com/typeerror-list-indices-must-be-integers-or-slices-not-str/)

In this article, we will learn about the **Python String `lstrip()`** method with the help of examples.

## lstrip() Syntax

The Syntax of **`lstrip()`** method is:

```Python 
string.lstrip([chars])
```

## lstrip() Parameters

The **`lstrip()`** method takes one parameter, and it’s optional.

- **chars(optional) –** set of characters representing string that needs to be removed from the left-hand side of the string. 

If the chars argument is not passed, the `lstrip()` function will strip whitespaces at the start of the string. 

## lstrip() Return Value

The **`lstrip()`** method returns a copy of the string by stripping the leading characters based on the arguments passed.

**Note:**  

- If we do not pass any arguments to `lstrip()` function, by default, all leading whitespaces are truncated from a string.
- If the string does not have any whitespaces at the beginning, the string will be returned as-is, matching the original string.
- If the characters passed in the arguments do not match the characters at the beginning of the string, it will stop removing the leading characters.

## Example 1: Working of lstrip()

```Python 
# Only leading whitespaces are removed
text1 = ' Python Programming '
print(text1.lstrip())

# Remove the whitespace and specified character at
# leading end
text2 = ' code its my code '
print(text2.lstrip(' code'))

# Remove the specified character at 
# leading end
text3 = 'code its my code'
print(text3.lstrip('code'))

Python Programming   
its my code        
 its my code
```

## Example 2 – How to use lstrip() method in real world? 

In the below example, we have a list of the price in dollars. However the dollar sign is appended at both the trailing and leading end of each element. We can simply iterate the list and remove the dollar symbol at the left hand side using the `lstrip()` method as shown below.

```Python 
price = ['$100$', '$200$', '$300$', '$400$', '$500$']
new_price = []
for l in price:
    new_price.append(l.lstrip('$'))

print(new_price)

```

**Output**

```Python 
['100$', '200$', '300$', '400$', '500$']
```
Generate Random String Using JavaScript
Tags: javascript, sh20raj, tip, youmustknow
Published: 2022-01-23 08:29:17

## Generate Random String

Video Documentation :- https://youtu.be/6QTVmiVwydc

### Use this function

```javascript
function getrandomString(length) {
    var result           = '';
    var characters       = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    var charactersLength = characters.length;
    for ( var i = 0; i < length; i++ ) {
      result += characters.charAt(Math.floor(Math.random() * 
 charactersLength));
   }
   return result;
}

console.log(getrandomString(5));//getrandomString function will return a string of length passed in it (5 here)

```

### Minified Version

```javascript
function getrandomString(r){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=n.length,o=0;o<r;o++)t+=n.charAt(Math.floor(Math.random()*a));return t}
```

---

### Or Use This One Liner

if you will ever need a temporary unique id for something. this
one-liner will generate a random string for you

```javascript
const randomString = Math.random().toString(36).slice(2);
console.log(randomString); //output- bg4v1vwslw4 (the string will be a random string )
```
See Demo Website :- https://tutorials.sh20raj.repl.co/js/generate-random-string-using-javascript/

[Fetch GitHub Markdown and Show on Blog Post or Website ft. showdownjs](/sh20raj/fetch-github-markdown-and-show-on-blog-post-or-website-ft-showdownjs-4dm3)
Dorm Room Doorbell
Tags: python, ios, sideprojects
Published: 2022-01-23 08:28:07

##Overview
Currently working on a camera for my dorm room that can detect if a person is at the door and alert me via an iOS app. The doorbell will run on an Raspberry Pi and the image detection will be done on OpenCV and the app will be built in Python. **The goal of this project is to create something comparable to Amazon's Ring Device**

##Current Progress
Installed and implemented OpenCV, achieved facial recognition via CascadeClassifier within OpenCV, achieved facial recognition with bounding boxes.

I was completely unaware that OpenCV comes out of the box with image classification tools, I was always under the assumption that additional libraries had to be installed. Hoping to get the recognition to be less touchy, perhaps slowing the frame rate of the video capture down so that events such as taking a picture or sending an alert via webhooks does not happen multiple times per instance that someone is at your door.

##What's Next:
Get OpenCV to take an image and save it locally when it detects a person in the frame longer that a couple seconds. As well as have the computer chime when a picture is taken or something to alert someone at the door their picture has been taken.
#24 - Create Phone Number CodeWars Kata (6 kyu)
Tags: javascript, webdev, tutorial, 100daysofcode
Published: 2022-01-23 08:27:36

##Instructions

Write a function that accepts an array of 10 integers (between 0 and 9), that returns a string of those numbers in the form of a phone number.

**Example**

> [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] 
> "(123) 456-7890"

The returned format must be correct in order to complete this challenge.
Don't forget the space after the closing parentheses!

---

##My solution:

```javascript
return '(' + n[0] + n[1] + n[2] +')' + ' ' + n[3] + n[4] + n[5] + '-' + n[6] + n[7] + n[8] + n[9]
```
---

##Explanation
I just used the index of every number, and joined it with the elements that I need to add for getting the correct string


---

**What do you think about this solution? 👇🤔**

[My Github](https://github.com/Cesardlr)
[My twitter](https://twitter.com/cesar__dlr)
[Solve this Kata](https://www.codewars.com/kata/525f50e3b73515a6db000b83)
Python String isdecimal()
Tags: python, programming, codenewbie, tutorial
Published: 2022-01-25 16:06:10

---
title: Python String isdecimal()
published: true
date: 2022-01-23 07:22:21 UTC
tags: #python #programming #codenewbie #tutorial
canonical_url: https://itsmycode.com/python-string-isdecimal/
---

The **Python String isdecimal()** method is a built-in function that returns true if all the characters in a string are decimal. If one of the characters is not decimal in the string, it returns false.

Also read [How to rename columns in Pandas DataFrame](https://itsmycode.com/how-to-rename-columns-in-pandas-dataframe/)

In this article, we will learn about the **Python String `isdecimal()`** method with the help of examples.

## isdecimal() Syntax

The Syntax of **`isdecimal()`** method is:

```Python 
string.isdecimal()
```

## isdecimal() Parameters

The **`isdecimal()`** method does not take any parameters.

## isdecimal() Return Value

The **`isdecimal()`** method returns

- `True` if all the characters in a string are valid decimal characters.
- `False` if one or more characters in a string are not decimal characters.

## Example 1: Working of isdecimal()

```Python 

# Python3 program to demonstrate the use
# of isdecimal() 
  
s = "12345"
print(s.isdecimal())
  
# contains alphabets
s = "123Hello123"
print(s.isdecimal())
  
# contains numbers and spaces
s = "12345 6789"
print(s.isdecimal())
```

**Output**

```Python 
True
False
False
```

## Example 2: String Containing digits and Numeric Characters

The superscript and subscript are considered as digit characters and not decimals. If the string contains subscript or superscript the isdecimal() method will returns False.

Similarly, the roman numbers, currencies and fractions are considered as numeric numbers and not decimals. The isdecimal() will return False if it finds these characters.

It is recommended to use [**isdigit() method**](https://itsmycode.com/python-string-isdigit/) and **isnumeric() method** to check if the characters are valid digits and numeric characters respectively.

```Python 

# Python3 program to demonstrate the use
# of isdecimal() 

# vaid decimal  
s = '12345'
print(s.isdecimal())

# in case of digit
#s = '²123'
s = '\u00B2123'
print(s.isdecimal())

# incase of numeric
# s = '½'
s = '\u00BD'
print(s.isdecimal())
```

**Output**

```Python 
True
False
False
```
MAKE YOUR FIRST APP IN FLUTTER
Tags: beginners, flutter, firstpost, dart
Published: 2022-01-23 08:14:43



## INTRODUCTION

it is open source UI developing kit  ,that developed by google in 2015 but it was released in 2017.Main feature of the flutter is used in cross platform application developing.

## DART
The one and only programming language that  used in flutter is dart.The main feature of the dart language is it is an platform  Independent programming language .object oriented ,Mainly it it is a opensource  programming language and it easy to learn

## Let Started....

Firstly we install the flutter  from given (https://docs.flutter.dev/get-started/install)

### Create Project

_flutter create_ command used to create the flutter project

syntax:
     


```
flutter create flutters
cd flutters
code .

```
(here we are use vs code to create our project)

### Lets Start Our Code
In flutter  mainly we are importing to libraries one is _cupertino.dart_ and _material.dart_. the first one is for Ios app and second one is Android app.

```
package:flutter/material.dart
package:flutter/cupertino.dart'
```
Here we use material.dart.which include may widgets  materialapp , statefull and stateless etc..

The sample Code given below:

```
package:flutter/material.dart
void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter',
      home: Scaffold(
        appBar: AppBar(
          title:  Text(' Our Project'),
        ),
        body:  Center(
          child: Text('HELLO'),
        ),
      ),
    );
  }

}
```
void main() -it is the main method \ function of our project.

Scaffold -It is  from the Material library, It provides  app bar, and a body which contain homescreen.

title - which give title of our app.
center - which is widget which give the text in the center of the screen.
Adding Google Authentication Feature.
Tags: javascript, webdev, programming, beginners
Published: 2022-01-23 08:13:11

Hey everyone! In this article, we will be adding a new feature **Google AUTH** to our login Form.
Let's start with basics install a react app using the below commands in the terminal.

```JavaScript
npx create-react-app google_auth
cd google_auth
npm start
```
Now, let's quickly install a very popular package  _react-google-login_  to display a “Log in with Google” button which will help us in retrieving information about the user and will also handle displaying a google login prompt.

```JavaScript
npm install react-google-login
```
Now after that write these lines of code in the App.js file i have added the explanation to each line

```JavaScript
import React from 'react'
import GoogleLogin from 'react-google-login';  // importing library
const App = () => {

  // Function for displaying response in console
  const displayResponse = (res) => {
     console.log(res);
     console.log(res.profileObj);

  };

  return (
    <div>
      {/* It takes some props as clientId , ButtonText
      onSuccess , onFailure, cookiePolicy= {single_host_origin} */}
      <GoogleLogin
         clientId=""
         buttonText="Login with Google"
         onSuccess={displayResponse}
         onFailure={displayResponse}
         cookiePolicy="single_host_origin"
      />
    </div>
  )
}

export default App;
```

Now, as you can see the clientId is yet not there, so for that go to "Google API console" and in there add a new project, just add your project name and done.
Now switch to the project which you just added. Go to credentials.
After that go to **configure consent screen** and after that click on **"External"** after that click on create.
Now it will ask you to fill in some more details like application name(not the same as your project's name). You have to also enter the support email id and after that just keep on clicking save and next.
Now, go back to the credentials tab again and click on create credentials. Here click on **Create OAuth client ID** and in there add application type to be Web application and add URI to where you want to use your google login.
Yuhuu!!! we generated our keys.
Now, simply copy and paste the code in the code editor where clientID ="Our Above steps result".

Now, just run your react app and click on the login button you will see something like this 

![Working](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k4az8nbfnzqkarmb90c2.jpg)
and after you log in with any of the accounts it will display it in the console.


![Working](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ibcr11i0z459qus869z3.png)

I have attached the GitHub code for the same.
[Github](https://github.com/kirtisingh3008/web-dev/tree/main/google_auth)
Thank You!!!🙂🙂
EC2 instance
Published: 2022-01-23 08:02:26

An Amazon EC2 instance is a virtual server in Amazon's Elastic Compute Cloud (EC2) for running applications on the Amazon Web Services (AWS) infrastructure.

Amazon provides various types of instances with different configurations of CPU, memory, storage and networking resources to suit user needs. Each type is available in various sizes to address specific workload requirements.

Many EC2 instance features are customizable, including the storage, number of virtual processors and memory available to the instance, OS and the AMI on which the instance is based. user can able to customise intances as per their requirement.
Financing your open source project
Tags: blockchain, web3, opensource
Published: 2022-01-23 08:00:48

Funding doesn’t mean your open source project is no longer pure. Financing means you want to take your project further.

The best form of financing for an open source project is a DAO. But ICO makes people feel that it is purely for making money. Therefore, most DAO tools are not suitable.

Here is a DAO tool built for developers: [VORG](https://vorg.io).

[VORG](https://vorg.io) is a decentralized DAO registry based on Ethereum.

You can create your unique DAO on [VORG](https://vorg.io) and get an associated unique domain name. At the same time, you can raise funds as needed by increasing capital and expanding shares on [VORG](https://vorg.io).

The trading of shares can be completed on [VORG](https://vorg.io), and the currency medium of the transaction is _Ether_.

You can refer to [VORG: Decentralized company and domain name registry](https://dev.to/vorg/vorg-decentralized-company-and-domain-name-registry-599a) to learn how to build a DAO, increase capital and shares, trade, and configure domain names.