My page
click here to download
大一一些琐碎的生活切片以及自己的一些想法
不定期掉落一些碎碎念
大一下流水账
截至24年6月28日: po是一位大一结束即将升大二的zju计科平民。回顾过去的一年,有些值得一提的感悟与思考,故而有了这篇文章
转专业
po高考发挥失常来了ZJU(非主代码,正常发挥就是主代码水平)。寒假参加选拔进入了竹院,大一下的半期专业确认到计科。这一年来因为专业的不确定经历了不少事情,最后有惊无险确认成功,也算是挽回了一些当年高考的遗憾,遂总结了一些经验供大家参考。
转专业战报
ZJU的转专业政策整体相对自由,没有强制要求原专业前百分之多少才能转(部分专业有表刷但要求并不高),加上大一的专业课占比较小,所以建议有想法且成绩尚可的同学都去试一试。(附转专业战报)
当然对于新同学而言这张图参考意义不大,如果不了解情况可能会得出不正确的结论,所以仅供参考。
事件节点
以下是po这届的政策,请同学们及时跟进最新政策
求是学院:
1.第一轮主修专业确认:只能在招生大类以内确认,如工试,工信
2.第二轮主修专业确认:可以跨大类确认,但是对于新高考地区只能高转低(只能由录取分高的大类转到录取分低的大类),对老高考地区无高转低限制。
3.寒假转专业:实际上是在大一下学期初转,本次转专业不看高考成绩,主要看大一上绩点与面试表现 后续还有三次假期转专业机会,直到大三上。
竹院:
1.主修专业确认:大一夏学期
2.转专业:大一暑假,大二寒假,大二暑假共三次转专业机会
竹院主修专业确认规则与求是学院第二次主修专业确认政策类似,依然有高转低的限制。不同之处在于竹院学生转专业不占余量,这并不意味着可以任转,只是说转专业会更容易些,但具体容易多少不好量化,并且竹院专业确认时间从我们这一届开始延后了(注:求科除外,求科大一上就确认主修专业,可以参加寒假转专业),所以有利有弊吧。 我觉得两者的区别在于,前者是存量竞争,如果其他同学太厉害就算你也很不错也可能落选;后者是向老师证明自己有能力学好,只要老师能看到你的潜力认为你可以在这个专业学好就会让你进,我了解到的竹院被拒拒大多是绩点不够又想要靠着竹的身份转入而被拒的,不占余量并不是安心躺平的保障。
注意事项
1.选课: 选课与绩点要求 转专业必须满足对应专业的课程与绩点要求,其中H课程可以平替同名的甲/乙课程(i.e.微积分H->微积分甲/乙,但微积分H不能覆盖数学分析)
2.绩点: 上述文件中的绩点只是基本要求,专业竞争越激烈绩点要求越高,所以要量力而行。老师主要看硬课绩点(微积分,线性代数,C语言程序设计与实验,工图等,如果是后面三次转专业应该还包含专业课)。po是4.8+转的,如果你想冲最热门的几个专业那最好硬课全满绩或接近满绩,比较热门的保证硬课4.5+。
3.面试: 考察你对专业的认识与了解。但更重要的是你之前的经历(比如学科竞赛),至于专业知识嘛其实都是可以速成的,总之尽量给老师留下一个好印象。
策略:我应该转专业吗?
1.如果你对当前专业比较满意,但想要挑战更好的更心仪的专业,那么建议参加大一寒假的转专业。因为大一上大多数专业的基础课程是重叠的(至少泛工科是这样,但农学,医学,人文类的有较大区别),所以不用刻意调整选课,转专业失败也没什么代价。
2.如果你不是很满意当前专业,下定决心要转或者想转的专业跨度大,专业课重合度低:
首先是选课问题,你可能要大幅调整你的课表选择选择目标专业的课程,比如想去数学那微积分就必须升级为数学分析(这俩难度不在一个量级上),线性代数升级为高等代数(当然如果原专业不学线代那也要把高代选上)
然而随之而来的就是不确定性:如果转不成功,那么你的情况会很被动。你当然可以收获更多的知识(),但功利地讲这些多学的或者更高难度的课就容易成为沉没成本,而且一般情况下转不成功也是因为这些课的成绩不理想阻碍了转专业。此时你要么继续跟着目标专业的培养方案走,要么及时止损选择留在本专业或者选择其他可能的专业。
而且还要特别注意转专业要求了这些课并不代表你只需要上这些课,比如上述文件中jk大一暑假转专业课程修读基本要求是4选2,但是如果你4选2的话就只是满足了基本要求,因为jk的正常进度是大一下四门全学完还加一个数字逻辑设计。真正下定决心转,最好尽可能跟着目标专业的培养方案同步选课,否则后面的压力会非常大(仅针对没啥基础的同学,大佬请自行忽视)而且面试时老师可能也会考虑你转了后能不能跟上进度,如果选课完全重合老师也更愿意让你来。这么干的风险也蛮大的,所以最好有把握或者下定决心才这么干。
后续发展
转专业成功是一个新的开始,并不代表可以放松了。大一上没有专业课,只要上课认真听了作业认真完成了都可以取得不错的成绩,但大一下三门专业课就有点吃不消了。po是小白,这学期学离散,fds,数逻(真对不起,没能让数逻大人使出全力……)加上把下学期的课拿了门到这学期上导致没时间做好准备成绩(数理基础课还好,专业课……)受了影响(算了不为自己开脱了……)
此外,如果是抱着“先转进来再说”的心态,其实是不建议转专业的:你转专业的原因是你喜欢(再降一点吧,至少比起其他更有感觉)这个专业并且付诸行动,而不只是为了拿到一张某个专业的学士学位证书想着以后找工作更有优势。所以对下定决心要转专业的同学,希望你们考虑长远,做好当下与未来的规划,这样对你转专业成功后的发展大有裨益。
一点私货 这学期在jk的感受
jk是不错的专业,也是zju的热门专业,但是学业压力与竞争压力都挺大的。
转进来前觉得自己都能扛下来,转进来后发现自己只能扛下来……这学期的期末月非常极限:为了做数逻大程整个端午都献给了从零开始学习VGA,PS2,IP core以及手搓500行代码,连续几天在实验室从早待到晚,终于在6.14做出了个勉强能玩的玩意儿,在此建议大家提早两周开始做大程(如果你准备solo的话)。期末周每科刚好有一天的时间复习(但凡少一天就会爆炸)从早到晚都在东1B的自习室补天……(这些怪我不怪jk,是我之前没做好相应的准备,但也说明在jk养老是不可能的,对于基础薄弱的同学而言更是要努力才可能不掉队)
当然好处是在jk也能见到各种各样的佬,你永远不缺学习榜样,这也是我来jk的原因之一。
最后祝大家都能进入心仪的专业!
(某天黄昏做完数逻lab从实验室出来时拍到的)
计算机学科素养速成课程
compression
1.有损压缩:一般用于人类感知相关的信息,如图片,音频。正是因为压缩导致电话里的声音与正常的人声有所区别
+合并bit块:不合并例如raw格式,会比JPEG更大
+视频:仅储存变化,用色块的简单运动来描述变化,但是当压缩过度时会出现错误
+去除超声波:人耳无法感知的声音信号
2.无损压缩:
+图片:
游程压缩,通过标记byte数量实现压缩,但有可能压缩后反而变大(图片信息碎片化)
DFTBA:将图片信息整合成更大的块并对块进行编码,注意传输数据时需要将编码与块的对应信息一并传递
file system
menu document
储存文件信息的文件,而一般文件只是储存数据。
including: name, creation time, time of last modification,owner,type(read/write), address
fragmentation/defragmentation;
hierarchical file system:still used today
lazy deletion:
删除时并没有真正擦除该位置的文件,只是在目录中删去了文件信息并且在下次写入时可以更改该位置的信息,正因如此某些已经彻底删除的文件仍有可能从电脑中恢复。
storage
hard disk drive
read and write from magnetic tape
not volatile
memory hierarchy
cpu register
cpu cache:import a block of instructions from ram at a time/not committing changes to ram immediately->dirty bits sync
ram
flash/usb memory
hard drives
OS
core functionality:kernal ----in charge of memory management/ I/O control / multitasking
kernal protection
once collapsed, you can restart to make it back to normal
dynamic memroy allocation
virtual rom
assume that the storage space is consistent in computers
memory protection
information of different applications is assigned to different parts to prevent interferences
IC
from vaccum tubes to transistors
PCB
standardized,easy to produce in large scale,helping to connect different parts of computers
production
pure sillicon slices,covered by oxide and then covered by a kind of material that will resolve once exposed to light.
steam penetration
Command line interfaces
easy to access computers that are faraway
simple but useful
evolve from teletype machines
meet the needs of human-computer interaction
the computers equipped with interactive functions are primitive terminals
defect: not intuitive
display
two ways to generate pictures: vector scaning and raster scaning
bit maps are not the original way of representing pictures since they take up much space
the hardpiece which is in charge of transforming from numbers to characters is the original form of GPU
development of cs during the cold war
the governments paved the way for the development of PC during the cold war
development of personal computers
IBM compatible
electronic devices for consumers
3D grahics
principle
we calculate the position of the object in three dimension space and then project it onto the scree
-
Orthogonal projection
-
perspective projection:two paralell lines will eventually intersect,like our sight
polygon
we choose triangles to represent a plane because we can not guarantee that four dots are on one plane
numerous triangles construct one 3D object
rendering
scanline rendering
the graph is not smooth
antialiasing
for pixels on the border, choose the color in between to make it mild to your eyes
occlusion relations
-
sorting the polygons first the rendering them from far to close
-
calculating the distances of each pixel first,however when the occluded parts are at the same distances the results are unpredictable(flickering)
lighting
using geometric methods to calculate the brightness of each part to make it 3 dimensionally vivid
texture/coloring
the information are stored in ram (gpu ram)
outside\inside
we usually calculate outside only
computer network
routing
to decide to where it send data packets
switches: divide the network into smaller parts
protocols
IP:IP addresses(computers) and port name(applications).
UDP:simple(data might lost) however fast
TCP/IP:guarantee that no packets are lost and packets can be sent at one time, but the price is less data can be transmitted at one time
packets have sequence,therefore we can send them simultaneously
ICMP
medium
cables: when two signals transmit at the same time it may cause chaos(expotential waiting time to solve conjestion)
wifi:magnetic waves
DNS server
translator
if failed:return numbers
eg. 404:the page not found
400~499:error occurred on the client side
layers of network
World Wide Web
introduction
different from the internet,www is based on the internet.
internet: lines/tubes
www: an information system that enables content sharing over the internet
URL:unified resources locator
helping to locate certain webpage
unique
language:html
information transmission protocol
http:only text, no encryption
https:safer
browser->searching engine
crawler:finding links
web-rank algorithm
hackers
attack on SQL: stack overflow
overwrite the info
Encrption
modern encryption is basd on complexity
exchange key
symmetric encryption: one way function makes it possible.We can share the same key without sending it via internet
e.g result :A^x mod B:A,B can be public and the result might be leaked but still hackers don't know the key x(especially when it is a large number)
asymmetric encryption
private key is private.public key is public
digital signature is based on it
ML/CV/NLP
ML is different from AI, it is one foundation of AI.Machines learn by getting close to the right answer.
CV: now using CNN
新章节:python学习之CS61A
basic knowledge
+very demanding on format:python uses indentation to distinguish between different code-blocks
+object-oriented
+for normal statements,execute it immediately;for functions,store the body waiting to be called
terminology
+interpreter:different from compiler,it can execute your code while you are writing,while still you can first write it in your text editor then run it just like C
frame
operations
+import lib functions
1.
import math
math.sqrt(4)
2.
from math import sqrt
sqrt(4)
three different ways to do the division: /,//,% / will transform the operand into float automatically,even if the result is an integer
format
no need to declare the variable before using it
function:
def hailstone(digit,num):
if digit==1:
print(digit)
print('the number of steps is:',num)
return num
if digit%2==0:
print(digit)
hailstone(int(digit/2),num+1)
if digit%2==1:
print(digit)
hailstone(digit*3+1,num+1)
return None
input/output
a,b=input().split() #inputs are all treated as strings,*.split()* helps to divide the inputs,w
print('%s %s'%(a,b)) #no comma in between
+all inputs are perceived as strings(),so transformation is needed.
however when we define a function we don't necessarily need to label the input type,rather it is when we call the function that we need to declare its type
a,b=map(lambda x:int (x),input('input your data').split()) #format:(the func you choose,input)
+for outputs,we can choose one format to output(similar to C except ',')
basic functions
many libs provide plenty of functions,which is a great advantage of python
data structure
类型 | 有序性 | 可变性 | 允许重复 | 允许不同类型 |
---|---|---|---|---|
列表 | 有序 | 可变 | 允许 | 允许 |
元组 | 有序 | 不可 | 允许 | 允许 |
集合 | 无序 | 可变 | 不允许 | 允许(必须不变元素) |
字典 | 无序 | 可变 | 不允许 | 允许(值不同类) |
operation on containers
slicing
[x for x in range(10) if x % 3 == 0]
{2*x: x for x in c}
list()
sum/max/all
=>they all need parameter to be iterable
sum: sum([1,2,3],4)/sum([[1,2,3],[4,5]],[])
max: max(range(10),key=lambda x: 7-(x-5)(x-7))
attention: range() returns a list of integers
all: resembles 'and' logic in function
strings
A kind of abstraction
strings are a type of sequence
abstraction
Tree
basic operations:
Data abstraction
conceal the data and corresponding operations so as to simplify complexity
do not violate abstraction barriers
class Account:
def __init__(self, balance):
self.__balance = balance # 使用双下划线隐藏属性
def deposit(self, amount):
self.__balance += amount
def withdraw(self, amount):
if amount <= self.__balance:
self.__balance -= amount
return amount
else:
raise ValueError("Insufficient funds")
def get_balance(self):
return self.__balance
account = Account(100)
print(account.get_balance()) # 正确使用接口获取余额
# 违反抽象屏障,直接修改隐藏属性
account._Account__balance = 1000
print(account.get_balance()) # 输出: 1000
Mutability
encoding:
unicode(contains ascii,a total of 109000 objects)->utf-8
the length of the encoding of unicode object vary from 1 to 4
operations:
from unicodedata import name,lookup
lookup('SNOWMAN')
name('A')
lookup('WHITE SMILE FACE').encode()
'A'.encode
Mutation
two objects are the same / equal(one thing)
两变量指向同一个对象,两个变量等价,变化同步
两个变量指向不同对象但是对象的值相同,两个变量相等,但变化不同步
python中传参基于变量的引用而不是变量的复制,对于不可变对象(整数,浮点,字符串),更改将会创建新的对象;对于可变对象修改会传递到函数外部
元组不可变,但其元素可以为可变对象,可以改变可变对象的值
字典的键必须为可哈希的(即不可变的),否则改变键会使得值不可查询,所以如果键为含有可变对象的元组依然非法
辨析:引用赋值,浅拷贝(拷贝结构,元素本身仍然是引用)与深拷贝(完全拷贝)
变量指向对象,是否变化的关键取决于对象是否可变
Mutable Function
default argument value: 默认参数必须在非默认参数之后,在默认参数值在函数定义时计算一次,并且在后续的函数调用中使用相同的对象。这意味着如果默认值是一个可变对象(例如列表、字典或自定义对象),并且在函数内部修改了该对象,那么后续的函数调用将共享该修改后的对象。这通常会导致意想不到的行为。
解决方法:使用'None'作为默认值
Partitions
partition
def list_partitions(n,m):
if n<0 or m == 0:
return []
else:
exact = []
if m == n:
exact = [[m]]
with_m = [[m]+p for p in list_partitions(n-m, m)]
without_m = list_partitions(n, m-1)
return exact +with_m +without_m
def list_partitions(n,m):
if n<0 or m == 0:
return []
else:
exact = []
if m == n:
exact = [str(m)]
with_m = [str(m)+'+'+p for p in list_partitions(n-m, m)]
without_m = list_partitions(n, m-1)
return exact +with_m +without_m
iterators and generators
可迭代对象和迭代器对象
迭代器(iterator): iter()或者 call function that returns a generator
一次性,可用next进行调用,也可用list一次性完成输出
yield 和 yield from(多个)
可迭代对象(iterable):可以转化为迭代器的对象
实例:
def list_max(n,m):
match = 0
if n<0 or m == 0:
return 0
elif n == m:
match = 1
a = list_max(n-m,m)
b = list_max(n,m-1)
return a + b + match
ver2:
def printlist(n,m):
if n < 0 or m == 0:
return []
else:
a = [ str(m) + p for p in printlist(n-m,m)]
b = [q for q in printlist(n,m-1)]
return a + b
def printlist(n,m):
match = []
if n < 0 or m == 0:
return []
elif n == m:
match = [[str(m)]]
a = [p + [str(m)] for p in printlist(n-m,m)]
b = [q for q in printlist(n,m-1)]
return match + a + b
def printlist_v2(n,m):
if n>=0 and m != 0:
if n == m:
yield [str(m)]
for p in printlist_v2(n-m,m):
yield [str(m)]+ p
yield from printlist_v2(n,m-1)
zip 函数
bind elements in different iterables
return an iterator
dictionary iterators
d.keys() d.values()
Efficiency
similar to that in C
compute efficiency:both time and space
def count_calls(f):
def counted(n):
counted.countnum += 1
return f(n)
counted.countnum == 0
return counted
def fib(n):
if n == 0 or n == 1:
return n
else:
return fib(n-1) + fib(n-2)
def count_frames(f):
def counted(n):
counted.countnum += 1
if counted.max < counted.countnum:
counted.max = counted.countnum
result = f(n)
counted.countnum -= 1
return result
counted.max = 0
counted.countnum = 0
return counted
Memoization
reduce time complexity at the cost of increasing space complexity
Memo version of fib :
def func_memo(f):
cache = {}
def func(n):
if n not in cache:
cache[n] = f(n)
return cache[n]
return func
使用一个空的大括号定义会得到一个新的字典而非集合
集合不可下标
empty_set = set() 定义空集合
object and inheritance
class A:
z = -1
def f(self,x):
return B(x-1)
class B(A):
n = 4
def __init__(self,y):
if y:
self.z = self.f(y)
else:
self.z = C(y+1)
class C(B):
def f(self,x):
return x
a = A()
b = B(1)
b.n = 5
b.z.z.z = 1
each time you call A,B or C a new object is created
b : B(1)
b.z = self.f(y)-->B(0)
b.z.z = B(0).z-->C(1)
b.z.z.z = C(1).z-->init(self,1)-->self.f(1)-->1
b.z.z.z.z = 1.z-->error
method
class cls:
def __init__(self):
return 0
def func1(cls):
return 1
def func2(self,param1):
return 2
def _func2(self):
return 3
def __func2(self):
return 4
def __func2__(self):
return 5
单下划线:下划线作为习惯性的格式
前双下划线:调用时格式obj._classname__func2()
前后双下划线:special method,由系统自动调用而不需要手动触发(例如实例化eg = class)
obj.func()中onj实例本身就充当一个参数
strings
print(f'welcome to {str1} {str2}')
print('welcome to {str1} {str2}'.format('my','world'))
string interpolation : evaluate a string literal that contains expression
inheritance and attribute lookup
subclass is a special form of base class
inheritance is a one way road
mulltiple inheritance
class C(A,B,D):
class statements
here class resembles struct datatype in C
class Bank():
Bank.interest = 0.03
accounts = {}
def open_account(name,password,money):
if name in accounts and accounts[name].password == password:
print('already exists')
else:
account = Account(name,password,money)
accounts.setdefault('name',account)
def log_in():
if
class Account(Bank):
def __init__(self,money,type)
class Tree():
def __init__(self,val,rest=[]):
self.value = value
self.rest = rest
辨析:inheritance and composition:
inheritance:base-->sub
composition:contain-->contained
repr & str:the former one is formatted,using python description
新章节:web dev之CS571
CHAPTER 1:intro
basic web technologies:
-HTML:structure
-CSS:decoration
-JS:interaction
.json: a kind of data structure(not abstract,like txt for example)
widely used to transmit data, since it is easy to get across to both humans and computers
{
"name":{
"first":"xxx",
"last":"xxx"
},
"gender":"armed helicopter",
"age":19,
"num":[35,31,23]
}
the job of browsers are merely sending the requests and receiving data and then rendering it
format
html
<html>
<head><br>
<br>
</head>
<body>
<table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table>
<p></p><br>
<ol>
<li><strong></strong></li>
</ol>
<select>
<option></option>
<option></option>
</select>
</body>
</html>
+differentiate between and welcome to zju
CSS&Javascript
three ways to use CSS:
1.inline
2.internal
3.external
and the same principle applies to Javascript
operations:
CSS:
- in
<link rel="stylesheet" href="style.css">
- in .css
.td{
color:firebrick;
font weight:300;
}
html:
- use document to reference DOM
document.getElementById/……
operations:
key word :this
eg.
<button onclick="name(this)" id="btn1">press to continue</button>
function name(target){
const con=document.getElementByTagName().value;
alert(target);
window.location.href=con;
}
Conversions between JS object and JSON
the slight difference in syntax
comments are not allowed in JSON
key value pairs must be in "" in JSON
other features
web programming is all about data
data can only be transferred in the form of text,therefore----
JSON.parse (objects are stored in heap,the variable for an object is actually a pointer)
JSON.stringify
if a variable is a const: it can not be reassigned yet its property can be reassigned
ATTENTION: Since the variable type is hidden here in JS,we should be extra cautious when it comes to variable assignment
新章节:短学期之大数据可视化
Data workflow
data platform->storage->acquision->
profiling
data overview
data schema
data quality
domain
wrangling
sorting
filter
distinct:remove duplicate objects
slice
extract
mutate
replace
split
merge
aggregate
reshape
join
modeling
m