teleren/devto huggingface dataset:
Desktop APPS with Flask an PyWebview
Tags: python, flask
Published: 2024-06-17 09:30:02

Here is a recipe on how to accomplish this :

Create a folder sructure like this one :


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

In the app.py file :

```python

from flask import Flask, render_template
import webview
import sys
import os

base_dir = '.'
if hasattr(sys, '_MEIPASS'):
    base_dir = sys._MEIPASS

def resource_path(relative_path):
    """ Get absolute path to resource, works for dev and for PyInstaller """
    try:
        # PyInstaller creates a temp folder and stores path in _MEIPASS
        base_path = sys._MEIPASS
    except Exception:
        base_path = os.path.abspath(".")

    return os.path.join(base_path, relative_path)

tf = resource_path('templates')
sf = resource_path('static')

app = Flask(__name__, static_folder=sf, template_folder=tf)

@app.route('/')
def home():
    return render_template("index.html")

if __name__ == '__main__':
    webview.create_window('My Flask App', app)
    webview.start()
```

In the main.spec file :

```bash
# -*- mode: python ; coding: utf-8 -*-


a = Analysis(
    ['main.py'],
    pathex=[],
    binaries=[],
    datas=[
        ('static', 'static'),
        ('templates', 'templates'),
    ],
    hiddenimports=[],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    noarchive=False,
    optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.datas,
    [],
    name='main',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    upx_exclude=[],
    runtime_tmpdir=None,
    console=False,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
)
```

And finally, run the following command: 

```bash
pyinstaller main.spec
```

The **exe** is in the dist folder


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mapxq730espusmctbde4.png)
Rik88 – Cổng Game Bài Chiến Thắng Hoàng Gia
Published: 2024-06-17 09:16:36

https://rik88.pw/ Rik88 – Cổng game bài hoàng gia uy tín✔️ với nhiều trò chơi hấp dẫn và đổi thưởng nhanh chóng✔️ Tham gia ngay để trải nghiệm sự khác biệt✔️✔️✔️
0589.777.444
hotro@rik88.pw
25/6/4 Lê Sát, Tân Quý, Tân Phú, Thành phố Hồ Chí Minh, Việt Nam
#rik88 #gamebairik88 #gamebaiuytinrik88 #conggamerik88
https://rik88pw.zohosites.com
https://hashnode.com/@rik88pw
https://hackmd.io/@rik88pw
Deploy a ReactJS App with ViteJS to GitHub Pages using GitHub Actions | Step-by-Step Tutorial
Tags: webdev, react, githubactions, javascript
Published: 2024-06-17 09:14:27

I'm excited to share my latest YouTube tutorial where I walk you through the process of deploying a ReactJS app built with ViteJS to GitHub Pages.

🌐✨ Whether you're a seasoned developer or just getting started, this step-by-step guide will help you get your app live on the web in no time!

🔍 In this video, you'll learn:
- ViteJS Documentation for deployment on GitHub Pages
- Configuring the app for deployment
- Creating a Github Action workflow file
- Deploying the app to GitHub Pages using GitHub Actions

👨‍💻 Why you should watch:
- ViteJS makes development fast and efficient.
- GitHub Pages offers a free and easy way to host your projects.
- You'll gain hands-on experience with modern deployment workflows.

🔗 Watch the full tutorial here:

{%youtube sVeNuOof0jg%}

If you find the video helpful, please give it a thumbs up and share it with your network. Don’t forget to subscribe to my channel for more web development tutorials and tips.

Feel free to drop any questions or feedback in the comments. I'd love to hear from you!

— — — — — — — — — — — — — — — — — — — — — — — — — — -
Blog: www.ghazikhan.in/blog
Twitter: https://twitter.com/codewithghazi
Instagram: https://www.instagram.com/codewithghazi/
LinkedIn: https://www.linkedin.com/in/ghazi-khan/
#WenguiGuo#WashingtonFarm
Tags: webdev, beginners, python
Published: 2024-06-17 07:09:23

  #WenguiGuo#WashingtonFarm
       The Kwok scam only pits the ants
    Guo Wengui touted things to the sky all day long, from farms to Xi Yuan, he declared, "Xi Yuan's encryption capabilities and future payments, as well as the future exchange with the US dollar, will create history, is the only stablecoin, floating, modern crypto financial platform." The ant help to fool the head, but after dozens of broken promises, Guo Wengui played a jump god, Tiandry ground branch, Yin and Yang five elements, Qimen Dun Jiqi battle, over and over again to play with the ant help, and Guo Wengui no sense of violation. The old deception hypohypotically called to make comrade-in-arms rich, claimed to be for the benefit of comrade-in-arms, in fact, it is a wave of investment and anal, tried and true, and now again. After the explosion of the Xicin may not be listed, according to normal people's thinking and reaction, must be very annoyed, sad, but Guo Wengui is unusual, talking and laughing, understatement, no stick, but to the camera hand holding pepper sesame chicken to eat with relish, full mouth flow oil! . Why? Because the fraud is successful, as for when the Joy coin will be listed, when will it be listed? Guo Wengui is a face of ruffian and rogue, hands a spread, claiming that they do not know. Guo Wengui hypocrisy a poke is broken, Guo's scam is just a variation of the method of trapping ants help it.
Implementing Role-Based Access Control (RBAC) In modern web applications
Tags: webdev, javascript, programming, beginners
Published: 2024-06-17 09:14:14

**Enhancing Security in ReactJS:**

Implementing Role-Based Access Control (RBAC)
In modern web applications, ensuring that users have access only to the modules they are permitted to see is crucial for both security and user experience. Here's a simple way to implement RBAC in your ReactJS application:

**Step-by-Step Guide:**

1 . **Define Roles and Permissions**

- Create a configuration file (roles.js).
- Define roles (e.g., admin, user) and their permissions (e.g., dashboard access, settings access).


2 . **Create Authentication Context**

- Create a context (e.g., AuthContext.js).
- Set up a context (AuthContext.js) to manage and provide user authentication state and role information.

3 . **Create a Higher-Order Component (HOC) for Authorization**

- Create a HOC (e.g., withAuthorization.js).
- This HOC will check if the user has the required permission and render the component or show an error message.

4 . **Protect Components with HOC**

- Wrap protected components (e.g., Dashboard.js, Settings.js) with the HOC.
- Pass the required permission to the HOC for each component.

5 . **Wrap the Application with AuthProvider**

- In your main application file (e.g., App.js), wrap the application with the AuthProvider.
- This will ensure the authentication context is available throughout the app.

**_Example:_**

`// roles.js
export const Roles = { ADMIN: 'admin', USER: 'user' };
export const Permissions = { DASHBOARD: 'dashboard', SETTINGS: 'settings' };
export const RolePermissions = { [Roles.ADMIN]: [Permissions.DASHBOARD, Permissions.SETTINGS], [Roles.USER]: [Permissions.DASHBOARD] };`

`// AuthContext.js
import React, { createContext, useContext, useState } from 'react';
const AuthContext = createContext();
export const AuthProvider = ({ children }) => { const [user, setUser] = useState({ role: 'user' }); return (<AuthContext.Provider value={{ user, setUser }}>{children}</AuthContext.Provider>); };
export const useAuth = () => useContext(AuthContext);`

`// withAuthorization.js
import React from 'react'; import { useAuth } from './AuthContext'; import { RolePermissions } from './roles';
const withAuthorization = (WrappedComponent, requiredPermission) => { return (props) => { const { user } = useAuth(); const userPermissions = RolePermissions[user.role]; if (userPermissions.includes(requiredPermission)) { return <WrappedComponent {...props} />; } else { return <div>You do not have permission to view this page.</div>; } }; };
export default withAuthorization;`

`// App.js
import React from 'react'; import { AuthProvider } from './AuthContext'; import Dashboard from './Dashboard'; import Settings from './Settings';
function App() { return (<AuthProvider><div className="App"><Dashboard /><Settings /></div></AuthProvider>); }
export default App;`

you can enhance your application's security by restricting module access based on user roles. By Steps🚀🔒

#Authorization #RBAC  #reactjs  #nextjs  #softwaredevelopment  #javascript  #HOC  #security
MySQL Select Database
Tags: mysql, mariadb, database, tutorial
Published: 2024-06-17 08:56:03

Chances are that you have multiple databases on the MySQL Server instance you're connected to; and when you need to manage several databases at once, you need to make sure you have selected the correct database for the queries you're writing. The following guide will tell you all about selecting MySQL databases to work with. Generally, there are two main ways to get it done. The first one is to use the MySQL Command Line Client; the second one is to try a convenient GUI tool. This article takes a look at both.

Tap the link to learn more about [MySQL Select Database](https://www.devart.com/dbforge/mysql/studio/mysql-select-database.html).
Security Hazards in the Use of startActivityForResult and setResult
Published: 2024-06-17 08:21:09

Android allows applications to communicate between processes through intents, which not only provides convenience for data sharing but also brings many hidden dangers. If developers do not properly dispose of intents transmitted between processes, it may lead to security vulnerabilities such as information leakage, permission escalation, and arbitrary code execution.


This article mainly introduces the security issues that may arise from the transfer of intent between activities, helping developers and security testers to correctly understand such issues. The transfer of intent between activities is mainly achieved through startActivityForeresult and setResult.

Details: [Security Hazards in the Use of startActivityForResult and setResult](https://security.tecno.com/SRC/blogdetail/264?lang=en_US)

Welcome everyone to discuss in the comment!
In Excel, Identify Data Layers Correctly and Convert Them to a Standardized Table
Tags: beginners, programming, tutorial, productivity
Published: 2024-06-17 08:08:06

**Problem description & analysis**:

Data in the column below has three layers: the 1st layer is a string, the 2nd layer is a date, and the 3rd layer contains multiple time values:

```
     A
1	NAME1
2	2024-06-03
3	04:06:12
4	04:09:23
5	08:09:23
6	12:09:23
7	17:02:23
8	2024-06-02
9	04:06:12
10	04:09:23
11	08:09:23
12	NAME2
13	2024-06-03
14	04:06:12
15	04:09:23
16	2024-06-02
17	12:09:23
18	17:02:23
```
We need to identify the three layers of data correctly and convert them to a standardized table:

```
      D	        E	       F
1	NAME1	2024-06-03	04:06:12
2	NAME1	2024-06-03	04:09:23
3	NAME1	2024-06-03	08:09:23
4	NAME1	2024-06-03	12:09:23
5	NAME1	2024-06-03	17:02:23
6	NAME1	2024-06-02	04:06:12
7	NAME1	2024-06-02	04:09:23
8	NAME1	2024-06-02	08:09:23
9	NAME2	2024-06-03	04:06:12
10	NAME2	2024-06-03	04:09:23
11	NAME2	2024-06-02	12:09:23
12	NAME2	2024-06-02	17:02:23
```
**Solution**:

Use **SPL XLL** to type in the following formula:

```
=spl("=E@1(?).(if(ifstring(~):s=~, if(ifdate(E(~))):d=~; [s,d,~])).select(ifa(~))",A1:A18)
```
SPL returns an integer for the date data. You need to format it into an easy-to-read form through Excel’s "format cells" option (or through SPL’s E() function). Use the same way to handle the time data.

As shown in the picture below:

![result table with code entered](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y9nakdxew7cxw9k5u9d2.png)
Explanation:

E()function converts a value to the Excel date/time data; E@1 converts a multilayer sequence to a single-layer one. ~ represents the current member; if() function judges whether it is a string and whether it is a date from left to right and executes the expressions, and then executes the default expression. ifa() judges whether the variable is a sequence.
A* Algorithm in One Byte
Tags: devchallenge, cschallenge, computerscience, beginners
Published: 2024-06-17 08:04:56

*This is a submission for [DEV Computer Science Challenge v24.06.12: One Byte Explainer](https://dev.to/challenges/cs).*

## Explainer

A* is a path finding algorithm, given a weighted graph, source node, goal node, the algorithm finds shortest path from source to goal according to the given weights. It's used in Network Routing, Video Game NPCs, Route Planning 

## Additional Context

Weighted Graph- A Graph whose edges have been assigned numbers(weights)
Activation Functions: The Secret Sauce of Neural Networks
Tags: devchallenge, cschallenge, computerscience, beginners
Published: 2024-06-17 07:49:51

*This is a submission for [DEV Computer Science Challenge v24.06.12: One Byte Explainer](https://dev.to/challenges/cs).*

## Explainer

Think of activation functions as the spice  in neural networks. They add the kick of non-linearity, helping models learn complex patterns. Without them, it's like cooking but without seasoning. ReLU, Sigmoid, and Tanh are the pop-stars!

## Additional Context

<!-- Please share any additional context you think the judges should take into consideration as it relates to your One Byte Explainer. -->

<!-- Team Submissions: Please pick one member to publish the submission and credit teammates by listing their DEV usernames directly in the body of the post. -->
Meme Monday
Tags: cloud, cloudcomputing, microsoft, azure
Published: 2024-06-17 07:43:36

**Wait, So Why Does Microsoft Call Its Cloud "Azure"?**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ycigxtivkatijd2vo47p.png)
[Source](https://cdn-cybersecurity.att.com/blog-content/cloud_joke_15.png)
#WenguiGuo #WashingtonFarm The New China Federation is an illegal organization for which Guo Wengui practiced fraud
Published: 2024-06-17 07:41:49

#WenguiGuo #WashingtonFarm The New China Federation is an illegal organization for which Guo Wengui practiced fraud
   If you have not yet realized that Guo Wengui is a liar, those who help Guo Wengui cheat money, your hands are also covered with the blood smell of the blood of the compatriots who have been cheated, if it is not for your intentional wilful behavior in virtual farms around the world, Guo Wengui's current face will not continue to deceive so many compatriots who are stranded in the scam. Helping to brag about the concept of worthless virtual coins all day long, confusing the quotas that make everyone confused, fiddling with the KYC forms that you are originally "reviewing", and the virtual coin cake that cannot be listed forever delayed, shamelessly helping to continue to cheat fellow citizens of money in a series of pretentiously cooperative questions and answers, I really do not understand. How can you greedy and bottomless scum come to Western civilized countries to harm the money of compatriots at home and abroad, and harm Western civilization!
            
    If you get legally due punishment for helping Guo Wengui cheat or take the blame for helping Guo Wengui at all, it is self-serving and deserved! New China Federation is Guo Wengui for his implementation of fraud illegal organization!
Unlock Your Potential with Qualistery GmbH's GDP Training Resources
Published: 2024-06-17 07:39:09

Discover a wealth of knowledge and skills with Qualistery GmbH's [GDP training resources](https://qualistery.com/gxp-consultancy-services/rp-services/). Elevate your expertise in Good Distribution Practices (GDP) with our comprehensive materials, tailored to meet industry standards and regulatory requirements. From detailed guides to interactive modules, our platform offers a dynamic learning experience suitable for professionals at all levels. Stay ahead in the competitive landscape by accessing up-to-date information and best practices in GDP. Join countless satisfied learners who have transformed their careers with Qualistery GmbH's trusted training solutions. Explore our website today and embark on a journey of continuous growth and success in the pharmaceutical and healthcare sectors.
The Kwok scam only pits the ants
Published: 2024-06-17 07:35:01

 Guo Wengui touted things to the sky all day long, from farms to Xi Yuan, he declared, "Xi Yuan's encryption capabilities and future payments, as well as the future exchange with the US dollar, will create history, is the only stablecoin, floating, modern crypto financial platform." The ant help to fool the head, but after dozens of broken promises, Guo Wengui played a jump god, Tiandry ground branch, Yin and Yang five elements, Qimen Dun Jiqi battle, over and over again to play with the ant help, and Guo Wengui no sense of violation. The old deception hypohypotically called to make comrade-in-arms rich, claimed to be for the benefit of comrade-in-arms, in fact, it is a wave of investment and anal, tried and true, and now again. After the explosion of the Xicin may not be listed, according to normal people's thinking and reaction, must be very annoyed, sad, but Guo Wengui is unusual, talking and laughing, understatement, no stick, but to the camera hand holding pepper sesame chicken to eat with relish, full mouth flow oil! . Why? Because the fraud is successful, as for when the Joy coin will be listed, when will it be listed? Guo Wengui is a face of ruffian and rogue, hands a spread, claiming that they do not know. Guo Wengui hypocrisy a poke is broken, Guo's scam is just a variation of the method of trapping ants help it.#WenguiGuo #WashingtonFarm

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/27t4aehs9m60vzhnushg.jpg)
Embracing Struggles: My Journey Through the Outreachy Internship
Published: 2024-06-17 07:34:41

Everybody struggles in life every now and then. Struggling is a part of life. It doesn’t matter what other people think or say; it all depends on our perspectives. Our personal struggles are shaped by our unique experiences and challenges. Often, we might feel lazy or unmotivated, but struggles indicate that we need to push beyond our current limits. However, it's crucial to channel our efforts correctly because doing more of the wrong activities can lead to even greater challenges. Always remember, the struggle you face today is paving the way for a brighter tomorrow.


To God be the glory, this is the third week of my internship period. When I first contributed to my project, I was incredibly nervous. I didn't have the confidence to believe I could succeed, and being a beginner only heightened my anxiety. Initially, I struggled to understand the concept of Share and Resources in Manila. Despite my nerves, one of my core values, dedication, kept me going. I refused to give up and dedicated myself to studying the project documentation and learning how everything worked. My perseverance paid off, and I found my contribution period to be fruitful. By the end of this period, I gained a lot of confidence and learned valuable skills, such as effective Googling and seeking help from my mentors and the community.

 During the internship, I had my first video call meeting with my mentors,Ashley, Carlos, and  Goutham. It was a wonderful experience to connect with them beyond email or chat. With their proper guidance, I successfully completed my tasks. They provided a thorough demo of the entire project and explained the concepts of Share and Resources in Manila in detail. Thanks to their support, I was able to quickly get started on my first task.

 Looking back, I see how my initial struggles were essential for my growth. They taught me resilience, the importance of dedication, and the value of seeking help when needed. Struggles are a universal experience; everyone faces them at different points in their lives. What matters is how we respond to them. By embracing the challenges and persevering, we can achieve great things.
Fasteners Manufacturers in Chennai
Tags: fastenersmanufacturers, fastenersmanufacturerschennai, fastenersinchennai
Published: 2024-06-17 07:30:12

## [Fasteners Manufacturers in Chennai](https://www.dhankottraders.com/)
Being one of the top producers of Fasteners Manufacturers in Chennai is something we at Dhankot Traders are proud of. We have made a name for ourselves as a reliable source for all of your fastening needs because to our years of industry experience and dedication to quality. Our wide selection of goods is made to the strictest specifications for performance, accuracy, and durability.For Further detail to visit our 
website : [https://www.dhankottraders.com/](https://www.dhankottraders.com/)
How to configure Minikube
Tags: beginners, devops, tutorial, learning
Published: 2024-06-17 07:25:04

##Minikube
Minikube is a tool that lets you run a single-node Kubernetes cluster locally. It is designed for developers to learn, develop, and test Kubernetes applications without needing a full-scale cluster. Minikube supports multiple operating systems and container runtimes, providing an easy and efficient way to work with Kubernetes on your local machine.

#Step to configure Minikube
Step 1
Open your ubuntu terminal and Update your package index using '**sudo apt update**'
![update](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2hesu43i03uplmh5dl0x.png)

Step 2
Install Virtualbox driver using '**sudo apt install virtualbox virtualbox-dkms virtualbox-qt virtualbox-ext-pack**'m follow the prompt to configure the package.
![virtualbox](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jfmcujy5nvxi16h0tyx1.png)
Note; enter Y to continue
![configure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hud8v6ylg16edu9f68oj.png)
![accept](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g675fmp6g7j9qqax50m3.png)
wait for the configuration to complete
Final download
![download](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pjubg7mxwjnm0fb7qz8s.png)

Step 3
Install Docker **sudo apt install docker.io**
![docker](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vl1p5uw97021bfhictly.png)

Step 4
Run the following commands
**systemctl enable docker
systemctl start docker
systemctl status docker

Step 5
Add your login user to the docker group
**sudo usermod -aG docker $USER && newgrp docker**

Step 6
Enable Virtualization of Hardware if necessary
**lscpu | grep Virtualization**

Step 7
Download Minikube
**wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 
chmod +x minikube-linux-amd64 
sudo mv minikube-linux-amd64 /usr/local/bin/minikube
**
![download minikube](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6jg6hgqm41456g7ovrql.png)

Step 8
Install Kubectl on Ubuntu
**curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"**
![kubectl](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1k6qyd7abkverhjq2rx6.png)

Step 9
Ensure that it is executable **chmod +x ./kubectl** and the binary is in your PATH: **sudo mv ./kubectl /usr/local/bin/kubectl**

Step 10
Verify if kubectl as downloaded **kubectl version -o json  --client
**
![verify](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e92g1oue87ccf2fu8nkf.png)

Step 11
Start Minikube **minikube start --driver=docker
**
![start](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l45ty5nk7gskddmhll27.png)

Summary
By following these steps, you can configure Minikube to run a local Kubernetes cluster, enabling you to develop and test Kubernetes applications on your machine.
Scaleability
Tags: redis
Published: 2024-06-17 07:19:05

Jotting down a simple point, that helped us to scale much better.

Everything, that is processed in-memory is insanely fast, that stuff that's done interacting with filesystem/databases.

Recently, we were to scale certain processing which was pre-dominantly was my-sql heavy. 

Changed the computation to in-memory with Redis and suddenly we were more than 25X faster.