teleren/devto huggingface dataset:
How to get file path from clipboard in ElectronJS
Tags: javascript, electronjs, clipboard, xclippy
Published: 2022-09-26 09:53:27

To get file path of a file which you have copied on the your computer through ElectronJS depends on the operating system run the Electron application on.
In this article, I work on two popular operating system MacOs  and Windows

On MacOS:

```javascript
const filePath = clipboard.read('public.file-url').replace('file://', '');
```
On Windows:

```javascript
const rawFilePath = clipboard.read('FileNameW');
const filePath = rawFilePath.replace(new RegExp(String.fromCharCode(0), 'g'), '');
```

```javascript
import { clipboard } from "electron";
export const getFilePathFromClipboard = () => {
  let filePath = "";
  if (process.platform === "darwin") {
    filePath = clipboard.read("public.file-url").replace("file://", "");
  }

  if (process.platform === "win32") {
    filePath = clipboard
      .read("FileNameW")
      .replace(new RegExp(String.fromCharCode(0), "g"), "");
  }

  return filePath;
};
```

I used above code for my love app [Xclippy] (https://xclippy.com)

#xclippy #osbkca
Interviews Recap - Talking about DevRel, Dev Edu, 3D, Nuxt, and more!
Tags: devrel, tutorial, beginners, vue
Published: 2022-09-26 09:16:55

I recently interviewed several people from the Vue.js community that I really enjoy talking to. We covered several topics like DevRel, Developer Education, 3D graphics, Nuxt.js, Helping communities and many more. Below, I am listing all of them so that you can check them out and learn about my friends and what they do everyday :)

I definitely recommend you to check them out as people here achieved a lot in their career and they love to share what they have learned along their path to become developers, content creators, leaders, etc. 

Let me know in the comments, who you would like me to interview next ;)

## DevRel with Alba Silvente

{% youtube OOPAbjzG09c %}

## DevRel with Chuck Meyer

{% youtube 9qzLye_gF7Y %}

## Developer Education with Daniel Kelly

{% youtube D-9cahz12ug %}

## 3D and Nuxt with Alvaro Saburido

{% youtube goVnvjI1j9A %}

## Helping Dev communities with Konstantin Bifert

{% youtube nEkCjsp2g8o %}
Seletores
Tags: css, id, class, tag
Published: 2022-09-26 09:12:21

No CSS os seletores organizam a página e dependendo da escolha facilita a manutenção. São usados para padronizar elementos estilizando de características semelhantes. Neste post abordo quatro tipos.

## Id
Este seletor considera o valor do Id. Por padrão, deve ser único por página. Navegadores "consideram" a multiplicidade de Id em uma página, mas se por exemplo for implementar javascript, com a função `getElementById()` o resultado é ineficaz.

- Sintaxe: #id
- Único por página
- Não reutilizável
- Rígidos

## Tag
Também conhecido como seletor de tipo. Quando aplicado, todas as suas instâncias terão o mesmo comportamento. Um bom uso para a regra é usá-la na técnica de reset.
O reset "limpa" as configurações preestabelecidas dos navegadores. Dessa forma, evita conflitos, suaviza as diferenças e alinha o estilo nos browsers.

- Sintaxe: tag {propriedade : valor}
- Associado ao objeto identificável do HTML;
- Sem limitações por página;

## Class
Confere melhor visualização e manutenção do código. Pode ser usado em tags diferentes para apresentar os mesmos efeitos. Os componentes não ficam limitados as tags e sim a `class`.

- Sintaxe: .class {propriedade : valor}
- Mais usado
- Facilita a manutenção
- Sem limitações por página
- Reutilizável

## * 
Seletor universal. Quando aplicado, todos os elementos da página terão o mesmo efeito. Muito usado em testes e não recomendado por deixar a página pesada. Pode ser usado como um seletor filho.
What are your Favorite Authors, on Which Topics, and Why?
Tags: discuss, writing, watercooler, gratitude
Published: 2022-09-26 09:09:10

I think the title says it all? 
I am thinking mainly about authors writing on DEV.to but feel free to mention your favorite writers outside.

This is a DEV Discuss thread — it can be as open-ended as we want. 😅

---

You an use this syntax for making easier for us to follow said author.

```
I really like reading @aspittel 
on topics such as #aws #beginners #career #learning  #writing
because <here goes something you are grateful for>

To follow:
{% user aspittel %}
```

 _In fact, I am excluding the [extraordinary writer Ali Splittel](https://dev.to/aspittel) from the competition because she wrote so many great articles on so many subjects that she would trust half of the answers, assuming we live in a fair world. I guess that's my way to say that she is **my** favorite author here._
990. Satisfiability of Equality Equations
Tags: algorithms
Published: 2022-09-26 08:54:05

# Description

You are given an array of strings `equations` that represent relationships between variables where each string `equations[i]` is of length `4` and takes one of two different forms: `"xi==yi"` or `"xi!=yi"`.Here, `xi` and `yi` are lowercase letters (not necessarily different) that represent one-letter variable names.

Return `true` *if it is possible to assign integers to variable names so as to satisfy all the given equations, or* `false` *otherwise*.

## Example 1:

```
Input: equations = ["a==b","b!=a"]
Output: false
Explanation: If we assign say, a = 1 and b = 1, then the first equation is satisfied, but not the second.
There is no way to assign the variables to satisfy both equations.
```

## Example 2:

```
Input: equations = ["b==a","a==b"]
Output: true
Explanation: We could assign a = 1 and b = 1 to satisfy both equations.
```

## Constraints:

- `1 <= equations.length <= 500`
- `equations[i].length == 4`
- `equations[i][0]` is a lowercase letter.
- `equations[i][1]` is either `'='` or `'!'`.
- `equations[i][2]` is `'='`.
- `equations[i][3]` is a lowercase letter.

---

# Solutions

## Solution 1

### Intuition

### Code

```cpp
class Solution {
private:
    int p[26];

    int find(int x) {
        if (p[x] != x) p[x] = find(p[x]);
        return p[x];
    }
public:
    bool equationsPossible(vector<string>& equations) {
        for (int i = 0; i < 26; i++) {
            p[i] = i;
        }
        for (string& equation : equations) {
            int a = equation[0] - 'a', b = equation[3] - 'a';
            if (equation[1] == '=') {
                p[find(a)] = find(b);
            }
        }

        for (string& equation : equations) {
            int a = equation[0] - 'a', b = equation[3] - 'a';
            if (equation[1] == '!' && find(a) == find(b)) {
                return false;
            }
        }
        return true;

    }
};
```

### Complexity

- Time: O(n)
- Space: O(1)
How does the Android Image Loading library work internally?
Tags: android
Published: 2022-09-26 08:53:47

---
title: How does the Android Image Loading library work internally?
published: true
description: How does the Android Image Loading library work internally?
tags: android
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iv0mxojivszj5w1vn81a.png
canonical_url: https://medium.com/@amitshekhar/how-does-the-android-image-loading-library-work-internally-82f9252cbfd9
---

For Android Developers, I believe this is important to learn about the internal working of libraries we use in our Android project. When we go through the source code to learn about the implementation, we get to know so many new concepts, which help us in other parts of our development work as well.

These concepts are also important when it comes to Android Interviews.

So, I highly recommend reading the source code of Android libraries.

So, I was reading the source code of various Image Loading libraries in Android like Glide, Fresco, etc.

These libraries do a lot of things internally for us so that we can just use them and get our tasks done easily. They make our life easier.

On the basis of my learnings, I have written a series of articles on “How does the Android Image Loading library work internally?”. I will list down all the articles here so that you can go through them and learn how the Android Image Loading library works internally.

### [How does the Android Image Loading library use the bitmap pool for responsive UI?](https://amitshekhar.me/blog/android-image-loading-library-use-bitmap-pool-for-responsive-ui)

In this blog, we are going to learn how the Android Image Loading library uses the bitmap pool to make the UI responsive.

We will learn about bitmap pooling.

### [How does the Android Image Loading library solve the slow loading issue?](https://amitshekhar.me/blog/android-image-loading-library-solve-the-slow-loading-issue)

In this blog, we are going to learn how the Android Image Loading library solves the slow loading issue of images.

Loading images fast is very important for a better user experience. We must learn how it is done under the hood.

### [How does the Android Image Loading library optimize memory usage?](https://amitshekhar.me/blog/android-image-loading-library-optimize-memory-usage)

In this blog, we are going to learn how the Android Image Loading library optimizes memory usage.

The out-of-memory issue is the biggest nightmare that is attached to the life of all Android developers. As Android developers, we must have faced OutOfMemoryError(OOM Error). How do these libraries solve this OOM Error?

We will learn these things.

That’s it for now.

Thanks

[Amit Shekhar](https://amitshekhar.me)
what is Amazon Relational Database Service (RDS) databases?
Published: 2022-09-26 07:51:32


Relational database management systems (RDBMSs) are a core component of many web applications, providing a structured way to store, organize, and access data. Amazon Relational Database Service (Amazon RDS) makes it easy to set up, operate, and scale a relational database in the cloud. Amazon RDS provides you with six familiar database engines to choose from, including Amazon Aurora, MySQL, MariaDB, Oracle, Microsoft SQL Server, and PostgreSQL.

With Amazon RDS, you can deploy scalable relational databases in minutes with cost-efficient and resizable hardware capacity. Amazon RDS automates time-consuming administration tasks such as hardware provisioning, database setup, patching, and backups. Amazon RDS provides you with a choice of database instance types and storage options to fit the performance and cost requirements of your applications. Amazon RDS is available on Amazon Elastic Compute Cloud (Amazon EC2) and Amazon Elastic Block Store (Amazon EBS).

Amazon Aurora is a MySQL-compatible relational database engine that combines the speed and availability of high-end commercial databases with the simplicity and cost-effectiveness of open source databases.

MySQL is a fast, reliable, and secure relational database that is trusted by businesses of all sizes around the world.

MariaDB is a community-developed fork of MySQL that is fast, reliable, and secure.

Oracle Database is the world's most popular relational database and is trusted by businesses of all sizes around the world.

Microsoft SQL Server is a relational database management system (RDBMS) from Microsoft.

PostgreSQL is a powerful, open source object-relational database system with an emphasis on extensibility and standards compliance.
Industrial Automation Projects For Students
Tags: javascript, webdev, beginners, programming
Published: 2022-09-26 07:32:04

Takeoff Edu Group provides the most creative conceptions and ideas that can make very effective final year projects for scholars, experimenters, and engineers. So browse through our list of [industrial automation projects for students](https://takeoffprojects.com/industrial-automation-projects-for-students) and choose the smart final year projects for your requirements. 
 
Automation may be a technology through which a procedure is executed with minimum human involvement. It helps to mix multiple actions into one and carry it out at the same time. Automation is critical and advanced technologies associated with it are being adopted by several corporations. 

Automation is one in all the newest trending technologies in several fields particularly in industries like producing, management systems, mining, etc. therefore doing smart automation based mostly final year projects will really assist you showcase valuable sensible skills.

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

Automation is important and advanced technologies associated with it are being custom-made by several corporations. Automation is one among the most recent trending technologies in several fields particularly in industries like producing, management systems, mining, etc. the businesses that may adapt, initiate and utilize international resources can generate important growth and success. Automation can shortly become a necessity for these industries.

Engineering student projects for B.Tech and M.Tech final year students. Takeoff Edu Group offers a wide range of projects best for [industrial automation projects for students](https://www.youtube.com/watch?v=LHNpZtr1TJ0) looking for magnificent final projects at low cost. 

Few of the projects titles for industrial automation projects for students:
- [Technological advances in LPG sector](https://takeoffprojects.com/project-details/technological-advances-in-lpg-sector--10686)
- [Automatic Gas Cylinder Booking Over Iot](https://takeoffprojects.com/project-details/automatic-gas-cylinder-booking-over-iot--2827)
- [Object Sorting Automated System Using Raspberry Pi](https://takeoffprojects.com/project-details/object-sorting-automated-system-using-raspberry-pi--6079)
- [Rfid Based Secure Smart School Bus System Using Raspberry Pi](https://takeoffprojects.com/project-details/rfid-based-secure-smart-school-bus-system-using-raspberry-pi--6706)
- [Iot Based Indoor Air Pollution Monitoring Using Arduino](https://takeoffprojects.com/project-details/iot-based-indoor-air-pollution-monitoring-using-arduino--6736)
The Core Traits to Look in for a Digital Marketing Agency
Tags: digital, webdev
Published: 2022-09-26 07:30:13

Digital marketing is shaping the business world with its agile methodologies and strategies. For an effective online presence, a brand or a business needs a digital marketing agency that offers services that align with the objectives of the brand or business to achieve its goals. 

While looking for a digital marketing agency, the following qualities have to be considered to ensure the proper investment of time and budget. 

Team of Professionals: 

An agency that hosts multidisciplinary specialists for planning, creating, and executing digital marketing services like content marketing, social media marketing, web development, Search Engine Optimization (SEO), website branding & design, mobile application development, and paid advertising with industry experience can be given the topmost priority.


An agile digital marketing agency with experts is always ahead of trends in digital marketing besides keeping the clients informed about the latest trends on the market.

Transparency among the team and clientele: 

Transparency is one of the key factors that an individual or a business has to look for in a digital marketing agency, Transparent communication among the team and the clientele helps in generating efficient business results either from scratch or mid-way. 

Flexible and Adaptive Culture: 

The world of digital marketing constantly changes with new trends and algorithms. Thereby, a digital marketing agency needs to have a flexible and adaptive culture that meets the needs of the client. 


Offering more than just advertising: 

Businesses and brands that engage with digital marketing agencies for generating leads and promoting business expect more than just buying, selling, and advertising. Agencies should possess marketing assets that add value to the business and audience as well. 

Industry Experience: 

A good amount of experience in specific industries enables digital marketing agencies to thrive in the market for a long time. This helps agencies to evolve more besides helping businesses to reach their marketing goals. 

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

Considering the above-mentioned factors can help one in finding a digital marketing company that can serve right for the business needs. It is also important to verify the agency with reviews and feedback before partnering. 

We, at Pixel Studios, focus on creating a profitable and beneficial digital space for our customers with the aid of digital marketing experts and the latest technologies. We infuse life into your brand such that it evokes emotion in the target audience.

Feel free to reach out to us. https://www.pixel-studios.com/
An E-commerce API
Tags: webdev, python, django, showdev
Published: 2022-09-26 06:48:30

One of my most recent projects is an E-commerce API that has helped me solidify more advanced concepts in Django and Django Rest Framework. I learned to work in a `dockerized` environment and use `Nginx`, `Gunicorn` ... inside `Docker` to make my application production ready.

## Basic Functionalities

- Registration using either [phone number or email](https://dev.to/earthcomfy/drf-boilerplate-for-user-registration-and-auth-using-phone-number-andor-email-3iie)
- Basic E-commerce features.
- Payment integration using Stripe.
- Caching using a Redis backend.
- Sending emails asynchronously using Celery and Redis as a message broker.
- Custom permissions set for necessary endpoints.
- Documentation using DRF Spectacular
- Dockerized for local development and production

## Technologies Used
- Django Rest Framework
- PostgreSQL
- Celery
- Redis
- Nginx
- Docker
- Stripe

This project makes use of:
- Viewsets
- Custom permissions
- Nested serializers and so on. If you would like to strengthen your skills, I highly recommend you to [check it out](https://github.com/earthcomfy/django-ecommerce-api)

I used Docker for local development and it has been so great! And then, with some adjustments, the application is production ready.

Tip: you can export your database schema to a `SQL` file using the command below:

```bash
docker exec -i [container_id] pg_dump -U [postgres_user]  --schema-only [database_name] > [target_path]
```
And then use this tool https://dbdiagram.io/ to generate ER diagram while playing around with the SQL code.

![ER Diagram](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hxt25z7rp2qahoiplvpo.png)

Link to GitHub repo: https://github.com/earthcomfy/django-ecommerce-api

I welcome any suggestion. Follow me to get upcoming tutorials.
Reasons why Java is still the best programming language
Tags: jozefbehr, java, programming
Published: 2022-09-26 06:34:58

A new version of Java with long-term support is just around the corner. As per Jozef Behr Java passes the 25 year mark, let's take a step back and look at some of the reasons why Java remains the best programming language for modern software development.


**The rich set of Java APIs**

The Java API is extensive. The standard JDK comes with over 200 built-in packages containing Java APIs that allow everything from parsing XML to translating between time zones. When developers add the Jakarta EE APIs, they have an even more extensive API library that enables the development of complex mid-tier applications and cloud-native microservices.

**First Order Android Support**

Android is the most popular mobile phone operating system in the world and Java is the de facto programming language for Android application development.

While the Android version of Java isn't exactly the same as what you'd find in the JDK, Google copied over 11,500 lines of code from the Java Standard Edition when they created their Java clone says Jozef Behr. As a result, developers can expect the version of Java they see on Android to be fairly close to the original.


**Forward evolution with backwards compatibility**

Java evolves slowly, but it does evolve. With over 25 years of evolution, Java has many evolutionary improvements to be proud of.

From the bulletproof modularity system that was delivered as part of the Jigsaw Project, to the recently added ability to functionally program in Java with lambda functions, Java continues to implement big changes demanded by the community.
Medusa using services in subscribers
Tags: javascript, webdev, beginners
Published: 2022-09-26 06:19:54

We first looked at [custom subscribers for medusa](https://daily-dev-tips.com/posts/creating-a-subscriber-in-medusa/).
And before that, we created our first [custom service](https://daily-dev-tips.com/posts/using-existing-services-in-a-custom-medusa-service/).

Let's look at how we can combine the two for maximum flexibility.

> Note: If you haven't read the above-linked articles, please read those first.

## Adding a custom service to the subscriber

The process here will be very similar to injecting services, but how we do it is slightly different.

Open up your subscriber file and start by declaring the service you want to inject.

```js
class ProductNotifierSubscriber {
    translateService;

    constructor({ translateService, eventBusService }) {
        this.translateService = translateService;
        eventBusService.subscribe("product.created", this.handleProduct);
    }
}
```

As you can see, we declare the `translateService` our custom service. Then inside the constructor, we assign it to the variable, gaining access to it in this file.

To use it, we can do the following:

```js
handleProduct = async (data) => {
    this.translateService.translateProduct(data.id).then((title) => {
        console.log("New product title: " + title)
    })
};
```

And that's precisely how we can attach our custom service to fire off inside the subscriber.

![Product notifier in medusa](https://cdn.hashnode.com/res/hashnode/image/upload/v1663307768749/T38aua4tQ.png)

There is no limit to how many services you can inject, but be aware they might bloat your subscribers.

### 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)