teleren/devto huggingface dataset:
Dart - Relational Operators
Tags: dart, operators, programming, code
Published: 2021-01-21 05:48:39

Dart provides operators that can be used to check the relationship between values or values within variables also known as **operands**.

All relational operators, **less than(`<`)**, **less than or equal to(`<=`)**, **greater than(`>`)**, **greater than and equal to(`>=`)** gives resultant value in **boolean** i.e either **`true`** or **`false`** after evaluation.

In this article, you will find **Relational** operators provided by Dart.

# Relational operators

- All of these relational operators are binary operators.

| Operator 	| Description | Example  |
| -------- 	| ----------- | -------- |
| `<`     	| Less than       | `x == y` |
| `<=`     	| Less than or equal to | `x != y` |
| `>`     	| Greater than       | `x == y` |
| `>=`     	| Greater than or equal to | `x != y` |

```c
main() {
  // create variables
  int a = 10, b = 12;

  // value of a and b
  print('Value of a is $a and b is $b');

  // > operator
  print(a > b); // false

  // < operator
  print(a < b); // true

  // >= operator
  print(a >= b); // false

  // <= operator
  print(a <= b); // true
}
```

Read the complete post on our site [Dart - Relational Operators](https://meshworld.in/dart-relational-operators/)

Read others post on our site [MeshWorld](https://meshworld.in)

Hope you like this!

Keep helping and happy 😄 coding
How To Write A Good README File
Tags: github, markdown, devops, devjournal
Published: 2021-01-21 05:47:51

In this article I cover the step by step guide on how to create a good README file which will give a detailed explanation to your project and make you stand out.

The quality of a README often differentiates a good project from a bad project. A good one takes advantage of the opportunity to explain and showcase:

1. What your application does,

1. Justify the technologies used,

1. Talk about some of the challenges you faced and features you hope to implement in the future.
A good README helps you stand out among the large crowd of developers putting their work on GitHub.

To read more features that you can add to your file. Please read the whole Article at my blog [How to Write A Good README File](https://larymak.hashnode.dev/how-to-write-a-good-readme-file)


Follow my links for more Programming and development tips
Visit my blog for more: [larymak's Blog](https://larymak.hashnode.dev/)
Twitter: [larymak1](https://twitter.com/larymak1)
YouTube: [TechTipsByLary](https://www.youtube.com/channel/UCrT1ARRZfLOuf6nc_97eXEg)
Instagram: [NextGenCoders](https://www.instagram.com/nextgencoders/)
GitHub: [larymak](https://github.com/larymak)
conda@mac
Published: 2021-01-21 05:43:58

```
brew search conda
brew install --cask anaconda
export PATH="/usr/local/anaconda3/bin:$PATH"

conda env list
conda create -n ml r-essentials r-base python=3 tensorflow scipy
conda activate ml
conda install pillow #example
conda deactivate
conda list

jupyter notebook --ip 192.168.0.1 --port 1111
```
Java: One Programming Language for All
Published: 2021-01-21 05:39:26

I often see questions like which is a first programming language to learn?, Is Java a good programming language to start with?, how good Java is as a first programming language, which is the best programming language for beginners, or shall I start with Java or Python?.

Well, the answer to all these questions is, Java is one of the most popular programming languages, and there are a lot of reasons to learn Java, starting with Job opportunities to leveraging community support.

But, in the context of beginning programming or choosing Java as the first language, my most significant reason is that it’s simpler to learn. Java is a platform neutral language, which means it is not tied to any particular hardware or operating system. It guarantees users to ‘write once, run anywhere’. Java language is supported by almost every operating system such as Sun Solaris, RedHat, Windows etc.

### WHY JAVA?
According to TIOBE’s rating, Java has been ranked first among all languages in the world in the last couple of decades.
A large number of well-known companies use Java-written software to develop software and applications. So if you know Java, you definitely won’t have to fight to find a job. The main reasons for Java’s popularity are its mobility, scalability, and large user community.

### How to start learning?
####Schedule your lessons
and find ways to minimize distractions. You need to discipline yourself by following your schedule.

####Use the rule of 20 minutes.
Before you ask for help, take at least 20 minutes to google yourself. There is a (very) high probability that the answer is already in front of you, and besides, the struggle makes you a better programmer in general.

####Practice coding every day.
Practicing helps you to improve. Make coding a habit. For example, you can code small pet projects.
Don’t hesitate to program more advanced programs with the help of Java API as soon as you have mastered the basics.

####Use blogs you like and forums
dedicated to Java and programming languages in general. It will help you to improve the situation.
Higher Order Function Examples
Tags: javascript, beginners, function
Published: 2021-01-21 05:38:26

Example-1 without higher order function


```javascript
var number = [1,2,3];
var result =[];

for (let i = 0; i < number.length;i++)
{
    result.push(number[i]*2);
}

console.log(result);
```

Example-1 with higher order function

```javascript
var number = [1,2,3];

var result = number.map((item)=>{
    return item * 2;
})

console.log(result);
```

Example-2 without higher order function

```javascript
var players =
[
    {
        name: 'A',
        avg: 33.2
    },
    {
        name: 'B',
        avg: 37.3 
    },
    {
        name: 'C',
        avg: 38.32
    },
    {
        name: 'D',
        avg: 40.76
    }
];

var UpdateResult = [];

for(var i = 0; i <players.length; i++)
{
    if(players[i].avg >= 37)
    {
       UpdateResult.push(players[i]);
    }
}

console.log(UpdateResult);
```

Example-2 with higher order function

```javascript
var players =
    [
        {
            name: 'A',
            avg: 33.2
        },
        {
            name: 'B',
            avg: 37.3
        },
        {
            name: 'C',
            avg: 38.32
        },
        {
            name: 'D',
            avg: 40.76
        }
    ];

var UpdateResult = players.filter((player) => player.avg >= 37);

console.log(UpdateResult);
```

Example-3 without higher order function


```javascript
var arr = [1, 2, 3, 4];

function getArraySum(array) {
    var total = 0;
    for (var i = 0; i < array.length; i++) {
        total += array[i];
    }
    return total;
}

var result = getArraySum(arr);

console.log(result)

```

Example-3 with higher order function

```javascript
var arr = [1, 2, 3, 4];

var total = arr.reduce((sum, item) => {
    return result = sum + item;
})

console.log(result);

```
Get Started with XState and Vue 3
Tags: vue, xstate, state, compositionapi
Published: 2021-01-21 05:26:17

---
title: Get Started with XState and Vue 3
published: true
description: I have created 2 YouTube tutorials on using XState with Vue 3 composables
tags: vue, xstate, state, compositionapi
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/5dbq5yhlj7f0cd8ub8e8.png
---

Hey folks, I just wanted to let you all know that I have recently created a pair of tutorials on using XState with Vue 3.

In the first video, I go over creating a simple state machine with the [XState Visualizer](https://xstate.js.org/viz/), and then show how to integrate this into a Vue 3 setup function by using the composable function provided by XState. 

{% youtube g4YnmydXMP8 %}

In the second video, I discuss how we can use [Typestates](https://xstate.js.org/docs/guides/typescript.html#typestates) along with Typescript to better type our state machines and give us great compile-time support inside of Vue templates. In this latter tutorial, I also go over scaffolding out a Vite application for Typescript. In this video, we work on asynchronous data fetching.

{% youtube 7tT45eRmyJE %}

I hope you check out the videos and give'em a thumbs up!
Cara Mengatasi Lupa Password Windows
Tags: windows
Published: 2021-01-21 05:25:15

Sebagai Pengguna Komputer pasti anda ingin mengamankan komputer anda dengan cara menggunakan password pada windows karena tidak ingin orang lain membuka laptop atau komputer anda.

Tetapi cara ini sering membuat orang mengalami kesulitan untuk masuk ke windows 7 karena lupa passwordnya tetapi tidak masalah berikut cara mengatasi lupa password pada windows 7.

kita akan menggunakan 2 cara untuk mengatasi lupa password pada windows 7. Pertama dengan menggunakan safe mode. kedua dengan reset password windows 7, berikut caranya mengatasi lupa password windows 7.

Cara Mengatasi lupa password windows 7 dengan Safe Mode

1. Langkah Pertama ketika kamu akan membuka password pada Windows 7 kita Mneggunakan lewat Safe Mode , cara ini cukup mudah dan tidak ribet untuk anda gunakan , dan cara ini juga dapat di gunakan untuk membobol billing warnet apabila safe mode di warnet tidak di kunci, tetapi saya sarankan untuk anda jangan menggunakan untuk hal-hal yang bersifat negatif dan merugikan orang lain.

2. Restart Komputer anda.

3. Lalu anda Tekan F8 pada saat booting ke windows , jangan terlalu lama apabila terlalu lama menekan f8 maka anda akan masuk ke windows kembali

4. Lalu anda Pilih Safe Mode , maka anda masuk seperti masuk windows biasa …

5. Langkah selanjutnya anda tinggal membuka akun windows anda

Control panel – user account – lalu anda pilih administrator yang berpassword – lalu anda pilih remove password

6. setelah anda remove langkah selanjutnya anda tinggal Merestart Komputer anda , maka komputer anda tinggal masuk Windows tanpa anda Password

Cara Mengatasi Lupa Password Windows 7 dengan Reset Ulang Password Windows 7

1) Hidupkan komputer anda, kemudian akan muncul menu untuk memasukkan password dan masukkan sembarangan password jika anda lupa dan ingin reset ulang password windows 7.

2) Kemudian akan muncul notifikasi bahwa anda salah memasukkan password dan pilih OK

3) Selanjutnya lakukan berulang-ulang hingga muncul dibawah menu reset password windows 7

4) Kemudian akan muncul menu wizard dan pilih next

5) Kemudian  masukkan flashdisk untuk reset ulang password windows 7. pilih flash disk reset yang baru saja anda colokkan ke laptop atau komputer anda, kemudian silahkan klik lagi [Next].

6) Selanjutnya masukkan password baru anda dan pilih next

7)Kemudian anda akan masuk kembali windows 7

Referensi : https://rincitekno.com
Deno
Published: 2021-01-21 04:53:01

I have tried using deno for many of the typescript/javascript projects I have done recently. A discord bot, many backend for server side, and tried to run react on one of them.

I found http servers in deno to slower to start with approximately 4s delay on startup.

But the actual dev experience, ahh that was so much more light then node, that I didn't get the feeling of doing a project.

If you haven't tried deno yet, you must give it a try.

It is exceptionally helpful if you use typescript in your workflow.

And the addition of built in tools like a bundler and file watcher makes life easier.

And biggest feature being security, no implicit access.

Try deno today! Goto deno.land
Risk of making a website open source.
Tags: mern, security, internet, help
Published: 2021-01-21 04:50:08

I saw a lot of open-source projects used by millions of people, but few of them are websites where users can access protected resources and authenticate themselves.

 I think the reason is authentication and data integrity. I think website owners scared about website security, that's why they don't make the website open source. 

I am specifically involved in MERN stack development, and I want to make an open-source website for developers.

On this website, all developer's data will be publicly visible to the world excluding private data and contact details. 

This website will have an admin, who can enter all data into the database using the web interface(**frontend**). I want this operation to be secured. 

Overall, I want to make a website where everyone can see data, but the editing operation will be carried by an authentication person.

So, I want to use JWT to authorize the admin and store the JWT token in the browser cookie(**same site and server-side cookie**).


### How can I make a secured open source website.

> Sorry for poor English and bad writing skills.
State of CSS: Multi-Column Layout
Tags: css, grid, layout, beginners
Published: 2021-01-21 04:43:55

![Lego Abbey Road](https://dev-to-uploads.s3.amazonaws.com/i/zr76dg7crjkzrg60gk0h.jpg)

<span>Photo by <a href="https://unsplash.com/@danielkcheung?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Daniel Cheung</a> on <a href="https://unsplash.com/s/photos/lego?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>

The [State of CSS 2020](https://2020.stateofcss.com/) came out recently. Reading through it I realized that I have some pretty big gaps in my CSS knowledge. What better way to plug that gap than a series on all things CSS that I missed?

I'm going to walk through all the features in State of CSS. I'll cover topics that are either new to me, or less than half of respondents say they have used. 

Let's kick it off with Multi-Column Layouts!

First an example: [view on codepen](https://codepen.io/unclejustin/pen/mdrgEYe)

![Multi-Column example](https://dev-to-uploads.s3.amazonaws.com/i/bmvzyxnnbr7blyz96kzd.png)

{% codepen https://codepen.io/unclejustin/pen/mdrgEYe default-tab=css %}

I alway forget about this one, but it's super handy. You don't always need CSS Grid. Sometimes you just want your beautiful prose not to spread across the screen like a rude subway passenger.

The syntax is short and easy to understand.

#### column-count
If you want a fixed number of columns.

#### column-width
The real money maker. Auto generate columns of a certain size OR character count.

#### column-rule
Style the dividing line between columns.

#### column-gap
Set the space between columns.

#### column-span
Make an element span all columns. User for fancy headings or ad banners (please don't use it for ad banners).

That's it for now, next time we'll cover position sticky!
Python Script to Organize Files in Folders
Tags: python, programming
Published: 2021-01-21 04:33:52

Python is really easy and fun language which can help us to build small scripts to automate some of our work. Here while reading few articles i came across one script written in python that help us to organize files in one folder ex. Downloads Folder where we download everything. To search a particular file from such mess was tedious task, but here my friend python can automate your task and help you to keep organised your downloads directory. Let's go ahead check below script.

```
import os
import shutil
 
#The Path of the directory to be sorted
path = 'C:\\Users\\<USERNAME>\\Downloads'
#This populates a list with the filenames in the directory
list_ = os.listdir(path)
 
#Traverses every file
for file_ in list_:
    name,ext = os.path.splitext(file_)
    print(name)
    #Stores the extension type
    ext = ext[1:]
    #If it is directory, it forces the next iteration
    if ext == '':
        continue
    #If a directory with the name 'ext' exists, it moves the file to that directory
    if os.path.exists(path+'/'+ext):
       shutil.move(path+'/'+file_,path+'/'+ext+'/'+file_)
    #If the directory does not exist, it creates a new directory
    else:
        os.makedirs(path+'/'+ext)
        shutil.move(path+'/'+file_,path+'/'+ext+'/'+file_)
```
You can save above mentioned file with organize.py and mentioned Path variable as your Directory which you want to organize in my case i wanted to organize my downloads directory. What this script will do is look for certain extensions in files and make directory with name of extensions of not present and move files in particular directory. Let’s Run file with below command

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

Originally Posted : [Akash Senta's Blog](http://akashsenta.com/blog/python-script-to-organize-files-in-folder/)
mount disk@ubuntu
Published: 2021-01-21 04:26:58

```
sudo lsblk #get /dev/sd*
sudo fdisk /dev/sda

>>n
>>p
>>default
>>default
>>w

sudo mkfs.ext4 /dev/sda1
sudo blkid #get UUID for /dev/sda1
sudo mkdir /mnt/sda1
sudo vim /etc/fstab

>>UUID= /mnt/sda1 ext4 defaults 0 0

sudo mount -a
```
Getting website meta tags with node.js!
Tags: node, express, cheerio
Published: 2021-01-21 04:09:32

Recently I was in need of a way to get meta tags for a service I was creating. So I decided to search GitHub for a solution. Unfortunately, everything either didn't work or was very slow. So here we are. 

---

- **First off, install `node-fetch` and `cheerio` with npm.** 

- **Next, we need to fetch the HTML of the website we are getting the meta tags from.**

```diff
 fetch("https://discord.com")
    .then(result => result.text())
    .then(html => {
        console.log(html);
    }).catch(error => {
        console.log(error);
    })
```
- **Now we need to pass this HTML into Cheerio, which will allow us to find meta tags from their attributes.**

```diff
 fetch("https://discord.com")
    .then(result => result.text())
    .then(html => {
        console.log(html);
+       const $ = cheerio.load(html);
    }).catch(error => {
        console.log(error);
    })
```

- **The way we do this is using code like this...**

**↓**  find meta elements with property "og:title"

``$('meta[property="og:title"]').attr('content')``

get the chosen elements content attribute  **↑**

- **After doing this for all the meta tags I had this...**

```diff
 fetch("https://discord.com")
    .then(result => result.text())
    .then(html => {
        console.log(html);
        const $ = cheerio.load(html);
+       const title = $('meta[property="og:title"]').attr('content') || $('title').text() || $('meta[name="title"]').attr('content')
+       const description = $('meta[property="og:description"]').attr('content') || $('meta[name="description"]').attr('content')
+       const url = $('meta[property="og:url"]').attr('content')
+       const site_name = $('meta[property="og:site_name"]').attr('content')
+       const image = $('meta[property="og:image"]').attr('content') || $('meta[property="og:image:url"]').attr('content')
+       const icon = $('link[rel="icon"]').attr('href') || $('link[rel="shortcut icon"]').attr('href')
+       const keywords = $('meta[property="og:keywords"]').attr('content') || $('meta[name="keywords"]').attr('content')
+       // do something with the variables
    }).catch(error => {
        console.log(error);
    })
```

---

You can see the finished product [here](https://metagrabber.vercel.app/) and view the source on  [GitHub](https://github.com/RemiixInc/meta-grabber). A node module is also available [here](https://www.npmjs.com/package/meta-grabber)!

---

Sorry if this article sucked, it was my first time writing on this blog.
When rails db:migrate error has occurred because I'd tried it several times.
Published: 2021-01-21 03:45:10

---
title: When rails db:migrate error has occurred because I'd tried it several times.
published: true
description: 
tags: 
//cover_image: https://direct_url_to_image.jpg
---

## 😅 Mysql2::Error: Duplicate column name
Because the last db:migrate had been canceled, some columns had been created and not rollbacked.

```sh
root@ccf3d04c49ac:/app# bin/rails db:migrate
Caused by:
Mysql2::Error: Duplicate column name 'landlord_agent_type'
```

## 🛠 Fix => Dive into MySQL and fix it by SQL

```sh
root@ccf3d04c49ac:/app# bin/rails db
Enter password:

MySQL [eshub_development]> show tables;
+-----------------------------+
| Tables_in_eshub_development |
+-----------------------------+
| contracts_rentals           |
+-----------------------------+
18 rows in set (0.004 sec)

MySQL [eshub_development]> desc contracts_rentals;
+-------------------------------+--------------+------+-----+---------+----------------+
| Field                         | Type         | Null | Key | Default | Extra          |
+-------------------------------+--------------+------+-----+---------+----------------+
| id                            | bigint       | NO   | PRI | NULL    | auto_increment |
| landlord_agent_type           | varchar(255) | YES  |     | NULL    |                |
| landlord_agent_id             | bigint       | YES  |     | NULL    |                |
+-------------------------------+--------------+------+-----+---------+----------------+
33 rows in set (0.005 sec)

MySQL [eshub_development]> alter table contracts_rentals drop column landlord_agent_type;
MySQL [eshub_development]> alter table contracts_rentals drop column landlord_agent_id;

MySQL [eshub_development]> show index from contracts_rentals;
+-------------------+------------+----------------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
| Table             | Non_unique | Key_name                                                 | Seq_in_index | Column_name   | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression |
+-------------------+------------+----------------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
| contracts_rentals |          0 | PRIMARY                                                  |            1 | id            | A         |          17 |     NULL |   NULL |      | BTREE      |         |               | YES     | NULL       |
+-------------------+------------+----------------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
11 rows in set (0.004 sec)

MySQL [eshub_development]> exit
Bye
```