自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(218)
  • 收藏
  • 关注

原创 m1 mac opt文件夹

m1 mac 的 opt 文件夹

2022-12-08 10:49:48 1770 1

原创 解决Failed to connect to github.com port 443 after 75004 ms: Operation timed out

计算机M1 Macbook Air 16 + 256解决方法在“访达”的菜单栏上点击“前往”,输入/etc/hosts。添加如下几行140.82.114.4 github.com 199.232.69.194 github.global.ssl.fastly.net185.199.108.153 assets-cdn.github.com185.199.109.153 assets-cdn.github.com185.199.110.153 assets-cdn.github.com

2022-04-25 01:01:04 2515 2

原创 m1 Mac zshrc 环境变量

cd ~open .zshrc把路径按照格式输入进去。

2021-09-29 14:31:13 1659

原创 m1 Mac manimgl 安装踩坑

安装scipy报错。解决方法:conda install scipy安装ManimPango报错。解决方法: brew install pango pkg-config之后再进行安装安装mapbox-earcut报错。解决方法:pip install cmake安装matplotlib报错。解决方法: conda install matplotlib...

2021-09-28 16:34:07 563

原创 动态规划与最长重复子串 LRS and Dynamic Programming

目录最长重复子串问题最长重复子串问题假设我们有一个字符串,要如何求出在这个字符串里最长的重复子串呢?比如给出字符串abcdeefabcd,显然这个字符串的重复子串有很多,比如a、b、ab、abc 等等,那么通过观察,我们可以知道这个字符串的最长重复子串为abcd...

2021-07-09 22:08:45 731 4

原创 windows当前使用壁纸路径

C:\Users(用户)\xx(当前用户名)\AppData\Local\Microsoft\Windows\Themes

2021-06-16 19:10:30 813

原创 react+d3 | problem 2(或与作用域相关)

function monthData(oriData) { let mp = {}; oriData.forEach(d => { let tmpObj = { max_temp: d['max_temperature'], min_temp: d['min_temperature'] }; /* tmpObj.max_temp = d['max_temperature']; tmpObj.min_temp = d['min_temper

2021-05-25 19:57:22 130

原创 react+d3.js | d3.csv无法读取正确的csv文件

整个文件夹结构如下:一开始的代码如下:const csvFile = d3.csv("./public/data/temperature_daily.csv").then(data => { console.log(data); });然而打印出来的信息并不是数据:事实上,这是public文件夹下index.html的代码,文件路径应该改为./data/temperature_daily.csv打印信息如下:推测:当前编辑的js文件与data事实上是同级的目录,

2021-05-24 10:18:33 502 1

原创 快慢指针 C++| leetcode #19, #876, #141, #142, #1721

目录快慢指针的思想Leetcode #19题目描述快慢指针的思想快慢指针的思想并不难理解。正如它的名字一样,快慢指针就是指两个指针,一个跑得快,一个跑得慢。这里所谓的快和慢指的是移动的步长,比如每次让一个指针向前走两步,而让另一个指针向前走一步,那么前面那个指针就是快指针,后面的就是慢指针。P.S. 在这篇blog中,快慢指针也可广义地指一个在前、一个在后的指针,下面将要讲到的leetcode #19就是使用了这种方法。Leetcode #19题目描述一种比较简单的想法是建立一个指针数组,使

2021-05-07 17:28:28 225 2

原创 pyqt5+matplotlib 导入文件并作图,画布更新

qtdesigner布局如下:ui文件转换成py文件,此过程略。新建show.py,关键代码如下:导入文件部分: def choose_file(self): self.fileName, fileType = QFileDialog.getOpenFileName(None, "选取文件", "C:\\", "All Files(*);;Text Files(*.txt)") self.spec_file.setText(self.fileName)作图

2021-04-13 15:00:15 1093 4

原创 逻辑回归(二):Loss易导

目录回顾梯度下降对Loss函数求偏导更新公式多分类问题总结回顾书接上回,讲到了逻辑回归的Loss函数的一般形式,大体如下:L(θ)=1m∑i=1mCost(hθ(x(i)),y(i))=1m∑i=1m[−y(i)log(hθ(x(i)))−(1−y(i))log(1−hθ(x(i)))]hθ(x)=g(θTX)g(z)=11+e−zL(\theta) = \frac{1}{m}\sum_{i=1}^mCost(h_\theta(x^{(i)}),y^{(i)})\\=\frac{1}{m}\sum_

2021-03-15 20:32:25 729

原创 逻辑回归(一):0还是1?

目录分类分类对于人来说,分类是一种很自然的能力。给一个小孩看猫和狗的照片,即使他说不出猫是猫,狗是狗,他也至少知道这两张照片里的动物是不同的。

2021-03-10 21:21:08 3908 8

原创 HKUST DDM面试

bg:中山大学 均分84/100 雅思7.5 美赛M奖tl:12.31投递 - 01.06推荐信齐 - 03.03面试 - 03.04发邮件通知面试通过 - 03.05offerQ:2-3分钟自我介绍,并说说为什么来这个项目A:说了自己的一段水科研,美赛经历等等。来这个项目因为有计算机相关课程,而且比较注重原理。Q:一个矩阵的特征值和特征向量A:略Q:连续概率密度函数,平均值和方差的形式A:∫−∞∞xp(x)dx\int^\infty_{-\infty}xp(x)dx∫−∞∞​xp(x)dx

2021-03-05 19:21:26 3534 5

原创 线性回归:机器学习的“Hello, World“

目录想要解决的问题线性回归(Linear Regression)选择模型(Model)损失函数(Loss function)梯度下降法(Gradient Descent)想要解决的问题假设我们知道若干房子的面积以及对应的房价,那么如果随便告诉我们一套房子的面积,怎么才能知道这套房子最可能买多少钱呢?再假设我们知道了一些零件的使用时间和对应的维修费用,那么如果告诉我们一个零件的使用时间,我们要怎样推测出来对应的维修费用呢?没错,线性回归就是用来解决这些问题的,也就是通过拟合曲线来进行预测。线性回归(Li

2021-03-03 23:33:27 167 2

原创 线代notes_2: MIT18.06 L6-L10

Column Space Null SpaceAll linear combinations cv+dwc \textbf{v}+d\textbf{w}cv+dw are in the space.Subspace SSS and TTT:Intersection S∩TS\cap TS∩T is a subspaceColumn SpaceA=[112213314415]A=\left[\begin{matrix}1&1&2 \\2&1&3 \\3&am

2021-02-27 10:31:51 181

原创 线代notes_1: MIT18.06 L1-L5

ContentIntroRow pictureColumn PictureThree variablesRow pictureColumn pictureLecture 2 EliminationLecture 3 Matrix multiplication and InversesInversesGauss-JordanLecture 4LU decompositionPermutationsIntron linear equations, n unknowns.E.g:2x−y=0−x+2y=3

2021-02-26 13:10:05 167

原创 纯粹直觉地理解主成分分析 (PCA)

引言写这篇blog只是分享一下个人对于PCA的直观理解,并不涉及严谨的数学推导,懒是一个原因,而且自己对线性代数的SVD那些知识掌握得还不够熟练,这里就不班门弄斧了。降维的思想要了解某个物体,我们往往会关注它的多个特性(或者叫多个维度)。假设这里有n个特性,那么对于每一个样本,我们可以用n维空间的某一个点来表示:(x1,x2,…,xn)(x_1, x_2 , \dots, x_n)(x1​,x2​,…,xn​)然而,这些特性中,会存在某一些高度相关的特性,比如在评价一个人时,他/她的总财产和月收入

2021-02-23 16:30:06 237

原创 《C++ Primer Plus》课后编程练习|ch2—ch8

C++ Primer Plus | chapter 2 课后编程练习C++ Primer Plus | chapter 3 课后编程练习C++ Primer Plus | chapter 4 课后编程练习C++ Primer Plus | chapter 5 课后编程练习C++ Primer Plus | chapter 6 课后编程练习C++ Primer Plus | chapter 7 课后编程练习C++ Primer Plus | chapter 8 课后编程练习...

2021-01-28 16:52:56 129

原创 C++ Primer Plus | chapter 8 课后编程练习

函数探幽#include<iostream>using namespace std;void printStr(const char * str, int n = 0);int cnt = 0;int main(){ int len; cout << "Please enter the length of the string: "; cin >> len; char * str = new char [len+1];

2021-01-28 15:32:29 367

原创 C++ Primer Plus | chapter 7 课后编程练习

函数——C++的编程模块#include<iostream>using namespace std;double Average(double, double);int main(){ double x, y; cout << "Please enter x and y (0 to quit): "; cin >> x >> y; while(x && y) { cout

2021-01-28 15:30:11 167

原创 C++ Primer Plus | chapter 6 课后编程练习

第六章 分支语句和逻辑运算符#include<iostream>#include<cctype>using namespace std;int main(){ char ch; cin.get(ch); while(ch != '@') { if(islower(ch)) ch = toupper(ch); if(!isdigit(ch)) cout << ch; cin

2021-01-21 09:10:59 108

原创 C++ Primer Plus | chapter 5 课后编程练习

第五章 循环和关系表达式#include<iostream>using namespace std;int main(){ int a, b; int sum = 0; cout << "Please enter the first integer: "; cin >> a; cout << "Please enter the second integer: "; cin >> b;

2021-01-21 09:05:42 119

原创 C++ Primer Plus | chapter 4 课后编程练习

第四章 复合类型#include<iostream>using namespace std;struct Person{ char first_name[20]; char last_name[20]; char grade; int age;};int main(){ Person x; cout << "What is your first name? "; cin.getline(x.first_nam

2021-01-20 20:19:40 145

原创 C++ Primer Plus | chapter 3 课后编程练习

第三章 处理数据#include<iostream>using namespace std;const int To_inch = 12;int main(){ int inch; cout << "Please enter your height (inch): ___\b\b\b"; cin >> inch; int feet = inch / To_inch; inch %= To_inch; cout

2021-01-20 20:14:09 109

原创 C++ Primer Plus | chapter 2 编程练习

第二章 开始学习C++编程练习:#include<iostream>using namespace std;int main(){ cout << "My name is Irving Chen." << endl; cout << "My address is SYSU." << endl; return 0;}#include<iostream>using namespace s

2021-01-20 20:09:03 519

原创 笔记1:A simple example of Gradient Descent using Python

Linear Regression & Gradient Descent引言Linear RegressionGradient Descent原理代码示例导入相关函数库导入Training Data建立model (function set)Iteration结论可视化引言写这篇blog的目的主要是让自己熟悉一下在李宏毅老师的机器学习课程中学到的Gradient Descent的原理,以及记录下每一步是如何用编程实现的。Linear Regression对于Linear Regression

2020-12-19 20:59:25 129 2

原创 PAT甲级1151~1155|C++实现

PAT甲级1151 LCA in a Binary Tree (30分)|C++实现PAT甲级1152 Google Recruitment (20分)|C++实现PAT甲级1153 Decode Registration Card of PAT (25分)|C++实现PAT甲级1154 Vertex Coloring (25分)|C++实现PAT甲级1155 Heap Paths (30分)|C++实现...

2020-10-16 23:58:28 146

原创 PAT甲级1155 Heap Paths (30分)|C++实现

一、题目描述原题链接Input Specification:Each input file contains one test case. For each case, the first line gives a positive integer N (1<N≤1,000), the number of keys in the tree. Then the next line contains N distinct integer keys (all in the range of int)

2020-10-16 23:57:05 609

原创 PAT甲级1154 Vertex Coloring (25分)|C++实现

一、题目描述原题链接A proper vertex coloring is a labeling of the graph’s vertices with colors such that no two vertices sharing the same edge have the same color. A coloring using at most k colors is called a (proper) k-coloring.Now you are supposed to tell if a

2020-10-16 23:48:05 162

原创 PAT甲级1153 Decode Registration Card of PAT (25分)|C++实现

一、题目描述原题链接Input Specification:​​Output Specification:Sample Input:8 4B123180908127 99B102180908003 86A112180318002 98T107150310127 62A107180908108 100T123180908010 78B112160918035 88A107180908021 981 A2 1073 1809082 999Sample Output:C

2020-10-16 23:35:51 114

原创 PAT甲级1152 Google Recruitment (20分)|C++实现

一、题目描述原题链接Input Specification:Each input file contains one test case. Each case first gives in a line two positive integers: L (≤ 1,000) and K (< 10), which are the numbers of digits of the given number and the prime to be found, respectively. Then

2020-10-16 23:07:01 753

原创 PAT甲级1151 LCA in a Binary Tree (30分)|C++实现

一、题目描述原题链接The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.Given any two nodes in a binary tree, you are supposed to find their LCA.Input Specification:​​Output Specification:S

2020-10-16 22:57:46 86

原创 PAT甲级1146~1150|C++实现

PAT甲级1146 Topological Order (25分)|C++实现PAT甲级1147 Heaps (30分)|C++实现PAT甲级1148 Werewolf - Simple Version (20分)|C++实现PAT甲级1149 Dangerous Goods Packaging (25分)|C++实现PAT甲级1150 Travelling Salesman Problem (25分)|C++实现...

2020-10-15 23:31:22 103

原创 PAT甲级1150 Travelling Salesman Problem (25分)|C++实现

一、题目描述原题链接Input Specification:​​Output Specification:Sample Input:6 106 2 13 4 11 5 12 5 13 1 84 1 61 6 16 3 11 2 14 5 177 5 1 4 3 6 2 57 6 1 3 4 5 2 66 5 1 4 3 6 29 6 2 1 6 3 4 5 2 64 1 2 5 17 6 1 2 5 4 3 17 6 3 2 5 4 1 6Sample

2020-10-15 23:29:32 116

原创 PAT甲级1149 Dangerous Goods Packaging (25分)|C++实现

一、题目描述原题链接When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in serious trouble. For example, oxidizing agent (氧化剂) must not be packed with flammable liquid (易

2020-10-15 23:14:46 239

原创 PAT甲级1148 Werewolf - Simple Version (20分)|C++实现

一、题目描述原题链接Input Specification:​​Output Specification:Sample Input 1:5-2+3-4+5+4Sample Output 1:1 4Sample Input 2:6+6+3+1-5-2+4Sample Output 2(the solution is not unique):1 5Sample Input 3:5-2-3-4-5-1Sample Output 3:No Solu

2020-10-15 10:44:51 114

原创 PAT甲级1147 Heaps (30分)|C++实现

一、题目描述原题链接Input Specification:​​Output Specification:Sample Input:3 898 72 86 60 65 12 23 508 38 25 58 52 82 70 6010 28 15 12 34 9 8 56Sample Output:Max Heap50 60 65 72 12 23 86 98Min Heap60 58 52 38 82 70 25 8Not Heap56 12 34 28 9 8 15 1

2020-10-15 10:30:01 78

原创 PAT甲级1146 Topological Order (25分)|C++实现

一、题目描述原题链接Input Specification:Each input file contains one test case. For each case, the first line gives two positive integers N (≤ 1,000), the number of vertices in the graph, and M (≤ 10,000), the number of directed edges. Then M lines follow, each

2020-10-15 10:13:56 90

原创 PAT甲级1141~1145|C++实现

PAT甲级1141 PAT Ranking of Institutions (25分)|C++实现PAT甲级1142 Maximal Clique (25分)|C++实现PAT甲级1143 Lowest Common Ancestor (30分)|C++实现PAT甲级1144 The Missing Number (20分)|C++实现PAT甲级1145 Hashing - Average Search Time (25分)|C++实现...

2020-10-14 19:08:44 83

原创 PAT甲级1145 Hashing - Average Search Time (25分)|C++实现

一、题目描述原题链接Input Specification:​​Output Specification:Sample Input:4 5 410 6 4 15 1111 4 15 2Sample Output:15 cannot be inserted.2.8二、解题思路考察了哈希表解决冲突的平方探测法,按照题目给的步骤进行模拟即可,代码比较易读,详情见代码注释。三、AC代码#include<iostream>#include<cstdio>#

2020-10-14 19:07:04 65

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除