teleren/devto huggingface dataset:
Can We Play Games On Linux Distros??
Tags: linux, gamedev
Published: 2022-04-26 07:09:54

Probably,Everyone thinks that open source is not for gaming and we cannot play games on open source.Now the above statement is absolutely not true,We can actually play games on open source linux distros.There are certain utilities which you need to play games on Linux.

I am going to discuss about how we can play games on Linux.Games which are playable on Windows can be played on Linux.

First,You need a utility called Wine which is a open source software made to run .exe files on Linux.


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

For example,
You can easily install wine on Ubuntu by simply using the apt-get installer of Ubuntu as follows:

sudo apt-get install wine

This will install wine on your Ubuntu system which will let you run the .exe files of windows directly on your Ubuntu.
You can directly right click on an .exe file and choose to run with wine option to run that file.

In this way you can play games directly on your Linux Distros.

Simple N Fast
As you can see I am playing the game called “I Am Alive” on Ubuntu


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

Now,The there is a second way of playing games on Linux which is by using playonlinux application.


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

By installing playonlinux you can directly interact with its GUI to play games and run applications of windows on Linux.

Voila! So Linux is awesome in its own way!
4 /100DaysOfFlutter : Dart: Enumerations, Classes and Objects
Tags: flutter, dart, tutorials, app
Published: 2022-04-26 07:06:37

---
title:  4 /100DaysOfFlutter : Dart: Enumerations, Classes and Objects 
published: true
description: Learn Dart Enumeratoins, classes and Objects
tags: #flutter #dart #tutorials #app
//cover_image:  https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o95l5yic96c8pagn0gly.png
---

<!-- title: 4 /100DaysOfFlutter : Dart: Enumerations, Classes and Objects -->
<!-- subtitle: Learn Dart Enumeratoins, classes and Objects -->


# Dart List: `List<String> skills = ['Swiming', 'running', 'Karate']`

This line wiil be spoken as List of String named skills has values Swiming running Karate; you can also use your own way of reading and pro-nounching it.

`List` can also be called as `array`.

a List can contain only one data type of element.
for mutliple type of element we can use something called as Objects in the list.


# Classes: Classes give us ability to make own type of data, a sort of template, protocol, rule for some Objects/ Variables.

```Dart
class Insan extends LivingThings {
  String name;
  int age;
  Insan(this.name, this.age);
}
```
Now I can use this data types to make own variables with this data types.
```Dart
  Insan Abhay = new Insan("Abhay", 19);
```

as before Insan is the type of variable, Abhay is the variable name 🆕 key word is for before it is new Variables made which has combination of data types/ mostly new key used when for a single variables we use mutilple dataytypes. Like, here we are using String and int at the same time passing the parameter's in the Class
  
## Objects: Objects gives ability to make the variables the classes we make,
in reality anything that takes place, area, **memory** is a Objects as the Variable named **Abhay** which is created above is going to take place in the memory then it is an Object, Object have type can your own type also, Like **Insan**

```dart
  Insan Abhay = new Insan("Abhay", 19);
```

Object are also known as Instances; you can check by your self just print the Variable name
```dart
print(Abhay);
//Instance of 'Insan'
```
Making classes helps us to make better Objects; *classes are created outside of the Function*


Check The code here with example press <kbd>.</kbd> and open the in the browser and start practicing.


If dont' got at some  point feel free to ping me on twitter [`@abhayprajapati_`](https://twitter.com/Abhayprajapati_)

Ok Bye.
Rumah Makin Homey Dengan 5 Hiasan Kaktus Mini
Tags: jasainteriordesainmedan, jasaarsitekmedan, interiordesainmedan, arsitekmedan
Published: 2022-04-26 07:06:27

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/obwszpwzx5btv0fpybjn.jpg)
Memberikan hiasan pada suatu ruangan memang salah satu hal yang wajib dilakukan untuk mencipakan ruangan yang cantik dan estetik. Sebagian orang mencoba untuk memberikan hiasan tanaman pada ruangan mereka. Salah satu kendala dalam menempatkan hiasan tumbuhan adalah karena pengalaman yang kurang baik dalam merawat tanaman. Padahal jika Anda tahu, ada beberapa tanaman yang sangat mudah dirawat baik oleh pemula atau orang yang sama sekali belum pernah merawat tanaman. 
Salah satu tanaman favorite  yang banyak digunakan untuk mempercantik adalah tanaman kaktus. Ada banyak jenis kaktus mini hias yang bisa Anda gunakan kita juga dapat menggunakan [Jasa Interior Desain Medan](https://kontraktor.kactusidea.com/) atau [Jasa Arsitek Medan](https://kontraktor.kactusidea.com/)  yang siap membantu mempercantik ruangan mu. 

Berikut ini 5 hiasan kaktus mini yang bisa Anda gunakan untuk hiasan rumah, yaitu :

**1.Gymnocalycium**
Kaktus ini memiliki tampilan yang menarik dan unik secara tampilannya. Dilengkapi dengan hiasan bunga merah muda yang terlihat cantik. Kaktus mini ini ditanam pada pot yang berukuran mini. Kaktus Gymnocalycium biasanya diletakan di meja kerja atau ruang tamu. 

**2.Mammillaria**
Mammillaria menjadi salah satu kaktus dengan tampilan yang unik dan menarik. Terdiri atas kumpulan batang unik berbentuk lonjong namun tetap dihiasi oleh adanya duri yang halus. Bunga yang ada pada tanaman ini memiliki warna merah muda atau putih. Cara perawatannya juga cukup gampang Anda lakukan. Cukup disimpan pada daerah yang terkena cahaya matahari walau sedikit. 

**3.Stapelia Grandiflora**
Kaktus jenis ini banyak kita temui difilm atau kartun-kartun. Memiliki bentuk yang mirip dengan kaktus sungguhan yang ada di padang pasir. Kaktus asal afrika ini telah menjadi primadona kaktus. Memiliki bentuk batang yang tebal dan dilengkapi dengan adanya bunga tebal yang berwarna merah. 

**4.Kaktus Mini Hias Ariocarpus**
Kaktus jenis ariocarpus ini menjadi salah satu kaktus yang paling banyak dipelihara sebagai hiasan ruangan saat ini. Pasalnya kaktus ini tidak memiliki duri pada tubuhnya. Anda juga bisa memilih kaktus dengan warna bunga yang bervariasi seperti putih, kuning, merah, atau pink.

**5.Kaktus Parodia atau Ball Cactus**
Kaktus ini memiliki bentuk yang unik karena berbentuk bulat. Tidak hanya itu, tanaman kaktus ini dilengkapi dengan adanya bunga yang berwarna kuning. Anda bisa menempatkan tanaman kaktus ini di ruangan yang masih terkena sinar matahari dan sejuk.
Array.every() - for checking if all items meet a condition
Tags: javascript
Published: 2022-04-26 06:44:39

This article is the eighth of the [Array Method Series](https://dev.to/dillionmegida/series/17614). In this article, I will explain what the `every` Array method is.

## What is the Every Method?
The `every` method of arrays is a higher-order function that asserts if ALL items in an array meet a certain condition. If all items meet it, it returns `true`, and if at least one item does not meet it, it returns `false`.

This method does not modify the array. It only loops through and applies a condition on each item until it finds the one that does not match. This means that if it finds an element that does not match, it doesn't continue looping through the remaining items in the array. It immediately returns `false`. And if it never finds such an item all through the loop, then it returns `true`

## Syntax of the Every Method

```js
array.every(function(item, index, array){
  // condition to test item with
  // return true or false
})
```

The `callbackFunction` passed to the `every` method is applied to each item in the array until it finds the item that does not match the condition in the function.

The arguments passed to the callback function in each loop are the `item`, the `index` of the item, and the original `array`.

## Without the Every Method
The `every` method is an abstracted function that does a quick check and stops at the first item that does not pass a certain criterion. Here's an example imitating the `every` method:

```js
const array = [1, 2, 3, 4, 5, 6, 7, 8]

let allNumbersLessThan5 = false;

for (let i = 0; i < array.length; i++) {
  const item = array[i]
  console.log(item)
  if (item >= 5) {
    allNumbersLessThan5 = false
    break
  }
}

console.log(allNumbersLessThan5)
// 1
// 2
// 3
// 4
// 5
// false
```

This loop approach is similar to what the `every` method does in the background. It loops through each item, and when it finds the item that does not match the specified condition (*that all numbers should be less than 5*), it stops the loop and returns `false`.

From the logs, you would see that the loop stopped at **5**, and since **5** did not pass the test, then the method already knows that NOT EVERY item meets the condition.

If it doesn't find a reason to stop the loop, then it means that all the numbers are less than 5.

## With the Every Method

Here's how you achieve the previous result with `every`:

```js
const array = [1, 2, 3, 4, 5, 6, 7, 8]

const allNumbersLessThan5 = array.every(item => {
  console.log(item)
  return item < 5
})

console.log(allNumbersLessThan5)
// 1
// 2
// 3
// 4
// 5
// false
```

Easier to read with fewer lines of code. Let's see an example where everything passes:

```js
const array = [1, 2, 3, 4, 5, 6, 7, 8]

const allNumbersLessThan5 = array.every(item => {
  return typeof item === "number"
})

console.log(allNumbersLessThan5)
// true
```

Every item passes the condition, so indeed, EVERY item is a number.

---

The `every` method is useful when you have different values in an array and you want to assert that all of them meet a condition.
How to get an alert message when changing the options in react?
Published: 2022-04-26 06:35:16

I am having an ADD button which allows me to add some objects to the option that I selected in the dropdown. And I also have a function attached to that Add Button.

` onAddClicked = () =>{
        this.setState({
            showOptions: true
        }); 
       
    }`


   ` <button type="button" onClick={this.onAddClick}
   style={{ float: "right",  marginLeft: "10px", marginRight: "10px" }}
    id="AddSelectedTag"
    className={((this.state.selectedOptions ?this.state.selectedOptions.length === 0 : true) ? 
    "re-btn-primary-inactive" : "re-btn-primary-blue")}disabled={(this.state.selectedOptions ? 
    this.state.selectedOptions.length === 0 : true) ? true : false}>Add 
    </button>`
I can select and option and few objects under it. Now I need to display an error message when I want to change my option after selecting few objects under that. I am having state for my selected options as "this.state.selectedOptions". I am trying this in my onAddClick().

`if(this.state.selectedOptions ? this.state.selectedOptions.value : null)
        {
          alert("selectedOptions value has changed");
        }`
But this is returning an alert message everytime I click on the Add button, not when I try to change the state
Terminal komandalar | Part 3 | C++
Tags: beginners, wecoded, firstyearincode
Published: 2022-04-26 06:28:23

## `alias nickname=''`
- bu komanda takroriy ishlatiladigan komandalar uchun yangi taxallus (nickname) beradi.
```
g++ main.cpp -o dastur && ./dastur
```
- main.cpp nomli faylni compilatsiya qiladi va birdaniga ishga tushiradi.

## `nano`
- faylni terminalda ochadi
```
./..a.out
```
- birdaniga bitta oldingi papkaga kirib, uning ichidagi ma'lumotni chiqaradi

## `include`
- kerakli kutubxonani chaqiradi. Masalan "iostream" (input output stream)

## `terminal = council`

## `std`
- standart namespace

## `cout`
- `cout <<` 
- qator boshida yoziladi

## `endl` (endline)
- `<< endl;`
- qator tugaganda yoziladi va qator tugaganini bildiradi

## `int main()`
- dasturga kirish uchun funksiya

## `int main()`
- bu siz dastur ishlamaydi.

## `return 0`
- dastur muvaffaqiyatli bo'lganini aniqlashtirish uchun foydalaniladi.

## `"string"`
- qo'shtirnoq ichida yozilgan so'z va sonlar "string" deyiladi.

## `&&`
- komandalarni bir vaqtda birin ketin bajarilishini ta'minlaydi

```
// (ctrl+/)
```
- // c++ dasturida izoh qoldirishda foydalaniladi

```
\n
```
- new line = endl. Sonlar bn ishlamaydi.

## `\ backslash-- escape characters`
note: add library IntelliJ Java
Published: 2022-04-26 06:21:23

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f43suwamqz9xpizlbrvs.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ztteb4jpttxumd5xebpm.png)
Adding Prisma to Remix
Tags: database, react
Published: 2022-04-26 06:17:48

As you might know, I'm a big fan of [Prisma](https://daily-dev-tips.com/tags/prisma/), and since we choose the indie stack when we set up our Remix project, it already comes with Prisma.

## Setting up Postgres in Remix

Since it already comes with Prisma installed, we can find the schema over in `prisma/schema.prisma` file.

Inside this, let's add the most basic post setup.
And while we are here, change the data source to `Postgres`.

```js
datasource db {
  provider = "postgres"
  url      = env("DATABASE_URL")
}

model Post {
  slug     String @id
  title    String
  content  String

  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}
```

Now open your `.env` file and the correct `DATABASE_URL` to your Prisma database instance.

For me it looks like this:

```js
DATABASE_URL = 'postgresql://USER:PASSWORD@127.0.0.1:5432/YOUR_DB';
```

Once you setup, run the following command to create the database.

```bash
npx prisma db push
```

We should have the database populated and visible in our database client.

![Database Postgres](https://cdn.hashnode.com/res/hashnode/image/upload/v1650088468908/VGp-z7Sys.png)

## Changing our model to Postgres

So far, our model has been using the plain JSON file we had set up locally.
Let's change it to be loaded from the Postgres database.

Open up the `app/models/post.server.ts` file and modify it to look like this.

```js
import { prisma } from '~/db.server';

export async function getPosts() {
  return prisma.post.findMany();
}

export async function getPost(slug: string) {
  return prisma.post.findUnique({ where: { slug } });
}
```

This makes it way cleaner as well.

> Note: Go ahead and add a post to your database. Either use the Prisma seeder or manually add one.

Now when we run our app, we don't have to make any other changes, and it will simply reflect this new data source!

A match made in heaven: Remix ❤️ Prisma.

If you want to see the completed code, it's hosted here on [GitHub](https://github.com/rebelchris/remix-starter/tree/prisma).

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Setup Seers Cookie Consent Banner on WordPress Manually
Tags: gdpr, php, laravel, wordpress
Published: 2022-04-26 06:12:59

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:**
Login to your WordPress site


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


In Left ribbon:

1. Click "Appearance" option
2. Then from sub menu, Click on "Theme File Editor" option


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


In Theme File Editor, Search for `header.php` to approaching the header section code. Paste script into Header Section of your website template in order to display the cookie consent banner.

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


Paste and Click on Update File. After that, Seers Cookie Consent Banner will successfully be Integrated on your Website.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0r84n93au9tzab2n87bt.png)
Handle Timezone with Django
Tags: django, python
Published: 2022-04-26 06:06:33

A truth for people all around the world is that we experience time differently. 

Trying to have the same time in your application for all users will not reflect real-time in their zone and mostly trying to register their different times in your database will result in more conflicts and errors. 

For example, if you are looking to query all users who registered in your application for a certain period, this will be quite impossible because all entries are stored in their respective time zone.

To handle this, the world uses the Coordinated Universal Time (UTC). A time zone refers to any region where the same standard time is kept. For example, I am in UTC + 1 timezone and the time I am writing this article is 06:36 AM. 
In India for example, where the timezone is UTC + 5, the time will be 11:36 AM. Interesting!🤩

## Timezone in Django

In order to make sure that your application deal with UTC regardless of the location of the user, make sure to have the following configurations in your `settings.py`.

```python
TIME_ZONE = 'UTC'
USE_TZ = True
```
Then anywhere you are using `datetime.now()` in your application, this will always create time in UTC.
What programming skills, concept, techniques have you learned so far?
Tags: discuss, programming, motivation
Published: 2022-04-26 06:02:54

From the time you start learning how to code until having a job(freelance, part-time, full-time), what concepts, techniques have you learned that help you from your entire career as a programmer ?

MINE:
**OOP and Design Patterns**
For me I learned Object Oriented Programming by applying Design Patterns which also helps me to properly understand abstraction and utilizing interface.

**Single Responsibility**
I believe it is the most common practice that every programmer should know.

**TDD specially UNIT TEST**
Time consuming but worth it, it helps you to refactor functions easily without worrying about having wrong implementation cause of refactoring. Writing test is fun :)

**Pure Functions**
Allows you to test your functions easily and compose your functions.

**Monads**
Composing functions with same shape(data type) of inputs and output. It helps you with problems that requires chains of transformation of the data.

Currently Learning:
- Domain Driven Design - (DDD)
- Low Level Design - (LLD)

My thoughts ?
I prefer learning techniques and concepts which can be applied in any programming languages because it helps me to write quality code.

Following the concept should be a habit because sometimes we procrastinate on refactoring making our code better, break the habit on (as long as it works then we settle) we should not settle we should improve them as long as it can be improved.

How about you guys, I want to know yours as well please share on the comments :)
FreeCodeCamp Responsive Web Design Projects
Tags: html, css, webdev
Published: 2022-04-26 05:57:20

FreeCodeCamp is one of the best free learning platform. For people who are beginners/learners in Front end Development then they can build these 5 projects and gain a certificate from FreecodeCamp.

This is complete free course where you learn about Responsive Web Design



## 1. Build a Personal Portfolio Web Page


![FreeCodeCamp Solution - Build a Personal Portfolio Web Page The webdev guy](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/05kzamnxc0tib8a6b9uy.jpg)

Tutorial Link - [https://youtu.be/rx2QMs0RyJk]()

## 2. Build a Technical Documentation Page


![FreeCodeCamp Solution - Build a Technical Documentation Page The webdev guy](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xibaqlmrpaeyzxfj30f0.jpg)

Tutorial Link -[https://youtu.be/6AgIfLu8zq0]()

## 3. Build a Product Landing Page


![FreeCodeCamp Solution - Build a product Landing Page The webdev guy](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nd5pqt01xd081gmc3s1h.jpg)

Tutorial Link - [https://youtu.be/6O40tRgELAk]()

## 4. Build a Survey Form



![FreeCodeCamp Solution - Build a Survey Form The webdev guy](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7g1tncy7r7h1swx6m7xz.jpg)

Tutorial Link - [https://youtu.be/pv9ORPWAnX8]()

## 5. Build a Tribute Page



![FreeCodeCamp Solution - Build a Tribute Page The webdev guy](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l0e5fjtpanc71uqpgpvi.jpg)

Tutorial Link - [https://youtu.be/smoVjG3OyFc]()
Five levels of Software
Tags: ux, database, webdev, beginners
Published: 2022-04-26 05:43:09

## UI : How data is displayed
![ui](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gtxj0s90wk6kb8uxt32y.png)
 
 
## API : How data is retrieved
![API](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zjc86hb60kvcnbrc87xi.png)
 
## DATABASE : How data is stored
![DATABASE](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/we05le9tt2ugyz1fh2it.png)
 
## LOGIC : How data is processed 
![LOGIC](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pdrmxef8d78pliym1bc3.png)
 
## HOSTING : Where data is stored
![HOSTING](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/stz8alnn7atypj95ny38.png)
Lets CONNECT!!!
Tags: linkedin, social, developers, discuss
Published: 2022-04-26 05:34:25

Hi folks, I've been on this platform for a while now. And to be honest I am not disappointed. I see great posts everyday, people around the globe who like to share thoughts, learning and want to learn.

I would be glad if we connect on socials. May be we can have a introductory meeting (may be more), discuss various topics, brainstorming and all the good stuff you can think off. 

I'm looking forward for your comments and connections over linkedIn.

Here's my profile -- [linkedIn Profile](https://www.linkedin.com/in/himanshu-pal-538a2614a)