Preface

The Remote SSH extension in VS Code provides the functionality to connect to other remote hosts. While the basic way of connection requires a username and password, using a key allows for direct login without the effort to type the password every time.

However, it’s crucial to understand that VS Code merely provides a GUI, and how to use a SSH key to login is a separate matter. These two aspects should not be confused.

This article will primarily explain how to configure SSH keys on both the local machine and the remote machine. Subsequently, it will delve into the usage of the VS Code Remote SSH extension.

Read more »

Preface

Python is renowned for its rich set of modules. However, unlike in Java development where Maven uses group Id, artifact Id, and version to uniquely identify a dependency, in practice, most Python projects differentiate modules solely by their names. Run pip install <module>, and you’ve got the module. But what about the module version? Most project requirements do not specify versions, leading to constant errors for those who run the project later.

Hence, the concept of a weakened version number undoubtedly does more harm than good. How to solve this issue? By using venv (virtual environment).

If you directly use pip install, all Python projects share these modules, leading to potential compatibility issues. Venv copies the original Python environment. The virtual environment runs only on the copied Python, and the installed modules exist only in that virtual environment. Multiple virtual environments are isolated from each other.

Usage

1️⃣Create venv:

1
python -m venv C:\Users\Gustav\Desktop\test\venv

The directory C:\Users\Gustav\Desktop\test\venv is the virtual environment.

Read more »

Overview

LeetCode Weekly Contest 370

This article is a summary of the weekly contest. I do not plan to discuss each problem in detail; for some problems, I will only provide a rough outline. The point of this article is self-reflection and improvement.

Achieved AC in the first three problems within 23 minutes, resulting in a ranking around 300 - more like a typing contest emphasizing speed rather than a coding contest. Brief description of problem-solving:

  • Problem 1: Easy problem but got stuck for 5 minutes 😒;
  • Problem 2: Similar to the first one in terms of background, also easy problem, but solved faster 😋;
  • Problem 3: A real medium-level problem that required a bit more thought, solved in 15 minutes, not bad 😋;
  • Problem 4: Couldn’t solve. If the data range is small, it’s a simple DP problem, but couldn’t find an optimization 😒;
Read more »

Problem

Source: 2127. Maximum Employees to Be Invited to a Meeting (Daily Problem)

A company is organizing a meeting and has a list of n employees, waiting to be invited. They have arranged for a large circular table, capable of seating any number of employees.

The employees are numbered from 0 to n - 1. Each employee has a favorite person and they will attend the meeting only if they can sit next to their favorite person at the table. The favorite person of an employee is not themselves.

Given a 0-indexed integer array favorite, where favorite[i] denotes the favorite person of the ith employee, return the maximum number of employees that can be invited to the meeting.

Example 1

Input: favorite = [2,2,1,2] Output: 3

image-20231101114926490image-20231101125447756

Read more »

Overview

LeetCode Weekly Contest 369

This article is a summary of the contest. I don’t plan to discuss each problem in detail, but will provide general ideas. The point of this article is self-reflection and improvement.

After reviewing the contest, it is not so difficult. Here is a brief description of my performance on each problem:

  • Problem 1: Simple simulation problem, an easy one.
  • Problem 2: Not difficult, but requires consideration of multiple cases. Unfortunately, I didn’t think thoroughly, resulting in 3 WA 😒.
  • Problem 3: a Medium-level DP problem. Initially struggled to come up with a solution, wasted time on the unsolved problem 4, but eventually solved it quickly 😋.
  • Problem 4: Despite being a hard-level problem and not solved during the contest, the code only exceeded time limits. After the contest, I figured out an optimization method by myself. Note that the messy logic during coding led to 2 WA 😒.
Read more »

Introduction

Azure Pipelines is a component of Azure DevOps (a SaaS platform) and serves as an automated CI/CD pipeline. Similar technologies include GitHub Actions and Jenkins.

As users, we only need to define various tasks in YAML, trigger the pipeline, and Azure Pipelines automatically executes these tasks for us.

So, how are tasks executed? Is there a limit to parallel tasks? How can we design YAML more efficiently to make a pipeline run faster? This article will analyze the architecture of Azure Pipelines from the perspective of task scheduling, providing answers to these questions along the way.

Read more »
0%