teleren/devto huggingface dataset:
What is NAT ?
Published: 2023-08-29 23:33:11

Network Address Translation (NAT) is a process in which one or more local IP address is translated into one or more Global IP address and vice versa in order to provide Internet access to the local hosts. Also, it does the translation of port numbers i.e. masks the port number of the host with another port number, in the packet that will be routed to the destination. It then makes the corresponding entries of IP address and port number in the NAT table. NAT generally operates on a router or firewall. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l4rr9q6uz1t7z729p4b0.jpg)
Network Address Translation (NAT) Types – 
There are 3 ways to configure NAT: 
 

Static NAT – In this, a single unregistered (Private) IP address is mapped with a legally registered (Public) IP address i.e one-to-one mapping between local and global addresses. This is generally used for Web hosting. These are not used in organizations as there are many devices that will need Internet access and to provide Internet access, a public IP address is needed. 
Suppose, if there are 3000 devices that need access to the Internet, the organization has to buy 3000 public addresses that will be very costly. 
 

Dynamic NAT – In this type of NAT, an unregistered IP address is translated into a registered (Public) IP address from a pool of public IP addresses. If the IP address of the pool is not free, then the packet will be dropped as only a fixed number of private IP addresses can be translated to public addresses. 
Suppose, if there is a pool of 2 public IP addresses then only 2 private IP addresses can be translated at a given time. If 3rd private IP address wants to access the Internet then the packet will be dropped therefore many private IP addresses are mapped to a pool of public IP addresses. NAT is used when the number of users who want to access the Internet is fixed. This is also very costly as the organization has to buy many global IP addresses to make a pool. 
 

Port Address Translation (PAT) – This is also known as NAT overload. In this, many local (private) IP addresses can be translated to a single registered IP address. Port numbers are used to distinguish the traffic i.e., which traffic belongs to which IP address. This is most frequently used as it is cost-effective as thousands of users can be connected to the Internet by using only one real global (public) IP address. 
 
Advantages of NAT – 
 

NAT conserves legally registered IP addresses. 
 
It provides privacy as the device’s IP address, sending and receiving the traffic, will be hidden. 
 
Eliminates address renumbering when a network evolves. 
 
Disadvantage of NAT – 
 

Translation results in switching path delays. 
 
Certain applications will not function while NAT is enabled. 
 
Complicates tunneling protocols such as IPsec. 
 
Also, the router being a network layer device, should not tamper with port numbers(transport layer) but it has to do so because of NAT.
One Step Closer
Tags: javascript, beginners, programming, webdev
Published: 2023-08-29 22:36:46

## **To the finish of my new project!**

### Well... maybe It's not thaaat close, but we are doing great!

Today I've completed one more controller of the API from my soccer scheduling website. Yes... It may be a little weird, but I think It's a really cool idea.

### Imagine:

- You're a soccer player
- That wants to organize this friday's soccer match with your friends or work colleagues

Here we go! A new platform that can do it for you, control the payments that all of the participants need to make and give the exact location based on google maps.

> Yeah, I'm making it possible. It's really archaic for the moment, because I'm developing the API, so I don't have much to show. But maybe I will finish 'till the end of this year.

But I developed about 50k+ lines of code, so that's something. But I'm not even close to the end. I have so much work to do, but I will do it!
Workorb AI - Understanding enterprise relationships with GraphLLM
Tags: ai, enterprise, b2b
Published: 2023-08-29 22:21:55

Workorb AI is the future of work for customer-facing teams, with automated complex repetitive tasks and greatly improved sales, upsell and service outcomes. We stitch internal and external conversations to untangle multi-year, multi-people B2B customer relationships using a new class of LLMs — Graph Large Language Models.

[https://workorb.ai](https://workorb.ai)
Day 815 : Boomerang
Tags: hiphop, code, coding, lifelongdev
Published: 2023-08-29 22:18:27

_liner notes_:
- Professional : Not a bad day. Had a bunch of meetings and in-between I worked on this new Web Component. Got a bunch of it done. All that really needs to be done is pull in some text from an array of objects that's passed into the Web Component. Also got an issue I was running into my work laptop but Tech support was able to help me fix it. Submitted my expense report for this month. Not a bad day at all.

- Personal : Last night, I went through tracks for the radio show. I also ironed some clothes for my trip. I also worked on the Web Component and made some progress.

![A small stream with a lot of rocks between two stone walls in a forest in Ice Age Trail, WI, USA](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3cfpwgdh8q8pc0ddcob3.jpg)

Going to do some more ironing and review some tracks. I want to see if I can get the text to show up in the Web Component. There's a new episode of "Zom100" that I want to watch. If it's not too late, I'll see what task I can boomerang back to before calling it a night.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube 4Qu2Aq1FusU %}
Top 7 Featured DEV Posts from the Past Week
Tags: top7
Published: 2023-08-29 21:50:32

---
title: Top 7 Featured DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week
tags: top7 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/izn8hfzc0bhki5h4cu15.jpg
---

_Every Tuesday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts published later in the week._ 

## Marketing for Developers: The Unconventional Guide

Developers often excel at building products but sometimes neglect marketing them effectively. Let's change that with these tips from @inovak!

{% embed https://dev.to/inovak/marketing-for-developers-the-unconventional-guide-3a1j %}


## Building Your Own VPN for Free

VPN companies have advertisements everywhere, there’s a reason they sponsor most tech YouTubers. But you don’t need to buy an expensive plan to use a VPN. Build your own with @baptistsec!

{% embed https://dev.to/baptistsec/building-your-own-vpn-for-free-3o9h %}


## Creating a More Than Minor Side-Project: From Planning To Release

It’s hard to get anything more than a pet project off the ground. In this post, @llxd shares their thought process in doing just that!

{% embed https://dev.to/llxd/creating-a-more-than-minor-side-project-from-planning-to-release-3be8 %}


## How To Update a Few Years Old Outdated Project in Node and React

Navigating old Node.js dependencies can be confusing. Here’s @meatboy’s experience decoding this challenge in a few-year-old repository using a custom tool—and how you can benefit from it.

{% embed https://dev.to/meatboy/how-to-update-a-few-years-old-outdated-project-in-node-and-react-31jm %}


## Building a Distributed Workflow Engine From Scratch

At their core, workflow engines are responsible for executing a series of tasks over a cluster of machines as efficiently as possible. Read on to explore the mysteries and challenges that come with creating such an engine with @acoh3n.

{% embed https://dev.to/acoh3n/building-a-distributed-workflow-engine-from-scratch-22kl %}


## Beyond Googling the Error Message

Here, @ingosteinke shares some helpful tips for finding the info you need while searching on the web. If you don't find any helpful results on Google or Ecosia, try rephrasing your questions, question your assumptions, and try to isolate relevant aspects. 

{% embed https://dev.to/ingosteinke/beyond-googling-the-error-message-lfp %}


## Complete Guide to JavaScript Promises, Async/Await and Promise Methods

In this tutorial from @myogeshchavan97, you will learn everything you need to know about using promises and async/await in JavaScript.

{% embed https://dev.to/myogeshchavan97/complete-guide-to-javascript-promises-asyncawait-and-promise-methods-5aom %}


_That's it for our weekly Top 7 for this Tuesday! Keep an eye on dev.to this week for daily content and discussions...and be sure to keep an eye on this series in the future. You might just be in it!_
Github Configuration Commands
Tags: github, git, linux, devops
Published: 2023-08-29 21:42:36

```
sudo apt update git
sudo apt install git
git --version
git config --global user.name "Muthukumark98"
git config --global user.email "muthukumar1998mk98@gmail.com"
git config --list
pwd
mkdir workspace
cd workspace/
git clone https://github.com/Muthukumark98/hello_test.git
ls
cd hello_test/
touch hello.py
ls
cat README.md 
ls
vim hello.py
cat hello.py
git status
git add hello.py
git status
git commit -m "first python code"
git status
git push origin main
git remote set-url origin https://<token>/<username>/<repo>
git push origin main
```
Copying and Pasting Strings with pyperclip Module in Python.
Published: 2023-08-29 21:37:13

Pyperclip :is a cross-platform Python module for copying and pasting clipboard functions in python.
Pyperclip  module has copy() and paste() functions that can send text  to and receive  text from your  Computer's  clipboard.
To use pyperclip run on your terminal **pip3 install pyperclip**   to install locally on  machine then run pthon3 to open the interactive shell  to execute the below code.

```

>>> import pyperclip
>>> pyperclip.copy('Vincent tommi!')
>>> pyperclip.paste()
'Vincent tommi!'
>>> 
```
Alfred, a advanced OSINT tool
Tags: python, code, github, osint
Published: 2023-08-29 21:30:27

Alfred is an advanced OSINT tool that searches for social media accounts based on the input username. Alfred has lots of options and settings and is currently in heavy development by our team so more features are to come. Thanks for your time and have a wonderful day. :D
https://github.com/Alfredredbird/alfred
React Fiber vs Reconciliation in ReactJS
Tags: webdev, react, website, nextjs
Published: 2023-08-29 21:13:35


🚀Reconciliation is algorithm which React.js uses to differentiate one tree with another to determine which parts need to be changed. Basically it keeps the track of UI and data layers when there is diff in both layers react uses virtual DOM and updates the changes by re-rendering the specific component.

🚀React Fiber is used to increase React's suitability for areas like animation, layout, and gestures. Its headline feature is incremental rendering: the ability to split rendering work into chunks and spread it out over multiple frames.
Basically react fiber is a architecture which splits the work and updates the only component that needs to change.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5fu7s6rledwlhsdqbc0z.jpeg)
Getting Started with Creating a Database Table in Flask-SQLAlchemy
Published: 2023-08-29 20:35:08

Flask-SQLAlchemy is a powerful tool that allows developers to seamlessly integrate a relational database into their Flask applications. Whether you're building a simple web app or a complex project, understanding how to create a database table using Flask-SQLAlchemy is a fundamental skill. In this beginner's guide, we'll walk you through the process step by step.

Prerequisites:

Before diving into creating a database table using Flask-SQLAlchemy, make sure you have the following set up:

Basic understanding of Python and Flask.

Flask and SQLAlchemy installed in your Python environment.
A database engine (like SQLite, MySQL, or PostgreSQL) configured for your Flask app.
Now, let's get started!

Step 1: Set Up Your Flask App:

Begin by creating a Flask application if you haven't already. Make sure to configure your app to use SQLAlchemy for database operations. 


Here's a basic example:

```
from flask import Flask
from flask_sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///mydatabase.db'  # Change this to your database URI
db = SQLAlchemy(app)
```



Step 2: Define a Model:

In SQLAlchemy, a model represents a table in your database. Define a model class by creating a Python class that inherits from db.Model. Each attribute in the class will correspond to a column in the table. Here's an example of a simple model:

```
class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(80), unique=True, nullable=False)
    email = db.Column(db.String(120), unique=True, nullable=False)

    def __repr__(self):
        return f'<User {self.username}>'

```

Step 3: Creating the Table:

Once you've defined your model, it's time to create the corresponding table in the database. To do this, open a Python shell or create a script and run the following commands:


from your_app_module import db, User  

- Update with your actual module and model names

- Create the tables

db.create_all()

This will create the necessary table(s) based on your defined models.

Step 4: Interact with the Database:

With the table created, you can now interact with the database using your model. For example, to add a new user to the User table:


```
new_user = User(username='john_doe', email='john@example.com')
db.session.add(new_user)
db.session.commit()
```


Step 5: Querying Data:

You can also perform queries on the table using SQLAlchemy's query API. Here's an example of how to retrieve all users:


```
all_users = User.query.all()
for user in all_users:
    print(user.username, user.email)
```


Conclusion:

Congratulations! You've successfully created a database table using Flask-SQLAlchemy and performed basic operations on it. This is just the beginning – Flask-SQLAlchemy offers many more advanced features for handling database relationships, migrations, and more. 

As you continue to develop your Flask applications, you'll find that SQLAlchemy is a versatile and essential tool for working with databases.
Java - 🧐 Checking Out if Empty with `isEmpty()`: Doubly Linked List 📖
Tags: java, computerscience, dsa, doublylinkedlist
Published: 2023-08-29 20:31:16

Hey Dev.to folks! 👋

When dealing with a doubly linked list, there's an easy way to check if it's a full house or a lonely room.🥳  Here comes the `isEmpty()` method.

### 📘 Quick Doubly Linked List Refresher:

Before we dive in, let's recall our framework:

```java
class Node {
    int data;
    Node next;
    Node prev;

    // Constructor: Crafting our node from scratch
    Node(int data) {
        this.data = data;
        this.next = null;
        this.prev = null;
    }
}

class DoublyLinkedList {
    Node head;
    Node tail;

    // Constructor: Setting the stage 
    DoublyLinkedList() {
        this.head = null;
        this.tail = null;
    }
}
```

Remember, each node in our doubly linked list has knowledge of both its previous and next neighbor. 🤝

### 🕵️‍♂️ Diving into `isEmpty()`:

Here's the quick insight on how...:

```java
public boolean isEmpty() {
    return head == null;  // If no head, no party!
}
```

Super straightforward, right? If there's no head node, then the list is empty!

### 🎈 Why `isEmpty()` is Your New BFF(I mean FOREVER!):

Ever tried inserting or deleting from a list? Knowing whether it’s populated can save you from situations you would not admit later on in life. Trying to work with non-existent nodes___? 🤷‍♂️

### 🎉 Wrapping Things Up:

The `isEmpty()` method: your first line of defense. It ensures you're not talking to yourself (though a rubber duck can help to catch thoughts :duck: ), and trust me, that’s a great feature to have. 

Cheers and happy coding! 🚀
Episode 23/34: Analog.js, Developer Survey, ng-conf, A11y
Tags: webdev, javascript, programming, angular
Published: 2023-08-29 20:28:15

Analog.js, a meta-framework for Angular, was finally released. Ng-conf published all recordings from this year's conference. The Angular Developer survey started, and Maria Korneeva with an article on Accessibility.

{% embed https://youtu.be/kYl6ooSTINM %}

## Analog.js

Last week, Analog.js had its first stable release.

{% embed https://twitter.com/brandontroberts/status/1693613413862142260 %}

What is Analog.js? It is a meta-framework. If you know Remix, Next.js or Nuxt.js, that's what it is all about.

That means it extends Angular by adding features like Vite, Server-Side Generation, or so-called API routes, i.e. typical backend endpoints. So, Analog.js contains a fully functional backend as well.

The typical use case is an application running full-stack on a cloud service, with a bit of dynamic behaviour but high demands on SEO. A blog is a perfect example of it.

Another aspect is the support of Vite, which Angular doesn't provide out of the box. Vite is a build tool with a vast ecosystem. Many tools see it as a standard and depend on it. In that regard, Analog opens the door for all those tools to Angular. That might even be more important than all the features combined.

{% embed https://analogjs.org/ %}

Brandon Roberts is the inventor and main contributor. He has also published an article and video on how to write a blog with Analog.js. 

{% embed https://dev.to/analogjs/how-to-build-a-blog-with-analog-and-angular-4pk2 %}

If you want to go all in, consider the Spartan framework from Robin Götz. It integrates tools like tRCP or Prisma to Analog.

{% embed https://dev.to/this-is-angular/spartan-type-safe-angular-full-stack-development-powered-by-analog-17dm %}

## Ng-Conf Videos

Ng-conf, one of the largest Angular conferences, released all their recordings. To get them for free, you have to register on their website.

{% embed https://twitter.com/ngconf/status/1694384952635453677 %}

## Angular Developer Survey

The Angular Developer survey started. Please find some time to fill it out. We know that the Angular team is very serious about it and aligns its roadmap to the outcome of that survey.

{% embed https://twitter.com/mgechev/status/1694849667685916839 %}

## Practical Accessibility in Web Development

Accessibility is a huge topic and continues to grow. Even more for services provided in the EU, where the European Accessibility Act finds its way into national laws. Maria Korneeva has you covered with everything you need to know.

{% embed https://www.heise.de/hintergrund/Practical-Accessibility-in-Web-Development-9200584.html %}
Choosing the Right TypeScript Type for Your Objects: Exploring Common Approaches
Tags: typescript, javascript, development
Published: 2023-08-29 20:12:31

TypeScript, with its powerful type system, empowers developers to write more reliable and maintainable code. However, when it comes to defining types for objects, there are various approaches to consider. In this article, we'll delve into three common approaches that TypeScript developers often use and dissect their implications. By understanding the strengths and weaknesses of each approach, you'll be better equipped to make informed decisions for your projects.

**Approach 1: Using a Generic Object Type**

```
type Param = Object;

function f(obj: Param) {
    return obj;
}

f({name: 'GR'});
f(new Date());

```
In the first approach, a generic type Param is used. While this approach allows acceptance of various object shapes, it lacks specificity. The limited type information may hinder type-specific operations and hinder access to object-specific properties and methods.

**Approach 2: Using a Mapped Type**

```
type Param = Record<string, unknown>;

function f(obj: Param) {
    return obj;
}

f({name: 'GR'});
f(new Date());

```

The second approach introduces a Param type defined with Record<string, unknown>. This provides more flexibility by allowing keys to be strings and values to be of any type (unknown). While offering improved specificity, it still falls short in providing precise type information for specific object types.

**Approach 3: Using an Index Signature**

```
type Param = {
    [index: string]: unknown;
};

function f(obj: Param) {
    return obj;
}

f({name: 'GR'});
f(new Date());

```
In the third approach, an index signature is used to define the Param type. This method offers flexibility similar to the previous one, accommodating objects of varying structures. However, relying solely on index signatures may sacrifice code intuitiveness and detailed type information.

**Considerations and Best Practices**

When selecting an approach, several factors come into play:

- Type Safety: Prioritize strong type safety. Specific types facilitate accurate type checking during compilation, reducing runtime errors.
- Specificity: Opt for precise types that reflect the actual data structure. Clear type definitions lead to better code suggestions and documentation.
- Code Intuitiveness: Choose an approach that maintains code readability. Intuitive code improves maintainability.
- Documentation: For team collaboration, well-defined types assist in understanding function expectations and results.
- Code Reusability: Aim for reusable types that contribute to a consistent codebase.

In conclusion, while the presented approaches offer varying degrees of flexibility, favoring specific types is recommended for enhanced type safety and code clarity. TypeScript's type system is a valuable asset for error prevention and code quality improvement. By making informed decisions about type definitions, you can harness the full potential of TypeScript in your projects.
Some awesome CSS experts...
Tags: css
Published: 2023-08-29 20:03:14

Here are some awesome persons:

- [Amit Sheen](https://amitsh.com/)
- [Ben Evans](https://www.tinydesign.co.uk/ben-evans-portfolio/)
- [Stephanie Eckles](https://smolcss.dev/)
- [Kevin Powell](https://www.youtube.com/channel/UCJZv4d5rbIKd4QHMPkcABCw)
- [Chris Coyier](https://chriscoyier.net)
- [Lea Verou](https://lea.verou.me/)