mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 23:04:05 -06:00
Add file
This commit is contained in:
parent
76c53018a0
commit
bf19f32af6
BIN
content/.trash/zhejiang_university_scholarship_third_prize.png
Normal file
BIN
content/.trash/zhejiang_university_scholarship_third_prize.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
BIN
content/assets/pdf/master_transcript.pdf
Normal file
BIN
content/assets/pdf/master_transcript.pdf
Normal file
Binary file not shown.
BIN
content/assets/pdf/undergraudate.pdf
Normal file
BIN
content/assets/pdf/undergraudate.pdf
Normal file
Binary file not shown.
BIN
content/assets/pic/academic_excellent_1920.png
Normal file
BIN
content/assets/pic/academic_excellent_1920.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
BIN
content/assets/pic/academic_excellent_award1819.png
Normal file
BIN
content/assets/pic/academic_excellent_award1819.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 445 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
@ -25,5 +25,9 @@ date: 2024-03-18
|
||||
|
||||
# MATLAB
|
||||
|
||||
* [Plot UI components for MATLAB](computer_sci/coding_knowledge/matlab/uicontrol.md)
|
||||
|
||||
# JavaScript
|
||||
|
||||
*
|
||||
|
||||
|
||||
54
content/computer_sci/coding_knowledge/js/DOM.md
Normal file
54
content/computer_sci/coding_knowledge/js/DOM.md
Normal file
@ -0,0 +1,54 @@
|
||||
---
|
||||
title: Document Object Model
|
||||
tags:
|
||||
- javascript
|
||||
- web
|
||||
- coding-language
|
||||
date: 2024-03-20
|
||||
---
|
||||
DOM 是指文档对象模型(Document Object Model),它是 HTML 和 XML 文档的编程接口。它提供了对文档结构、样式和内容的访问和操作。
|
||||
|
||||
DOM 将文档表示为一个由**节点和对象组成的树状结构**。*每个节点代表文档中的一个元素*,例如 `<div>`、`<p>` 或 `<img>`。*每个对象都包含一组属性和方法,用于访问和操作节点*。
|
||||
|
||||
JavaScript 可以使用 DOM 来:
|
||||
|
||||
- 获取和设置元素的属性
|
||||
- 添加、删除和修改元素
|
||||
- 绑定事件处理程序
|
||||
- 操纵文档的样式
|
||||
- 读取和写入文档内容
|
||||
|
||||
**DOM 是 JavaScript 中最重要的 API 之一,它是 Web 开发的基础。**
|
||||
|
||||
|
||||
## Demo code
|
||||
|
||||
```js
|
||||
// 获取元素的属性
|
||||
const element = document.getElementById("my-element");
|
||||
const attribute = element.getAttribute("href");
|
||||
|
||||
// 设置元素的属性
|
||||
element.setAttribute("href", "https://www.example.com");
|
||||
|
||||
// 添加元素
|
||||
const newElement = document.createElement("div");
|
||||
document.body.appendChild(newElement);
|
||||
|
||||
// 删除元素
|
||||
element.parentNode.removeChild(element);
|
||||
|
||||
// 绑定事件处理程序
|
||||
element.addEventListener("click", () => {
|
||||
// 这是一个事件处理程序
|
||||
});
|
||||
|
||||
// 操纵文档的样式
|
||||
element.style.color = "red";
|
||||
|
||||
// 读取文档内容
|
||||
const textContent = element.textContent;
|
||||
|
||||
// 写入文档内容
|
||||
element.textContent = "Hello, world!";
|
||||
```
|
||||
129
content/computer_sci/coding_knowledge/matlab/uicontrol.md
Normal file
129
content/computer_sci/coding_knowledge/matlab/uicontrol.md
Normal file
@ -0,0 +1,129 @@
|
||||
---
|
||||
title: Plot UI component in MATLAB
|
||||
tags:
|
||||
- matlab
|
||||
- coding-language
|
||||
date: 2024-03-20
|
||||
---
|
||||
# Demo
|
||||
|
||||
```matlab
|
||||
clear all;close all;clc;
|
||||
|
||||
file_path = './signal/signal.xlsx';
|
||||
signal = readtable(file_path);
|
||||
|
||||
mc_signal = load('./signal/mc_signal.txt');
|
||||
mc_signal = mc_signal';
|
||||
|
||||
label = signal.Properties.VariableNames;
|
||||
|
||||
t = signal.t;
|
||||
|
||||
signal_cell = cell(length(label) - 1,1);
|
||||
|
||||
figure;
|
||||
|
||||
for i = 1:length(label) - 1
|
||||
signal_cell{i} = plot(t, signal.(label{i+1}), 'LineWidth', 1.5, 'DisplayName', label{i+1});
|
||||
hold on;
|
||||
end
|
||||
|
||||
hold off;
|
||||
|
||||
xlabel('Time (s)');
|
||||
ylabel('Amplitude');
|
||||
title('Signal');
|
||||
legend('show');
|
||||
|
||||
grid on;
|
||||
grid minor;
|
||||
|
||||
prompt = cell(length(label), 1);
|
||||
|
||||
for i = 1:length(label) - 1
|
||||
prompt{i} = ['Show ', label{i+1}];
|
||||
end
|
||||
|
||||
prompt{end} = 'Show All';
|
||||
|
||||
show_popupmenu = uicontrol('Style', 'popupmenu', 'String', prompt, 'Position', [20, 20, 100, 25], 'Callback', @(src, event) update_plot_show(src, event, signal_cell));
|
||||
|
||||
for i = 1:length(signal_cell)
|
||||
prompt{i} = ['Hide ', label{i+1}];
|
||||
end
|
||||
|
||||
prompt{end} = 'Hide All';
|
||||
|
||||
hide_popupmenu = uicontrol('Style', 'popupmenu', 'String', prompt, 'Position', [140, 20, 100, 25], 'Callback', @(src, event) update_plot_hide(src, event, signal_cell));
|
||||
|
||||
delete_noise_button = uicontrol('Style', 'pushbutton', 'String', 'Delete Noise', 'Position', [20, 220, 100, 50], 'Callback', @(src, event) delete_noise(src, event, signal_cell, mc_signal));
|
||||
|
||||
function update_plot_show(src, ~, signal_cell)
|
||||
|
||||
selectedCurve = get(src, 'Value');
|
||||
|
||||
if selectedCurve == length(signal_cell) + 1
|
||||
for i = 1:length(signal_cell)
|
||||
set(signal_cell{i}, 'Visible', 'on');
|
||||
end
|
||||
return;
|
||||
end
|
||||
|
||||
for i = 1:length(signal_cell)
|
||||
if selectedCurve == i
|
||||
set(signal_cell{i}, 'Visible', 'on');
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function update_plot_hide(src, ~, signal_cell)
|
||||
|
||||
selectedCurve = get(src, 'Value');
|
||||
|
||||
if selectedCurve == length(signal_cell) + 1
|
||||
for i = 1:length(signal_cell)
|
||||
set(signal_cell{i}, 'Visible', 'off');
|
||||
end
|
||||
return;
|
||||
end
|
||||
|
||||
for i = 1:length(signal_cell)
|
||||
if selectedCurve == i
|
||||
set(signal_cell{i}, 'Visible', 'off');
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function delete_noise(~, ~, signal_cell, mc_signal)
|
||||
|
||||
|
||||
persistent flag;
|
||||
|
||||
if isempty(flag)
|
||||
flag = 1;
|
||||
end
|
||||
|
||||
if flag
|
||||
|
||||
for i = 1:length(signal_cell)
|
||||
signal_cell{i}.YData = signal_cell{i}.YData - mc_signal;
|
||||
end
|
||||
|
||||
flag = 0;
|
||||
|
||||
else
|
||||
|
||||
for i = 1:length(signal_cell)
|
||||
signal_cell{i}.YData = signal_cell{i}.YData + mc_signal;
|
||||
end
|
||||
|
||||
flag = 1;
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
```
|
||||
|
||||
@ -3,7 +3,7 @@ title: Resume
|
||||
tags:
|
||||
- resume
|
||||
- readme
|
||||
date: 2024-03-07
|
||||
date: 2024-03-20
|
||||
---
|
||||
|
||||
<div style="margin:auto;width: 50%; transform: translate(50%, 0);">
|
||||
@ -95,8 +95,9 @@ It was my first class project in college. It was a simple program based on an ol
|
||||
|
||||
# 🏆 Honors
|
||||
|
||||
* Excellent Graduate of Zhejiang University
|
||||
* Third Class Scholarship of Zhejiang University
|
||||
* Award of Honor for Graduate
|
||||
* [Excellent Graduate of Zhejiang University](assets/pic/outstanding_graduates_of_zhejiang_university.jpg)
|
||||
* [Third Class Scholarship of Zhejiang University](assets/pic/zhejiang_university_scholarship_third_prize.png)
|
||||
|
||||
# 🎈 Clubs & Social Activities
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user