Skip to content

Commit 1907d23

Browse files
committed
docs(notes): add VS Code vsix note, update linear algebra note
1 parent 6909f2d commit 1907d23

File tree

2 files changed

+135
-61
lines changed

2 files changed

+135
-61
lines changed

notes/2025-02-27-linear-algebra-note-en.md

+58-61
Original file line numberDiff line numberDiff line change
@@ -5,59 +5,57 @@ layout: post
55
title: Linear Algebra Note
66
---
77

8-
Let's break it down further with a concrete example to help clarify the concept of the canonical form of a quadratic form.
8+
## Example
99

10-
### Example
11-
12-
Consider the quadratic form in two variables \[x\] and \[y\]:
10+
Consider the quadratic form in two variables \\( x \\) and \\(y\\):
1311

1412
\[ Q(x, y) = 2x^2 + 4xy + 3y^2 \]
1513

16-
#### Step-by-Step Transformation to Canonical Form
14+
### Step-by-Step Transformation to Canonical Form
1715

1816
1. **Matrix Representation:**
19-
- Write the quadratic form as a matrix equation. The matrix \[A\] associated with this quadratic form is:
17+
- Write the quadratic form as a matrix equation. The matrix \\(A\\) associated with this quadratic form is:
2018

21-
\[
22-
A = \begin{pmatrix}
23-
2 & 2 \\
24-
2 & 3
25-
\end{pmatrix}
26-
\]
19+
\[
20+
A = \begin{pmatrix}
21+
2 & 2 \\
22+
2 & 3
23+
\end{pmatrix}
24+
\]
2725

28-
Note that the off-diagonal elements are half of the coefficient of the \[xy\] term.
26+
Note that the off-diagonal elements are half of the coefficient of the \\(xy\\) term.
2927

3028
2. **Find Eigenvalues and Eigenvectors:**
31-
- Compute the eigenvalues of \[A\] by solving the characteristic equation \[\det(A - \lambda I) = 0\].
29+
- Compute the eigenvalues of \\(A\\) by solving the characteristic equation \\( \det(A - \lambda I) = 0 \\).
3230
- For each eigenvalue, find the corresponding eigenvector.
3331

3432
3. **Diagonalization:**
35-
- Construct a matrix \[P\] whose columns are the eigenvectors of \[A\].
36-
- Compute \[D = P^TAP\], which will be a diagonal matrix with the eigenvalues of \[A\] on the diagonal.
33+
- Construct a matrix \\(P\\) whose columns are the eigenvectors of \\(A\\).
34+
- Compute \\(D = P^TAP\\), which will be a diagonal matrix with the eigenvalues of \\(A\\) on the diagonal.
3735

3836
4. **Change of Variables:**
39-
- Define new variables \[u\] and \[v\] such that:
37+
- Define new variables \\(u\\) and \\(v\\) such that:
4038

41-
\[
42-
\begin{pmatrix}
43-
x \\
44-
y
45-
\end{pmatrix} = P \begin{pmatrix}
46-
u \\
47-
v
48-
\end{pmatrix}
49-
\]
39+
\[
40+
\begin{pmatrix}
41+
x \\
42+
y
43+
\end{pmatrix} = P \begin{pmatrix}
44+
u \\
45+
v
46+
\end{pmatrix}
47+
\]
5048

51-
- Substitute these into the original quadratic form to get a new form in terms of \[u\] and \[v\].
49+
- Substitute these into the original quadratic form to get a new form in terms of \\(u\\) and \\(v\\).
5250

5351
5. **Canonical Form:**
5452
- The resulting quadratic form will be in the canonical form, which is a sum of squares:
5553

56-
\[
57-
Q(u, v) = \lambda_1 u^2 + \lambda_2 v^2
58-
\]
54+
\[
55+
Q(u, v) = \lambda_1 u^2 + \lambda_2 v^2
56+
\]
5957

60-
where \[\lambda_1\] and \[\lambda_2\] are the eigenvalues of \[A\].
58+
where \\(\lambda_1\\) and \\(\lambda_2\\) are the eigenvalues of \\(A\\).
6159

6260
### Interpretation
6361

@@ -73,27 +71,27 @@ This process simplifies the quadratic form and makes it easier to analyze its pr
7371
In the context of quadratic forms, the term "二次型的规范形" translates to "canonical form of a quadratic form" in English. Understanding this concept involves recognizing how a quadratic form can be simplified or transformed into a standard form through linear algebra techniques.
7472

7573
### Quadratic Forms
76-
A quadratic form is a homogeneous polynomial of degree two in several variables. For example, in two variables \[x\] and \[y\], a quadratic form might look like:
74+
A quadratic form is a homogeneous polynomial of degree two in several variables. For example, in two variables \\(x\\) and \\(y\\), a quadratic form might look like:
7775

7876
\[ Q(x, y) = ax^2 + bxy + cy^2 \]
7977

8078
### Canonical Form
8179
The canonical form of a quadratic form is a simplified version that reveals essential properties, such as the rank and signature (the number of positive, negative, and zero eigenvalues). To achieve this form, we typically perform a change of variables, often through diagonalization or other orthogonal transformations.
8280

8381
#### Steps to Find the Canonical Form:
84-
1. **Matrix Representation:** Represent the quadratic form as a symmetric matrix \[A\]. For the above example, the matrix would be:
85-
\[
86-
A = \begin{pmatrix}
87-
a & \frac{b}{2} \\
88-
\frac{b}{2} & c
89-
\end{pmatrix}
90-
\]
82+
1. **Matrix Representation:** Represent the quadratic form as a symmetric matrix \\(A\\). For the above example, the matrix would be:
83+
\[
84+
A = \begin{pmatrix}
85+
a & \frac{b}{2} \\
86+
\frac{b}{2} & c
87+
\end{pmatrix}
88+
\]
9189

92-
2. **Diagonalization:** Find an orthogonal matrix \[P\] such that \[P^TAP\] is a diagonal matrix \[D\]. This process involves finding the eigenvalues and eigenvectors of \[A\].
90+
2. **Diagonalization:** Find an orthogonal matrix \\(P\\) such that \\(P^TAP\\) is a diagonal matrix \\(D\\). This process involves finding the eigenvalues and eigenvectors of \\(A\\).
9391

94-
3. **Change of Variables:** Use the matrix \[P\] to change variables, transforming the original quadratic form into a sum of squares, each corresponding to an eigenvalue.
92+
3. **Change of Variables:** Use the matrix \\(P\\) to change variables, transforming the original quadratic form into a sum of squares, each corresponding to an eigenvalue.
9593

96-
4. **Canonical Form:** The resulting diagonal matrix \[D\] represents the canonical form of the quadratic form, where each diagonal entry is an eigenvalue of \[A\].
94+
4. **Canonical Form:** The resulting diagonal matrix \\(D\\) represents the canonical form of the quadratic form, where each diagonal entry is an eigenvalue of \\(A\\).
9795

9896
The canonical form helps in analyzing the properties of the quadratic form, such as determining whether it is positive definite, negative definite, or indefinite, which is crucial in optimization and other mathematical applications.
9997

@@ -104,15 +102,15 @@ The **normal form of a quadratic form** refers to the simplified standard repres
104102
---
105103

106104
### **1. Definition of a Quadratic Form**
107-
A **quadratic form** in \[ n \] variables is a function of the form:
105+
A **quadratic form** in \\( n \\) variables is a function of the form:
108106

109107
\[
110108
Q(x) = x^T A x
111109
\]
112110

113111
where:
114-
- \[ x = (x_1, x_2, \dots, x_n)^T \] is an \[ n \]-dimensional column vector,
115-
- \[ A \] is an \[ n \times n \] symmetric matrix.
112+
- \\( x = (x_1, x_2, \dots, x_n)^T \\) is an \\( n \\)-dimensional column vector,
113+
- \\( A \\) is an \\( n \times n \\) symmetric matrix.
116114

117115
The goal is to transform this quadratic form into a simpler, standardized form.
118116

@@ -121,27 +119,27 @@ The goal is to transform this quadratic form into a simpler, standardized form.
121119
### **2. Finding the Normal Form**
122120
To simplify the quadratic form, we use an orthogonal change of variables:
123121

124-
1. **Find the Eigenvalues and Eigenvectors of \[ A \]:**
125-
- Compute the eigenvalues \[ \lambda_1, \lambda_2, \dots, \lambda_n \].
122+
1. **Find the Eigenvalues and Eigenvectors of \\( A \\):**
123+
- Compute the eigenvalues \\( \lambda_1, \lambda_2, \dots, \lambda_n \\).
126124
- Find an orthonormal basis of eigenvectors.
127125

128-
2. **Diagonalization of \[ A \]:**
129-
- Since \[ A \] is symmetric, it can be diagonalized as \[ A = P D P^T \], where:
130-
- \[ P \] is an orthogonal matrix (whose columns are eigenvectors of \[ A \]).
131-
- \[ D \] is a diagonal matrix with eigenvalues \[ \lambda_1, \lambda_2, \dots, \lambda_n \] on the diagonal.
126+
2. **Diagonalization of \\( A \\):**
127+
- Since \\( A \\) is symmetric, it can be diagonalized as \\( A = P D P^T \\), where:
128+
- \\( P \\) is an orthogonal matrix (whose columns are eigenvectors of \\( A \\)).
129+
- \\( D \\) is a diagonal matrix with eigenvalues \\( \lambda_1, \lambda_2, \dots, \lambda_n \\) on the diagonal.
132130

133-
3. **Change of Variables:**
134-
- Define a new variable \[ y = P^T x \], then:
131+
3. **Change of Variables:**
132+
- Define a new variable \\( y = P^T x \\), then:
135133

136-
\[
137-
Q(x) = x^T A x = (P y)^T A (P y) = y^T (P^T A P) y = y^T D y
138-
\]
134+
\[
135+
Q(x) = x^T A x = (P y)^T A (P y) = y^T (P^T A P) y = y^T D y
136+
\]
139137

140-
- Since \[ D \] is diagonal, the quadratic form simplifies to:
138+
- Since \\( D \\) is diagonal, the quadratic form simplifies to:
141139

142-
\[
143-
Q(y) = \lambda_1 y_1^2 + \lambda_2 y_2^2 + \dots + \lambda_n y_n^2
144-
\]
140+
\[
141+
Q(y) = \lambda_1 y_1^2 + \lambda_2 y_2^2 + \dots + \lambda_n y_n^2
142+
\]
145143

146144
This is the **normal form of the quadratic form**.
147145

@@ -157,4 +155,3 @@ To simplify the quadratic form, we use an orthogonal change of variables:
157155
This process is essential in **conic sections, optimization, and differential equations**, as it helps classify quadratic surfaces and functions.
158156

159157
Would you like a more detailed example?
160-

notes/2025-03-21-vscode-vsix-en.md

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: vscode-vsix
3+
lang: en
4+
layout: post
5+
audio: false
6+
translated: false
7+
generated: true
8+
---
9+
10+
To manually download a `.vsix` file for a Visual Studio Code (VS Code) extension, you can use the Visual Studio Marketplace, which hosts all official extensions. The `.vsix` file is the packaged format for VS Code extensions, and while the Marketplace doesn’t always provide a direct download button, you can construct the download URL or use alternative methods. Here’s how to do it step-by-step:
11+
12+
### Steps to Manually Download a `.vsix` File
13+
14+
1. **Find the Extension on the Visual Studio Marketplace**
15+
- Go to the [Visual Studio Marketplace](https://marketplace.visualstudio.com/vscode) in your web browser.
16+
- Search for the extension you want (e.g., "Python" by Microsoft, "Prettier - Code formatter", etc.).
17+
- Open the extension’s page. For example, the Python extension’s URL might look like:
18+
`https://marketplace.visualstudio.com/items?itemName=ms-python.python`.
19+
20+
2. **Identify the Publisher and Extension Name**
21+
- On the extension’s page, note the **publisher** and **extension identifier**. These are part of the URL or displayed on the page.
22+
- For example, in `ms-python.python`, `ms-python` is the publisher, and `python` is the extension name.
23+
24+
3. **Construct the Download URL**
25+
- The `.vsix` file can be downloaded directly using a specific URL pattern provided by the Marketplace. The general format is:
26+
```
27+
https://<publisher>.gallery.vsassets.io/_apis/public/gallery/publisher/<publisher>/extension/<extension-name>/latest/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage
28+
```
29+
- Replace `<publisher>` with the publisher’s name and `<extension-name>` with the extension name.
30+
- For the Python extension (`ms-python.python`), the URL would be:
31+
```
32+
https://ms-python.gallery.vsassets.io/_apis/public/gallery/publisher/ms-python/extension/python/latest/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage
33+
```
34+
- Paste this URL into your browser, and it will trigger the download of the `.vsix` file.
35+
36+
4. **Alternative: Use the Marketplace Page “Download Extension” Link (if available)**
37+
- Some extension pages include a “Download Extension” link under the **Resources** section or elsewhere. If present, click it to download the `.vsix` file directly. However, this is less common, so the URL method is more reliable.
38+
39+
5. **Verify the Download**
40+
- The downloaded file will have a `.vsix` extension (e.g., `ms-python.python-<version>.vsix`).
41+
- Check the file size and name to ensure it matches the extension and version you expect.
42+
43+
6. **Install the `.vsix` File in VS Code (Optional)**
44+
- Open VS Code.
45+
- Go to the Extensions view (`Ctrl+Shift+X` or `Cmd+Shift+X` on macOS).
46+
- Click the three-dot menu (`...`) at the top-right of the Extensions pane.
47+
- Select **Install from VSIX**, then browse to and select the downloaded `.vsix` file.
48+
49+
### Example Walkthrough
50+
Let’s say you want the **ESLint** extension by Dirk Baeumer:
51+
- Marketplace URL: `https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint`
52+
- Publisher: `dbaeumer`
53+
- Extension name: `vscode-eslint`
54+
- Download URL:
55+
```
56+
https://dbaeumer.gallery.vsassets.io/_apis/public/gallery/publisher/dbaeumer/extension/vscode-eslint/latest/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage
57+
```
58+
- Open this URL in your browser, and the `.vsix` file (e.g., `dbaeumer.vscode-eslint-<version>.vsix`) will download.
59+
60+
### Notes
61+
- **Version**: The `/latest/` part of the URL ensures you get the most recent version. If you need a specific version, you’d typically need access to the version number (visible on the Marketplace’s “Version History” tab) and might need to adjust the URL or use a tool like `ovsx` (see below), though the Marketplace API doesn’t always expose older versions easily via direct URL.
62+
- **Blocked Downloads**: If the URL doesn’t work, the publisher might restrict direct access, or your browser/network might block it. In such cases, try a different browser or a download manager.
63+
- **Alternative Tools**: You can use a command-line tool like `ovsx` (from the Open VSX Registry) to download extensions. Install it via npm (`npm install -g ovsx`), then run:
64+
```
65+
ovsx download ms-python.python
66+
```
67+
This downloads the `.vsix` file programmatically.
68+
69+
### Final Answer
70+
To manually download a `.vsix` file for a VS Code extension:
71+
1. Go to the extension’s page on the [Visual Studio Marketplace](https://marketplace.visualstudio.com/vscode).
72+
2. Identify the publisher and extension name (e.g., `ms-python.python`).
73+
3. Use this URL format in your browser:
74+
```
75+
https://<publisher>.gallery.vsassets.io/_apis/public/gallery/publisher/<publisher>/extension/<extension-name>/latest/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage
76+
```
77+
4. Download the `.vsix` file and optionally install it in VS Code.

0 commit comments

Comments
 (0)