teleren/devto huggingface dataset:
How to Install Bitwarden on Ubuntu 20.04
Tags: bitwarden, ubuntu, linux, opensource
Published: 2021-02-09 14:59:01

Bitwarden is open source password manager. It stores sensitive information such as website credentials in an encrypted vault. The Bitwarden platform offers a variety of client applications including a web interface, desktop applications, browser extensions, mobile apps, and a CLI.

This article will guide you to install self-hosted Bitwarden on Ubuntu 20.04 server.

<strong>Prerequisites</strong>
A <a href="https://www.hostnextra.com/vps-hosting.html">Ubuntu 20.04 install KVM VPS</a>.

A root user access or normal user with administrative privileges.

Bitwarden needs a Hosting Installation Id and Key to install. Please Request your Hosting Installation ID and Key.

Let’s get started with the installation process.

Learn more: <a href="https://www.hostnextra.com/kb/install-bitwarden-on-ubuntu-20-04/">Install Bitwarden on Ubuntu 20.04</a>
Day 47 Of 100DaysOfCode: More About Algorithm(Heap Sort)
Tags: womenintech, codenewbie, 100daysofcode, womenwhocode
Published: 2021-02-09 14:55:42

Today is my 47th day of #100DaysOfCode and #python. Also continue to learned more about algorithm. Time and space complexity of heap sort. To understand about this sorting algorithm I took help of [link](https://www.geeksforgeeks.org/heap-sort/).

#Python Code
Heap is a specialize tree- based data structure. For a given node C, if P is a parent node of C then the value of P is greater than or equal to the value of C. The node at the top of the heap is called the root node.
```python
def heapify(A, n, i):
    largest = i
    l = 2 * i + 1
    r = 2* i + 2
    if l < n and A[i] < A[l]:
        largest = l
        
    if r < n and A[largest] < A[r]:
        largest = r
    if largest != i:
        A[i],A[largest] = A[largest],A[i]
        heapify(A,n,largest)
def heapSort(A):
    n = len(A)
    for i in range(n//2 -1,-1,-1):
        heapify(A,n,i)
    for i in range(n-1,0,-1):
        A[i],A[0]= A[0],A[i]
        heapify(A,i,0)
        
A = [4,2,1,3,5,6]
heapSort(A)
n = len(A)
print('Sorted array is:')
for i in range(n):
    print('%d'%A[i]),
```
Out put of the above code is,
```
Sorted array is:
1
2
3
4
5
6
```
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Day 47 Of <a href="https://twitter.com/hashtag/100days?src=hash&amp;ref_src=twsrc%5Etfw">#100days</a> Of Code and <a href="https://twitter.com/hashtag/Python?src=hash&amp;ref_src=twsrc%5Etfw">#Python</a> <br>* More about Algorithm<br>* Heap Sort<br>* Best Case Time Complexity O(nlogn)<br>* Worst Case time Complexity O(nlogn)<br>* Space Time complexity O(1)<a href="https://twitter.com/hashtag/womenintech?src=hash&amp;ref_src=twsrc%5Etfw">#womenintech</a> <a href="https://twitter.com/hashtag/100DaysOfCode?src=hash&amp;ref_src=twsrc%5Etfw">#100DaysOfCode</a> <a href="https://twitter.com/hashtag/DEVCommunity?src=hash&amp;ref_src=twsrc%5Etfw">#DEVCommunity</a> <a href="https://twitter.com/hashtag/CodeNewbie?src=hash&amp;ref_src=twsrc%5Etfw">#CodeNewbie</a> <a href="https://t.co/cHqq6Vmpw3">pic.twitter.com/cHqq6Vmpw3</a></p>&mdash; Durga Pokharel (@mathdurga) <a href="https://twitter.com/mathdurga/status/1359150525707599875?ref_src=twsrc%5Etfw">February 9, 2021</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Difference between Object.freeze and Object.seal in JavaScript
Tags: javascript, beginners
Published: 2021-02-09 13:59:57

There are times when we want our objects to retain their original properties such that the property should be not changeable or editable.

We can change or add property of an object like below 

```
var a = { 
    color: 'red'
};
//Object.freeze(a)

a.value = 10;

>a
[object Object] {
  color: 'red',
  value: 10
}

```
We can add Object.freeze(a); to the above code to prevent value property to be added to the a object.

Also Object.freeze(a) does not allow the property of an object to be changed.

```
var a = {id: 1};
a.id=5;
console.log(a);
> 5


var b = { cost: 100;};
Object.freeze(a);
b.cost= 200
console.log(a);
> 100

>delete b.cost
false

```
We cannot perform delete operation with an object which is freeze where on using delete it will return false.

Object.seal allows to change an existing property unlike Object.freeze

```
var a = { id: 6};
Object.seal(a);
a.cost=500;
a.id=10;

>a
[object Object]{
   id:10
}

>delete a.id
false

```
So now if we want to allow delete to work on the object we can use Object.preventExtensions() instead of Object.seal()

So the below is the observation on using prevent extension

```
var a = {id: 6};
Object.preventExtensions(a);
a.id=9;
a.cost=100;

>a
[object Object]{
   id: 9
}

> delete a.id
true

> a
[object Object] {...}

```

There is another way for freezing a property instead of the whole object with Object.freeze.

Suppose we want to freeze id of an object a only rather than the whole object, we can use it like below

```
var a = { id : 5, cost : 100, quantity: 50};

Object.defineProperty( a, 'id', { writable: false, value:5});

a.id = 10;
a.quantity=10
a.cost= 60

>a
[object Object]{
   id:5,
   cost:60,
   quantity: 10
}

```
View Git Tags with Semver Ordering
Tags: engineeringpractices, styling
Published: 2021-02-16 15:03:06

---
title: View Git Tags with Semver Ordering
published: true
date: 2021-02-09 14:45:13 UTC
tags: EngineeringPractices,Styling
canonical_url: https://qvault.io/2021/02/09/view-git-tags-with-semver-ordering/
---

 ![What is semver](https://qvault.io/wp-content/uploads/2021/01/semver-info.jpg "semver info")

The post [View Git Tags with Semver Ordering](https://qvault.io/2021/02/09/view-git-tags-with-semver-ordering/) first appeared on [Qvault](https://qvault.io).

If you’re like me, you wish all [Git tags](https://git-scm.com/docs/git-tag) adhered to the [Semantic Versioning standard](https://semver.org/). Unfortunately, Semver is just a convention, so Git tags can basically be any string of text. By default when you use the `git tag` command, your output will be in _alphabetical_ order. Being a gopher, almost all the projects I work on are tagged according to Semver standards, which means the default output is fairly useless.

In order to print all the Git tags in a project in Semver order, simply run `git tag -l | sort -V`.

Alternatively, if you’re on at least version 2 of Git, you won’t even need to use the `sort` command, just run:

```
git tag -l --sort=version:refname
```

If you want the latest tags at the top of the output, use `-version` to inverse the sort:

```
git tag -l --sort=-version:refname
```

If you want your global installation of Git to default to Semver sorting, you can use the following command as of Git v2.1+:

```
git config --global tag.sort version:refname
```

## Examples of Git standard output

### Default alphabetical sorting

```
v0.0.0
v0.0.1
v0.0.12
v0.0.2
v0.1.0
v0.10.0
v1.0.0
v1.1.1
v1.11.0
v1.12.0
v10.0.0
v2.0.0
```

### Semver sorting

```
v0.0.0
v0.0.1
v0.0.2
v0.0.12
v0.1.0
v0.10.0
v1.0.0
v1.1.1
v1.11.0
v1.12.0
v2.0.0
v10.0.0
```

## Thanks For Reading!

Take [computer science courses on our new platform](https://app.qvault.io/)

Follow and hit us up on Twitter [@q\_vault](https://twitter.com/q_vault) if you have any questions or comments

[Subscribe](https://mailchi.mp/5c7f5c281bbe/qvault-newsletter-subscribe) to our Newsletter for more programming articles
How to learn anything in 20 hours: My thought::
Tags: productivity, tutorial, programming
Published: 2021-02-09 14:36:28

**This is a personal understanding which I got from this video at [Tedx talk by Josh Kaufman](https://youtu.be/5MgBikgcWnY)**

You have free time just it feels that you have no free time.

I am very much enthusistic to learn new things.


go to the book store,library how to learn new things?

How many time takes to learn something new : 10000 hours

What we say?

I have no time: excuse :p

expert level performance: 10000

most time practicing,most learning,improvising

experts are built

Outliers

10000 rule everything but need to be a expert

It's not true,

performance = 1/practice

how good you are = saturated curve practice_time

# to be a reasonably good 20 hours

## Rapid skill acquisition

What you want to do with this skill?

1.Deconstruct the skill: Required component
2.Learn enough to self correct coose 3 to 5 books/courses don't use to it procastinate. do learn enough self edit.

3.Remove practice barriers :: **mobile,tvs,everything**

4.Practice at least 20 hours.

Feeling stupid is a barrier overcome it stick with the practice.

# The major barrier to learn anything is not intellectual, it's emotional.

<br>
> credit
<span><b>cover Photo by</b> <a href="https://unsplash.com/@stephanieharvey?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Stephanie Harvey</a> on <a href="https://unsplash.com/s/photos/productivity?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>
UI Dev Newsletter #43
Tags: webdev, html, css, javascript
Published: 2021-02-09 14:29:35

- [Improved dark mode default styling with the color-scheme CSS property and the corresponding meta tag](https://bit.ly/3aM3OPF)
Thomas Steiner explains how the color-scheme CSS property and the corresponding meta tag allow developers to opt their pages in to the theme-specific defaults of the user agent stylesheet.


- [Dark Patterns at Scale: Findings from a Crawl of 11K Shopping Websites](https://bit.ly/39WVfCw)
A group of researchers share findings from a large-scale study, analyzing ~53K product pages from ~11K shopping websites to characterize and quantify the prevalence of dark patterns.


- [How to avoid layout shifts caused by web fonts](https://bit.ly/3rwVqKW)
Simon Hearne describes different techniques on how to optimize font delivery to remove layout shifts.


- [An async function walks into a loop](https://bit.ly/2Oizo07)
Oscar Braunert identifies the template loop problem in his Eleventy site and moves the template’s critical logic into plain JavaScript.


- [Grow the IndieWeb with Webmentions](https://bit.ly/2MIL6Rb)
Amber Wilson explains why webmentions exist and how to add it to your site.


- [Let’s Bring Spacer GIFs Back!](https://bit.ly/3pZQUUB)
Josh Comeau creates an element to add some space between the icon and text.


- [Authentication](https://bit.ly/2Oi6InW)
Jeremy Keith explains the two-factor authentication and the “factor” part of it.


- [Accessibility Wins](https://bit.ly/3qcJm1f)
Marcy Sutton showcases accessible user interfaces and tools.



Happy coding!

[Subscribe to the newsletter here!](https://bit.ly/34155z3)
The only way to conquer the world as a developer.
Tags: teamwork, coding, business, opensource
Published: 2021-02-09 14:22:26

## The Journey!
The last 2 years I've learned so much about programming. 
Creating my dream project has been always a great motivator that kept me going. Finding my first job skyrocketed my ego, my happiness and the desire to create more and more magical code, that one day reach could the screen of thousands.

After a year of coding, I created a platform like teachable that had all the fancy stuff. A live chat, a file upload system, a custom back-end made with node, an admin panel and so much more. You can actually see [axions](https://github.com/AkisKourouklis/axions-courses) in my github account.

After that, the next big thing came. I started a company at the age of 17 hoping for something better. Teamwork and structure are two things I've learned that can make a difference at all. Yet so much more to accomplish. 

## The Idea ?
Have you ever wondered how long would it take you to finish a product, that would be actually good to have a place in the market? Don't worry I am thinking that every day. Backend, Frontend, Database, Devops, structure and so much more.
[Axions](https://github.com/AkisKourouklis/axions-courses) took me 3 months to finish and the structure is bad, it has a lot of bugs, not enough features and yet 15k lines of code. Not anywhere near to reach market standards. Maybe I am a bad developer, but am I ?

What I really realized was that, just being a coder doesn't matter. What matters is to have a businessman mindset and be able to learn everything you have to. From coding to how to talk to a business meeting.

## The invitation -
I have an invitation for you. Let's create a team, let's work together and see what potential we have to create a product that would have a place in the market, a product that will be created by young developers who believed in teamwork and believed that working as a whole is better than working alone.

Thanks for reading the article, 
Message me on LinkedIn if you find this article interesting and you want to discuss further information. I've been working to a new project the last 3 months that is quite interesting and quite exciting.

Hope you have a great day, Sotiris

[LinkedIn](https://www.linkedin.com/in/sotiris-kourouklis-8a52349b/)        
[Github](https://github.com/AkisKourouklis)
Kubernetes - Delete multiple resources
Published: 2021-02-09 13:59:10

If you want to delete all your elements of a kind, you can easily do it with the next command:

*Exemple to delete all pod in the default namespace*
> kubectl delete pod --all=true

<br/>

With the **--all=true**, you are able to delete all the elements which match the request.

---

I hope it will help you!
Json validation with OpenAPI Schema
Tags: openapi4j, openapi, schema
Published: 2021-02-09 13:55:26

---
title: Json validation with OpenAPI Schema
published: true
description: How to validate a json file against a Schema that is defined in an OpenAPI definition?
tags: openapi4j, OpenAPI, schema
//cover_image: https://direct_url_to_image.jpg
---

How to validate a json file against a Schema that is defined in an OpenAPI definition?

Using the open source library `openapi4j`!

Add the dependencies in your pom.xml file:

```xml
        <dependency>
            <groupId>org.openapi4j</groupId>
            <artifactId>openapi-parser</artifactId>
            <version>1.0.5</version>
        </dependency>

        <dependency>
            <groupId>org.openapi4j</groupId>
            <artifactId>openapi-schema-validator</artifactId>
            <version>1.0.5</version>
        </dependency>
```

Load the OpenAPI definition (`petstore.yaml`) and the json file (`pets.json`) to validate against the `Pets` schema:

```java
        URL specURL = new URL("file:src/main/resources/petstore.yaml");
        URL contentURL = new URL("file:src/main/resources/pets.json");
        String schemaName = "Pets";

        OpenApi3 api = new OpenApi3Parser().parse(specURL, true);
        JsonNode contentNode = TreeUtil.load(contentURL);
        Schema schema = api.getComponents().getSchema(schemaName);
        JsonNode schemaNode = schema.toNode();

        SchemaValidator schemaValidator = new SchemaValidator(new ValidationContext<>(api.getContext()), null, schemaNode);

        ValidationData<Void> validation = new ValidationData<>();
        schemaValidator.validate(contentNode, validation);
        if (validation.isValid()) {
            System.out.println("ok");
        } else {
            System.out.println(validation.results());
        }
```

If there is any inconsistency, the `ValidationData` object will have a list of all errors found.
Day 10: Array Search
Tags: 100daysofcode, java
Published: 2021-02-09 13:47:33

Find largest and smallest number in an given array.

```java
public class DayTen {
	
	static int arr[] = {4, 366, 23, 14, 6, 559, 4588, 33, 900, 453, 3, 6789, 29, 145};
	 
    static int largest() 
    { 
        int i; 
          
        int max = arr[0]; 
        
        for (i = 1; i < arr.length; i++) 
            if (arr[i] > max) 
                max = arr[i]; 
       
        return max; 
    } 
    
    static int smallest() 
    { 
        int i; 
          
        int min = arr[0]; 
        
        for (i = 1; i > arr.length; i++) 
            if (arr[i] < min) 
                min = arr[i]; 
       
        return min; 
    } 
    
    public static void main(String[] args)  
    { 
        System.out.println("The largest number in the array is " + largest()); 
        System.out.println("The smallest number in the array is " + smallest());
       } 
} 
```
React Styling: ClassName
Tags: react
Published: 2021-02-09 13:46:03

Continuing from previous post.

Styling is the ability to apply colors, backgrounds, images, grids to html using a [CSS (Cascading Style Sheet)](https://www.w3.org/Style/CSS/Overview.en.html). 

**CSS**
CSS [gives us the ability to set colors, backgrounds, text sizes and fonts, images, grids, and apply animations](https://css-tricks.com/).  It does this in a file named a stylesheet.  

The Style Sheet is one of the three aspects of a web page: 
- HTML 
- JavaScript 
- The Style Sheet
 
Styles must be able to 'locate' HTML Elements in order to apply the rules. This is done via the
[Selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors).  

> Click on the selector link above and study CSS for the next year or two. You must know how to use Selectors and how to write the Rules. 

**React Styling**
When we created our first react app, we saw this file.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/z9ghiy2xq9xgzo00rgwx.jpg)

The contents were similar to this:

```css
.App {
  text-align: center;
} 

.App-header {
  background-color: #282c34;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: calc(10px + 2vmin);
  color: white;
}

//edited for brevity 
```
Anything starting with a dot '.' in a stylesheet is referred to as a "Class" rule. HTML uses 'class' rules to apply it's rules for specific HTML Elements.

**React and the className Rule**

Non-react 'normal' HTML refers to class rules like this:
```html
 <div 
    class="App">
  <header 
     class="App-header">
```
But react requires the 'class' attribute to be changed to 'className'!  Like this:

```html
 <div 
    className="App">
  <header 
     className="App-header">
```
**Tips**
This post is not a lesson on CSS. The study of CSS and its application is a separate career long pursuit.  

There's two parts to CSS, the theory, and the artistry. It's not enough to just know the theory. 

JWP2021 React style className
where to post remote jobs for developers for free?!
Tags: help, hiring, resources, free
Published: 2021-02-09 13:44:40

Hey friends! 🖖
Do you know any additional resources to post engineering jobs for free that I can add to this list?
https://asynchr.com/blog/tpost/79kggiovc1-where-to-post-remote-jobs-for-developers

BTW we've launched asynchr, mentioned there, today!
Get an invite, record your video job description and automatically post it across social media for free!
React Hooks: useRef Explained in 2 Minutes
Tags: react, javascript, replit, tutorial
Published: 2021-02-09 13:44:20

When building a React app, there are going to be times where you'll want to reference a particular part of the DOM for one reason or another. If you've written Javascript code before, you're likely very familiar with how you would go about doing this, however In React you'll have to change your ways a bit — luckily it is pretty painless — in comes the useRef hook.

**How It Works**

The useRef hook simply returns an object with a ".current" property which will be the DOM element or value that you plan to use at some point or another within your component. **Note: useRef will not cause any re-renders,** it is simply an object that holds the DOM or value you've assigned to it.

**How To Use It**

1. Import useRef from React
2. Create a variable and set the value to useRef()
3. Place a ref attribute on an element (there are other ways to use this hook, but I'm simply covering the most common / simplest use case), with the value set to the variable created above
4. Access the DOM element with 'variableName.current'

*Example:*

```jsx
// 1. Importing useRef from React
import React, {useRef} from 'react';
import './App.css';

function App() {

// 2. Creating firstParagraph and secondParagraph and setting their values to useRef()
  let firstParagraph = useRef()
  let secondParagraph = useRef()

// 3. Placing a ref attribute "ref={}" on both paragraph tags, with the appropriate
	// variable as the attribute value
  return (
    <div className="App">
      <p ref={firstParagraph} >First Paragraph First Paragraph First Paragraph First Paragraph First Paragraph First Paragraph First Paragraph First Paragraph First Paragraph First Paragraph First Paragraph First Paragraph First Paragraph </p>
      <button onClick={() => firstParagraph.current.innerText = "Hi"}>Change First Paragraph Text</button>

      <p ref={secondParagraph} >Second Paragraph Second Paragraph Second Paragraph Second Paragraph Second Paragraph Second Paragraph Second Paragraph Second Paragraph </p>
            <button onClick={() => secondParagraph.current.style.backgroundColor = "lime"}>Change Second Paragraph Background Color</button>
    </div>
  );
}

// 4. Notice that within our onClick event we reference the appropriate ref
	// (which is holding our DOM element) via variableName.current
		// we then manipulate the DOM element just as we normally would in Vanilla JS.

export default App;
```

**Try It Yourself**

It is always easier to see this type of functionality by [trying it yourself](https://repl.it/@antdp425/Demonstrating-useRef-Hook)  Head over to the replit, fork the repo, and experiment! Create a new ref, a new paragraph (or whatever you want), and try to connect the dots by doing something similar to whatever you end up adding to the page.

As always, refer to the docs for more clarity / a deeper dive:

[useRef Hook](https://reactjs.org/docs/hooks-reference.html#useref)

Feel free to reach out on any of my socials for questions, feedback, or just to connect / say hello 👋.
Everything You Need To Know About WordPress Automatic Update
Tags: wordpress
Published: 2021-02-09 13:30:10

Oh yes, WordPress has rolled out another update in December – The “Simone”! It has brought tons of improvements and a few new features to entice the developers. But one major update that has jolted the developer’s community is its auto-update feature.

 

<a href="https://addwebsolution.com/blog/wordpress-56-features-improvements-makes-it-interesting">WordPress 5.6</a> has shipped with an all-new user interface that allows developers or site admins to opt for automatic updates for major releases and can perform website health checks on the go. Enabling automatic updates for WordPress ensures your <a href="https://addwebsolution.com/wordpress-development-services">WordPress Website Development</a> is secure and intact from any security breaches. WordPress up-gradation is an excellent choice, but how to get the most out of it? Here’s a guide to know everything about WordPress automatic updates.

<b>Understanding the TYPE of WordPress auto-update…</b>

1) CORE updates
2) Plugin updates
3) Theme updates
4) Translation File updates

Read Descriptive addons on all updates at <a href="https://addwebsolution.com/blog/wordpress-56-features-improvements-makes-it-interesting">WordPress Automatic Update – Everything You Need To Know</a>