teleren/devto huggingface dataset:
Hello, World!
Tags: flags, opensource, github, typescript
Published: 2023-08-31 19:04:27

This simple "Hello, World!" is here to introduce you to [Basestack](https://basestack.co/) and let you know that we're developing this project transparently and in the open.


**What Exactly is Basestack?**

Basestack is an open-source stack designed specifically for developers and startups. It offers a comprehensive suite of tools, including Feature Flags, with additional tools such as Feedback, Forms, and more on the horizon. Our goal is to empower you in building great products.

**Why Choose Our Feature Flags Platform?**

Basestack Feature Flags is a self-hosting platform that provides an effortless method to host your very own Feature Flags management platform. By leveraging services like [Vercel](https://vercel.com), any developer, whether an indie or startup, gains full control over their features and data. Ultimately, the platform is housed in your account, under your management, giving you complete control over your data.

#### Tools

- ⛳ Feature Flags (_Beta_) [Docs](https://docs.basestack.co/feature-flags) | [Website](https://basestack.co/)
- 📄 Forms (Planned)
- 💬 Feedback (Planned)


#### Check more at:

- [Github Repo](https://github.com/basestack-co/basestack)
- [Twitter](https://twitter.com/basestack_co)
My Portfolio Website
Tags: showdev
Published: 2023-08-31 18:46:50

I have always dreamt of having a space where I could display my work, share my passion, and connect with like-minded individuals. After dedicated effort and a lot of learning, I am thrilled to introduce my very own portfolio [website](https://www.vitaliyprymak.com/).

Creating a portfolio website wasn't just about showcasing my work; it was about crafting a digital representation of my creative journey. I envisioned a clean and visually appealing platform that would not only highlight my projects but also reflect my personality and design aesthetic. 

One of the most exciting parts of this journey was learning about web hosting and domain management. With the help of online resources and tutorials, I was able to grasp the intricacies of GitHub Pages, which allowed me to host my website for free. This was a major milestone, as it gave me the autonomy to manage my site without relying on external platforms.

My portfolio website became a canvas to exhibit a diverse range of projects, from web development endeavors to graphic design creations. Whether it's a visually captivating illustration or a complex coding project, each piece of work represents a stepping stone in my journey.
Rest API using Amazon Lambda & ApiGateway
Tags: aws, cloud, api, serverless
Published: 2023-08-31 17:51:54

![Day24](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/11zghxh804yid0a1hbpx.png)

[24/30] #30DaysOfAWS Today, Amazon Lambda with Amazon ApiGateway & Hands-On.

**AWS Lambda** is a serverless computing service that allows you to run code in response to events without the need to provision or manage servers. You can write your code in various programming languages (such as Python, Node.js, Java, etc.) and upload it to Lambda. When an event occurs (e.g., an HTTP request, a file being uploaded to Amazon S3, a database update), Lambda automatically executes your code in a container, scales as needed, and then stops the execution when the code is finished.

**Amazon API Gateway** is a managed service that enables you to create, publish, maintain, monitor, and secure APIs at any scale. It acts as a front-end for your APIs, allowing you to define endpoints, request/response models, authentication, throttling, and more. API Gateway can be used to create RESTful APIs or WebSocket APIs.

Recently I wanted to make a personal project related to Sinhalen AWS. I make Rest API using Amazon Lambda & ApiGateway. It's a cool project. The procedure is user selects AWS service after that visible service details in Sinhala language. Its now under development publish will soon.

![Architecture Diagram](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0wv6plftbna8v97k7s8m.png)

Step-by-step tutorial for How to create **Rest API using Lambda &
ApiGateway**. You can download it using this [URL](https://lasantha-fileshare-s3-932747549174-v1.s3.us-east-2.amazonaws.com/AWSRestAPICreation.pdf).

Learn More - https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html

Thanks for reading the Article.

**Connect with me**
- Website - https://devopswithlasantha.tech
- LinkedIn - https://www.linkedin.com/in/lasanthasilva
- Twitter - https://twitter.com/LasanthaSilva96
- Medium - https://medium.com/@lasanthasilva
- Github - https://github.com/sanju2
Working Memory
Tags: productivity, programming, developer, coding
Published: 2023-08-31 17:44:34

Working Memory is about all the things that are on your mind at any given moment.

It’s like the RAM on your computer. It’s how your mind juggles and makes sense of the various things that you care about as you go about your day.

It’s something we kind of take for granted.

To help ourselves manage our working memory, many of us reflexively rely on some kind of notepad. As we work on things, we jot things down. Jotting things down is one form of “resolving”, at least temporarily, something our mind has been hanging on to. This lightens our mental load, letting us devote our attention more fully to what’s in front of us. The act of writing can also help clarify what may have previously been hazy.

## Working memory vs. knowledge bases

This way of jotting things down willy nilly can feel messy, even improper - like we’re somehow doing notes wrong. But this is your working memory! If what you’re jotting down is too neat and tidy, you’re probably keeping it in your head too long. Your threshold for what is acceptable to write down is probably too high.

This is the key difference between your working memory and your knowledge base. A knowledge base is for the nuggets of knowledge that you want to record for posterity. Like the hard drive on your computer. For the knowledge base serve its purpose successfully, it makes sense to put a little extra thought into how things are written and organized. Plus, a knowledge base is often thought of as a showcase for others. It’s where formal insights are published.

We often think of notes as serving the purpose of a knowledge base. But working memory needs an outlet of its own - usually via notes of the quick, messy variety.

## Your notes shouldn’t slow you down.

When we have a lot going on - a lot on our minds - it’s especially essential that we have a working memory solution to help us out. And while we need to be able to seamlessly capture thoughts without thinking twice, it can also help to compartmentalize things - so that we’re able to effectively shift gears and have the most relevant content at our fingertips when the time comes.

A tool for working memory should be fast and ergonomic, optimized for instant capture, but also for compartmentalization and retrieval. It should let you work in a way that fits your mental model. It shouldn’t burden you with extra cognitive overhead that only undermines its primary purpose. It provides a space to clear your mind, stash things for later, and clarify your next steps. It serves only to help you find greater focus and peace of mind in your day-to-day.


## [Check out Stashpad](https://www.stashpad.com/?utm_campaign=devto&utm_source=articleCTA)

Thanks for reading this post! It comes to you from the good people at Stashpad :)

Stashpad is the note-taking app designed for your working memory. It's made for devs, by devs. It comes with features for technical notes, like markdown support, customizable key bindings, and syntax highlighting. 

Get your thoughts out, organize them effortlessly, and return to them when you're ready.
opieed - event and service manager
Tags: typescript, nextjs, challenge, opieed
Published: 2023-08-31 17:32:59

# opieed
This app is built with Next.js 13, Tailwind, Axios, crypto-js


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

## ⚠️ Under development
This application does not have functionality yet and was created only for the purpose of studies.

### V1.0 Features

- It should be able to register a service;
- It should be able to register an event;

#### Details

- Each service can publish multiple events;
- Each service can subscribe to multiple events;
- Each event have: 
 -  A title
 -  A description
 -  Service Name
 - Optional Version of Service    
 - A JSON schema;

## GitHub
  https://github.com/PetrusNoleto/opieed
## Figma File 
  https://www.figma.com/community/file/1279041818052587181

#### Auth Screens

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

#### Sevices Page

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

#### Events Page
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9osp07eu7nrsjj5r2ae5.png)
Next.js 13 - Use Server Action to submit form data
Tags: webdev, nextjs, beginners, opensource
Published: 2023-08-31 17:32:13

---
title: Next.js 13 - Use Server Action to submit form data
published: true
description: Use Next.js 13 Server Action to submit form data
tags: #webdev, #nextjs, #beginners, #opensource
canonical_url: https://www.kirandev.com/nextjs-server-actions-submit-form
---

Next.js 13 introduces a new feature called [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions). It is built on top of React Actions.

Server Actions are a way to run code on the server when a user performs an action on the client.

For example, when a user submits a form, you can run code on the server to process the form data.

In this article, we will learn how to use Server Actions to submit form data.

Let's create a new Next.js app using the following command:

```bash
npx create-next-app@latest
```

Enable the experimental server actions feature by adding the following code to the `next.config.js` file:

```js
const nextConfig = {
  experimental: {
    serverActions: true,
  },
};
```

Create a new page with a signup form at `app/signup/page.tsx` with the following code:

```jsx
export default function SignupPage() {
  return (
    <form method="POST">
      <input type="text" name="name" />
      <input type="email" name="email" />
      <input type="password" name="password" />
      <button type="submit">Create Account</button>
    </form>
  );
}
```

This page can be accessed at `/signup`.

Now you can add a function within the page component to handle the form submission. This function will be called when the user submits the form.

```jsx
export default function SignupPage() {
  const createAccount = async (formData: FormData) => {
    "use server";

    const name = formData.get("name");
    const email = formData.get("email");
    const password = formData.get("password");

    // Validate the form data and save it to the database

    console.log({ name, email, password });
  };

  // Form code
}
```

The `use server` directive makes sure that this function is only executed on the server.

Within the `createAccount` function, we can access the form data using the `FormData` API. We can then process the form data and save it to the database.

Let's use this function to handle the form submission by adding the `action` attribute to the form element:

```jsx
<form action={createAccount} method="POST">
  ...
</form>
```

Here is the complete code for the page component:

```jsx
export default function SignupPage() {
  const createAccount = async (formData: FormData) => {
    "use server";

    const name = formData.get("name");
    const email = formData.get("email");
    const password = formData.get("password");

    console.log({ name, email, password });
  };

  return (
    <form action={createAccount} method="POST">
      <input type="text" name="name" />
      <input type="email" name="email" />
      <input type="password" name="password" />
      <button type="submit">Create Account</button>
    </form>
  );
}
```
Machine learning for traffic analysis
Tags: machinelearning, cybersecurity, security
Published: 2023-08-31 17:24:00

Machine learning can be used in various cybersecurity applications to provide analytical approaches to detect and react to an attack. Additionally, it can improve security procedures.


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


Some typical machine learning mechanisms used in network traffic analysis include:

1.Network-based defense: This technique tries to lower the likelihood of attacks on the network by adding an extra layer of defense. It does this by setting up policies and controls to specify users who are authorized to do what on the network.



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



2.Intrusion detection: Applications can use machine learning algorithms to detect cyberattacks and take appropriate action before they go into effect. This is done by using network surveillance software to look for malicious activity where the behavior varies from normal users. 


There are two main problems with using machine learning for network traffic analysis:

1. Time and requirements: The model must be trained and updated on a regular basis in order to classify network traffic effectively. This process can be time-consuming, especially when dealing with large amounts of data. Additionally, the model must be specific to the task it is being used for.
         
2. Complexity: The process of classifying network traffic is complex due to the ever-changing nature of cyberattacks. There are many factors to consider when determining how well-suited a particular method is for classifying a particular type of attack. Additionally, each technical layer has its own subcategories,
which makes it difficult to use the same algorithms across them.


Overall, machine learning is a powerful tool that can be used to improve cybersecurity. However, it is important to be aware of the limitations of this technology and to take steps to mitigate these limitations.


Reference paper: https://www.sciencedirect.com/science/article/pii/S1877050920305494%5C
Learn TypeScript from experts
Tags: typescript, javascript, programming, javascriptlibraries
Published: 2023-08-31 17:21:42

Are you ready to ride the TypeScript wave all the way to mastery? Let me introduce you to a fantastic resource: Zero to Mastery's TypeScript Bootcamp. It is like a journey where you will effortlessly master TypeScript coding!

So here's how it works:

- You will learn everything from the ground up, whether you are completely new to this or have some prior experience. 

- First-hand experience working on real-world projects. Your skills will advance, but you'll also unlock your creative potential.

- Join the popular Zero to Mastery community. It is a place where mentors and students may help one another and grow together.

Sound exciting? You bet! Grab your spot at the TypeScript Bootcamp here: [TypeScript Bootcamp](https://academy.zerotomastery.io/a/aff_k6qbrm5m/external?affcode=441520_nmkbcy8m)

This is for you if:

- You're a developer ready to rule the world of coding with the language that is expanding most rapidly.

- Practical knowledge excites you, especially if it leads to actual employment chances.

- You are ready for some practical, real-world coding action because you are tired of those hazy tutorials.

- Don't let this incredible coding opportunity pass you by! Your love for coding is waiting!
Research associate roles everybody should know
Published: 2023-08-31 17:21:10

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hf3w0j8fgswqokr9604d.jpg)
In academic and research institutions, as well as in some industries, a research associate is a common professional position. Typically, research associates work with other researchers, scientists, and faculty members on a variety of research projects. The duties of research associates can change depending on the organization and the particular field, but the following are some typical duties:
Working closely with principal investigators (PIs), research scientists, or professors, research associates plan, carry out, and manage research projects. They provide their knowledge when designing, carrying out, and analyzing experiments or studies.
Literature Review: To comprehend the state of the art and the context of the research field, they conduct in-depth literature reviews, which guide the formulation of research hypotheses and methodologies.
Laboratory and Fieldwork: Research associates may carry out laboratory experiments, fieldwork, or clinical trials, depending on the field. They make certain that procedures are accurately and securely followed.
Technical Competencies: Research associates frequently need specialized technical competencies related to their research area, such as competence in the use of laboratory instruments, software tools, data analysis software, programming languages, etc.
They record the procedures, approaches, findings, and outcomes of the research. For the purpose of keeping track of the study's progress and disseminating its findings to the scientific community, this documentation is essential.
Data collection and analysis: [Research associates](https://bigsciences.com/) gather data using various techniques such as surveys, observations, experiments, and more. They are frequently in charge of organizing and processing data using statistical and analytical methods in order to reach meaningful conclusions.
The 7 Best PS3 Games You Must Play
Tags: games, playstation, gaming, ps3
Published: 2023-08-31 17:13:44


[Kazemario Evolution](https://www.kazemario.com/) | The PS3 is a game console made by Sony that was released in 2006 and officially stopped production in 2017. Although the era has ended, the PS3 still has a lot of enthusiasts. This is evidenced by the PS3 selling well in existing online stores.

For about seven years, competing in the console market. The PS3 has presented a number of games that are very exciting and worth playing. And here, Kezemario will provide recommendations for the 7 Best PS3 Games That You Must Play.

1. The Last of Us
2. Red Dead Redemption
3. Uncharted 2: Among Thieves
4. God of War 3
5. GTA 5
6. PES 2018
7. Call of Duty: Modern Warfare 2

Here's the link to a full post: https://www.kazemario.com/2023/08/the-7-best-ps3-games-you-must-play.html
How to add new data to JSON file using Pyhton and keep the JSON file format
Tags: python, programming, json, coding
Published: 2023-08-31 17:13:33

## Hi 🙂🖐


In this post, I will share with you how to add new data to JSON file using Pyhton.

If you have this JSON data in this format, how can we deal with this data in this format? It is not as easy as you think; some programmers, especially beginners, face problems. The problem happened when they started to add new data. In this post, I will share with you an easy way to solve this problem.


## This is the JSON file called `database.json`

```json
{
    "tasks": [
        {
            "name": "signup and earn 0.20$",
            "description": "signup and earn money",
            "money": 0.2
        },
        {
            "name": "signup and earn 0.10$",
            "description": "signup and earn money",
            "money": 0.1
        },
        {
            "name": "signup and earn 1.20$",
            "description": "signup and earn money",
            "money": 1.2
        }
    ]
}
```

## Now i will to add new data to this file

```python
import json

tasks = json.load(open('database.json', 'r'))['tasks']

tasks.append({"name": "test", "description": "2222", "money": 1})

json.dump(tasks, open('database.json', 'w'))
```

## As you can see, the JSON format will be damaged.
```
[{"name": "signup and earn 0.20$", "description": "signup and earn money", "money": 0.2}, {"name": "signup and earn 0.10$", "description": "signup and earn money", "money": 0.1}, {"name": "signup and earn 1.20$", "description": "signup and earn money", "money": 1.2}, {"name": "test", "description": "2222", "money": 1}]
```

This happend becuse you write a tasks list to the json file

```python
tasks = json.load(open('database.json', 'r'))['tasks']
print(tasks)
```
## result
```
[{'name': 'signup and earn 0.20$', 'description': 'signup and earn money', 'money': 0.2}, {'name': 'signup and earn 0.10$', 'description': 'signup and earn money', 'money': 0.1}, {'name': 'signup and earn 1.20$', 'description': 'signup and 
earn money', 'money': 1.2}, {'name': 'test', 'description': '2222', 'money': 1}]
```

To keep the JSON file format 

```python
import json

tasks = json.load(open('database.json', 'r'))


tasks['tasks'].append({"name": "test", "description": "2222", "money": 1})


json.dump(tasks, open('database.json', 'w'), indent=4)
```

## result

```json
{
    "tasks": [
        {
            "name": "signup and earn 0.20$",
            "description": "signup and earn money",
            "money": 0.2
        },
        {
            "name": "signup and earn 0.10$",
            "description": "signup and earn money",
            "money": 0.1
        },
        {
            "name": "signup and earn 1.20$",
            "description": "signup and earn money",
            "money": 1.2
        },
        {
            "name": "test",
            "description": "2222",
            "money": 1
        }
    ]
}
```



**Now we're done 🤗**

**Don't forget to like and follow 🙂**

**Support me on PayPal 🤗**
https://www.paypal.com/paypalme/amr396
Parallel Query Execution in PostgreSQL
Tags: apacheage, postgressql, database, parallelquery
Published: 2023-08-31 16:58:10

PostgreSQL employs a Parallel Query feature that optimizes the execution of certain queries, boosting performance in multi-core systems.

## Understanding Parallel Query

- Parallel Query is invoked when the optimizer deems it the most efficient strategy.
- It employs multiple background worker processes for concurrent execution.

## The Plan Structure

- A query plan with Parallel Query includes a Gather or Gather Merge node.
- The Gather node assembles the parallel execution results.

## Parallel Execution Scope

- If the Gather node is at the plan's top, the entire query runs in parallel.
- If within the plan tree, only the nodes below it run in parallel.

## Optimal Worker Count

- The planner determines the number of workers.
- The chosen workers execute the parallel portion of the query.
- The number of workers can be capped by max_parallel_workers_per_gather.

### Leader's Role

- The session's main process becomes the leader.
- The leader reads the tuples generated by the workers.
- For small result sets, the leader assists in query speed-up.

## Gather Merge Insight

- When using Gather Merge nodes, workers produce sorted tuples.
- The leader merges and maintains the sort order.

## Conclusion
PostgreSQL's Parallel Query mechanism is a powerful tool for enhancing query performance. By leveraging multiple background workers, parallel execution optimizes data retrieval, particularly on multi-core systems. Through careful planning and an understanding of parallel execution's nuances, developers can harness this feature to accelerate query processing, delivering improved responsiveness and efficiency.

## Reference
[parallel query](https://www.postgresql.org/docs/current/how-parallel-query-works.html)