teleren/devto huggingface dataset:
HTTP3之QUIC协议中的Connection Migration
Tags: http3, quic, connectionmigration
Published: 2024-05-29 07:24:17

## 背景
[Connection Migration](https://datatracker.ietf.org/doc/html/rfc9000#name-connection-migration)是`QUIC`协议的特性之一。协议通信一般依赖网络标识比如(IP和port), 如果网络切换，通信需要重新开始，这对于频繁网络切换场景体验很差，比如无线网络使用APP时，网络切换可能需要重新登陆，终端用户可能莫名其妙。`QUIC`协议设计的时候，使用`Connection ID`标识对方，网络切换只要保证`Connection ID`正确就可以。`Connection Migration`就是描述这一过程交互规范。

## 细节
`Connection Migration`需要在`Handshake`完成后才能执行。发送方可能发送`PATH_CHALLANGE`帧给对方，对方可能发送`PATH_RESPONSE`帧回应。发送方也可以不发送probe frame, 直接切换继续通信。

## 实现
本地实验最好的方式就是变更port,比如从`9000`变为`9001`。下面使用[ngtcp2](https://github.com/ngtcp2)库实现`Connection Migration`的代码片段。
1. 生成新的`UDP socket`
```c
struct sockaddr_in source;
source.sin_addr.s_addr = htonl(INADDR_ANY);
source.sin_family = AF_INET;
source.sin_port = htons(9001);
fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
bind(fd, (struct sockaddr *)&source, sizeof(source));
connect(fd, (struct sockaddr *)(&remote), remote_len);
getsockname(fd, (struct sockaddr *)&local, &local_len)
```
2. 使用`ngtcp2`提供的`Connection Migration`接口。
```c
int ngtcp2_conn_initiate_immediate_migration(ngtcp2_conn *conn, const ngtcp2_path *path, ngtcp2_tstamp ts)
int ngtcp2_conn_initiate_migration(ngtcp2_conn *conn, const ngtcp2_path *path, ngtcp2_tstamp ts)
```
`ngtcp2`提供了两种接口，都会发送`PATH_CHALLANGE`, 但是前者不会等待对方的`PATH_RESPONSE`就迁移。后者会等待对端的`PATH_RESPONSE`帧才迁移本地的网络路径。
```c
ngtcp2_addr addr;
ngtcp2_addr_init(&addr, (struct sockaddr *)&local, local_len);
if (0) // nat rebinding
{
     ngtcp2_conn_set_local_addr(conn, &addr);
     ngtcp2_conn_set_path_user_data(conn, client);
}
else
{
     ngtcp2_path path = {
          addr,
          {
               (struct sockaddr *)&remote,
               remote_len,
          },
          client,
     };
     if ((res = ngtcp2_conn_initiate_immediate_migration(conn, &path, timestamp())) != 0)
     // if ((res = ngtcp2_conn_initiate_migration(conn, &path, timestamp())) != 0)
     {
          fprintf(stderr, "ngtcp2_conn_initiate_immediate_migration: %s\n", ngtcp2_strerror(res));
          return -1;
     }
}
```
3. 处理`path validation callback`，比如对端回复了`PATH_RESPONSE`帧
```C
int path_validation(ngtcp2_conn *conn, uint32_t flags, const ngtcp2_path *path,
					const ngtcp2_path *old_path,
					ngtcp2_path_validation_result res, void *user_data)
{
	(void)conn;
	if (old_path)
	{
		get_ip_port((struct sockaddr_storage *)(old_path->local.addr), ip, &port);
		fprintf(stdout, ", old local: %s:%d", ip, port);
	}

	if (flags & NGTCP2_PATH_VALIDATION_FLAG_PREFERRED_ADDR)
	{
		struct client *c = (struct client *)(user_data);
		memcpy(&c->remote_addr, path->remote.addr, path->remote.addrlen);
		c->remote_addrlen = path->remote.addrlen;
	}
	return 0;
}
```

## 最后
可以参考`ngtcp2`的example(https://github.com/ngtcp2/ngtcp2/tree/main/examples), 如果想看简单的，可以参考我的[http3 client](https://github.com/Shouhua/aioquic/blob/note/note/ngtcp2/http3_client.c)
Study In USA
Published: 2024-05-17 12:13:46

The United States of America needs no introduction. It is the world’s oyster if you want to fulfill your dreams.

The country is a home of diverse ethnicity, the highest number of top-ranked universities, and a picturesque landscape.

The USA is truly a land for opportunities, a destination for immigrants seeking new vistas. It’s a country that is not only a pioneer in technological innovation and scientific exploration, but it is also highly regarded for its motion picture industry, and art and architecture. With the most international mix of people inhabiting the US, it is a true amalgamation of various lifestyles and cultures.

The U.S. has the largest population of international students with more than 800,000 students opting this country as their most favored overseas education destination. Being one of the leading studies abroad destinations, the country opens the gateway for ample career opportunities to international students in various fields of work.

Why USA

High-quality education

Wide range of programs and courses

Flexible and comprehensive course structure

Multiple scholarships and funding opportunities

Research and Training opportunities

Make your stay comfortable with part-time job opportunities

Career Opportunities

#Immigration and visa consultant in Ahmedabad #top immigration consultants in Ahmedabadbest #immigration and visa consultants in Ahmedabad #visa consultant in Ahmedabad #Canada pr consultant in Ahmedabad
HTTP3之QUICTLS报错: "unable to get local issuer certificate"
Tags: http3, quictls, certificate
Published: 2024-05-29 07:12:57

## 2024-06-06更新
https://github.com/openssl/openssl/issues/9436 有人在OpenSSL仓库提出了这个问题，但是官方也没有时间整这个。

看了评论后，我感觉这个问题确实不是官方的问题，当然是我的观点哈。为什么呢？因为人家仓库默认出来空的，正常，况且那么多平台，每个平台的证书库都不一样，如果随着操作系统迭代，那这个库就有点太不正经了。。。，所以最好是让各个平台自己编译成平台包的时候添加就好，比如我们使用Ubuntu等系统的时候，默认(目录位于`/usr/lib/ssl`)会跟系统的证书库(`/etc/ssl`)链接在一起了，这些都是在系统包维护者编译包的时候干的。  

https://salsa.debian.org/debian/openssl/-/blob/debian/unstable/debian/rules#L122 这个地址是debian编译OpenSSL使用的rules文件，其中122行明确的新建了软链接到debian平台的官方证书库(`/etc/ssl`)。  

所以如果自己编译certs文件夹是空的，正常，别慌，但是通过问题找到这个问题就已经成功了。。。 :)
## 背景
最近使用QUICTLS整HTTP3时候，将自签证书加入到系统默认cert store,然后加载默认证书路径时总是报错: 
```
"unable to get local issuer certificate"
```
QUICTLS在以前文章中介绍过。总的来说，就是为了让OpenSSL支持QUIC协议，基于OpenSSL仓库修改的仓库。系统原本安装了OpenSSL，通过编译QUICTLS后也安装了OpenSSL。注意**依赖库时要分清楚使用哪个动态库**。

本文是在使用QUICTLS动态库时导致的问题，QUICTLS依赖库默认位于`/usr/local/lib64`，下面代码打印出证书相关默认目录。

```c
// test.c
#include <stdio.h>
#include <openssl/x509.h>

int main()
{
     const char *file_path = X509_get_default_cert_file();
     const char *dir_path = X509_get_default_cert_dir();
     const char *file_env = X509_get_default_cert_file_env();
     const char *file_env = X509_get_default_cert_dir_env();
     printf(format: "file: %s, dir: %s, file_env: %s, dir_env: %s\n", 
          file_path, dir_path, file_env, dir_env);

     return 0;
}
// 打印原生OpenSSL相关证书地址
// gcc -o test test.c -lcrypto && ./test
// file: /usr/lib/ssl/cert.pem, dir: /usr/lib/ssl/certs, file_env: SSL_CERT_FILE, dir_env: SSL_CERT_DIR

// 打印QUICTLS相关证书地址
// gcc -o test test.c -L/usr/local/lib64 -lcrypto && ./test
// file: /usr/local/ssl/cert.pem, dir: /usr/local/ssl/certs, file_env: SSL_CERT_FILE, dir_env: SSL_CERT_DIR
```

## 根本原因
根本原因是因为使用`quictls`后, `OpenSSL`使用了新的配置目录`/usr/local/ssl`, 里面只有`certs`文件夹, 而且里面是空的。  
是的，怎么也没有想到是这么回事，就这个问题整了好长时间！！！   
在进行证书验证时候, 找不到最终的根证书(找得到才怪), 就会报错: `"unable to get local issuer certificate"`

## 解决办法
解决办法是跟原生的`OpenSSL`目录(`/usr/lib/ssl`)里面设置的一样就好。
```bash
QUICTLS_DIR=/usr/local/ssl
sudo rmdir "$QUICTLS_DIR/certs"
sudo ln -s /etc/ssl/certs "$QUICTLS_DIR/certs"

sudo rmdir "$QUICTLS_DIR/private"
sudo ln -s /etc/ssl/private "$QUICTLS_DIR/private"

sudo rm "$QUICTLS_DIR/openssl.cnf"
sudo ln -s /etc/ssl/openssl.cnf "$QUICTLS_DIR/openssl.cnf"

/usr/local/bin/openssl version -a # QUICTLS的各种配置
openssl version -a # 原生OpenSSL的各种地址, 特别是OPENSSLDIR
```

另外，`openssl`命令始终使用原生的, 因为原生是`/usr/bin/openssl`, `QUICTLS`的`openssl`命令位于`/usr/local/bin/openssl`。
leading IT Software Services and Digital Marketing agency,
Tags: itservices, softwaredevelopment
Published: 2024-05-29 07:10:11


At [Dossiefoyer](https://www.dossiefoyer.com/), we are passionate about leveraging technology and digital innovation to drive your business forward. We have grown into a leading IT Software Services and Digital Marketing agency, dedicated to helping businesse s of all sizes navigate the complexities of the digital landscape.

Our Mission:
Our mission is to empower businesses with cutting-edge IT solutions and dynamic digital marketing strategies that deliver measurable results. We strive to be your trusted partner in digital transformation, ensuring your business remains competitive and relevant in today’s fast-paced market.

Who We Are::
We are a team of seasoned professionals with expertise spanning IT consulting, software development (webapp development and mobile app development), Digital Marketing and Staff Augmentation. Our diverse backgrounds and shared passion for technology enable us to deliver comprehensive solutions tailored to meet the unique needs of our clients.

What We Do:

IT Solutions:
Our IT services are designed to streamline your operations and enhance your technological capabilities. From custom software development and system integration to IT support and cybersecurity, we provide solutions that drive efficiency and innovation.

Digital Marketing:
Our digital marketing team crafts data-driven strategies to boost your online presence and engage your target audience. We specialize in SEO, content marketing, social media management, PPC advertising, and email marketing, ensuring your brand stands out in the digital crowd.

Our Approach:
o	Client-Centric Focus:
We believe in building long-term partnerships with our clients. Our approach is collaborative, ensuring we understand your business goals and challenges to deliver solutions that are aligned with your vision.

o	Innovation and Excellence:
We are committed to staying ahead of the curve by adopting the latest technologies and best practices. Our team is dedicated to continuous learning and improvement, ensuring we deliver innovative solutions that exceed expectations.

o	Results-Driven Strategies:
We measure our success by the results we achieve for our clients. Our strategies are data-driven, enabling us to deliver measurable outcomes that drive growth and success.

Why Choose Us:
Expert Team: Our team of experts brings a wealth of experience and knowledge to every project.
Customized Solutions: We tailor our services to meet the specific needs and goals of each client.
Proven Track Record: Our portfolio of successful projects and satisfied clients speaks for itself.
Transparent Communication: We maintain open and honest communication throughout every project.

Our Values:
1.	Integrity: We uphold the highest standards of integrity in all our actions.
2.	Innovation: We embrace change and continuously seek new ways to improve.
3.	Customer Satisfaction: We are dedicated to meeting and exceeding our clients' expectations.
4.	Collaboration: We work together with our clients and within our team to achieve the best results.
Mock The API Data With Playwright
Tags: javascript, playwright, testing, beginners
Published: 2024-05-29 07:07:42

Mocking API responses” refers to the practice of creating simulated responses from an API without actually interacting with the real API. This technique is commonly used in software development, especially during testing phases, to mimic the behavior of real API endpoints. By using mock responses, developers can isolate specific parts of their code for testing purposes without relying on external services, thus enabling more efficient and controlled testing environments.

[Click on the link](https://kailash-pathak.medium.com/mock-the-api-data-with-playwright-5f6f43e0ffea) for more detail

There are various tools and libraries available for mocking API responses in different programming languages and frameworks.Mocking API responses with Playwright is a useful technique for testing your web applications without relying on real API servers. It allows you to simulate different scenarios and responses from your APIs, making your tests more robust and independent of external services.
Game Development Diary #9 : Second Course Complete
Tags: gamedev, blog, newbie, godot
Published: 2024-05-29 07:00:00

29/05/2024 - Wednesday

#Difficulty Curves
Introducing the curve resource and using timers to increase the difficulty of our level over time.

#Scaling Enemy Health


#Ending the Game
Using the TreeExited signal to check when the player has won the game.

#The Victory Screen
Building a User Interface for when the player wins the game, letting them restart and quit. Introducing a variety of essential Control nodes and Containers.

#Rewarding the Player
Rewarding the player with stars based on their performance in the level.

#Using GLTF Files
Learning how to use GLTF and GLB files to add premade meshes into your games. Then using them to build the final turrets and home base.

#Updating the MeshLibrary
Adding rock and tree meshes to the MeshLibrary to fill out the level and give more control over the environment with the GridMap.

#Barbarians and Animations
Learning how to use bundled AnimationPlayer nodes within GLTF/ GLB files to add an animated barbarian enemy.

#Polish and Balance
Tweaking Project Settings, adding fonts, and using exported variables to balance the play experience.

#Plans for Next Session:
Implementing what I've learn from this course into my project.
How to Export Matplotlib Plots to JPEG or PDF
Tags: python, beginners, export, matplotlib
Published: 2024-05-29 06:50:27

To save a plot created using Matplotlib to a JPEG or PDF file, you can follow these steps:

1. First, create your plot using Matplotlib. For example, let's say you have a simple line plot:

    ```python
    import matplotlib.pyplot as plt
    import numpy as np

    # Generate some example data
    x = np.linspace(0, 10, 100)
    y = np.sin(x)

    # Create the plot
    plt.plot(x, y)
    plt.xlabel('X-axis')
    plt.ylabel('Y-axis')
    plt.title('Sine Wave')

    # Show the plot (optional)
    plt.show()
    ```
![Figure 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/viv4cqgfmtjze50pr7l6.png)

2.After creating the plot, you can save it to a file using the `savefig` function. Specify the filename and the desired format (JPEG or PDF). For example:

    ```python
    # Save the plot as a JPEG file
    plt.savefig('my_plot.jpg', format='jpeg')

    # Save the plot as a PDF file
    plt.savefig('my_plot.pdf', format='pdf')
    ```

   Replace `'my_plot.jpg'` and `'my_plot.pdf'` with your desired filenames.

3.The saved file will be in the same directory where your Python script is located.

Remember to adjust the plot and filenames according to your specific use case. If you have any other questions or need further assistance, feel free to ask! 😊
Coltongene ACT Prep: Free & Paid Resources to Boost Your Score
Published: 2024-05-29 06:47:17

Considering Coltongene for ACT prep? Explore FREE practice tests for Reading & the entire ACT. Target your weaknesses & maximize your score with Coltongene's ACT Reading practice tests (and maybe skip the SAT!). Discover if Coltongene is the best online ACT prep program for you.

Learn More- https://coltongene.co/
Ontime Inspectors
Tags: home, inspection
Published: 2024-05-29 06:44:47

Ensure peace of mind with On Time Inspectors, your trusted partner for comprehensive home inspections in Orlando, FL. Whether you're buying, selling, or maintaining your home, our experienced inspectors provide thorough evaluations to uncover any potential issues or safety concerns. From the foundation to the roof, we meticulously examine every aspect of the property, providing detailed reports and expert recommendations to help you make informed decisions. With our commitment to quality, professionalism, and customer satisfaction, you can trust On Time Inspectors to deliver reliable results and exceptional service. Schedule your home inspection with us today and rest assured that your investment is in good hands.


Address: 689 Randon Terrace, Lake Mary, FL 32746, USA

E-Mail: info@ontimeinspectors.com

Phone: 407 810 4307

Visit: https://www.ontimeinspectors.com/
Mastering Matplotlib: A Guide to Bar Charts, Histograms, Scatter Plots, and Pie Charts
Tags: python, beginners, matplotlib, charts
Published: 2024-05-29 06:39:27

Let's dive into the different types of plots you can create using Matplotlib, along with examples:

1. **Bar Chart**:
   - A bar chart (or bar plot) displays categorical data with rectangular bars. Each bar represents a category, and the height of the bar corresponds to the value of that category.
   - Example:
     ```python
     import matplotlib.pyplot as plt

     x = [1, 3, 5, 7, 9]
     y1 = [5, 2, 7, 8, 2]
     y2 = [8, 6, 2, 5, 6]

     plt.bar(x, y1, label="Example one")
     plt.bar(x, y2, label="Example two", color='g')

     plt.xlabel("X-axis")
     plt.ylabel("Y-axis")
     plt.title("Bar Chart Example")
     plt.legend()
     plt.show()
     ```
![Figure 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rx6aqzg13khoxk3wy0bu.png)

   - This code creates a bar chart with two sets of bars, labeled "Example one" and "Example two" ⁴.

2.**Histogram**:
   - A histogram represents the distribution of continuous data by dividing it into bins and showing the frequency of values falling into each bin.
   - Example:
     ```python
     import matplotlib.pyplot as plt
     import numpy as np

     data = np.random.randn(1000)  # Generate random data
     plt.hist(data, bins=20, edgecolor='black')

     plt.xlabel("Value")
     plt.ylabel("Frequency")
     plt.title("Histogram Example")
     plt.show()
     ```
![Figure 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7gk2teo0js9269up48k3.png)

   - This code creates a histogram from random data.

3.**Scatter Plot**:
   - A scatter plot displays individual data points as dots. It is useful for visualizing relationships between two continuous variables.
   - Example:
     ```python
     import matplotlib.pyplot as plt

     x = [10, 20, 30, 40]
     y = [20, 25, 35, 55]

     plt.scatter(x, y, marker='o', color='b', label="Data points")
     plt.xlabel("X-axis")
     plt.ylabel("Y-axis")
     plt.title("Scatter Plot Example")
     plt.legend()
     plt.show()
     ```
![Figure 3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lriy4iuf29tqr6o3w1dp.png)

   - This code creates a scatter plot with data points.

4.**Pie Chart**:
   - A pie chart represents parts of a whole. It shows the proportion of each category relative to the total.
   - Example:
     ```python
     import matplotlib.pyplot as plt

     labels = ['Apples', 'Bananas', 'Cherries', 'Dates']
     sizes = [30, 25, 20, 15]

     plt.pie(sizes, labels=labels, autopct='%1.1f%%', startangle=90)
     plt.axis('equal')  # Equal aspect ratio ensures a circular pie chart
     plt.title("Pie Chart Example")
     plt.show()
     ```
![Figure 4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6nxlxc67ei9rwplbb1ao.png)

   - This code creates a simple pie chart with labeled slices ².

Remember to customize these plots further by adjusting labels, colors, and other parameters according to your specific requirements. Happy plotting! 😊📊🎨
Eventify
Tags: eventapp, event, conferenceapp
Published: 2024-05-29 06:38:47

Harness the potential of our event management solutions

Planning an event? Make it a breeze with Eventify’s comprehensive management solutions. Let us take out the stress of the process — from seamless registration to engaging attendee experiences in the event app, we get you covered.

Focus on creating unforgettable moments while we handle it! Learn more at: https://eventify.io/
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rpm56wy3vf12bs4xqlnv.jpeg)
Pole lights
Published: 2024-05-29 06:35:40

[Pole lights](https://jainsonslightsonline.com/collections/surface-led-panels ) are highly demanded for safety and security measures. Enormous vehicle accidents as well as slips happen in parking lots and on walking paths, resulting in numerous injuries per year. These lights are fitted on pathways and outdoor spaces for the prevention of automobile accidents and increase in safety. These lights are manufactured using premium quality steel, aluminum and fiberglass to enhance its durability.
Seeking Guidance: How Can a Cloud Data Engineer Harness the Power of GenAI?
Tags: genai, cloudcomputing, learning, communityhelp
Published: 2024-05-29 06:29:44


Hello everyone,

As a Cloud Data Engineer, I'm intrigued by the potential of General Artificial Intelligence (GenAI) in our field. I'm keen on learning and applying GenAI in my role and would greatly appreciate your advice on:

Basics of GenAI: Could you suggest resources that explain GenAI concepts simply?

GenAI Applications: Any examples of GenAI use in cloud data engineering?

Hands-On Learning: Know any GenAI projects or tutorials related to our field?

Networking: Any GenAI-focused communities or groups you'd recommend?

Staying Updated: How do you keep up with the latest in GenAI?

I'm excited to embark on this GenAI journey and would appreciate any guidance. Thank you for your time and input!
Challenges and Best Practices in Data Annotation
Published: 2024-05-29 06:21:46

Data annotation is a crucial step in the development of machine learning models, but it comes with several challenges. Addressing these challenges effectively through best practices can significantly improve the quality and reliability of AI systems.

Challenges in Data Annotation

-Consistency and Accuracy:
Ensuring consistency and accuracy in annotations is a major challenge. Different annotators may interpret data differently, leading to inconsistent labels. This inconsistency can negatively impact the model’s performance.

-Subjectivity:
Some data, especially in fields like sentiment analysis or image recognition, can be highly subjective. Annotators may have different opinions on the same piece of data, making it difficult to achieve uniform annotations.

-Scalability:
Annotating large datasets manually is time-consuming and labor-intensive. Scaling up the annotation process while maintaining quality is a significant hurdle.

-Domain Expertise:
Certain datasets require domain-specific knowledge for accurate annotation. For instance, medical images or legal documents need expert annotators who understand the nuances of the field.

-Bias:
Annotator bias can creep into the data, leading to biased models. This bias can result from cultural, demographic, or personal differences among annotators.

**Best Practices in Data Annotation
Clear Guidelines and Training:
Provide annotators with clear, detailed guidelines and comprehensive training. This helps in minimizing inconsistencies and ensuring that all annotators understand the labeling criteria uniformly.

Use of Quality Control Mechanisms:
Implement quality control mechanisms such as inter-annotator agreement metrics, spot-checking, and using a gold standard dataset. Regular audits and feedback loops can help maintain high annotation quality.

Leveraging Automation:
Use automated tools to assist with data annotation. Semi-automated approaches, where algorithms handle simpler tasks and humans review the results, can significantly increase efficiency and scalability.

Expert Annotators for Specialized Data:
For domain-specific datasets, employ expert annotators who have the necessary knowledge and experience. This ensures that the annotations are accurate and relevant.

Bias Mitigation Strategies:
To reduce bias, diversify the pool of annotators and implement bias detection mechanisms. Annotations should be regularly reviewed to identify and correct any biased patterns.

Iterative Annotation and Feedback:
Use an iterative approach where initial annotations are reviewed and improved upon. Continuous feedback and revision cycles help in refining the annotations and improving overall data quality.

Data Annotation Services:
Partnering with professional [data annotation services ](https://gts.ai/)can address many of these challenges effectively. Companies like Data Annotation Services offer expert solutions tailored to specific project needs. They employ advanced tools and experienced annotators to ensure precise and reliable data labeling, which enhances the performance and accuracy of AI models.