My question on my gpa last semester

Dear Daniel:

   As a student, I show great respect for teacher’s grading and don’t want to change anything but just ask for a word.

   Last semester, in total, I quit 2 class and sleep once and 4 times 5 mins late and never summitted the homework late.

   The first day this semester, I’ve asked some of my classmates. The first is the one who took oral test with me, he got 3.3. I obviously performed better than him in the oral test, and after we checked the answer of the final exam, we shared quite similar answers. So we may not have great difference in the test scores. So the only distance occurred in my attendance. But as far as I know, attendance only occupy 20% of the study. In another case, another person who shared the same experience with me, which means that he also had 1 time off class and he got 3.7.

   I don’t mean something else, I know my strength in English, and I know my attitude may hurt you. Actually, it’s an ideology shock caused by cultural difference. I don’t put punctuation as top priority. I know, every teacher favors students with good attitudes. But I may point out that those attitudes may be pseudo-good attitude. I’ve got bored of seeing people pretend to listen to you and playing games on their screen, and even the top girls had done while I was sleepy cuz my lack of sleep to tackle the study burden. I think I get this low score is just because my "outstanding" figures in your eyes.

   Actually, this semester, I can apply the “no need to study “ policy because my TOEFL score has reached 95. But I didn’t do that, because I’m still seeking the better score, and in search of a method to practice my speaking and writing. (P.S. I didn’t realize that the teacher is still you) So let’s get rid of the preconceived  ideas and witness my progress.

   yours, sincerely.

   Victor Yang

韩国旅游游记

从山城首尔到海滨釜山,用脚步去感受他的文化艺术与风情。

但从一个人暴走的感觉来看,虽说韩国人还是比较友好的,但我还是无奈的被坑了好多钱。老一辈的人对中国日本都还有偏见。听在釜山的一个阔佬说:“对中国友好程度在萨德以前是一半一半,现在呢是1/3,2/3。”估计新冠以后就无了。韩国人被中国人和日本人欺负还能保持这种虚假的民族性(军队美国/文化日本/赚钱中国),其实还是很厉害的。

这无疑导致我对韩国的印象很差。很差。虽然是发达国家,有很多发达国家的要素,但真的不想去第二次,不想在韩国花一分钱,感觉这里是非常专制(连route都不给)、民众极其愚昧、素质也不高,可远观而不可亵玩焉。

Continue reading "韩国旅游游记"

数学建模导论

时间性、随机性、优化性三个变量能很好的对应八卦限图。

数学建模应当掌握的十类算法
‍‍ 1、蒙特卡罗算法(该算法又称随机性模拟算法,是通过计算机仿真来解决问题的算 法,同时可以通过模拟可以来检验自己模型的正确性,是比赛时必用的方法)

2、数据拟合、参数估计、插值等数据处理算法(比赛中通常会遇到大量的数据需要 处理,而处理数据的关键就在于这些算法,通常使用Matlab作为工具)

3、线性规划、整数规划、多元规划、二次规划等规划类问题(建模竞赛大多数问题 属于最优化问题,很多时候这些问题可以用数学规划算法来描述,通常使用Lindo、 Lingo软件实现)

4、图论算法(这类算法可以分为很多种,包括最短路、网络流、二分图等算法,涉 及到图论的问题可以用这些方法解决,需要认真准备)

5、动态规划、回溯搜索、分治算法、分支定界等计算机算法(这些算法是算法设计 中比较常用的方法,很多场合可以用到竞赛中)

6、最优化理论的三大非经典算法:模拟退火法、神经网络、遗传算法(这些问题是 用来解决一些较困难的最优化问题的算法,对于有些问题非常有帮助,但是算法的实 现比较困难,需慎重使用)

7、网格算法和穷举法(网格算法和穷举法都是暴力搜索最优点的算法,在很多竞赛 题中有应用,当重点讨论模型本身而轻视算法的时候,可以使用这种暴力方案,最好 使用一些高级语言作为编程工具)

8、一些连续离散化方法(很多问题都是实际来的,数据可以是连续的,而计算机只 认的是离散的数据,因此将其离散化后进行差分代替微分、求和代替积分等思想是非 常重要的)

9、数值分析算法(如果在比赛中采用高级语言进行编程的话,那一些数值分析中常 用的算法比如方程组求解、矩阵运算、函数积分等算法就需要额外编写库函数进行调 用)

10、图象处理算法(赛题中有一类问题与图形有关,即使与图形无关,论文中也应该 要不乏图片的,这些图形如何展示以及如何处理就是需要解决的问题,通常使用Matlab 进行处理)

以上八大卦限分别对应10个命题

2019 预算/目标

计数名称价格购买原因个数
1weebil稳定器3000画⾯增稳⽤的利器,以前我的视频⼿总是在抖来抖去,此后就再也不会有这个问题。⽽这个产品是最时候旅拍的和最轻便的。1
2a7r420000画质像素王者,虽然还没有出,但索尼制造必属精品。⾃从相机变成了像⼿机⼀样的电⼦产品以后就更新换代⽐较快了,但凡事都有⼀个终极形态,⽐如这个,18K视频,⼀定会使它更具魅⼒。
3腾⻰标准变焦镜头28-754000专⻔为全画幅相机设计的轻便且画质不错的镜头1
4镜头355000⼀直⼈⽂焦段,适合扫街和拍⼈像。1
5托福考试2000出国留学必备考试1
6gre学习8000在托福考试拿下后搞定1
7树莓π及ros学习1000tpu是张量计算的王者1
8⽇本旅游7999初定在第⼆学期和第三学期之间。1
9会员⽹站运维⽀出300这个是⼀笔很⼤的开销了。1
10笔记本8000等今年年底明年年初的时候再买,主要是有1amd最新或者intel最新的cpu的轻薄本就ok。
11workstation100001深度学习和剪视频


本学期的目标
1. 托福
2. gpa3.7
3. 小project 3-7(硬软结合)
4. vlog3-7

Continue reading "2019 预算/目标"

新学期内卷指南

开学后的第一天。早上去报道,本来以为自己很完美的get到了邮箱的意思并完成了网上离校💕手续,但没有提交。被扣留在某地完成抄写一份,非常无奈。

之后去了SI100的教室,不就是个吹逼讲座课嘛,结果还需要做quiz,quiz的内容和做阅读理解差不多,总的来说就是教授帮忙解读这个领域里面最具代表性的综述性论文而已,但是更新速度很快,能到最近几个月的。虽然对于计算机来说也算是老论文了。

电路这周六开始上。

吃中饭的时候看了眼我的cs100,挂了,我选择和学长一样在大四重修。学校的给分制度还是非常的规范和不讲道理的。我觉得就是因为annotation导致的不及格。不过也好,反正最后也会是惨不忍睹。这学期已经够差了,何患无辞。

2022.1.29 update cs100 没有挂,室友挂了。还是拿到B+,第二学期遇到张龙文后变得很仰慕。

php 问题总结

脚本语言的通病

  • 弱类型语言
$a = 1;
$b = array();
$c = "test";

<?php
  $a = null; $b = false;  
  if($a == $b){  
      echo “a和b相等!”;  
  }else{  
      echo “a和b不相等!”;  
  }  
  $a = ''; $b = 0; 
  if($a == $b){  
      echo “a和b相等!”;  
  }else{  
      echo “a和b不相等!”;  
  }  
?>
  • require( )包含文件 可以文件注入
<form>Choose theme:
    <select name = theme>
        <option value = blue>Blue</option>
        <option value = green>Green</option>
        <option value = red>Red</option>
    </select>
    <input type = submit>
</form>
<?php
    if($theme) {
        require($theme.'.txt');
    }
?>
  • sql 注入 拼装字符串,addslashes/stripslashes防御
$sql =”select * from phpben where user_name=’admin’ and pwd =’123′”;  
$sql =”select * from phpben where user_name=’ ‘or’=’or” and pwd =” “;  
$sql =”select * from phpben where user_name=’ ‘or 1=’1′ and pwd =” “;
  • Xss攻击
<body>
<?php
$searchQuery = $_GET['q'];
/* some search magic here */
?>
<h1>You searched for: <?php echo $searchQuery; ?></h1>
<p>We found: Absolutely nothing because this is a demo</p>
</body>

直接打 search.php?q=%3Cscript%3Ealert(1)%3B%3C%2Fscript%3E

Reference

  1. https://www.kancloud.cn/chunyu/php_basic_knowledge/840701
  2. https://www.cnblogs.com/Renyi-Fan/p/10856650.html#_label0_1
  3. https://www.runoob.com/w3cnote/php-safe-collection.html
  4. https://www.oschina.net/translate/top-6-security-attacks-php?print

P5003 跳舞的线 - 乱拐弯

这道DP有点精妙~,大概最优子结构的转移函数写法长这样:

$$f_{max,i,j,0}=max(f_{max,i,j-1,0},f_{max,i,j-1,1}+1)$$

$$f_{max,i,j,1}=max(f_{max,i-1,j,0}+1,f_{max,i-1,j,1})$$

$$f_{min,i,j,0}=max(f_{min,i,j-1,0},f_{min,i,j-1,1}+1)$$

$$f_{min,i,j,1}=max(f_{min,i-1,j,0}+1,f_{min,i-1,j,1})$$

为了防止在起始点拐弯,最好的办法是-1越界。

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#define re register int 
#define LL long long 
using namespace std;
int n,m;
int f[1010][1010][2],g[1010][1010][2];
char a[1010][1010];
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
	for(int j=1;j<=m;j++)
	cin>>a[i][j];
	memset(f,63,sizeof(f));
	if(a[1][1]=='#'){cout<<-1;return 0;}
	g[1][1][0]=g[1][1][1]=0;
	f[1][1][0]=f[1][1][1]=0;//0 left 1 down
	for(int i=1;i<=m;i++)g[0][i][1]=g[0][i][0]=-2147483647;
	for(int i=1;i<=n;i++)g[i][0][1]=g[i][0][0]=-2147483647;
	for(int i=1;i<=n;i++)
	for(int j=1;j<=m;j++)
	if(a[i][j]=='o')
	{
		if(i==1&&j==1)continue;
		g[i][j][1]=max(g[i-1][j][1],g[i][j-1][0]+1);
		f[i][j][1]=min(f[i-1][j][1],f[i][j-1][0]+1);
		g[i][j][0]=max(g[i-1][j][1]+1,g[i][j-1][0]);
		f[i][j][0]=min(f[i-1][j][1]+1,f[i][j-1][0]);
	}
	int Ansa=max(g[n][m][1],g[n][m][0]);
	int Ansb=min(f[n][m][1],f[n][m][0]);
	if(Ansb>n+m-2)cout<<-1<<endl;
	else cout<<Ansa-1<<" "<<Ansb<<endl;
	return 0;
}

linux编译出现 (.text+0x20):对‘main’未定义的引用 collect2: 错误:ld 返回 1 | (.text+0x20): undefined reference to `main' and undefined reference to function 解决方法

操作系统:ubuntu18.04 hpbook2000 gcc版本7.3.0

首先借鉴了国内网站,但大多说的是Makefile 很奇怪,我以为是源码编译的时候的问题但大家都是用”apt install gcc && apt install g++“来安装的,按说是不会出现这种错误的。我那时比较幼稚,就傻吼吼的等了一天源码编译gcc。

搞定了也没用,照样提示以上错误。那怎么办,听网上说只要把main 改成_start 或者不是main的函数名就ok了。又有人说最最主要的原因是Scrt1.o的main函数名定义在了使用它的前面所以报错。好吧,我就算知道也没法改.o文件怎么办。

网上又说有个可以痛改前非的办法,在gcc&g++加个-nostdlib或-nostartfile参数就可以。编译完说内核缺失,错的更离谱了。还有segmentation fault 搞笑。


最终解决办法

cd /usr/lib/ && cp crt1.o Scrt1.o

没有的话就编译一遍gcc就有了。g++和gcc是连带关系所以一并解决。