teleren/devto huggingface dataset:
7 Open-Source Libraries SAVE NOW!
Tags: webdev, javascript, programming, beginners
Published: 2023-08-12 06:17:01

Stay at the forefront of software development by discovering these 7 game-changing open-source libraries that are reshaping the tech landscape in 2023. From AI to web development, these tools offer unparalleled functionality and efficiency. 

Let's dive in and explore their transformative capabilities!

**TensorFlow 3.0:**
Lead the AI revolution with TensorFlow 3.0's advanced features and robust ecosystem. Unlock the power of deep learning and build cutting-edge AI applications effortlessly.

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

[https://www.tensorflow.org/js](https://www.tensorflow.org/js)

**Vue.js 3.2:**
Craft stunning frontend experiences with Vue.js 3.2's enhanced performance and features. Stay productive with its intuitive design and flexible architecture.

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

[https://vuejs.org/](https://vuejs.org/)

**FastAPI 1.0:**
Experience blazing-fast backend development with FastAPI 1.0. Create robust APIs quickly using Python's type hints and enjoy automatic documentation generation.

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

[https://fastapi.tiangolo.com/](https://fastapi.tiangolo.com/)

**PyTorch Vision:**
Empower your computer vision projects with PyTorch Vision's comprehensive tools. Dive into deep learning for image recognition, segmentation, and more.

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

[https://pytorch.org/](https://pytorch.org/)

**Deno 2.0:**
Secure your JavaScript runtime with Deno 2.0. Leverage its built-in TypeScript support and enhanced security features for efficient and safe server-side scripting.

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

[https://deno.com/](https://deno.com/)

**Tailwind CSS 3.0:**
Simplify styling with Tailwind CSS 3.0. Design responsive and consistent UIs using its utility-first approach, and accelerate your frontend development.

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

[https://tailwindcss.com/](https://tailwindcss.com/)

**Node-RED 2.5:**
Simplify IoT development with Node-RED 2.5. Create flow-based applications and integrate devices and APIs seamlessly.

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

[https://nodered.org/](https://nodered.org/)

**Conclusion:**
These open-source libraries are essential tools for any developer aiming to stay ahead in 2023. 

For everything else, 7000+ AI Tools for 1000+ categories Visit - [https://www.aiforme.wiki/](https://www.aiforme.wiki/)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9naeb9ji17t1m2evafhs.png)
I built a strange webhook handler in NodeJS
Tags: api, backend, node, aws
Published: 2023-08-12 06:16:16

One fine fintech startup wanted to build a webhook payment handler. This article will walk through how my NodeJS code was able to handle webhook deliveries like a piece of cake.

### Context
This client lives and breaths Java and it was also related to payment. So he insisted on using Java, multithreading, Thread pools and all of that shit which I did not understand. And he cared too much about getting it done asap! In fact thats why he came to me cause I had built it already with Javascript. But how am I going to make my single threaded Javascript code handle huge traffic?

### Objectives

1. The webhook payload needs to be validated, transformed and stored into a database.
2. The webhook was delivered by a 3rd party, so a success response need to be sent back immediately after the delivery. We can't let the webhook get clogged by traffic!
3. It was a startup, we did not want to spend too much time thinking about scaling and load balancing

### Brainstorming

The API needs to be super responsive, so my first thought was to process it asynchronously.
We were on AWS, so we could use EC2! but how are we going to handle scaling? I didn't want to get into that mess. Even with ELB(Elastic load balancer), still need to run multiple containers to process them parallelly.

It hit me after a while, that we are actually fine if we have some delay in the processing. We just want to respond back to the webhook immediately and do not want the webhook server to become unresponsive.

So instead of thinking parallel processing, I started to think how to optimise the response TAT. And we were totally fine with processing the requests with a delay if there is more. 

Finally the price, we already had an EC2 running for the APIs. So we need to use the same instance but again cant let the webhook bottleneck API. So our only go to is a lambda which is bad for most cases. But thats the best we could do right now.

### The final spec

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

We have the API gateway connected to the Lambda function. The lambda function was on autoscale so it took care of traffic out of the box. The whole role of the function is to accept the request, push the message to SQS and respond back. This took just 100ms once the lambda is warm.
The same EC2 used for APIs run another docker container that polls the queue every 30 seconds for new messages. If it finds any, it dequeues the message and processes it one by one. Any failure happening while processing wont affect the response sent to the 3rd party as its strictly decoupled. The response has already been sent!

### Conclusion

I am not sure if this is the best way to build a webhook handler. But this was the quickest, cheapest solution I could come up with. Feel free to criticise and suggest better ideas.

Follow me on Twitter: twitter.com/HarishTeens
Follow me on GitHub: github.com/HarishTeens
Introduction to OpenCV in Python: Basics and Installation Guide
Tags: python, opencv, opensource, coding
Published: 2023-08-12 06:12:32

**OpenCV (Open Source Computer Vision Library)** is a versatile open-source software library that plays a crucial role in the fields of computer vision and machine learning. It provides a comprehensive suite of tools for tasks ranging from image filtering and object detection to face recognition and more. In this article, we'll delve into the fundamental concepts of OpenCV in Python and guide you through the process of getting started.
To get started with OpenCV in Python you need to install the library

**Installing OpenCV:**

Before you can start harnessing the power of OpenCV in Python, you'll need to install the library. The installation process is straightforward, and you can achieve it by executing the following command in your command-line interface:

`pip install opencv-python`

**Importing the Library:**

Once you've successfully installed OpenCV, the next step is to import the library into your Python environment. This can be done with a simple import cv2 statement.

`import cv2`

**Troubleshooting Installation Errors:**

In some cases, you might encounter errors while attempting to install OpenCV using the 'pip install opencv-python' command. If that happens, consider these steps to troubleshoot the issue:

**1. Check Your Python Version:** Ensure that your Python version is compatible with OpenCV. Generally, OpenCV supports Python versions 2.7, 3.5, 3.6, 3.7, 3.8, and 3.9.

**2. Upgrade pip:** To make sure you're using the latest version of the pip package manager, run the command: 

`pip install --upgrade pip`

**Basic Image Manipulation:**

Let's dive into some practical code to understand the basics of using OpenCV in Python. Here's a step-by-step example of converting an image to grayscale:


<pre>

import cv2

# Load an image from file
image = cv2.imread('image.jpg')

# Display the loaded image
cv2.imshow('Original Image', image)
cv2.waitKey(0)  # Wait for a key press
cv2.destroyAllWindows()  # Close the displayed window

# Convert the image to grayscale
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

# Save the grayscale image
cv2.imwrite('gray_image.jpg', gray_image)

print("Image converted and saved.")

</pre>

**Note:** Remember to replace 'image.jpg' with the actual path to the image you want to work with. 

This example showcases the process of loading an image, displaying it, converting it to grayscale, and saving the resulting image.
Converting <tr> tag contents to df
Tags: python, beautifulsoup
Published: 2023-08-12 06:04:30

Converting <tr> tag contents to df

Converting <tr> tag contents to df
----------------------------------

When it comes to software development, sometimes we encounter situations where we need to convert the contents of an HTML <tr> tag into a dataframe (df) format. This can be a challenging task, but with the right techniques, it can be accomplished smoothly.

Before we dive into the conversion process, let's briefly explain what a <tr> tag is. In HTML, the <tr> tag represents a table row. It is used to define a row in an HTML table. Each row can contain multiple <td> tags, which represent table cells.

Now, let's focus on how to convert the contents of a <tr> tag into a dataframe. One approach is to use a combination of HTML parsing and data manipulation libraries, such as BeautifulSoup and pandas. Here's an example:

`import pandas as pd  
from bs4 import BeautifulSoup  
html_content = '''  
<tr>  
<td>John</td>  
<td>Doe</td>  
<td>Software Developer</td>  
</tr>  
'''  
soup = BeautifulSoup(html_content, 'html.parser')  
table_row = soup.find('tr')  
data = \[\]  
for cell in table\_row.find\_all('td'):  
data.append(cell.text)  
df = pd.DataFrame(\[data\], columns=\['First Name', 'Last Name', 'Occupation'\])  
`

Voila! We have successfully converted the contents of the <tr> tag into a dataframe. The resulting dataframe will have columns named 'First Name', 'Last Name', and 'Occupation', with the corresponding values.

Converting <tr> tag contents to a dataframe can be a useful technique when dealing with web scraping or parsing HTML tables. It allows us to extract structured data and perform further analysis or manipulation.

Remember, practice makes perfect. So, don't hesitate to experiment and explore different approaches to handle HTML data in your software development projects. Happy coding!

### References:

*   BeautifulSoup Documentation: [https://www.crummy.com/software/BeautifulSoup/bs4/doc/](https://www.crummy.com/software/BeautifulSoup/bs4/doc/)
*   Pandas Documentation: [https://pandas.pydata.org/docs/](https://pandas.pydata.org/docs/)
Latest Newsletter - Browser Runs All the Things (Issue #127)
Tags: javascript, tech, webdev, discuss
Published: 2023-08-12 05:56:13

---
title: Latest Newsletter - Browser Runs All the Things (Issue #127)
published: true
description: The browser, the final frontier. Seems like the only thing not running in the browser these days is another browser. What’s up with this craziness?
tags: javascript, tech, webdev, discuss
---

Browser Runs All the Things (Issue #127)

The browser, the final frontier. Seems like the only thing not running in the browser these days is another browser. What’s up with this craziness?

https://markjgsmith.substack.com/p/mark-smiths-newsletter-12-08-2023

Would love to hear any comments and feedback you have.

[@markjgsmith](https://twitter.com/markjgsmith)
Machine Learning
Tags: machinelearning, python, ai, beginners
Published: 2023-08-12 05:01:18


Hey everyone! I'm beyond thrilled to announce that I'm taking the plunge into the captivating realm of Machine Learning, and I'm bringing you along for the ride! 

But that's not all – buckle up, because I'll be documenting my learning journey through regular blogs! That's right, you'll get a front-row seat to witness my progress, challenges, 'Eureka!' moments, and everything in between.

From coding to algorithms, data wrangling to model training, we'll be exploring it all. And your input is gold – I welcome your thoughts, suggestions, and any tips you might have picked up on your own journey. Let's create a dynamic learning community where we uplift and empower each other!

So, here's to stepping into the world of Machine Learning, one blog post at a time. Be sure to stay tuned for updates, and let's make this journey one for the books!
How to Add Additional Price According to user selection in wordpress woocommerce cart page and checkout page.
Published: 2023-08-12 05:48:40

I have a problem while doing price addition according to multiple choice of user on a cart page of wordpress woocommerce site.


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

Please suggest me best procedure to solve this problem.
Python Data Types and Variables Example
Tags: python, programming, beginners, webdev
Published: 2023-08-12 05:32:23

As Python developers, understanding the fundamentals of data types and variables is essential for writing effective and efficient code. In this comprehensive guide, we will dive into the world of Python data types and variables, exploring their significance and uncovering their inner workings.

Throughout this article, we will unravel the intricacies of Python's built-in data types and learn how to work with variables to store and manipulate data.

Whether you are a beginner taking your first steps in Python or an experienced programmer looking to strengthen your knowledge, this guide will provide you with the insights and practical examples you need to master data types and variables in Python.

We'll start by exploring the rich variety of data types available in Python. From numeric types like integers and floats to text types, boolean types, sequence types, mapping types, and sets, we'll cover them all.

Each data type serves a specific purpose and has its own unique features and behaviors.

Next, we'll delve into the world of variables and discover how they allow us to store and reference data in our programs. We'll learn about the variable declaration, assignment, and naming conventions, and we'll explore best practices for working with variables effectively.

Python's dynamic typing and type inference capabilities will also be demystified. We'll explore how Python automatically determines the data type of a variable based on its assigned value, enabling us to write flexible and adaptable code.

Additionally, we'll uncover the power of type conversion, also known as type casting. We'll discuss the methods available to convert data between different types, and we'll provide practical examples to demonstrate their usage in real-world scenarios.

Furthermore, we'll shed light on variable scope and lifetime, understanding how variables are accessible within different parts of our code and how long they persist in memory.

To ensure we follow best practices, we'll provide guidelines for working with data types and variables, including naming conventions, selecting appropriate data types, and optimizing memory usage.

By the end of this article, you'll have a solid grasp of Python's data types and variables, empowering you to write cleaner, more efficient, and more expressive Python code.

So let's embark on this journey together and unravel the intricacies of Python data types and variables!
WinMatch Table Games
Published: 2023-08-12 05:02:44


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9pi6qq97pkhxl0szwrn3.jpeg)


Winmatch[](https://winmatch.com/) is a peer-to-peer betting exchange designed for smart bettors who want more value. Offering deep liquidity and low commissions, winmatch returns maximum value to bettors. On winmatch, bettors find better odds, a clean and easy-to-use betting interface, and helpful customer support.
Revolutionizing Database Interaction: The Power of Object-Relational Mapping (ORM)
Tags: programming, database, postgres
Published: 2023-08-12 04:27:08

## **Simplifying Data Fusion: The Magic of ORM**

ORM is a technique that maps objects in an object-oriented programming language to data in a relational database.
In other words, ORM allows you to interact with a database using objects, which is more intuitive for object-oriented programmers.

```
[Backend]
|
|-- ORM
|   |
|   |-- Database
|
|-- Application code
```
The backend is the layer of software that sits between the ORM and the database. It is responsible for sending requests to the ORM and receiving responses from the ORM. The ORM is the layer of software that maps data between the objects in the application code and the tables in the database. The database is the layer of software that stores the data for the application.

## This code snippet showcases how Prisma ORM simplifies database operations:

```
// Import the Prisma Client library.
import prisma from "@prisma/client";

// Create a new Prisma client object.
const prismaClient = new prisma();

// Create a new user object.
const user = {
  name: "John Doe",
  email: "johndoe@example.com",
};

// Save the user to the database.
prismaClient.users.create({ data: user });

// Get all users from the database.
const allUsers = prismaClient.users.findMany();

// Get the user with the id of 10.
const user = prismaClient.users.findOne({ id: 10 });

// Update the user's name.
user.name = "Jane Doe";

// Save the user to the database.
prismaClient.users.update({
  data: user,
  where: { id: user.id },
});

// Delete the user from the database.
prismaClient.users.delete({ where: { id: user.id } });
```
TRACK OF THE LATEST EPISODES
Published: 2023-08-12 04:10:32

HOW CAN I KEEP TRACK OF THE LATEST EPISODES AND AIR DATES OF MY FAVORITE TV SHOWS?
Keeping up with my favourite TV shows' latest episodes and air dates has become increasingly convenient and hassle-free in recent years. One of the most effective ways to stay updated is by subscribing to online streaming platforms such as Netflix, Hulu, Pikashow APP, or Amazon Prime. These platforms often release new episodes immediately after they air on television, allowing viewers to watch their favourite shows conveniently. Additionally, these streaming services provide a notification feature that alerts users when a new episode of a subscribed show becomes available.
**[Click](https://nameboost.blogspot.com/track-of-latest-episodes)**
用 Postman Integrations，自動備份 Postman Collection
Tags: postman, integrations, backup, tutorial
Published: 2023-08-12 04:00:44

## 本篇要解決的問題

上個月在〈[用 Google Apps Script，定期備份 Postman](https://www.letswrite.tw/gas-backup-postman/)〉有提到，在亂點之下看到 Postman 原有的備份功能，後來因為找不到才寫了那篇筆記文，結果很意外的，這幾點為了找別的設定，竟然找到了耶。

而且用起來很簡單，只要 Collection 裡有變動就會自動執行備份，這麼好用的功能怎麼可以不記錄一下呢？

---

## 建立 GitHub 專案及 Access Token

本篇示範的是自動將 Postman Collection 備份到 GitHub 上，需要先建立備份用的專案，及新增一組 Access Token。

建立專案時，可選為 Private，另外 Add a README file 也可打勾，我們要先有一個檔案，讓主要分支可以建立起來：

![打勾 Private、Add a README file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hfjvy8xshc36bqfhsvzb.png)

專案建好後，接著要建立一個 Access Token。

點擊此連結進到產生 Token 的頁面：[Personal access tokens (classic)](https://github.com/settings/tokens)。

點擊右上角的 **Generate new token > Generate new token(classic)**：

![點擊 Generate new token > Generate new token(classic)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ebija3ga2x5nd2ltt5l8.png)

接著看下圖：

![建立 GitHub Access Token](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5202hcft95t7ptj7728.png)

**Note** 部份取一個認得出功能的說明。

**Expiration** 選擇 **No expiration**。

**Select scopes** 的部份，**repo** 打勾。

頁面滑到最下面，點擊 **Generate Token**，就會建立一組 Token，記得把 Token 複製下來，下一步馬上就會用到。

---

## Postman Integrations，GitHub backup

打開 Postman，點擊我們想要備份的 Collection，最右側會出現一排選單，點擊最下面「i」的那個 Icon：

![點擊 Collection、Icon](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i4hjp8n224g9jtl4078v.jpg)

點擊 i 的 Icon 後，會出現 Collection 的資訊，最下面就會看到寫著 Back up 的說明文字：

![Back up your collection](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y71lx22auoq5oukz58c9.png)

點擊 **View all options**，就會看見目前有以下這 9 種備份方式：

![Postman 9 種備份方式](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k8sa3d9pvcvvu52o3mkb.png)

本篇用的是備份到 GitHub 上，因此點擊 GitHub，會看到以下：

![點擊 Backup a collection Add Integration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9zdm7ajne150bs7u7v4q.png)

因為我們單純是要備份 Collection，所以點擊 **Backup a collection** 的 **Add Integration**。

點擊後，第一步 Postman 會要求填上 Personal Access Token，我們把從第一步取得的 GitHub Access Token 複製貼上，然後點擊 **Authenticate and Proceed**：

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

接著就是一個表格，要填的是備份的一些設定。

因為我們在第一步就先建立好了 GitHub 專案，及專案中的分支，因此大部份欄位都是用選的，除了 Nickname、Enter Directory (optional)、Enter filename 這三個必須要手填。

要注意的是，填寫的值要都用英文，原本 August 為了好認所以填寫了中文，結果會一直備份失敗，直到都換成了英文才成功。

以下是 August 備份調用 ChatGPT API 的填寫範例：

![Add integration 填寫範例](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/52z8bhxo3xmzgn05oev6.png)

都選好及寫好後，就可以點擊 **Add integration**。

新增成功，就會看到 Integration 頁面多出了這次的備份設定：

![自動備份設定成功](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wz3c6oti736kbg6f28ox.jpg)

點進去就可以看見是成功或失敗：

![顯示備份結果](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hdt4ktwghmls28kvz2z5.png)

右上角的三個按鈕也都可以點擊。

再進到 GitHub 我們設定要拿來備份的專案上，就會看見 Collection 已經備份完成：

![GitHub 上備份完成](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0w57n67d328aouqnvneh.png)

目前使用的狀況，除了有時候會秀逗沒有進行備份，大部份只要 Collection 裡有變動，就會觸發自動備份。

是不是很簡單呢？
Un-stage and un-modify a file in Git - Part 2
Tags: git
Published: 2023-08-12 03:37:09

_This post is part of my [“Shorts”](https://poddarayush.com/shorts) series, where each post is concise and hyper-focused on a single concept._

In a [previous post](https://poddarayush.com/shorts/unstage-a-file/), we learned about the `git rm` command which helps you un-stage a file, and delete any modifications made. However, the `git rm` command is essentially meant to “delete” files, not undo them.

Git offers a dedicated command to undo modifications, or undo staging of a file. In this post, I will introduce you to `git restore` which can be used to perform both these tasks.

> Git introduced `git restore` in version 2.23.0. Earlier, the commands `git reset` and `git checkout` were used for the same purposes. But, `git restore` was introduced as a more dedicated tool for these specific purposes.

I will not cover the details of the `git restore` command since Git is very helpful with these commands, and I think it is best for you to explore them yourself. When you run `git status`, Git exactly tells you the commands to un-stage or undo any unstaged modifications. This is how the output of `git status` looks like. Notice the commands mentioned for undo-ing.

```diff
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	renamed:    README.md -> README

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   ammend.md
```


Fair warning
------------

If you use `git restore <file>` to undo any unstaged modifications to a file, then you will lose all those changes forever. Git only helps you recover changes that have ever been committed.

If you are feeling uneasy about losing those modifications forever, but still want to undo the modifications, a better way is to use `git stash`. I will explore this command in a later post.

Further exploration
-------------------

As always, I encourage you to explore the command further using `man git-restore`.