teleren/devto huggingface dataset:
Ubuntu 20.04 Screen tearing
Tags: ubuntu
Published: 2024-04-15 12:33:20

Screen tearing may happen when you change a display orientation to "Portrait Right" or "Portrait Left"

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

If you are using Intel's built-in graphic, you can try the combinations of following methods.

## Method 1
Step 1. If you don't have the folder "/etc/X11/xorg.conf.d", create one.
Step 2. create the file `20-intel.conf`in the directory `/etc/X11/xorg.conf.d/`

content in `20-intel.conf`
```
Section "Device"
    Identifier "Intel Graphics"
    Driver "intel"
    Option "TearFree" "true"
    Option "AccelMod"    "uxa"
    Option "DRI"         "3"
EndSection
```
and then reboot



## Method 2
Try creating another file `20-intel-graphics.conf` in the directory "/etc/X11/xorg.conf.d/"

content in the file
```
Section "Device"
    Identifier "Intel Graphics"
    Driver "intel"
    Option "TearFree" "true"
    Option "AccelMod"    "uxa"
    Option "DRI"         "3"
EndSection
```
and then reboot

Tips:
You can try playing the following options in method 1 and 2.
1. Try using either `Option "AccelMod" "uxa"` or `Option "AccelMod" "sna"` or none of them.
2. try using `Option "TripleBuffer" "true"` or not.
3. Try using `Option "DRI" "3"` or not

Remember to reboot after setting them.

## Method 3
1. try removing the buggy package
```
sudo remove xserver-xorg-video-intel
```
and reboot

2. if that doesn't work, try reinstalling it.
```
sudo apt update
sudo install xserver-xorg-video-intel
```

## My working settings (for your reference)
1. content in `/etc/X11/xorg.conf.d/20-intel.conf` and`/etc/X11/xorg.conf.d/20-intel-graphics.conf`
```
Section "Device"
    Identifier "Intel Graphics"
    Driver "intel"
    Option "TearFree" "true"
    Option "AccelMod"    "sna"
    Option "DRI"         "3"
    Option "TripleBuffer" "true"
EndSection
```

2. Reinstall `xserver-xorg-video-intel`



## ref
- [SO - Intel screen tearing - Ubuntu 18.04](https://askubuntu.com/questions/1066722/intel-screen-tearing-ubuntu-18-04)
- [YT - Fix Screen Tearing in Linux
](https://www.youtube.com/watch?v=rVBq6d3c1gM)
- [YT - How To FIX Intel Screen Tearing In Linux](https://www.youtube.com/watch?v=cGbIPFDZoOU)
Thoughts about AI on UI design
Published: 2024-04-15 12:31:36

In PR [575](https://github.com/tarasglek/chatcraft.org/pull/575) I fixed a issue of [ChatCraft](https://github.com/tarasglek/chatcraft.org) so that user now can only see the copy button in the shared chat. 

| Before  | After |
| ------------- | ------------- |
| ![before](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wx45fazcvyanpgusam4x.png)  | ![After](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ocxy9yqvxjr346j2l6ty.png) |

And then we have a different opinions about the `Options` button at the end of the shared chat.

Should we keep it as previous:

![Options](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/00lp5jk0xd2n89kxcjwf.png)

or can we just use the `Duplicate...` option as the new button in a shared chat?

It has not been updated for now, but it reminds me of an issue: tools similar to chatGPT are not well-suited for this kind of design work. Despite being quite helpful with coding throughout the semester in my studies, which enabled me to build my iOS app and fix issues in ChatCraft.

I'm wondering if there is an AI tool that can help design UI, since I know that DALL-E 3 often generates bizarre images and not suitable for creating design mockups. There are some tools like [Uizard](https://uizard.io/autodesigner/) that can generate general outlines, although I have not tried it myself, I highly doubt it can handle the issue mentioned above. I believe design skills will become increasingly important to developers, and I need to start practicing as soon as possible.
Bun Runtime - Building Nuxt app with Bun (Part 2)
Tags: node, javascript, cleavr
Published: 2024-04-15 12:27:36

In our previous [blog](https://dev.to/anishghimire862/bun-runtime-introduction-part-1-c1p) on the [Bun Runtime](https://bun.sh/) series we briefly discussed Bun runtime, its installation process, scaffolding new projects, and the way to run them.

In this part, we’ll be setting up a new [Nuxt](https://nuxt.com/) application with Bun.

Bun supports Nuxt out of the box so we can use `nuxi cli` to initialize a Nuxt project.

Run the following command to initialize a new Nuxt project:

```
bunx nuxi init my-nuxt-app
```

![Initialize Nuxt App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iiwg3haizab2na9uxl5w.png)

The command is throwing [Node](https://nodejs.org/en) version incompatibility errors during the initialization since the project setup is trying to use NodeJS instead of Bun. In this case, we can set the target to bun and re-run the command.

To setup the project using Bun add `--bun` flag just after `bunx` and run the command again:

```
bunx -–bun nuxi init my-nuxt-app
```

![Initialize Nuxt app with Bun](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a80lyy9lrzkouacn8amt.png)

Once we’ve set the project you can navigate to the new project directory and run the `bun –bun run dev` to start the development server.

Make sure to pass the target as bun with flag `--bun` otherwise, Bun will spin up a node process to execute the program.

![Nuxt Dev Server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tvx8nsjgke9nm5lk6b7t.png)

Our dev server is already up and running so we can visit `localhost:3000` to see our Nuxt app running behind the new Bun runtime. ;)


![Nuxt App Demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a1y7ooo6tw5qx9c3eawf.png)

In this blog, we’ve set a Nuxt project using Bun. I hope this blog helps you with setting up a Nuxt app using Bun.

In the next part of this blog, we'll be deploying the Nuxt app we created using a server and deployment management tool called [Cleavr](https://cleavr.io), with Bun as the runtime.
What is RDBMS?
Tags: webdev, programming, beginners, tutorial
Published: 2024-04-15 12:00:00

A relational database management system, or a RDBMS is just a database management system that helps you create and maintain a relational database.

Now, there are very many different relational database management systems out there. Some of the most popular ones are,

- MySQL
- SQL Server(By Microsoft)
- Oracle
- But of course, there are plenty more.

Each database management system has a different flavor of SQL. But, all these implementations are very similar and are based on the standard SQL specification. So, most of the SQL code that you will learn in this course will work with any database management system.

In this course, we will be using MySQL, which is the most popular open source database in the world.

OK, now to this diagram.

![Relational Vs Non-Relational](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/89c2kl3emjwbnhcymqjm.png)

What about non-relational databases? In non-relational databases, we don't have tables or relationships, these databases are very different from relational databases, but that's a topic for an entirely different course.

What you need to know is that non-relational database management systems don't understand SQL. They have their own query language.

So, we use SQL to work with Relational Database Management Systems.

Happy Coding!
Karl 🤛

P.S. I have a JavaScript eBook(Zero to Mastery) to help you become job-ready by understanding how JavaScript really works behind the scenes. [Get it here](https://karlgusta.gumroad.com/l/ufcer/6wh7z13).
DeFi Comptroller Smart Contract Review
Published: 2024-04-15 11:56:04

 The smart contract that i will be reviewing here is a Solidity smart contract for a Comptroller in a decentralized finance (DeFi) system. I will be explaining in details what each code snippet is doing, every function and libraries used in the contract.

---


```javascript
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.16;
```

    This line specifies the SPDX-License-Identifier for the contract, indicating the license under which it is released. In this case, it's MIT.
    pragma solidity ^0.5.16; specifies that the contract is compatible with Solidity version 0.5.16 or higher.

---

```javascript
import "./CToken.sol";
import "./ErrorReporter.sol";
import "./Exponential.sol";
import "./Unitroller.sol";
```

These lines import other Solidity files (CToken.sol, ErrorReporter.sol, Exponential.sol, Unitroller.sol) that contain contract definitions and libraries used by the Comptroller contract.

**CToken.sol :**  Defines an abstract base contract for cTokens in the Compound protocol. 

**ErrorReporter.sol** Defines error reporting contracts for the Comptroller and Token contracts within a decentralized lending protocol.

**PriceOracle.sol** Outlines an abstract Price Oracle interface, which provides a method for fetching the underlying price of a given cToken asset.

**ComptrollerInterface.sol** Defines a set of contracts for a decentralized lending protocol.


**ComptrollerStorage.sol** Outline the storage structures for different versions of the Comptroller contract, which manages various aspects of the lending protocol, including market listing, collateral factors, interest rates, and distribution of COMP tokens.

**Unitroller.sol** The Unitroller contract serves as the entry point for interactions with the Comptroller logic. It acts as a proxy that delegates execution to the current implementation of the Comptroller contract while managing administrative functionalities like upgrading the implementation and transferring administrative rights.

**Comp.sol** The Comp contract is an ERC-20 token implementation with added functionality for voting delegation.
---
Understanding PropTypes in React: Ensuring Data Integrity and Component Consistency
Tags: webdev, proptypes, react, frontend
Published: 2024-04-15 11:28:48

PropTypes are a way to document and enforce the types of props passed to components. They help catch bugs early by specifying the expected data types of props. PropTypes are particularly useful in large projects where multiple developers are involved, as they provide a clear contract for how components should be used.

React component with PropTypes for different data types:

import React from 'react';
import PropTypes from 'prop-types';

function ComponentA(props) {
  return (
    <div>
      <h1>{props.title}</h1>
      <p>{props.description}</p>
      <ul>
        {props.items.map((item, index) => (
          <li key={index}>{item}</li>
        ))}
      </ul>
      <button onClick={props.onClick}>{props.buttonText}</button>
    </div>
  );
}

ComponentA.propTypes = {
  title: PropTypes.string.isRequired, // string
  description: PropTypes.node, // node (string, number, element, array, etc.)
  items: PropTypes.arrayOf(PropTypes.string).isRequired, // array of strings
  onClick: PropTypes.func.isRequired, // function
  buttonText: PropTypes.string // string (optional)
};

export default ComponentA;

In this component:

title is a required string.
description can be any node (string, number, element, array, etc.).
items is an array of strings and is required.
onClick is a required function.
buttonText is an optional string.
These PropTypes cover various data types commonly used in React components. You can adjust them based on your specific needs.
How do I get a folder from AWS S3 Bucket?
Published: 2024-04-15 11:27:53

In the world of cloud storage, Amazon S3 is super popular because it's scalable and reliable. But sometimes, getting specific folders from your S3 bucket can feel like a challenge. Don't worry! You can make it easier with Commander One and the AWS CLI.

Let's talk about Commander One.

Commander One isn't just a regular file manager. It's like a special browser for S3 on your Mac. With it, you can easily upload and download files from your [download folder from s3](https://ftp-mac.com/download-folder-from-s3/) or buckets in your AWS account. It's really user-friendly, so you don't have to remember any tricky commands. Plus, it lets you manage all your online files and folders just like they're sitting on your computer's hard drive.
Understanding Licensing for Large Language Models (LLMs)
Tags: llm, ai, licenses
Published: 2024-04-15 11:12:53


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

Understanding how to correctly use Large Language Models (LLMs) in your products without violating licensing terms is crucial due to their complexity and the vast amount of data they process. We’ve developed a straightforward guide on permissive licenses that is perfect for anyone integrating these models into their products.

For more details, check out [our guide](https://llm.extractum.io/static/blog/?id=permissive-licenses-llms-explained) on LLM licenses on our website.
APIs that can help to build eCommerce Application Much Faster
Tags: ecommerce, api
Published: 2024-04-15 10:58:53

Hey developers,
Have any of you built an E-Commerce application? Or are you currently in the process of building one? Drop the link or just idea in the comment :)

I would like to share the experiance where i've built an E-Commerce application myself for **selling old books**. In the beginning, I kept it simple with basic functionalities such as sign-up, online payment processing, and order tracking. Initially, everything went well until I realized how time-consuming it was to develop these functionalities from scratch. To be honest, it took a lot of time. :/

Therefore, I started looking for APIs that I could integrate into my application. I came across some really interesting ones, and I've listed a few in this blog post:

Link: [https://apyhub.com/blog/top-ecommerce-apis-2024](https://apyhub.com/blog/top-ecommerce-apis-2024)

But that's not all. If any of you have already built an E-Commerce application and have come across any useful APIs, I would be happy to know your experiences.

Thanks!
SELECT - INSERT INTO SELECT
Published: 2024-04-15 10:52:33


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


Certainly! Let's create a practical example involving a `source` table and a `target` table. Imagine we have an e-commerce platform with a table that keeps track of all the products, and we want to create a promotional campaign for products that have been highly rated by customers.

First, we'll create a `source` table named `Products` that contains product information, including ratings:

```sql
CREATE TABLE Products (
    ProductID INT,
    ProductName VARCHAR(255),
    Rating DECIMAL(3, 2)
);
```

Let's assume the `Products` table has the following data:

| ProductID | ProductName | Rating |
|-----------|-------------|--------|
| 1         | Laptop      | 4.5    |
| 2         | Smartphone  | 4.7    |
| 3         | Headphones  | 4.6    |

Next, we'll create a `target` table named `Promotions` where we want to insert products with a rating of 4.5 or higher for a special discount campaign:

## create Promotions table without any values! it should be empty!(not always just for our purpose :) ) 
```sql
CREATE TABLE Promotions (
    ProductID INT,
    ProductName VARCHAR(255)
);
```

Now, we'll use the `INSERT INTO SELECT` statement to insert the `ProductID` and `ProductName` from the `Products` table into the `Promotions` table for products with a rating of 4.5 or higher:

```sql
INSERT INTO Promotions (ProductID, ProductName)
SELECT ProductID, ProductName
FROM Products
WHERE Rating >= 4.5;
```

After executing this query, the `Promotions` table will contain the following data:

| ProductID | ProductName |
|-----------|-------------|
| 1         | Laptop      |
| 2         | Smartphone  |
| 3         | Headphones  |

This is a practical example of how the `INSERT INTO SELECT` statement can be used in the real world to manage promotions based on product ratings in an e-commerce scenario.
BDG WIN: A Gateway to Money-Making Games
Tags: onlinegames, games
Published: 2024-04-15 10:50:05

In the digital age, gaming has evolved beyond mere entertainment into a lucrative avenue for earning money. One such platform that has garnered attention is BDG WIN, an online gaming portal where players can engage in skill-based games and competitions to win real money prizes.

[BDG WIN](https://bdgwin.win/) stands out in the crowded field of gaming platforms by offering a diverse array of games that blend entertainment with the thrill of potential earnings. From classic card games like Poker and Rummy to strategy-based contests and even esports tournaments, BDG WIN caters to a broad spectrum of gaming preferences.

What makes BDG WIN particularly appealing is its commitment to fair play and transparency. The platform ensures that all games are skill-based, which means that players' success is determined by their expertise rather than chance. This level playing field creates an environment where skillful gamers can truly shine and earn rewards for their abilities.

For those new to the concept of earning money through gaming, BDG WIN provides a user-friendly interface and comprehensive tutorials to get players started. The platform's emphasis on user experience extends to its customer support, ensuring that players can resolve any queries promptly.

Participating in games on BDG WIN involves both excitement and responsibility. While the potential for earning money adds an extra layer of thrill, players are encouraged to approach gaming with moderation and discipline. BDG WIN promotes responsible gaming practices to ensure that users can enjoy themselves without compromising other aspects of their lives.

In addition to individual games, BDG WIN often hosts tournaments and events that attract a large community of players. These gatherings not only offer substantial prize pools but also foster a sense of camaraderie among participants, turning gaming into a social and rewarding experience.

As the popularity of online gaming continues to rise, platforms like BDG WIN exemplify the evolving landscape of digital entertainment. By combining skill-based challenges with the allure of financial rewards, BDG WIN has carved out a niche for itself in the realm of money-making games. Whether you're a seasoned gamer looking to monetize your skills or a newcomer intrigued by the possibilities, BDG WIN presents an exciting opportunity to explore the intersection of gaming and earning. So, dive in, sharpen your strategy 
Other Games [BDG WINS](https://bdgwins.com/
)  [TIRANGA](https://tirangagames.game/
)  [TC LOTTERY](https://tc-lottery.world/
)
Flower preservation India
Published: 2024-04-15 10:36:51

One of the finest and most well-liked flower preservation services in India is offered by **[flower preservation India](https://flowerpreservationindia.com/)**. We are able to help you with selecting the best way of preserving flowers for memorial flowers, bridal bouquets, or unique gifts. The best features of both traditional approaches and state-of-the-art preservation technology are incorporated in our procedures and services. It's the ideal option whether you want to preserve a beautiful  roses or a marigold that is in flower. Using our flower preserving method, you can also keep your memories live indefinitely while enjoying every subtlety of each flower. Find out today how to preserve flowers in India.
The Role of SMEP BIM Modeling Services in Building Sustainable Cities
Tags: design, architecture
Published: 2024-04-15 10:34:45

As cities continue to grow, the imperative for sustainable urban development intensifies. This development paradigm seeks not just to accommodate urban expansion but to do so in a way that is sustainable, resilient, and beneficial for all. Central to this mission are Structural and Mechanical, Electrical, and Plumbing (MEP) **[BIM Modeling Services](https://theaecassociates.com/cad-bim-services-aec-industry/)**, which play a crucial role in shaping the built environment's sustainability profile.


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

At the heart of sustainable urban development lies the selection of eco-friendly materials and practices. Structural services focus on utilizing materials that are not only durable and resilient but also have a low environmental impact. Similarly, MEP systems are designed with sustainability in mind, employing energy-efficient solutions, water-saving plumbing, and HVAC systems that minimize energy consumption and reduce greenhouse gas emissions.

Urban development projects across the globe serve as testaments to the successful integration of structural and **[MEP services](https://theaecassociates.com/articles/revolutionizing-educational-spaces-the-role-of-mepfp-design-documentation-services-in-creating-modern-learning-environments/)** for sustainability. From the use of green roofs and solar panels to the implementation of rainwater harvesting and greywater recycling systems, these projects showcase how innovative engineering can support sustainable urban living.

Looking ahead, the future of urban landscapes will increasingly depend on the evolution of structural and MEP services. The integration of smart technologies and the Internet of Things (IoT) within these services promises to further enhance sustainability. Smart buildings that can manage their energy use more efficiently, adaptive lighting systems, and automated waste management are just the beginning.

In conclusion, the role of structural and **[ASMEP services](https://theaecassociates.com/mep-bim-modeling-services/)** in sustainable urban development is both foundational and transformative. As we move towards a future where sustainability is non-negotiable, the continuous innovation and integration of these services will be paramount in shaping resilient and sustainable urban environments.