teleren/devto huggingface dataset:
Fast Storage - Netlify Blob challenge
Tags: netlifychallenge, devchallenge, webdev, javascript
Published: 2024-05-12 20:50:07

*This is a submission for the [Netlify Dynamic Site Challenge](https://dev.to/challenges/netlify): Build with Blobs.*

## What I Built
I want to build a webapp to support freelancer, software engineers to host their digital products quickly for their MVP. Previously, I would host my downloadable resources on S3 and share with my customers or put it into my landing pages. However, I hate the fact that I have to update this link on all my pages every time when I update new version of the file. 

So what I want to have is:
1. Easily create a product with a downloadable digital file.
2. Get a fixed + permanent link for the product. Every time I update the product by uploading a new file, the link won't need to be changed.
3. Able to create an auto expiration link for a product so that I can use it for any email or promotion campaigns. The link will live for a period that I defined and then it will be invalidated without me doing any thing.


## Demo
<!-- Share a link to your Netlify app and include some screenshots here. -->

All the features I built in last few days are listed in this landing page here: https://regal-madeleine-9b4642.netlify.app/

A quick look of a few screens showing the features:

### Mobile screens to add/update products

![Mobile screens](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kfbscnuugja3us2dj6gx.png)

### Expirable link creation

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

## Platform Primitives
<!-- Tell us how you leveraged Netlify Blobs. -->
I'm using Netlify Blobs to store both the products' photo and binary files. The products and the Blobs' keys are then stored into a DynamoDB table so that I can manage them properly.

DynamoDB also comes handy with the ability to expire an item. I used this for the short-live link features.

<!-- Did you implement additional platform primitives like the Netlify Image CDN or Cache Control? Tell us about that too! You may qualify for more than one prompt. -->
I'm using Next.js Image so it will leverage Netlify Image CDN as well.

<!-- 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. -->


<!-- Don't forget to add a cover image (if you want). -->

Here is a cover image for my landing page


![Landing Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oxgz82emb8mib2m3n4kd.png)

<!-- Thanks for participating! -->
Understanding the Practical Application of the @Transactional Annotation in Spring Boot
Tags: java
Published: 2024-05-12 20:47:13

## Introduction

In Spring Boot, @Transactional is one of the most used annotations as it is used to manage transactions and used to define a scope of transaction. It can either be applied to the method level or class level. It provides data consistency and reliability.

## Understanding transaction management in Spring Boot using @Transactional

•	@Transactional annotation simplifies transaction management by providing a more declarative approach.
•	This annotation can be used at the method level or class level.
•	Developers can focus more on the business logic aspect and the annotation takes care of the transaction management.
•	Transactional annotation is used for managing transactions in the spring-boot application.


## Why Do We Need Transaction Management?

Let's grasp the concept of transactions through the provided example, considering we are having 2 tables, offer_criteria and offer when saving offer data into the database, it is crucial to save to save both information to the database.

## Attributes of @Transaction

•	Propogation — defines our business logic’s transaction boundary. Spring boot manages to start and pause a transaction according to the propagation setting set.
•	Isolation- represents how changes applied by concurrent transactions are visible to each other. Each isolation level prevents zero or more concurrency side effects on a transaction. 
•	ReadOnly- marks the transaction as read only.
•	TimeOut- sets the time limit for the transaction.
•	RollbackFor & NoRollbackFor — Specify exceptions that trigger a rollback or do not trigger a rollback, respectively.

Hope this article has given you more understanding about @transactional annotation and the importance of using it when dealing with more than one database call in single transaction.

Thanks for reading, kindly give like and follow for more articles.
Day 42/366
Tags: 1percentplusplus, 100daysofcode
Published: 2024-05-12 20:32:15

🚀 **Today's Learning:**

🌟 DSA

- Print all subsequences/Power Set
- Generate all binary strings

🌟 Dev

- Use of postman for API testing

🔍 **Some Key Highlights:**

DSA

To print all subsequences or the power set of a given set, you'd typically use a recursive approach. Starting with an empty subsequence, you'd iterate through each element in the set. At each step, you have two choices: either include the current element in the subsequence or exclude it. You continue this process recursively, generating subsequences that include or exclude each subsequent element. The base case occurs when you've processed all elements, at which point you print or store the generated subsequence. By exploring all possible combinations, you effectively generate all subsequences or the power set of the original set.

For generating all binary strings of length n, you can employ a similar recursive strategy. Starting with an empty string of length n, you'd explore each position in the string. At each position, you can either append '0' or '1'. You continue this process recursively until you've filled all n positions in the string. Once you've reached the base case (when all positions are filled), you print or store the generated binary string. By systematically exploring all possible combinations of '0' and '1' at each position, you generate all binary strings of length n.

DEV

Using Postman for API testing simplifies the process by providing a user-friendly interface for sending requests to an API endpoint and analyzing the responses. Much like sending a request through a web browser, you can input the endpoint URL, select the HTTP method (such as GET, POST, PUT, DELETE, etc.), and include any required headers, parameters, or body content. Postman allows you to organize requests into collections, making it easy to manage and run tests for different APIs or endpoints. Additionally, you can set up and automate workflows by chaining requests together, defining variables, and writing tests to verify the correctness of the responses. Postman's features, including environment variables, pre-request scripts, and test scripts, streamline the testing process and facilitate collaboration among team members. Overall, Postman serves as a comprehensive tool for API testing, offering a range of functionalities to ensure the reliability and functionality of APIs.

 #100daysofcode #1percentplusplus #coding #dsa
PostgreSQL für django aufsetzen - django in Produktion (Teil 2)
Tags: django, production, postgres
Published: 2024-05-12 20:30:56

## Vorwort

Im letzten Teil haben wir den Server bereit gemacht. In diesem Teil wird es um die Datenbank gehen. Ich habe mich für PostgreSQL entschieden, da es eine lange bewährte, viel genutzte Open - Source Datenbank ist. Ebenso ist Postgres natürlich skalierbar, d.h. wenn einmal mehr Nutzeranfragen kommen sollten kann man den Server anpassen, sodass eine große Anzahl von gleichzeitigen Anfragen verarbeitet werden kann.

### PostgreSQL installieren

Zuerst müssen wir das ganze via apt installieren:
```
sudo apt install postgresql postgresql-contrib
```

Jetzt können wir auf die PostgreSQL Datenbank zugreifen:
```
sudo -u postgres psql

# Nun sollte das Prompt so ausschauen:
psql (15.6 (Debian 15.6-0+deb12u1))
Type "help" for help.

postgres=#
```

### Datenbank & Nutzer erstellen

Jetzt erstellst du deinen eigenen Datenbank Nutzer.

```
# Verbinde dich mit postgres
sudo -u postgres psql

# Erstelle deine Datenbank - benutze Natürlich deinen eigenen Namen ;)
CREATE DATABASE meine_datenbank_xyz;

# Nun kannst du dich mit deiner Datenbank Verbinden
\connect meine_datenbank_xyz

# Jetzt kannst du deinen eigenen Nutzer für die Datenbank mit Passwort erstellen.
CREATE USER mein_nutzer WITH PASSWORD 'password';
```

### Datenbank Schema und PSQL 15

Seit PostgreSQL 15 gibt es bei der Sicherheit von Postgres ein Update.
`Remove PUBLIC creation permission on the public schema (Noah Misch) The new default is one of the secure schema usage patterns that Section 5.9.6 has recommended...`
Das hat Auswirkungen auf das Aufsetzen der Datenbank mit django. [Hier kannst du mehr darüber lesen](https://gist.github.com/axelbdt/74898d80ceee51b69a16b575345e8457)

Wenn du also jetzt `python manage.py migrate` ausprobieren würdest, hättest du folgende Fehlermeldung: `permission denied for schema public`

Deswegen müssen wir jetzt das Schema Autorisieren und deinen Nutzer etwas anpassen:
```
CREATE SCHEMA mein_schema AUTHORIZATION mein_nutzer;
ALTER ROLE mein_nutzer SET client_encoding TO 'utf8';
ALTER ROLE mein_nutzer SET default_transaction_isolation TO 'read committed';
ALTER ROLE mein_nutzer SET timezone TO 'CET';
```

Nun sollte `python manage.py migrate` funktionieren. Das werden wir uns im nächsten Teil anschauen!
Explore Worldwide Healthcare-Access Global Doctors & Hospitals Database
Published: 2024-05-12 20:26:20

Discover comprehensive healthcare options around the globe with Access Global Doctors & [Hospitals Database](https://doctorsinfo.co/). Whether you're planning a trip abroad or seeking specialized treatment, our extensive database connects you with trusted medical professionals and top-notch facilities worldwide. Access essential information, including services offered, accreditation, and patient reviews, ensuring you make informed decisions about your healthcare needs, wherever you are. Find Out More:- [Doctorsinfo](https://doctorsinfo.co/)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3yjansfzd276fqdg5z5e.jpg)
Microsoft OpenAI: Errors I Learned
Tags: azure, ai, learnings, community
Published: 2024-05-12 20:01:42

Greetings my fellow Technology Advocates and Specialists.

This is the __Chapter #5__ of my __Data & AI__ Series based on __Microsoft Build AI Day, Switzerland, 2024.__

In this Session, I will provide readers, the list of __Known Errors in Microsoft OpenAI.__ which I learned recently in AI Day, Switzerland.

| __CODE REPOSITORY:-__ |
| --------- |

{% github arindam0310018/09-May-2024-Data-And-AI__All-In-One %} 

| __Error #1:-__ |
| --------- |
| __HTTP Code 429__ |
| This means "Too many requests exceeding resource limits". The limitation can be because of CPU usage, Memory usage and maximum concurrent connections. |
| ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x6932oaxapteg45843pw.jpg) |

| __Error #2:-__ |
| --------- |
| __Common Error with GPT 3.5__ |
| ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hvtc29slx7dljlv9j4jb.jpg) |

I will keep updating this blog as and when I learn more !

__Hope You Enjoyed the Session!!!__

__Stay Safe | Keep Learning | Spread Knowledge__
Microsoft OpenAI Security
Tags: azure, ai, learning, community
Published: 2024-05-12 20:01:10

Greetings my fellow Technology Advocates and Specialists.

This is __Chapter #3__ of my __Data & AI Series__ based on __Microsoft Build AI Day, Switzerland, 2024.__

In this Session, I will provide readers, the details which I captured on __Microsoft OpenAI Security.__

| __CODE REPOSITORY:-__ |
| --------- |

{% github arindam0310018/09-May-2024-Data-And-AI__All-In-One %}

| 1. AI Pain Points:- |
| --------- |
| ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jqbfsc4mzecnt5ej3vpn.jpg) |

| 2. Generative AI Threat Map:- |
| --------- |
| ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8i7badddzuhjj6cvfyad.jpg) |

| 3. New Principles for AI Security:- |
| --------- |
| ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r5m720w2zbfpr9k7trip.jpg) |

| 4. The way Microsoft Addresses risk from attackers:- |
| --------- |
| ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/10hu1v6j7s22053sgb6k.jpg) |

| 5. How does Microsoft address risks from the use or misuse of AI:- |
| --------- |
| ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0wt2q4aw6cfsl79n1zye.jpg) |

| 6. Security Control Within AI Systems:- |
| --------- |
| ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/utl2crp6s1ixh4t9wkou.jpg) |

| 7. Threat Modelling Scenarios:- |
| --------- |
| ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/02c9i0qx9379xycmak34.jpg) |

| 8. Threat Mapping Template: Mapping Vulnerabilities with Mitigations:- |
| --------- |
| ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uphrpe8g122qa0nze54v.jpeg) |

| 9. Secure AI :- |
| --------- |
| ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mh115zda884hvt91aifc.jpg) |

| 10. Security for AI - Ever Evolving Process:- |
| --------- |
| ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0gamt0ktvwp6n4er0n4h.jpg) |

__Hope You Enjoyed the Session!!!__

__Stay Safe | Keep Learning | Spread Knowledge__
Getting Started with TypeScript: Types
Tags: typescript, learning, javascript, tutorial
Published: 2024-05-12 19:57:20

## Type

**What is Type?**

_Easy way to refer to different properties + functions that a value has_.

**Let's learn from an example**

`"red"`

What do you see above, it's a string. That's right. But also
It is a value that has all the properties + methods that we assume that a string has 

**Properties + Methods a 'string' has in JS**

_charAt(), charCodeAt(), concat(), includes(), endsWith(), indexOf(), lastlndexOf(), localeCompare(), match(), length and so on...._

I hope you understand from the above example what a type is.

## Categories of Types

In the world of typescript there are two different categories of types.


1. Primitive Types
2. Object Types

## Primitive Types
Primitive types are all the basic types you might guess.

- number
- string
- boolean
- symbol
- void
- null
- undefined

## Object Types
These are any types you create or any other types that are built into language itself.

- functions
- classes
- arrays 
- Objects

**Why do we care about types?**

1. Types are used by the Typescript Compiler to analyze our code for errors
2. Types allow other engineers to understand what values are flowing around our codebase

Examples of Types

```typescript
const today = new Date();
```

I created a variable that is an instance of a Date object, if I hover of that variable my code editor will tell me the type of value this variable is pointing at.

> const today: Date

Typescript can now use this information to decide what we can do with this variable. For example if we use this variable and put a dot at the end, I will see my autocomplete pop up here.

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

This is listing out all the different functions and properties a Date object has. Typescript knows that because it has internal definition of what a Date is.

Similarly if we try to reference a value that a doesn't exist in the Date object, we will immediately see an error.


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

Now lets create a plain JavaScript Object.

```typescript
const person = {
    age: 20,
    getAge: function(): number {
        return this.age;
    }
}
```

If I hover over the variable now, it will show all the properties and the method the object has.


![Typescript](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4z4bbessekg6uwfh5bsg.png)


I hope by these examples you have the basic idea of types in TypeScript. We will discuss more about each of these in the later posts.
Stacks in Action: A Dive into the Concept and Implementation
Tags: datastructures, stack, programming
Published: 2024-05-12 19:47:21

A stack is a data structure that allows the addition and removal of elements with a specific rule: the last element to be added is the first one to be removed. This rule follows the **LIFO (Last-In, First-Out)** order, which means that the last item to enter the stack is the first to leave. Stacks are similar to a real-life stack of plates, where the plate placed on top of the stack is the first to be removed.

Now, let's take a look at a Java code example representing a simple stack implementation:

```java
import java.util.List;
import java.util.ArrayList;
import java.util.function.Consumer;

public class Stack<T> {
    private int top;
    private int length;
    private List<T> data;

    public Stack() {
        this.top = -1;
        this.length = 0;
        this.data = new ArrayList<T>();
    }

    public boolean isEmpty() {
        return this.length == 0;
    }

    public void push(T element) {
        this.top++;
        this.length++;
        this.data.add(element);
    }

    public T getTop() {
        if (this.isEmpty()) {
            throw new RuntimeException("empty stack");
        }

        return this.data.get(top);
    }

    public T pop() {
        if (this.isEmpty()) {
            throw new RuntimeException("empty stack");
        }

        T element = this.data.remove(top);

        this.top--;
        this.length--;
        return element;
    }

    public void forEach(Consumer<T> consumer) {
        for (int i = this.top; i >= 0; i--) {
            consumer.accept(this.data.get(i));
        }
    }
}
```

In the code above we have a simple stack structure with 3 properties:

- `top`: The index of the top element.
- `length`: The length.
- `data`: A list of a generic type to store the data.

And we have 3 main methods:

- `push`: The top position will be the next one, the length will be incremented by 1 and the new element will be added to the top of the stack.

- `pop`: This method checks if the stack is empty. If it is, an exception is thrown indicating that the stack is empty. If it is not empty, it retrieves the top element, decrements the top index and the length by 1, and then returns the removed top element.

`push` usage example:

```java
Stack<Integer> stack = new Stack();
stack.push(10); // index 0
stack.push(20); // index 1
stack.push(30); // index 2
// the top is 2
```

`pop` usage example:

```java
Stack<Integer> stack = new Stack();
stack.push(10); // index 0
stack.push(20); // index 1
stack.push(30); // index 2
// the top is 2
Integer removed = stack.pop();
// after pop top is 1
```
what happens when you type https://www.google.com in your browser
Tags: dns, firewall, loadbalancer, https
Published: 2024-05-12 19:45:59

**DNS Request**:

A browser sends a DNS request to a DNS server to resolve the domain name "www.google.com" into an IP address.
**TCP/IP Communication**:

Once the DNS server responds with the IP address, the browser establishes a TCP connection with the server at that IP address.
**Firewall**:

The firewall checks the incoming connection request to ensure it's safe and allowed based on configured rules.
**HTTPS/SSL**:

 HTTPS(Hypertext Transfer Protocol Secure) is used, an SSL(Secure Sockets Layer) handshake occurs between the browser and the server to establish a secure, encrypted connection.
**Load Balancer**:

In a large-scale setup like Google's, incoming requests often go through a load balancer. This device distributes incoming network traffic across multiple servers to ensure efficient use of resources and improved performance.
**Web Server**:

The load balancer directs your request to one of Google's web servers. The web server processes the HTTP request, retrieves the requested webpage (in this case, the Google homepage), and generates an HTTP response.
**Application Server**:

For dynamic content or specific functionalities (like search queries on Google), the web server may interact with an application server. The application server runs the necessary scripts or processes to generate dynamic content.
**Database**:

If the request requires data from a database (e.g., search results from Google's index), the application server communicates with the database server to fetch the required information.
Overall, this sequence of events involves multiple layers of technology working together to deliver the requested webpage securely and efficiently.
77WIN | SÒNG BẠC 77WIN CASINO | TẶNG TRẢI NGHIỆM 177K
Published: 2024-05-12 09:25:16

77Win là nhà cái giải trí casino trực tuyến kiếm tiền hấp dẫn. Với kho tàng trò chơi phong phú và nhiều chương trình khuyến mãi tuyệt vời cho khách hàng.
Địa Chỉ: 127 Đường số 79, Khu phố 1, Quận 7, Thành phố Hồ Chí Minh, Việt Nam
Email: darem1sskids@gmail.com
Website: https://77win.mx/
Điện Thoại: (+84) 378329482
#77win #77winmx #77wincasino #nhacai77win
Social Links:

https://77win.mx/

https://77win.mx/dang-ky-77win/

https://77win.mx/nap-tien-77win/

https://77win.mx/rut-tien-77win/

https://77win.mx/tai-app-77win/

https://77win.mx/author/77win-mx/

https://www.facebook.com/77winmx

https://www.youtube.com/channel/UCYXxQHqtUc-j4eHmNSDUUfQ

https://www.pinterest.com/77winmx/

https://www.tumblr.com/77winmx

https://vimeo.com/77winmx

https://www.twitch.tv/77winmx/about

https://www.reddit.com/user/77winmx/

https://500px.com/p/77winmx?view=photos

https://gravatar.com/77winmx

https://www.blogger.com/profile/15831340800420050465

https://77winmx.blogspot.com/

https://draft.blogger.com/profile/15831340800420050465

https://twitter.com/77winmx

https://www.gta5-mods.com/users/77winmx

https://www.instapaper.com/p/77winmx

https://hub.docker.com/u/77winmx

https://www.mixcloud.com/77winmx/

https://flipboard.com/@77winmx/77winmx-1f0remhly

https://issuu.com/77winmx

https://www.liveinternet.ru/users/77winmx/profile

https://beermapping.com/account/77winmx

https://qiita.com/77winmx

https://www.reverbnation.com/artist/77winmx

https://guides.co/g/77winmx/379868

https://os.mbed.com/users/77winmx/

https://myanimelist.net/profile/77winmx

https://www.metooo.io/u/77winmx

https://www.fitday.com/fitness/forums/members/77winmx.html

https://www.iniuria.us/forum/member.php?436026-77winmx

https://www.veoh.com/users/77winmx

https://gifyu.com/77winmx

https://www.dermandar.com/user/77winmx/

https://pantip.com/profile/8134500#topics

https://hypothes.is/users/77winmx

http://molbiol.ru/forums/index.php?showuser=1348116

https://leetcode.com/u/77winmx/

http://www.fanart-central.net/user/77winmx/profile

https://www.chordie.com/forum/profile.php?id=1951556

http://hawkee.com/profile/6821873/

https://www.gta5-mods.com/users/77winmx

https://codepen.io/77winmx

https://jsfiddle.net/77winmx/brt0kf15/

https://forum.acronis.com/user/655225

https://www.funddreamer.com/users/77winmx

https://www.renderosity.com/users/id:1492739

https://www.storeboard.com/77winmx

https://doodleordie.com/profile/7winmx

https://mstdn.jp/@77winmx

https://community.windy.com/user/77winmx

https://connect.gt/user/77winmx

https://teletype.in/@77winmx

https://rentry.co/77winmx

https://talktoislam.com/user/77winmx

https://www.credly.com/users/77winmx/badges

https://www.roleplaygateway.com/member/77winmx/

https://masto.nu/@77winmx

https://www.ohay.tv/profile/77winmx

https://www.mapleprimes.com/users/77winmx

http://www.rohitab.com/discuss/user/2184797-77winmx/