- 博客(98)
- 收藏
- 关注
原创 副显示器显示不清晰问题
A: 尝试校准颜色,不好调。然后把DP线拔了重插,就突然正常了。Q: 显示器2连接之后调整分辨率,颜色变不正常。Q: 显示器2显示不清晰,文字非常模糊。
2023-12-19 15:59:59
1697
原创 使用libigl绘制implicit function图像
转换为mesh网格,常用的算法是marching cubes算法(siggraph 87’
2023-03-19 22:52:07
282
原创 React Native & Kotlin 完整版
React Native & Kotlin 完整版Part1: React Native 基本配置(Windows + Android版)官网链接本人使用的node版本:v16.14.0node -v 查看使用的yarn版本:1.22.15yarn --version 查看react native版本:0.671 Node, JDK以管理员身份运行cmd,运行命令:choco install -y nodejs-lts openjdk112 安装Android S
2022-03-06 00:58:41
3898
原创 React Native中使用Kotlin
github项目地址写在前面现希望用 kotlin 计算 a+b 的值返回,用 react-native 调用并显示结果a+b在文件AlertManager.kt中fun trigger(a:Double, b:Double, resPromise:Promise)react-native只能使用async & await接收结果,参见文件App.js此外,java和kotlin同时存在并不影响,因此react-native生成的java文件不用动步骤1 初始化React
2022-03-03 02:00:58
4389
原创 报错:npm ERR code EPERM
1 完整错误npm ERR! code EPERMnpm ERR! syscall opennpm ERR! path D:\NodeJS\node_cache\_cacache\tmp\7bbab18enpm ERR! errno EPERMnpm ERR! FetchError: Invalid response body while trying to fetch https://registry.npmjs.org/webpack: EPERM: operation not permitt
2022-01-15 01:38:08
41572
22
原创 什么是Vanilla JavaScript?
答案:是指没有用任何别的框架,如jQuery等的纯JS(pure JS):Vanilla JavaScript === JavaScriptVanilla JavaScript不是框架,更不是别的奇奇怪怪的东西,它就是指最朴素的JavaScript…背景Vanilla:意思是“香草”。这个词与冰淇淋有关,没有味道的冰淇淋就是香草味冰淇淋,把这个概念移植到JS中,这仅仅只是为了区别使用了如jQuery等框架的JS。关于Vanilla JavaScript的Quora链接关于Vanilla J
2021-12-05 19:54:29
4612
原创 配置:django + react
使用脚手架的连接步骤react:npx create-react-app reactappdjango:django-admin startproject djangoproject把reactapp目录放入djangoproject目录中reactapp目录下:npm run build连接django的 templates 和react的 build/index.htmlsettings.py 设置template项并在文件末尾加入STATICFILES_DIRS:'DIRS': [
2021-11-07 20:07:31
1444
原创 配置:react+d3
将npm+parcel+react配置完成后npm i d3import * as d3 from "d3";使用React useEffect和useRefimport React, { useEffect, useRef } from 'react';示例代码:import React, { useEffect, useRef } from 'react';import * as d3 from "d3"; import "../styles/LineChart.css";
2021-11-05 18:03:43
320
原创 配置:npm+parcel+react
前期安装npm initnpm i --save-dev parcelnpm i react react-dom中期修改修改package.json的scripts项,添加:"start": "parcel index.html --open"创建index.html文件,body引入(1. react的入口div;2. 类型为module的index.js)<div id="app"></div><script type="module" src="i
2021-11-05 15:32:58
238
原创 python常用命令速览
1. conda环境创建:conda create --name env python=3.8激活:activate env不激活: deactivate删除:换源:在.condarc中换2. python换源安装(注意vpn抽疯的问题…)pip install pkg -i http://pypi.douban.com/simple --trusted-host pypi.douban.com3. jupyter notebook添加新conda环境激活环境:activate
2021-11-03 17:03:54
188
原创 [Kaggle] 手写数字识别 - SVM&PCA
Kaggle 手写数字识别 - 使用SVM&PCAKaggle Notebook 地址使用最简单的scikit-learn的PCA&SVC,SVC使用默认参数,也没有使用GridSearchCV等方法,准确率可达到0.975左右。
2021-08-13 12:15:06
254
原创 CH1 经济学十大原理
经济学定义:研究社会如何管理自己的稀缺资源研究人们如何做出决策研究人们如何相互影响研究整个经济的力量和趋势稀缺性:社会资源的有限性十大原理> 人们如何做出决策原理1:人们面临权衡取舍效率:社会能从其稀缺资源中得到最大的利益平等:将这些利益平均分配给社会成员原理2:某种东西的成本是为了得到它所放弃的东西机会成本:为了得到某种东西所放弃的东西原理3:理性人考虑边际量理性人:系统而有目的地尽最大努力实现其目标的人边际行动:对行动计划的微小增量边际收益、边际成本
2021-01-26 16:54:41
256
原创 JS实现扫雷
一个近期学习JavaScript的小项目~项目github地址扫雷试玩(github page)效果图大体思路扫雷基本地雷:用随机数随机生成数字:在地雷生成之后,数在当前格子周围的地雷数生成雷数和地图大小:初级:10个雷,9*9中级:40个雷,16*16高级:99个雷,16*30文件组织images文件夹存放图片本项目使用的图片来源:阿里巴巴矢量图库index.html做展示出来的页面index.css做页面的样式index.js做页面的逻辑代码
2020-12-12 03:07:25
380
原创 Squarified Treemaps 论文算法复现
Squarified Treemaps复现了论文Squarified Treemaps的算法,将层次结构可视化为宽高比适宜的矩形划分图GitHub完整代码实验环境windows10visual studio 2017opengl: GLFWc++可视化效果使用论文中的测试数据测试数据同论文Squarified Treemaps中样例(按100的比例扩大),结果标注面积如图所示(由于本次实现坐标从左上角开始计算,因此行4 3和行2 2 1位置不同,但没有任何影响)数据:vector
2020-11-28 01:54:30
1543
1
原创 win10 vscode使用ssh与本地虚拟机ubuntu连接记录
PART1:关于ssh的一点杂记ssh username@ipv4generate keys> ssh-keygenkey locations:private key: ~/.ssh/id_rsapublic key: ~/.ssh/id_rsa.pubpublic key goes into server “authorized_keys” fileubuntu安装openssh-server (client已安装)> sudo apt-get install opens
2020-11-17 22:27:17
1284
原创 非递归实现的二叉树前、中、后、层序遍历
今日刷题时遇到的问题,顺便记一下模板LeetCode 144.二叉树前序LeetCode 145.二叉树后序第一套模板(个人倾向)// 前序vector<int> preorderTraversal(TreeNode* root) { if(!root) return {}; vector<int> result; stack<TreeNode*> stk; stk.push(root);
2020-11-17 03:21:26
150
原创 使用libigl显示距离场效果
代码#pragma warning(disable:4996)#include<iostream>#include<igl/readOBJ.h>#include<igl/opengl/glfw/Viewer.h>#include<igl/png/readPNG.h>#include <igl/unproject_onto_mesh.h>// distance field algorithm#include<stdafx.h&
2020-11-08 01:20:37
561
原创 b样条曲线:OpenGL GLFW实现交互绘制b样条曲线(含闭合曲线及多种节点向量)
代码/*INTRODUCTION// Mouse:// - LEFT button:// 1. add/move a control points// 2. with keyboard DELETE: delete control points// - RIGHT button:// 1. PRESS: select a control points// 2. RELEASE: add a control point in front of the selected point//
2020-11-08 01:19:32
1391
1
原创 bezier曲线:OpenGL GLFW实现交互绘制bezier曲线
代码/*INTRODUCTION// Mouse:// - LEFT button:// 1. add/move a control points// 2. with keyboard DELETE: delete control points// - RIGHT button:// 1. PRESS: select a control points// 2. RELEASE: add a control point in front of the selected point//
2020-11-08 01:18:13
1222
原创 扫描线填充算法:OpenGL GLFW实现交互多边形填充
代码#include <GLFW/glfw3.h>#include<iostream>#include<vector>#define WIDTH 960.f // width of main window#define HEIGHT 600.f // height of main windowusing namespace std;const int MAXN = 600; // >= HEIGHT, 扫描线// hide the con
2020-11-08 01:17:06
963
原创 Sutherland-Hodgman算法:OpenGL GLFW实现交互的多边形裁剪
代码/*INTRODUCTION// Mouse:// - LEFT button:// 1. add point to draw the polygon// - RIGHT button:// clip the polygon// Keyboard:// - SPACE:// clear the window*/#include <GLFW/glfw3.h>#include<iostream>#include<vector>#defi
2020-11-08 01:15:47
889
原创 Liang-Barsky算法:OpenGL GLFW实现交互的直线段裁剪
代码/*INTRODUCTION// Mouse: // - LEFT button: // 1. draw a new line// 2. choose the endpoint to modify a line// - RIGHT button:// clip the lines// Keyboard:// - SPACE:// clear the window// - DELETE:// keep the clipped lines(black ones)
2020-11-08 01:14:07
731
1
原创 bresenham算法:OpenGL GLFW实现交互画直线
代码/*INTRODUCTION// Mouse:// - LEFT button:// 1. draw a new line// 2. choose the endpoint to modify a line// Keyboard:// - DELETE:// clear the window*/#include <GLFW/glfw3.h>#include<iostream>#include<vector>#include&l
2020-11-08 01:12:23
1213
2
原创 关于动态规划的新理解
今日在LeetCode 53. 最大子序和上看到的一个题解,很好的诠释了动态规划的内涵关于遍历:i位置是子序列的头。这是暴力法。以子序列长度为单位遍历。见LeetCode 5.最长回文子串i位置是子序列的尾。这是最常见的动态规划。今日实战的动态规划53. 最大子序和70. 爬楼梯...
2020-11-08 01:08:38
91
原创 c++ OpenGL之GLFW/glfw3.h:windows+vs配置步骤
参考链接:https://www.youtube.com/watch?v=OR4fNpBjmq8&list=PLlrATfBNZ98foTJPJ_Ev03o2oq3-GGOS2&index=2一、官网下载链接:https://www.glfw.org/download.html选择32位(32-bit windows binaries)下载:二、创建vs项目(需要用到glfw的项目)1. 在该工程目录下新建文件夹,命名为“Dependencies”2. 在“Depende
2020-09-18 01:45:47
8302
4
原创 neural network: cost function
cross entropy(交叉熵)bp神经网络以交叉熵作为损失函数公式解释先换一下公式版本(适用于手写数字识别 0-9):lil_ili:one-hot编码的样本结果矩阵(10×n10×n10×n,nnn为样本数)若现有3个样本:(x(1),y(1)),(x(2),y(2)),(x(3),y(3))(x^{(1)},y^{(1)}), (x^{(2)},y^{(2)}),(x^{(3)}, y^{(3)})(x(1),y(1)),(x(2),y(2)),(x(3),y(3))其中,y
2020-07-23 14:30:34
186
原创 c++计算导数
#include<iostream>#include<cmath>using namespace std;int main(void){ double epsilon = 0.0001; // 10^-4 // y = x^2+x+3; x=2 d=5 double x1 = 2+epsilon, x2 = 2-epsilon; double f1 = pow(x1,2)+x1+3, f2 = pow(x2,2)+x2+3; double derivative
2020-07-22 13:36:34
9331
原创 kd树的ADT实现
实现功能:kd树的初始化、插入、删除、精确查找、范围查找#include<iostream>#include<vector>#include<algorithm>#include<queue>#define INF 0x3f3f3fusing namespace std;template<class T>struct kdTreeNode { vector<T> data; //该节点的多维数据 int spl
2020-06-05 17:46:58
278
原创 csp模拟4
A#include<cstdio>#include<set>using namespace std;int main(void){ int n,k; scanf("%d%d",&n,&k); int res=0; for(int i=0;i<n;i++){ long long a; scanf("%lld",&a); if(k>10) continue; else{ set<int> s;
2020-06-05 12:16:02
339
原创 week12作业
A题意给出n个数,找出出现至少(n+1)/2次的数输入51 3 2 3 3111 1 1 1 1 5 5 5 5 5 571 1 1 1 1 1 1输出351思路输入的同时,用map统计各个数出现的次数,若大于等于(n+1)/2,记录当前索引,输入完毕后输出该值。代码#include<cstdio>#include<map>using namespace std;const int MAXN=1e6;int N,num[MAXN
2020-06-05 12:15:35
160
原创 kmp
注释部分为自己写的kmp,TLE了,没有优化#include<cstdio>#include<string.h>using namespace std;char P[10010],S[1000010];int tms[10010];int pLen,sLen;int kmp(){ /* int tot=0,j=0; for(int i=0;i<sLen;){ if(j==pLen-1 && S[i]==P[j]){ tot++;
2020-06-05 12:15:20
171
原创 week15作业:kbdr hash、字典树
A总结bkdr hashseed=7,17,131…mod=1e9+7unsigned int bkdrHash(string s){ unsigned int hash=0,seed=131,mod=1e9+7,tmp=seed; int n=s.size(); for(int i=0;i<n;i++){ unsigned int as=s[i]; hash+=as*tmp%mod; tmp*=seed; } return hash;}注意输入必须用get
2020-06-05 12:15:08
322
原创 week14作业
A代码#include<cstdio>#include<cmath>using namespace std;int n,a,b,c; //a:R b:P c:Schar s[105];char ans[105];int vis[105],cnt=0;void init(int n){ cnt=0; for(int i=0;i<n;i++){ ans[i]=' '; vis[i]=0; }}int main(void){ int t;
2020-06-05 12:14:45
156
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人