teleren/devto huggingface dataset:
AWS Cost Optimization
Tags: aws, devops, cloud
Published: 2023-07-04 18:30:22

**Cloud Front:** 
CloudFront caching can reduce the cost. With CloudFront caching, more objects are served from CloudFront edge locations, which are closer to your users. This reduces the load on your origin server and reduces latency.

**Auto Scaling:**
AWS Auto Scaling can help you optimize your utilization and cost efficiencies when consuming AWS services, so you only pay for the resources you actually need. When demand drops, AWS Auto Scaling will automatically remove any excess resource capacity, so you avoid overspending. AWS Auto Scaling is free to use and allows you to optimize the costs of your AWS environment.


**Choose the proper Instance Type:**
By choosing the proper instance type, you can reduce costs. With the same configuration from Intel to AMD, you can reduce costs. Moreover, AWS Gravitation will provide you with better performance at a low cost. For an example: c5.large costs 71.54 USD, c5a.large costs 64.24 USD, saving 7.3 USD.


**Choose a proper Region:**
From Bangladesh to Mumbai or Singapore, two closet regions Latency is almost the same, but price is a big difference. For example, the price of EC2- c5a.large in Singapore is 64.24 USD, while it is 34.31 USD in Mumbai. Save around $30.


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

**S3 storage classes and life cycle:**
Depending on your different access patterns, use S3 storage classes. S3 storage classes are purpose-built to provide the lowest-cost storage. Use Lifecycle Management so that objects are stored cost-effectively throughout their lifecycle.

**Terminate unused EC2 completely:**
Sometimes we just stop the unused instance. It is true that a stopped instance won’t generate any costs, but an attached EBS will. So, terminate the idle instance completely.




_More are coming._
Day 786 : Wild
Tags: hiphop, code, coding, lifelongdev
Published: 2023-07-19 21:15:29

_liner notes_:
- Professional : Pretty much got the first draft of my blog post done. Created some images for it. Cleaned up some code for the demo application I made for the blog post. Helped out with some community questions. Had a meeting with my manager to talk about things coming up.

- Personal : So, I got the listing of sessions in my side project. Also got selecting a session to switch over to a form. Didn't get to finish the form that will be filled with the info from the selected session, but I got it started. I went through a few tracks for the radio show and watched a couple of episodes of "Promised Neverland" second season. That show is wild.

![The landscape of Monument Valley, AZ, USA with desert vegetation in the foreground and Mesas in the distance with the setting sun's sunrays shine through to stone columns ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lz9xkks8tb4zo0320n0i.jpg)

Got the new "Secret Invasion" already downloaded in the Disney+ app. Going to eat dinner, go through some tracks and finish up the form in my side project and end the night watching the episode. Maybe sneak in an episode or two of "Promised Neverland".

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube nKXNZ8n3r_M %}
How to import CSV data in spring boot to save in PostgreSQL: Spring Batch
Published: 2023-07-19 21:11:27

This could be done using OpenCSV, Apache POI and Spring Batch 

if you have small amount of Data we can use OpenCSV, if we are using Excel we can use Apache POI, today we tackling the large dataset set situation that we can use Spring Batch .

large dataset can be handled using Spring Batch .
Stream discovery - find a streamer
Tags: refinehackathon, webdev, nextjs, typescript
Published: 2023-07-19 20:49:43

## What I built 
Streamer discovery is web app to discover, create and rate twitch streamer. Guest users can only search streamer. Logged in users can create new streamer and rate existing one.

### Category Submission:

- Best Overall Project
- Most Visually Pleasing
- Most Technical Impressive
- Best Project built using Supabase as the main data provider for the refine app. 
- Best Project built using Material UI as the main UI framework for the refine app.

### App Link
The project has been deployed with Vercel and can be found at the following link: [Stream-discovery](https://stream-discovery.vercel.app/streamers)

### Screenshots
**Main page**
![Main page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rtveuv0iyqa2whas8n9f.png)

**Login page**
![Login page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hprg6orjv0lqr89660cf.png)

**Register page**
![Register page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bm5wqrsf459cso5soea7.png)

**Create new streamer**
![Create new streamer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/99a8pw1r4x7g4nppx0ds.png)

### Description 
Stream discovery is a web app for people who likes watching streams.
This app helps find a new streamer.
People can create account and then add new streamers and rate existing.
Guest users can only see and filter curretly added streamers.

### Link to Source Code 
The source code for the project can be found on GitHub at the following repository: [GitHub Repo](https://github.com/JustOndra/stream-discovery)

### Permissive License 
The project is licensed under the [MIT](https://github.com/JustOndra/stream-discovery/blob/main/LICENSE).

## Background (What made you decide to build this particular app? What inspired you?)
I decided to build this app beacause nowadays is pretty popular the watch some people streaming things that they like.
I wanted to make app for people to easily find new streamers.
They can choose streamers based on rating from other users. 

### How I built it (How did you utilize refine? Did you learn something new along the way? Pick up a new skill?) 

This Project is built using the following resources:
- [Refine](https://refine.dev/)
- [Next.js with typescript](https://nextjs.org/)
- [Material UI](https://mui.com/)
- [Supabase](https://supabase.com/)

I definitely learn more about Next.js and discovered Refine which looks nice and good choice for my project.
I also learn how to work with Supabase which is also great tool that simplified so many things. And more importantly I learned how to work a use documentation of new tech tools.

### Additional Resources/Info
I would love to continue in developing this app and add new features.
Something I have in mind:
- Add fetch directly to twitch.tv to fetch data for particular streamer handle
- Add add a comment for logged in users
- Read comments for guest users.
ReactJs Virtual DOM
Tags: beginners, react, javascript, programming
Published: 2023-07-19 20:16:05

**What is DOM? And why we are understanding react DOM?**

DOM stands for '**Document Object Model**'. It is a structured representation of HTML in the webpage or application . In modern javascript framework have change the way of web development.They have provided a great abstraction by addressing common issues in browsers and enhancing performance using methodologies that were not possible through plain JavaScript.

One of the most popular javascript framework of front-end development is React js.

**What is react dom? How it is work?**

React popularized something called the Virtual DOM.The virtual DOM is only a virtual representation of the actual DOM.For every DOM object, there is a corresponding Virtual DOM object. Everytime the state of our application changes, the virtual DOM gets updated instead of the real DOM.
ReactDOM is a package that provides DOM-specific methods that can be used at the top level of a web app to enable an efficient way of managing DOM elements of the web page. ReactDOM provides the developers with an API containing the following methods and a few more. 

**-render()**
**-findDOMNode()**
**- unmountComponentAtNode()**
**- hydrate()**
**- createPortal()**

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


**How does a page render in a browser?**

When a browser loads any webpage, the page is loaded in multiple parts, then it is constructed in the browser and rendered.

- The HTTP protocol returns data in bytes.

- These bytes are converted into characters, then tokens, then nodes, and then, lastly, the object model.

- The DOM (Document Object Model) is a tree-like structure that represents HTML. It is generated from a webpage’s HTML markup. Similarly, the CSSOM (CSS Object Model) is generated from a webpage’s CSS markup. The DOM and CSSOM are loaded independently as trees, and then they are combined into a render tree to form a webpage.


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

**Why is React so fast?**

There is no direct access or change to the DOM elements in Virtual DOM. When virtual DOM gets updated, React compares it with a virtual DOM snapshot that was taken right before the update. It then compares the new virtual DOM with the previous virtual DOM and figures out which objects have changed. 
Once React knows which virtual DOM objects have changed, it updates only those objects on the real DOM and other elements don't get updated as opposed to what the real DOM normally does. This is how virtual DOM works behind the scenes, making it much faster.


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

**Conclusion**

Virtual DOM is a powerful concept that React uses to overcome standard performance issues in the browser.
Python Email Validation
Tags: python, security, productivity, api
Published: 2023-07-19 20:15:29

Hello guys,

Meet PWValid - it is a powerful and very simple Python package to validate and check emails. It helps developers tackle spam and disposable emails.

**PIP Command:** pip install pwvalid
**PYPI Link :** [PWValid](https://pypi.org/project/pwvalid/)

```
import pwvalid 
email = input('Enter Email:')
result = pwvalid.isSpam(email)
print(result)
```

Must Try

Project By [Regem Enteprises](https://regem.in)
Animated Website using HTML CSS and JavaScript
Tags: html, css, javascript
Published: 2023-07-19 20:00:05

Animated Website using HTML CSS and JavaScript

in this video we will learn how to make animated website using HTML CSS and JavaScript from scratch.   Inside the project have bunch of features such as responsive, cool animations and also have animated menus.

So, inside the project have a lot features that are help you to improve your skills, hope this tutorial is helpful and beneficial for you.

after watching the complete tutorial you can learn many new things from it.

{% embed https://www.youtube.com/watch?v=5XEN7xQda3A %}
Istio CRD triplet
Tags: kubernetes, devops, cloudnative, sre
Published: 2023-07-19 19:55:44

One of the most popular choices among organizations for open-source service mesh is [Istio](https://istio.io/latest/docs/setup/getting-started/). As a prerequisite is rather important to understand [the value of a service mesh.](https://medium.com/@dejanualexandru/the-value-of-a-service-mesh-istio-metrics-65c9a929bc25)

To make sure traffic management is in place you're going to manage (minimum) these 3 CRDs:

* **Gateway** = resource describes how to route traffic from the outside world to your mesh-enabled services, typically used to expose your services to external traffic, such as incoming HTTP requests from outside the mesh.
```bash
# list gateways from all namespaces
kubectl get gateways.networking.istio.io -A
```
* **VirtualService** = resource that defines a set of routing rules for traffic sent to a Kubernetes service.
```bash
# list virtualservices from all namespaces
kubectl get virtualservices.networking.istio.io -A
```
* **DestinationRule** = resource that defines the policies that apply to traffic after it has been routed through VirtualService
```bash
# list destinationrules from all namespaces
kubectl get destinationrules.networking.istio.io -A
```

When a request comes into the `gateway`, Istio will use the rules defined in the `virtualservice` resource to determine which service to route the traffic to. Afterwards the `destinationrule` applies the policies to traffic intended for the service after routing has occurred.

There're are many other Istio resources, to list them just `kubectl api-resources | grep -i istio` and if you need to inspect what Istio resource are in the cluster, you can use `kubectl get istio-io -A`.
PETSCIITile:showcase
Tags: petsciitile, opensource, development, csharp
Published: 2023-07-19 19:49:30

hello, as a mimi testand a fun thing, i will start a showcase post, make something cool in PETSCIITile and boom! i will see al of them, if u can, go to https://github.com/jossse69/PETSCII-Tile/releases and have some fun, if u want, you can also contribute! see ya!

(josé luiz costa beker)
Sculpting Health: Weight Loss & Wellness Centers Redefine Body Transformation
Published: 2023-07-19 19:26:42

In an era anywhere health and well-being are at the forefront of society's priorities, weight loss and wellness hubs play a pivotal role in helping individuals achieve their fitness goals. These centers are no extensive just about shedding pounds; they have evolved into comprehensive wellness hubs, redefining body change in unique and holistic ways. Join us as we delve into how weightiness loss and **[weight loss and wellness center](https://alchemywellness.health/)** are sculpting a healthier future for individuals.

Customized Fitness Programs: Gone are the beings of one-size-fits-all workout routines. Modern weight loss and wellness centers appreciate that each person's body is different, with unique needs and trials. They offer customized fitness programs that are tailored to individual fitness planes, body types, and goals. This personalized approach ensures maximum results without the peril of injury or burnout.

**Nutrition Psychoanalysis for Sustainable Results**: 

Effective weight loss is not solely about intense workouts but also nearby nourishing the body with the right foods. Wellness centers now proposition nutrition counseling, where certified experts educate clients about well-adjusted diets and healthy eating habits. By fostering a sustainable rapport with food, individuals can achieve long-lasting results.

Mindfulness and Rational Wellness: Weight loss journeys often involve psychological hurdles. To address this aspect, recent wellness centers incorporate mindfulness practices and mental wellness curriculums. These may include meditation sessions, stress management techniques, and works that help individuals develop a positive mindset towards their qualification goals.

**Integrating Know-how for Progress Tracking**: 

Technology plays a significant role in modern weight loss and wellness centers. From qualification trackers to mobile apps, individuals can display their progress and have real-time feedback. This integration of technology enhances motivation and liability, ultimately contributing to successful transformations.

Holistic Wellness Services: Yonder weight loss, these centers focus on holistic well-being. They offer amenities such as spa treatments, massage therapy, and stress-relief programs. By talking the physical, mental, and emotional aspects of health, individuals can experience a complete conversion, inside and out.

**Conclusion**: 

Weight loss and wellness centers have advanced into comprehensive havens for achieving optimal health. By offering personalized fitness programs, nutrition counseling, mindfulness practices, and general **[TRT therapy near me](https://alchemywellness.health/service/mens-health/)** wellness services, they redefine body transformation. These centers empower personalities to sculpt a healthier and more fulfilling life, promoting a positive and sustainable style to overall well-being.
What's Here in Ruby Class Hash
Tags: ruby, hash, rubywhatshere
Published: 2023-07-19 19:01:16

---
title: What's Here in Ruby Class Hash
published: true
description: 
tags: ruby, hash, rubywhatshere
---

Check out the [What's Here](https://docs.ruby-lang.org/en/master/Hash.html#class-Hash-label-What-27s+Here) section in the documentation for Ruby class Hash.  (Full disclosure: I wrote it.)

It's not a tutorial; it's an overview of methods by category (creating, comparing, querying, etc.).
Google Apps Script support JSDoc and Markdown
Tags: google, googleappsscript, googledocs, markdown
Published: 2023-07-19 18:46:44

---
title: Google Apps Script support JSDoc and Markdown
published: true
description: Google Apps Script Docs Support
tags: Google, GoogleAppsScript, GoogleDocs, Markdown
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-07-19 18:44 +0000
---

Yes Google Apps Script support Markdown in docs only in your IDE

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


NOt is supported in the Library Docs Shared

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/al1kpypsv0h6oxcxfkrl.png)
Dynamic Lookup with MongoDB Aggregation API
Tags: mongodb, mongoose, lookup, aggregation
Published: 2023-07-19 18:42:48

In Mongoose, there's a great and useful feature called [Population](https://mongoosejs.com/docs/populate.html), which makes it possible to dynamically connect a field to another document from another collection.

Let's say, in _sales_ document you have _costumer_ field. Costumer might be a _person_ or a _company_. And you want to keep costumer in one field. No problem. You can create a schema like the one below.
```js
costumer: { type: ObjectId, refPath: "costumerType" },
costumerType: { type: String, enum: ["people", "companies"] }
```
Then, when you need to get this _sales_ document, you can "populate" costumer field like below.
```js
await sales.find({}).populate("costumer")
```
Mongoose will bring you the costumer, whether person or company.
Very useful.
## Switching to Aggregation API
If you're building much bigger app, there might be a need for complex database queries. MongoDB have a great query API called Aggregation API.

At the point that you're working with Aggregation API, you may encounter the limitation that aggregation doesn't directly support dynamic lookups — _lookup ($lookup) is an operator for bringing documents from other collections in same database._

Nevertheless, nothing is impossible.

I created a trick to make dynamic lookups possible by the following method.

```js
await sales.aggregate([
  // Lookup for people and get result into "_temporaryPeople"
  { $lookup: {
    from: "people",
    localField: "costumer",
    foreignField: "_id",
    as: "_temporaryPeople",
  }},
  // Lookup for companies and get result into "_temporaryCompanies"
  { $lookup: {
    from: "companies",
    localField: "costumer",
    foreignField: "_id",
    as: "_temporaryCompanies",
  }},
  // Set "costumer" field with merge of two variables.
  // This will set "costumer" the wanted document.
  { $set: {
    costumer: {
     $mergeObjects: [
       { $first: "$_temporaryPeople" },
       { $first: "$_temporaryCompanies" },
     ]
    }
  }},
  // After we're done, we can destroy temporary fields.
  { $unset: ["_temporaryPeople", "_temporaryCompanies"] },
])
```
Until MongoDB adds dynamic lookup to the Aggregation API,
I think this is the easiest way to handle this issue.

Stay with MongoDB 🏄‍♂️
Some important ideas from JavaScript
Published: 2023-07-19 18:39:44

- JavaScript is a weakly and dynamically typed language, i.e. there is not much restriction with respect to handling different datatypes and .js code is not compiled and is directly interpreted. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ljvbmzl1719h4lz5i7ad.png)

- There is truthy and falsie values in JavaScript. I don't know if there are actually those words, but this idea is real. By default, any string other than empty string or number other than 0 is treated as truthy value in conditionals. This is also applicable to other datatypes too.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/50i3aw2kutk5jwspu05s.png)

- Using square bracket notation [] for accessing object properties is significantly better, at least in my experience as it allows you to dynamically use it, whereas it is not possible with dot notation.
What is table partation in SQL
Published: 2023-07-19 17:20:02

Table partitioning is a technique used to divide a large table into smaller, more manageable parts called partitions. Each partition is an independent unit that stores a subset of the table's data. Partitioning offers several benefits, including improved query performance, simplified maintenance, and increased scalability.

If you are new to [sql](https://www.tutorialwithexample.com/sql) please read from basic first.

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

Here are some key points about table partitioning:

1. **Data distribution:** Partitioning allows you to distribute data across multiple physical or logical storage units. This distribution can be based on a predefined range of values, such as dates, numeric ranges, or specific column values.

2. **Query performance:** Partitioning can significantly enhance query performance by allowing the database to selectively scan and access only relevant partitions when executing queries. This approach reduces the amount of data that needs to be processed, resulting in faster query response times.

3. **Maintenance flexibility:** Partitioning provides flexibility for managing and maintaining large tables. You can perform operations like backup, restore, or index rebuild on individual partitions, reducing the overall maintenance time and minimizing the impact on the entire table.

4. **Pruning:** Partitioning enables "partition pruning," which is the ability to exclude partitions from query execution based on certain conditions. This pruning technique eliminates unnecessary scans on partitions that don't contain relevant data, further improving query performance.

5. **Range, list, and hash partitioning:** MySQL supports different partitioning methods. Range partitioning divides data based on a specified range of values. List partitioning divides data based on specific value lists. Hash partitioning uses a hashing algorithm to distribute data evenly across partitions.

6. **Partition management:** MySQL provides various management operations for partitions, such as adding new partitions, merging or splitting existing partitions, and altering partition boundaries. These operations allow you to adapt your partitioning strategy to changing requirements without impacting the entire table.

It's important to note that the effectiveness of partitioning depends on the nature of your data, the types of queries you execute, and your overall database design. It's recommended to analyze your workload and assess the benefits and trade-offs before implementing partitioning for your MySQL tables.
On next post of partition i will write all example of partition , like how to create table, and operation on that table.
Thanks