teleren/devto huggingface dataset:
Fill the State of Frontend 2024 survey and share your insights! Last chance to join 4500+ frontend specialists!
Tags: frontend, javascript, react, softwaredevelopment
Published: 2024-06-24 12:55:22

Let's dive in and compare notes across the globe!

In our third edition, we try to surpass last time's success – with nearly 4000 devs from 125 countries! Are you curious how your stack stacks up internationally and how others do what you do?

Share your frontend journey and see where we all fit in the global frontend scene. It'll only take a few minutes.

[State of Frontend 2024 survey](https://stateoffrontend2024.typeform.com/survey?utm_source=www&utm_medium=devto&utm_campaign=sofe2024&utm_content=post&typeform-source=dev.to)

Your insights shape the big picture, so go on, click above, and answer some easy questions!
Maximize Your Python Code: Efficient Serialization and Parallelism with Joblib
Tags: python, joblib, piplines, tips
Published: 2024-06-24 12:54:14

Joblib is a Python library designed to facilitate efficient computation and useful for tasks involving large data and intensive computation. 

### Joblib tools :

- **Serialization**: Efficiently saving and loading Python objects to and from disk. This includes support for `numpy arrays`, `scipy sparse matrices`, and `custom objects`.

- **Parallel Computing**: Parallelizing tasks to utilize multiple CPU cores, which can significantly speed up computations.

### Using Python for Parallel Computing

- **Threading**: The threading module allows for the creation of threads. However, due to the GIL, threading is not ideal for CPU-bound tasks but can be useful for I/O-bound tasks.

- **Multiprocessing**: The multiprocessing module bypasses the GIL by using separate memory space for each process. It is suitable for CPU-bound tasks.

- **Asynchronous Programming**: The asyncio module and async libraries enable concurrent code execution using an event loop, which is ideal for I/O-bound tasks.

> managing parallelism manually can be complex and error-prone. This is where joblib excels by simplifying parallel execution.

### Using Joblib to Speed Up Your Python Pipelines

- **Efficient Serialization**

```
from joblib import dump, load

# Saving an object to a file
dump(obj, 'filename.joblib')

# Loading an object from a file
obj = load('filename.joblib')

```

- **Parallel Computing**

```
from joblib import Parallel, delayed


def square_number(x):
"""Function to square a number."""
    return x ** 2

numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

# Parallel processing with Joblib
results = Parallel(n_jobs=-1)(delayed(square_number)(num) for num in numbers)

print("Input numbers:", numbers)
print("Squared results:", results)


```
**_output_**

`Input numbers: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Squared results: [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
`

- **Pipeline Integration**

```
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
import joblib

# Load example dataset (Iris dataset)
iris = load_iris()
X = iris.data
y = iris.target

# Split data into training and test sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Create a pipeline
pipeline = Pipeline([
    ('scaler', StandardScaler()),
    ('svc', SVC())
])

# Train the pipeline
pipeline.fit(X_train, y_train)

# Save the pipeline
joblib.dump(pipeline, 'pipeline.joblib')

# Load the pipeline
pipeline = joblib.load('pipeline.joblib')

# Use the loaded pipeline to make predictions
y_pred = pipeline.predict(X_test)

# Evaluate the model
accuracy = accuracy_score(y_test, y_pred)
print(f"Accuracy: {accuracy}")

```

**_output_**

`Accuracy: 1.0
`
Tools to debug Clipping and Overflow Issue
Tags: css, webdev
Published: 2024-06-24 12:48:58

We are using Salesforce and we have a custom component that has a drop down combo box. The dropdown never extends beyond the component. I have tried using dev tools to see what the issue is. At the dropdown div I added the overflow visible style but it is still clipped. I've gone through the HTML tree and can't find an overflow:hidden which is something I read that can cause this issue in css. I was unable to find any clip-paths either. 

The drop down auto-computed height seems to be correct and would allow it to overflow the control but it is still being clipped. 

What else could I look at or try to override in the dev tools to see why something is getting clipped on an html page?
Last week, I made my very first sale as an indiehacker
Tags: webdev, beginners, learning, indie
Published: 2024-06-24 12:25:22

Last week, I made my very first sale as an #indiehackers 🥳

> "cool story bro"

But what's important here isn't the sale, it's how I got it 👉 Fighting my imposter syndrome.

- I got a response on a marketing post here asking for a DM before buying.
- My 2023 me would have avoided it: "What if I can't respond positively? What if they thought it was bad? What if...".
- 1 year xp Indie me: "Nothing happens out of nothing, let's go".
- The potential customer just wants to know if [DirectoryFast](https://directoryfa.st) can do a "classic" directory layout?
- I spent 5 minutes creating it and sent a screenshot.
- Deal done, money and access sent in less than an hour.

Sound trivial? It's absolutely not the case for a savage like me, I really don't like talking to people, my impostor syndrome is on another level.

But I've been fighting it all my life, I chose a previous difficult career to prove myself and I choose another career in hardmode as an indie now.

I just need challenges 💪
What is HTML?
Tags: webdev, javascript, html, website
Published: 2024-06-24 12:16:29


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tuztsb6abv1jbpgq8uoy.png)
 
HTML stands for Hyper Text Markup Language
HTML is the standard markup language for creating Web pages
It used to create structure or a layout of web page.
HTML pages are saved by using .html extension in web page name
Identical file we save as “index.html”
does documenting your progress actually work?
Tags: learning, discuss, codenewbie, programming
Published: 2024-06-24 12:12:40

Lots of developers that I've met and read about highly recommend keeping a Dev Journal. Stand-ups and check-ins in professional development and engineering teams happen daily to keep track of their progress. There's also a devjournal tag within this Dev.to community with lots of focused posts on their learning. 

But for someone like me, a self-taught dabbler, I've tried millions of different journals including Apple Notes, Notion, and my most recent obsession, Obsidian. Even though Obsidian does have a UI and workflow that I am easily accustomed to, its daily notes intuition just doesn't really cut it for me. I'm someone who hates looking at blank pages. It's uninspiring and incredibly dangerous, because that's where the options are limitless and at the same time they're nowhere.

So I've built a few templates for my daily notes to track my progress, but I still find them pretty underwhelming since I have to click through all of them to read what I did the past week or month. This kept me from continuing the consistency of writing everyday, let alone the fact that I took time out of my day to do this, that led up to a bunch of lost notes with no actual context of progress or reflective insights.

Relative to this, it's easier for me to look through photos, i.e. a gallery style visual board to see what I was doing the the past week or month. I've tried writing in this style within an Obsidian note with the simplest formats: The month it is, the day of the month and what I'm working on, all within the same page, so I can scroll to the top when I'm at the end of the month to see how much I've progressed. 

This of course isn't the best solution but it's somehow working at the moment. I've initially thought of starting an Instagram or Twitter account dedicated to post short videos of my progress, however I'm terrified of how I instantly get distracted once the focus shifts to gathering a social media following instead of my learning.

Share with me some of the progress-tracking tools you've used! Should I start an Instagram account or just keep going with my Obsidian page workflow? Do you face the same troubles as I do? Let me know what you think and do drop me a follow too!
What is Digital Marketing and why it is important ?
Published: 2024-06-24 12:11:41

Digital marketing in simple language refers to the use of digital channels, platforms, and technologies to promote products, services, or brands to a target audience.  

The importance of digital marketing are presented below through the following points,

1. Helps to reach a wider audience.
2. Cost-Effective 
3. Digital marketing enables precise targeting of specific demographics, interests, and behaviors, ensuring that marketing efforts reach the most relevant audiences.
4. Digital marketing facilitates direct interaction with customers through social media, email, and other online platforms, fostering stronger relationships and customer loyalty.
5. Consistent and strategic digital marketing efforts help build and maintain brand awareness, making businesses more recognizable and 
trustworthy to potential customers. 

In conclusion, digital marketing is vital for modern businesses. It uses digital channels to reach a wider audience cost-effectively, targets specific demographics efficiently, and fosters direct customer interaction to build strong relationships. Consistent strategies enhance brand awareness, making businesses more recognizable and trustworthy. Overall, digital marketing drives growth and customer engagement.
Scaling Databases (Sharding)
Tags: systemdesign, softwareengineering, softwaredevelopment, sharding
Published: 2024-06-24 12:11:01

💜 **DAY4 -> Scaling Databases (Sharding)** 💜

As in my previous blogs, We talked about replication of databases. In this We will talk about Sharding.

👉 What is Sharding?
- Sharding is simply dividing DB mutually exclusive, so data is divided.

- In simple word, you divide data in smaller chunks called as shards because as data becomes huge the performance also decreases, but having smaller data does not impact performance that much.

**Real life example : **
- Let's say we have a huge list of names stored on db.
- Now we can divide db into 3 shards like shard1 will store names starting 'A' to 'J', shard2 -> 'K' to 'T' and shard3 -> 'U' to 'Z'.
- When request comes to store new names in db, we can simply check first character and point it to proper shard for storing data.
- When GET request comes, then also we will be able to decide which shard would hold data.


![API to shards](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/us5b3zdtfzl9bah9x2h3.png)

-> Remember Image shown above as different shards is not different database but its a single database which has 3 nodes.

**SQL vs NO-SQL**
- Both dbs has inbuilt sharding features.
- SQL follows ACID properties but NO-SQL doesn't. So if there is any update that have to be run on multiple shards, SQL will either perform operations on all shards or none shards at all. but NO-SQL can give intermediate results.

**BENEFITS**
- Improved Scalability: It allows Dbs to handle more capacity in much better way.
- Increased Performance: Any operation that works on only one shard, will achieve result much faster as data is less, so performance is more.
- Fault Tolerance: If one fails, the others can continue to serve the requests. So, not complete outbreak.
- Reduced Costs: Vertical Scaling is costly thus sharding allows horizontal scaling.

**Why is sharding not used by default**
- The reason for this is very simple, Its very costly as well as time consuming for 2 shards to communicate with each other even though they belong to same DB. So it becomes absolute important to select such data on which sharding is done, so that there is none to minimum communication requirement between shards.
Personalized Acrylic Keychains
Published: 2024-06-24 12:06:32

For individuals, these keychains serve as more than just functional items. They can commemorate special occasions such as weddings, birthdays, or graduations, acting as tokens of cherished memories. The ability to personalize them with dates, names, or heartfelt messages adds sentimental value, turning them into mementos that evoke nostalgia and warmth whenever they are used or seen.

The design possibilities with acrylic keychains are virtually limitless. Advanced printing techniques allow for intricate details, gradients, and even photographic images to be faithfully reproduced on the small surface area, ensuring that even the most complex designs retain their clarity and visual impact. This makes them not only practical accessories but also miniature canvases for creative expression.

In terms of durability, acrylic keychains are highly resistant to wear and tear. Unlike traditional materials that may fade or corrode over time, acrylic retains its color and clarity, ensuring that the personalized design remains vibrant and intact for years to come. This durability makes them suitable for various environments, from bustling city streets to outdoor adventures.

https://www.vogesey.com/products/custom-epoxy-glitter-acrylic-keychian-vogesey-cnc-keychain
Django Rest Framework
Tags: django, restapi, javascript, python
Published: 2024-06-24 12:02:41

---

## Table of Contents

### 1. Introduction
1.1 What is REST?  
1.2 Principles of RESTful APIs  
1.3 What is Django Rest Framework?  
1.4 Installing and Setting Up Django Rest Framework  
1.5 Setting Up the Development Environment  

### 2. Getting Started with Django Rest Framework
2.1 Creating a New Django Project  
2.2 Creating a New Django App  
2.3 Defining Models in Django  
2.4 Making Migrations and Migrating  

### 3. Serializers
3.1 Introduction to Serializers  
3.2 Creating and Using Serializers  
3.3 Model Serializers  
3.4 Custom Serializers  

### 4. Views and URLs
4.1 Function-Based Views (FBVs)  
4.2 Class-Based Views (CBVs)  
4.3 Using Generic Views  
4.4 Using Mixins  
4.5 Routing URLs to Views  

### 5. ViewSets and Routers
5.1 Introduction to ViewSets  
5.2 Using ViewSets  
5.3 Routers and URL Routing  
5.4 Customizing ViewSets  

### 6. Authentication and Permissions
6.1 Introduction to Authentication  
6.2 Session Authentication  
6.3 Token Authentication  
6.4 JWT (JSON Web Tokens) Authentication  
6.5 Setting Up Permissions in DRF  
6.6 Custom Permissions  
6.7 Implementing Throttling  

### 7. Relationships and Nested Serializers
7.1 Handling One-to-Many Relationships  
7.2 Handling Many-to-Many Relationships  
7.3 Creating Nested Serializers  
7.4 Serializing Complex Data  

### 8. Pagination and Filtering
8.1 Setting Up Pagination  
8.2 Customizing Pagination Styles  
8.3 Filtering Data  
8.4 Using DjangoFilterBackend  
8.5 Implementing Search Functionality  
8.6 Ordering Results  

### 9. Advanced API Features
9.1 API Versioning  
9.2 Handling Different API Versions  
9.3 Content Negotiation  
9.4 Implementing Content Negotiation in DRF  

### 10. Documentation and Testing
10.1 Generating API Documentation  
10.2 Using Swagger for Documentation  
10.3 Using Redoc for Documentation  
10.4 Writing Tests for Your API  
10.5 Testing Authentication and Permissions  
10.6 Advanced Testing Techniques  

### 11. Performance Optimization and Caching
11.1 Optimizing Query Performance  
11.2 Using select_related and prefetch_related  
11.3 Setting Up Caching in DRF  
11.4 Caching Strategies and Best Practices  

### 12. Deployment and Best Practices
12.1 Preparing for Deployment  
12.2 Deploying to Heroku  
12.3 Deploying to AWS  
12.4 Deploying to DigitalOcean  
12.5 Best Practices for Code Organization  
12.6 Security Considerations  
12.7 Maintaining and Versioning APIs  

### 13. Final Project
13.1 Planning and Designing the API  
13.2 Implementing the API  
13.3 Testing the API  
13.4 Deploying the Final Project  

### Appendix
A.1 Django Rest Framework Official Documentation  
A.2 Additional Resources and Tutorials  
A.3 Common Issues and Troubleshooting  

---
Niloom.ai: Revolutionary Generative AI Platform Democratizes Spatial Computing Content Creation
Published: 2024-06-24 11:57:55

Spatial computing, which encompasses augmented reality (AR) and virtual reality (VR), is poised for a massive leap forward thanks to Niloom.ai's groundbreaking generative AI platform. This revolutionary tool eliminates the technical barriers that have traditionally limited AR/VR content creation, opening the door for a new wave of immersive experiences designed by anyone, not just seasoned developers.

## Unleashing Creativity with Generative AI

Niloom.ai's intuitive interface empowers users to create sophisticated AR/VR experiences through simple text or voice prompts. The platform's generative AI engine, GenAI, takes care of the heavy lifting, automatically generating complete AR/VR scenes, personalized AI agents, and individual assets like 3D models, animations, and sound effects. This eliminates the need for complex coding or reliance on large teams of engineers, making spatial computing content creation accessible to a wider audience than ever before.

## Streamlined Workflow for Maximum Efficiency

Niloom.ai goes beyond simply generating assets. It streamlines the entire content creation process, from ideation to publishing. Users can leverage a comprehensive suite of editing tools for real-time collaboration, precision editing, version control, and testing. A visual timeline allows creators to maintain a bird's-eye view of their entire project, facilitating the development of complex storylines and interactive elements.

## Democratizing Spatial Computing for All

Before Niloom.ai, creating AR/VR content was a time-consuming and expensive endeavor. Niloom.ai breaks down these barriers, allowing creators of all technical backgrounds to bring their ideas to life in a fraction of the time and at a fraction of the cost. This empowers a new generation of storytellers, educators, and entrepreneurs to explore the vast potential of spatial computing.

To read the full article [click here](https://hyscaler.com/insights/niloom-ai-generative-ai-platform/)!
So excited to be a Judge on the WixStudio Challenge 😱!
Tags: wixstudiochallenge, wix, 100daysofcode
Published: 2024-06-24 11:56:54

So excited to be a Judge on the WixStudio Challenge 😱! Stay tuned by following #wixstudiochallenge:

{% tag wixstudiochallenge %}

More info here: https://dev.to/challenges/wix
Demystifying Software-Defined Networking (SDN): Simplifying Network Management
Tags: cschallenge, sdn, networking, computer
Published: 2024-06-24 11:54:57

Software-Defined Networking (SDN) is a modern approach to managing computer networks. Traditional networking involves hardware like routers and switches, each with its own software and controls. SDN changes this by separating the control layer from the hardware layer, making the network more flexible and easier to manage.

<u>**Key Concepts of SDN:**</u>

1. Control Plane and Data Plane:

- Control Plane: This is the brain of the network. It makes decisions about where data should go.

- Data Plane: This is the muscle of the network. It actually moves 
the data to its destination.

- Example: Imagine a busy city with a traffic control center (Control Plane) that decides the best routes for cars (Data Plane) to take. The control center doesn't drive the cars but tells them where to go.

2. Centralized Management:

- In SDN, a central controller manages the entire network. This controller can be a software application that dictates how the network devices should handle traffic.

- Example: Think of the controller as a master conductor in an orchestra, ensuring all musicians (network devices) play in harmony according to the music score (network policies).

3. Programmability:

- Network administrators can program the network to handle traffic based on specific needs, like prioritizing video calls over regular web browsing.

- Example: It's like setting up traffic lights to give priority to ambulances and fire trucks during emergencies.

4. Scalability and Flexibility:

- SDN makes it easy to scale the network up or down and adapt to changing demands without needing to reconfigure hardware.

- Example: Imagine being able to expand a road or change traffic rules instantly to accommodate a sudden increase in vehicles, like during a sports event.

<u>**Simple Example: Home Network with SDN
** </u>

Consider a smart home with various devices connected to the internet: smartphones, smart TVs, and IoT devices. With SDN, you could prioritize video streaming on your smart TV during the evening while limiting bandwidth for software updates on other devices. This ensures smooth streaming without buffering.
<u>**Visualizing SDN:**</u>

Here's a simple diagram to illustrate how SDN works:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fgd86rawip2dop25z5v2.png)

1. Traditional Network: Each router and switch has its own control and data planes, operating independently.

2. SDN Network: A central controller manages all routers and switches, separating the control plane from the data plane.

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


In summary, SDN transforms network management by centralizing control, making networks more flexible, programmable, and easier to manage. It's like moving from a traditional road system to one where traffic flow can be dynamically adjusted for optimal performance.
Whimsy and Wonder: Celebrating Children's Book Authors
Tags: children, books
Published: 2024-06-24 11:48:06

"Whimsy and Wonder: Celebrating Children's Book Authors" is a heartfelt tribute to the creative minds behind beloved tales that have enchanted generations. These [children book authors](https://ismeniarodriguezbooks.com/) spin magic through their imaginative narratives and endearing characters, crafting stories that ignite curiosity and inspire dreams. From timeless classics to modern favorites, each author leaves an indelible mark on young readers' hearts, fostering a love for reading and storytelling. "Whimsy and Wonder" honors the dedication and artistry of children book authors, whose words continue to spark joy, impart wisdom, and create cherished moments between parents and children around the world.
How to make policy in laravel?
Tags: webdev, laravel, tutorial, php
Published: 2024-06-24 11:41:49


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

In this article, We are studying Policy in laravel. The policy helps developers streamline authorization logic and keep their code clean and maintainable. Laravel Policies provide a way to authorize user actions on resources. Policies help centralize authorization logic and make it easy to manage access rules.

# How to make policy in laravel?
## Create a Policy:
Run the below command, to create a policy class in laravel. It will create an ArticlePolicy class in the app\Policies directory.

```
php artisan make:policy ArticlePolicy
```
## Define Policy Methods:
You can define different methods that perform on posts. You might create methods like view, create, update, and delete. These methods should return a boolean value.

```
public function view(User $user, Article $article)
{
	return $user->id == $post->user_id;
}
```
The above method checks articles created by and access users is the same.

## Register Policies:
You should register your policies in the AuthServiceProvider provider. You can add policies to their respective policies.

```
protected $policies = [
	Article::class = ArticlePolicy::class,
];
```
[Read More] (https://www.devrohit.com/policy-in-laravel/)