teleren/devto huggingface dataset:
Desktop apps with Django without Electronjs
Tags: django, python3, gui, electron
Published: 2021-03-23 08:58:55

---
title: Desktop apps with Django without Electronjs
published: true
description:  
tags: django, python3, gui, electron
---

Not only JS folks can reuse web tehnologies for desktop applications we can do it too. If you want to create a nice gui and you want to reuse your web tech knowledge try [flaskwebgui](https://github.com/ClimenteA/flaskwebgui).


First, install it:
```bash
pip install flaskwebgui
```
Next to `manage.py` file create a `gui.py` file where you need to import `application` from project's `wsgi.py` file.

```bash
├── project_name
│   ├── asgi.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── gui.py # this 
├── manage.py
```


```py
#gui.py

from flaskwebgui import FlaskUI
from project_name.wsgi import application

FlaskUI(application).run()

```
Next start the application with:
```py
python gui.py  
```
Django will be served by `waitress`.  


Also, you can use any frontend framework you like + any python web framework you like, just pass a function which starts the server to `start_server` parameter.
Your website does not need cookies
Tags: webdev, ux, analytics
Published: 2021-03-23 08:23:05

## GDPR and respect

The regulation in EU law on data protection and privacy called »General Data Protection Regulation [GDPR](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation)« is generally a good thing, but unfortunately it makes browsing the web way worse.

Instead of respecting the users privacy I see a lot of websites and web applications which display annoying cookie overlays, force the user accept incomprehensible privacy disclaimers, slow everything down by loading a ton of unneeded JavaScript and still integrate third party tracking software.

Let's face it: we failed. Thanks to GDPR the user is disrespected even more by most of the websites out there.

## The obvious solution

Of course there is another way. Your website does not need cookies. Recently we removed all of the cookies on [our website](https://www.visuellverstehen.de) and you can do it too. It is not so difficult.
* Remove all third party tracking software.
* If you need website analytics, use a privacy friendly alternative (e. g. [Plausible](https://plausible.io)).
* Do not blindly  install fancy marketing plugins from a marketplace. Instead understand how a website works and build things yourself.
* Do not use similar techniques as an alternative. By cookies I mean all kind of stored client data. Using local storage instead of cookies will not help you.

I do not really see a good reason to use cookies except for storing user sessions to enable authentication. If you need this functionality, please explain it to the user in your login and register forms.

By the way, I am neither the first nor the only one talking about this (e. g. [GitHub](https://github.blog/2020-12-17-no-cookie-for-you/)).

## Not convinced yet?

There is a nice [little game](https://cookieconsentspeed.run) out there which will help you understand.
What Is CMS Web Development?
Tags: cms, web, development
Published: 2021-03-23 08:20:01

**What Is CMS Web Development?**

CMS is a software which allows you to manage the content. The software helps to make typical sites from blocks, like a constructor. You can order CMS website development services in JoinSoft.
 Conventionally, the CMS can be divided into several parts:
- database storage, which contains information about users, site content and other important entities;
- repository of interface elements with which the user directly interacts when viewing the site;
- a visual editor that makes it easy to create pages.
In addition, many modules allow you to add various additional features to the site.

**What are CMS web development services for?**
 
Modern CMS are used almost everywhere. After you contact the CMS website development company, you will be able to:
- to fill the site with content, change and administer the resource without being an IT-specialist and without serious programming skills;
- create new pages in a short time without extra cost;
- to optimize the appearance of the site and improve the quality of its content;
- reduction of time spent on the development of the website, no need to focus only on technical problems.

**How To Order CMS Website Development Services?**

- At the end of the page click on [Contact us](https://Joinsoft.com/services/CMS-based-development/).
- Fill out the form and expect a connection from a [JoinSoft specialist](https://Joinsoft.com/services/CMS-based-development/).

**What Do You Get After Work With JoinSoft CMS Web Development Company?**

1. An effective tool for solving specific problems.
2. The ability to change any information on the site yourself.
3. Constant testing of the web resource by users, so you can quickly deal with detected bugs and vulnerabilities.
4. Signing the NDA and transferring all intellectual property rights upon completion. 
5. Testing - checking the program for compliance with all the requirements for it. 
6. An individual approach to solving the problem.
7. Full control of the project.
8. Active communication - instant answers to inquiries and technical support even after the completion of the project.
9. Guaranteed security of the customer's property.
Let's talk about Views
Tags: sql, database, orm
Published: 2021-03-23 08:18:40

SQL Views are a very powerful tool, that is sometimes overlooked. With all these ORM frameworks, Spring Data, etc... we sometimes forget that the most powerful solution is using SQL. 

In this short article, I will go over the advantages and disadvantages of using views. The decision to use them is up to you. 

## Why yes? 

### Business rules

Do you have a business logic (only show articles after their release date) that you are writing to most of the queries you use to interact with that business part? By placing these business rules into a VIEW you can be sure about a unified portrayal of the data. By doing this you will have fewer issues with this logic in the long term. Also when the logic changes you have just one place to change it.

### Complex query logic

Had you ever wrote a Hibernate query so long and complicated you got lost reading it after few minutes? Simplify your queries by hiding the complicated logic behind the view definitions. SQL is the best choice of language for more specific use cases, your ORM of choice will not be able to handle more complex stuff like WINDOW functions, etc... Also, code maintenance will be much more simple, as you will be doing just the most CRUD operations.

### Consitency

Have you ever changes the table structure in your database resulting in a long refactoring session, fixing all the queries referencing those tables? A view can act as an interface for your tables. When you change the tables, chances are you can just modify the view definitions to result in the same view. 

### Security

Have you ever needed to restrict access to some data in the table (like the user's personal data)? Or provide access to another team, not wanting them to have full access? With views you can have the table restricted, have they allowed data in the view and that be shared, provided to your team, etc...

## Why no? 

### Query performance

It's easy to forget that there can be a very complex logic behind the view and that query needs to run every time you hit the view. 

Some DB engines will allow you to create indexes over a view, or create something called materialized view (data from the query is stored in a table, that is refreshed based on some rules).

### Data modifications

Not all views support data modifications. Only the most simple ones, must have a primary key and all the fields. When you have joins and multi tables structures you are out of luck. 

You can still use the tables for data modification and views to query logic. 

### Portability

Views are part of your DB engine. They are written in the specific flavor of your DB engine of choice. If you need to support multiple engines maybe it's not exactly for you. Otherwise, I would go for it, switching engine once per 10 years is no excuse to use this awesome feature. 

...

To get more stuff like this you can follow me on [Twitter](https://twitter.com/pavel_polivka).
My portfolio JAM Stack website using vue.js, gridsome and tailwind
Tags: vue, tailwindcss, javascript, webdev
Published: 2021-03-23 08:12:28

Hey 👋
I've been working on my portfolio jamstack website and thought I'd share: https://garpunkal.dev. 

It uses Vue.Js with Gridsome, TailwindCSS and SquidexCMS. 

- Vue.JS
- Gridsome
- Tailwind
- SquidexCMS
- Vercel hosting and CD.
- JamStack

SquidexCMS is connected to the website through API's in Gridsome server config. I then use GraphQL to display the data from Squidex within the site. 

I use Vercel as a Node server to rebuild my site every-time the repo changes or a build hook is used from Squidex. 

Vercel then builds the static solution with either the repo change or the Squidex update. 

All my code is open sourced to help others: https://github.com/garpunkal/garpunkal.dev

I'd love feedback and any comments!  

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/siob1kg3dag6ixtnqv5s.png)
 

Thanks, 
Gareth
Build A Password Generator with React JS - react-toastify - Beginners Tutorial
Tags: javascript, react, beginners, tutorial
Published: 2021-03-23 08:06:51

{% youtube YpTmcCBBdTE %}

I have also added react toastify notifications in this project.

Build Password Generator using React JS. In this Video we will be building a password generator using React JS. It will be able to generate a strong password by generating a random sequence of uppercase letters , lowercase letters, numbers and special Characters.

Hope You Guys Enjoyed the Video. Like Share Comment and Subscribe to my channel for more videos like these.

Code:
https://github.com/somanath-goudar/react-password-generator

Working Demo:
https://react-password-gen.netlify.app/

**You may also like my other posts:**

{% link https://dev.to/somanathgoudar/build-a-youtube-clone-with-just-html-css-for-complete-beginners-4fk1 %}
First Website using HTML and CSS
Tags: webdev, html, frontend, css
Published: 2021-03-23 07:58:29

Here I have created my first Website named "Pixels" using HTML and CSS and I want to Upgrade this Website and want to make it Amazing. Can u Check it once and Give Me feedback What Changes should i make and How is it ?. Thank You 

Website's  Github Respository link = https://github.com/nikhil051102/PixelsWebsite
How to Make a Div Cover the Whole Page with CSS
Tags: todayilearned, beginners, css
Published: 2021-03-23 07:39:42

## Brief Background
I am currently taking the [Intro to webdev course](https://frontendmasters.com/courses/web-development-v2) on [FrontendMasters](https://frontendmasters.com/). My task is to rebuild the iOS calculator in HTML, CSS and JS as described in the [open-sourced notes](https://btholt.github.io/intro-to-web-dev-v2/js-project) for the course.

I came up with a UI sketch that had my calculator centred on the page like so:
![calculator UI sketch](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s5y39chtbjldwthz8hjq.jpg)

But when I tried it out, I got this:
![buggy calculator container](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/81bfcjjdrwlup9ax4uu8.jpeg)

My code:
```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="./styles.css" />
    <title>JS Calculator</title>
  </head>
  <body>
    <div class="container">
      <div class="calculator"></div>
    </div>
  </body>
</html>
```
```css
* {
  box-sizing: border-box;
}

body {
  background-color: #7fffd4;
  border: solid black;
}

.container {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.calculator {
  border: solid red;
  height: 600px;
  width: 400px;
}
```
This was not what I expected.
The `container` div did not occupy 100% of the page even after assigning it `width: 100%; height: 100% `. I found this behaviour weird. I then searched dear ol' Google to find out why...

## The solution

It turns out there are a few things you need to know to make this work as expected. Lenmor did a great job of taking me through it below:

[CSS gotcha: How to fill page with a div?](https://dev.to/lennythedev/css-gotcha-how-to-fill-page-with-a-div-270j)
Magento 2 Configurable products slow.  Fix Magento performance issue  
Published: 2021-03-23 07:37:56

Magento 2 configurable products are just containers for simple products (variations). You can no longer configure pricing data directly in the configurable product as the parent configurable inherits all its unit, tier price, and inventory data from the child simple products. So on the configurable product page, Magento loads all the configurations as a simple product. Even a single Magento Product model is slow 300ms to load, what to tell about several products on the same page... The complexity of the configurable products is just terrible. Product with 5 color and 5 sizes it is 5 * 5 + 1 separate SKUs. 

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

# Magento 2 Configurable Products are slow to Load!

One of the biggest issues of the Magento 2  is the configurable products. Even Small configurable products can be slow to load in the frontend. I worked on a store with a product that is available in over 50 colors and 10 sizes. This resulted in a configurable product with over 500 child products. Due to Magento 2, Architectural issues products can lead to very slow and takes several minutes to load. 

In the frontend, Magento 2 loads all variations in a giant JSON object and renders that into the DOM using the legacy Knockout JS library and Jquery. This JSON object is 1 megabyte for 1000 variations. In the backend, this JSON is also built and passed to a UI component wrapped in XML. Purely written Magento 2 Core PHP code is not able to append extremely large XML structures to an existing XML structure.

Even with 1000 variations page load time for an uncached configurable product was in excess of 60 seconds.

If you are having traffic on your site configurable products will just kill your MySQL database 

# Fix Magento Configurable Product Performance issue:

Unfortunately, this issue can't be fixed because even simple product is slow in the M2. It is just a waste of money and time to fix a jank car.
Delete multiple MySQL database server on local Mac
Tags: dbdb, database, mysql
Published: 2021-03-23 07:34:18

---
title: Delete multiple MySQL database server on local Mac
published: true
description: Delete multiple MySQL database server on local Mac
tags: dbdb, database, mysql
series: dbdb
//cover_image: https://direct_url_to_image.jpg
---

# Delete MySQL datadir
- The datadir contains your data.
```bash
cd ~/tmp/path-to-your-dir

# Delete "mysql8-name1"
rm -fr mysql/versions/8.0.23/datadir/mysql8-name1

# Delete "mysql8-name2"
rm -fr mysql/versions/8.0.23/datadir/mysql8-name2

# Delete "mysql5-name3"
rm -fr mysql/versions/5.7.31/datadir/mysql5-name3

# Delete "mysql5-name4"
rm -fr mysql/versions/5.7.31/datadir/mysql5-name4
```

# Delete MySQL basedir(option)
- The basedir contains MySQL programs.
- If you want to delete basedir too, you can do that.
```
...
```
CSS Shapes - The basics
Tags: css
Published: 2021-03-23 07:29:01

When it comes to CSS, we can make cool shapes. They are often used for some web design elements.
But some people love to even make art with them!

We'll start with the basics of some shapes you can make with CSS.
Throughout this series, we'll look at some more advanced shapes and how you can create them.

In todays article:

- [Squares with CSS](#heading-squares-with-css)
- [Rectangles with CSS](#heading-rectangles-with-css)
- [Circles with CSS](#heading-circles-with-css)
- [Ovals with CSS](#heading-ovals-with-css)

## Squares with CSS

Let's start with the shape of all shapes. The square is used for a lot of other shapes.

It's as simple as having an element that has an equal width/height.

```html
<div class="square"></div>
```

```css
.square {
  width: 200px;
  height: 200px;
  background: #3e92cc;
}
```

This will result in a basic square:

![A Square in CSS](https://cdn.hashnode.com/res/hashnode/image/upload/v1616046808417/1qCe7fobO.png)

## Rectangles with CSS

From the square, we can make a rectangle by adjusting the width or height.
Making one of those bigger will give us a rectangle.

```html
<div class="rectangle"></div>
```

```css
.rectangle {
  width: 300px;
  height: 200px;
  background: #3e92cc;
}
```

![Rectangle shape in CSS](https://cdn.hashnode.com/res/hashnode/image/upload/v1616046956955/d1zB1ep8W.png)

## Circles with CSS

Now for one of my favorites, a circle.
It's a versatile element to use for avatars or buttons.

It can be created by using the square but adding a `border-radius` to it.

```html
<div class="circle"></div>
```

```css
.circle {
  width: 200px;
  height: 200px;
  background: #3e92cc;
  border-radius: 50%;
}
```

![Circles in CSS](https://cdn.hashnode.com/res/hashnode/image/upload/v1616047110703/x8GfgTdPtt.png)

## Ovals with CSS

And equally, we can add a border-radius to our rectangle to make oval shapes.

```html
<div class="oval"></div>
```

```css
.oval {
  width: 300px;
  height: 200px;
  background: #3e92cc;
  border-radius: 50%;
}
```

![Ovals in CSS](https://cdn.hashnode.com/res/hashnode/image/upload/v1616047206556/cZORJDLc5.png)

## Demonstration of CSS Shapes

I also made this Codepen for you to play around with, have some fun exploring these basic shapes, and already think about how other shapes will work.

{% codepen https://codepen.io/rebelchris/pen/yLVWrYZ %}

### 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)
Interesting ML Paper
Tags: datascience, machinelearning, python, algorithms
Published: 2021-03-23 07:27:39

Algorithm to predict when AI models for medical image diagnosis will make incorrect predictions.

[https://arxiv.org/abs/2103.09957](https://arxiv.org/abs/2103.09957)

Join [Neural Network](https://www.facebook.com/groups/65666) group on facebook

-Thanks
What is the Difference Between Coursera and Udemy?
Tags: datascience, machinelearning, programming, analytics
Published: 2021-03-23 07:23:19

As a Data Science learner, You may have questions in your mind- Coursera vs Udemy for Data Science?. So if you are confused between Coursera vs Udemy, read this article and decide which platform is better for you to learn Data Science.

Data Science is getting popular day by day. Many companies are adopting data science, especially for marketing purposes. According to the Harvard Business article, The Data Scientist is the **“Sexiest Job of the 21st Century”.** That’s why many people want to learn Data Science. When it comes to learning, the most common and easy way is MOOCs.

MOOCs are **Massive Online Open Courses.** These are the courses available online that provide data science training to a large audience. These online courses are boon for the people who can’t attend universities due to various reasons like location, financial problems, etc.

There are lots of online platforms available that offer a wide range of online courses like **Coursera, Udemy, Udacity, Datacamp, edX, etc.** But the most preferred platforms by the learners are Coursera and Udemy.

Both platforms are great and provide useful resources for learners. Now let’s start with the brief comparison between Coursera vs Udemy.
**[Click to continue reading...](https://www.mltut.com/coursera-vs-udemy-for-data-science/)**
Build Algorithm
Tags: algorithms, codenewbie, webdev
Published: 2021-03-23 07:22:55

Interesting Repo for learning algorithms, important methods and essentials to clear almost 2-3 rounds of your technical interviews. 

This Repo has several common/advanced algorithm implementations in above listed programming languages.

-Python 
-Java
-C/CPP
-Go(GoLang): 
-Javascript(codes mostly in ES6)

[Repo](https://github.com/thealgorithms)

GoLang Fact: 40 times faster the Python. Kubernetes, Docker is completely written in Golang. prime stack for Google Products. it has inbuilt concurrency model. NodeJS is all about libuv(cpp build) which makes NodeJS async and GoLang has this feature inbuilt.
Haskell Development on VoidLinux: A match in heaven and hell
Tags: haskell, linux, voidlinux
Published: 2021-03-23 07:19:45

I'm a huge fan of voidlinux. As it's my daily driver, it taught me to get good at linux and the phenomonal tools within it's ecosytem. 

Let's go through the process at this point in time and see if we can get a working Haskell environment in place.

## Stack as a sandbox: the easy way

If you're a voidlinux advocate, you'll note that this is not what you want. It takes up lot's of space and it's far easier than it should be.

However this will get you going.

### 1. Uninstallation
DO NOT install the following. If you have any of these, uninstall them.
- `ghc`
- `cabal-install`
- `haskell-language-server`

Stack will install a `ghc` and `cabal-install` when you call stack in your project directory. It will find the correct tools based on the `resolver` property in your `stack.yaml` file.

### 2. Installation
DO install the following.
- `stack`
- `ncurses-libtinfo-devel`

`stack` is the tool of choice for managing haskell projects.
`ncurses-libtinfo-devel` provides the file `/lib/libtinfo.so` and related symbolic links. Without it, stack doesn't know what the architecture of your machine is and cannot build GHC.

### 3. haskell-language-server

Install the haskell language server for your IDE. In vscode, it's called `Haskell`.

### 4. Open IDE

Stack should now work flawlessly for all projects.

When a project is opened in your vscode, the `Haskell` extension will download and install the appropriate GHC and Cabal versions.


## Binaries: the hard way

Well you asked for it, binaries built purely for your architecture.

### 1. Installation

Install the following packages from the voidlinux repositories.
- `ghc`
- `stack`
- `cabal-install`
- `haskell-language-server`

If all went well, skip step two because `haskell-language-server` has been added to the list of available packages.

### 2. build haskell-language-server

This is complicated for new users, but for voidlinux veterans this should be very fun indeed.

In summary, you'll process the following instructions:

1. clone void-linux/void-packages from GitHub.
2. pull and rebase the patch from branch `package/haskell-language-server` at https://github.com/waynevanson/void-packages.
3. Build `haskell-language-server` for your machine, which is now available due to the step prior.
4. Install the package post build with `xi` from `xtools`.

### 3. Enjoy!

Stack should now work great in all projects that have can build with `ghc-8.8.4`. If your project does not use this, you'll have to use the easy method instead.


## Conclusion

This is extremely rushed but I hope it helps someone if they're in need of this. I had no one.

Please email me at waynevanson@gmail.com if you require guidance. Hopefully `haskell-language-server` is in the packages by then and this article can be streamlined.