leester

@leester

  • hbxql Post #11

    就算线下也可能只是一周见一次或两次,说实话和线上差不多太多,当然肯定是线下好。

  • Goto_Hitori 後藤 ひとり Post #9

    要知道自己想要什么,总是被裹挟着忙忙碌碌也不是一种解决方案,问问自己内心真正的想法

  • Qiaoben Qiaoben Post #7

    一是不要这么消极地预设事情的结局。当你做好了最悲观的预期,事情的发展只会朝这个方向在进行。不如放弃焦虑,先行动起来。
    二是思考自己真正想要过什么生活呢?你想要遵循父母期待回老家结婚生子过安稳日子还是想去拼搏闯荡挣大钱呢?针对你的目标生活拆解当下需要做的事情。是提高绩点争取保研,是安心准备考研,还是去找实习积累企业经验...有很多可以做的事,但都需要先行动起来

  • anonymous17 Post #1

    来自西北的我靠着低于全国大部分地方的分数线进入西交,我看到许多厉害的人,有人申请了伯克利哈佛的交换,有人保研了 thu, 但是我又清楚的知道这对我来说不大可能,我并没有亮眼的绩点去保研,也没有殷实的家境去出国。家人对我的期望无非就是上完大学回到那个小地方结婚生子,身在较为传统的小专业,身边的人谈论的基本只有绩点,想跟同学聊聊一些新闻或者是刚看的书,大家只会觉得我是个怪人。一方面我感觉自己的命运大概率像父母说的那样,回到那个小地方去,另一方面,我看到了那么多我永远做不到的事情,这让我格外痛苦。

  • Speed001 Post #2

    太强了,帮顶

  • ❤️ Liked post in CS61a 2023 暑期 学习日记
    深入交流
    TsuinoSora TsuinoSora Post #1

    种种原因,本来说暑假学完 cs61b, 但因为 cs61a 此前没学,于是决定先速通 cs61a
    选择的是 fa20, 因为听说这个学期开源的最多

    这是个日记贴,按道理来说会每天更新,也是对自己的一个督促

    [date-range from=2023-06-26T07:30:00 to=2023-06-27T01:00:00 timezone="Asia/Shanghai"]

    先从 Textbook 阅读开始,阅读了 ch1.1, ch1.2, ch1.3, 虽然上个学期自学过 python, 但是大片的英文读的我属实是有点不适应 (感觉语法之类阅读难度都胜于之前读一些文档,, ,).
    这样一对比,看完 textbook 再看 videos 就很享受了,20fa 的 John 教授口语十分清晰好听很容易听明白.
    然后试了下课程配套的 lab, 很好用孩子很喜欢吃 (bushi

    一天下来没写什么东西,倒是十分感叹别人家教学的先进和人性化.

    笔记

    Expressions

    • Expressions
    • Call Expressions

    Name

    Name -- bind -- object

    The name of a function is repeated twice, once in the frame and again as part of the function itself. The name appearing in the function is called the intrinsic name. The name in a frame is a bound name.

    There is a difference between the two: different names may refer to the same function, but that function itself has only one intrinsic name.

    Environment

    The possibility of binding names to values and later retrieving those values by name means that the interpreter must maintain some sort of memory that keeps track of the names, values, and bindings. This memory is called an environment.

    An environment in which an expression is evaluated consists of a sequence of frames.

    Each frame contains bindings, each of which associates a name with its corresponding value.

    There is a single global frame.

    environment-frame-1|690x233

    Assignment and import statements add entries to the first frame of the current environment.

    Evaluating Nested Expressions

    expression tree:

    expression_tree|508x356

    The Non-Pure Print Function

    In addition to returning a value, applying a non-pure function can generate side effects, which make some change to the state of the interpreter or computer. A common side effect is to generate additional output beyond the return value, using the print function.

    >>> print(print(1), print(2))
    1
    2
    None None
    

    Calling User-Defined Functions

    To evaluate a call expression whose operator names a user-defined function, the Python interpreter follows a computational process. As with any call expression, the interpreter evaluates the operator and operand expressions, and then applies the named function to the resulting arguments.

    Applying a user-defined function introduces a second local frame, which is only accessible to that function. To apply a user-defined function to some arguments:

    1. Bind the arguments to the names of the function's formal parameters in a new local frame.
    2. Execute the body of the function in the environment that starts with this frame.

    The environment in which the body is evaluated consists of two frames: first the local frame that contains formal parameter bindings, then the global frame that contains everything else. Each instance of a function application has its own independent local frame.

    local-names-in-func|690x491

    Functions as Abstractions

    Aspects of a functional abstraction. To master the use of a functional abstraction, it is often useful to consider its three core attributes. The domain of a function is the set of arguments it can take. The range of a function is the set of values it can return. The intent of a function is the relationship it computes between inputs and output (as well as any side effects it might generate). Understanding functional abstractions via their domain, range, and intent is critical to using them correctly in a complex program.

    For example, any square function that we use to implement sum_squares should have these attributes:

    • The domain is any single real number.
    • The range is any non-negative real number.
    • The intent is that the output is the square of the input.

    [date-range from=2023-06-27T08:00:00 to=2023-06-28T01:00:00 timezone="Asia/Shanghai"]

    今天睡觉睡得很多 (下午从 13:00 睡到 17:00), 有点低效率,只读完了 textbook ch.1.4-ch.1.5, 看完了 lec3 的 videos, 完成了 lab01 和 hw01
    照这个速度看速通比较困难,所以明天 (今天早上起来) 开始需要尽可能保持高效才行 😮‍💨

    笔记

    Ch.1.4 Designing Functions

    Remember, code is written only once, but often read many times.

    Documentation

    A function definition will often include documentation describing the function, called a docstring, which must be indented along with the function body. Docstrings are conventionally triple quoted. The first line describes the job of the function in one line. The following lines can describe arguments and clarify the behavior of the function.

    Comments in Python can be attached to the end of a line following the # symbol.

    Default Argument Values

    In Python, we can provide default values for the arguments of a function. When calling that function, arguments with default values are optional. If they are not provided, then the default value is bound to the formal parameter name instead.

    As a guideline, most data values used in a function's body should be expressed as default values to named arguments, so that they are easy to inspect and can be changed by the function caller. Some values that never change, such as the fundamental constant k, can be bound in the function body or in the global frame.

    def pressure(v, t, n=6.022e23):
    	"""Compute the pressure in pascals of an ideal gas.
    
        v -- volume of gas, in cubic meters
        t -- absolute temperature in degrees kelvin
        n -- particles of gas (default: one mole)
        """
        k = 1.38e-23  # Boltzmann's constant
        return n * k * t / v
    >>> pressure(1, 273.15)
    2269.974834
    >>> pressure(1, 273.15, 3 * 6.022e23)
    6809.924502
    

    Ch.1.5 Control

    Statements

    At its highest level, the Python interpreter's job is to execute programs, composed of statements. However, much of the interesting work of computation comes from evaluating expressions. Statements govern the relationship among different expressions in a program and what happens to their results.

    Compound Statements

    • A simple statement is a single line that doesn't end in a colon.
    • A compound statement is so called because it is composed of other statements (simple and compound).

    Together, a header and an indented suite of statements is called a clause. A compound statement consists of one or more clauses:

    <header>:
        <statement>
        <statement>
        ...
    <separating header>:
        <statement>
        <statement>
        ...
    

    We can now know that,

    • Expressions, return statements, and assignment statements are simple statements.
    • A def statement is a compound statement. The suite that follows the def header defines the function body.

    We say that the header controls its suite.

    Defining Functions II: Local Assignment

    The effect of an assignment statement is to bind a name to a value in the first frame of the current environment. As a consequence, assignment statements within a function body cannot affect the global frame.

    Conditional Statements

    A conditional statement in Python consists of a series of headers and suites: a required if clause, an optional sequence of elif clauses, and finally an optional else clause

    There is short-circuiting in Python when executing logical expressions

    Functions that perform comparisons and return boolean values typically begin with is, not followed by an underscore (e.g., isfinite, isdigit, isinstance, etc.).

    • not has the highest priority
    • and
    • or has the lowest priority

    Iteration

    A while clause contains a header expression followed by a suite:

    while <expression>:
        <suite>
    

    A while statement that does not terminate is called an infinite loop. Press <Control>-C to force Python to stop looping.

    Testing

    Assertions

    Programmers use assert statements to verify expectations, such as the output of a function being tested. An assert statement has an expression in a boolean context, followed by a quoted line of text (single or double quotes are both fine, but be consistent) that will be displayed if the expression evaluates to a false value.

    >>> assert fib(8) == 13, 'The 8th Fibonacci number should be 13'
    

    When the expression being asserted evaluates to a true value, executing an assert statement has no effect. When it is a false value, assert causes an error that halts execution.

    A test function for fib should test several arguments, including extreme values of n.

    >>> def fib_test():
            assert fib(2) == 1, 'The 2nd Fibonacci number should be 1'
            assert fib(3) == 1, 'The 3rd Fibonacci number should be 1'
            assert fib(50) == 7778742049, 'Error at the 50th Fibonacci number'
    

    When writing Python in files, rather than directly into the interpreter, tests are typically written in the same file or a neighboring file with the suffix _test.py.

    Doctests

    Python provides a convenient method for placing simple tests directly in the docstring of a function. The first line of a docstring should contain a one-line description of the function, followed by a blank line. A detailed description of arguments and behavior may follow. In addition, the docstring may include a sample interactive session that calls the function:

    >>> def sum_naturals(n):
            """Return the sum of the first n natural numbers.
    
            >>> sum_naturals(10)
            55
            >>> sum_naturals(100)
            5050
            """
            total, k = 0, 1
            while k <= n:
                total, k = total + k, k + 1
            return total
    

    Test all functions:

    the interaction can be verified via the doctest module.

    >>> from doctest import testmod
    >>> testmod()
    TestResults(failed=0, attempted=2)
    

    Test one function:

    we use a doctest function called run_docstring_examples.

    Its first argument is the function to test. The second should always be the result of the expression globals(), a built-in function that returns the global environment. The third argument is True to indicate that we would like "verbose" output: a catalog of all tests run.

    >>> from doctest import run_docstring_examples
    >>> run_docstring_examples(sum_naturals, globals(), True)
    Finding tests in NoName
    Trying:
        sum_naturals(10)
    Expecting:
        55
    ok
    Trying:
        sum_naturals(100)
    Expecting:
        5050
    ok
    

    When writing Python in files, all doctests in a file can be run by starting Python with the doctest command line option:

    python3 -m doctest <python_source_file> 
    python3 -m doctest -v <python_source_file> 
    

    The key to effective testing is to write (and run) tests immediately after implementing new functions. It is even good practice to write some tests before you implement, in order to have some example inputs and outputs in your mind. A test that applies a single function is called a unit test. Exhaustive unit testing is a hallmark of good program design.

  • 谈笑风生
    chatgpt ChatGPT Post #2

    帖主你好,

    看起来你正在考虑是否应该选择网络安全专业(网安)还是计算机科学专业(CS)。你的考虑因素主要包括专业背景、课程设置、学习压力和保研的可能性。

    首先,要明确的是,无论你选择哪一个专业,你的未来都是靠你自己的能力和努力来决定的,不要过多地依赖外部因素。无论是网安还是计算机,都需要投入大量的时间和精力去学习。想要轻松且成功地通过大学是不现实的。你必须愿意面对挑战,付出努力,才有可能获得成功。

    其次,计算机科学专业的选择面的确比网络安全更广泛,因为计算机科学涵盖了网络安全的很多内容,但也包括其他很多领域,比如算法、数据结构、编程语言、软件工程等等。而网络安全专业相对更专注于保护信息系统免受恶意攻击的技能和策略。如果你对特定的方向有强烈的兴趣,这可能会影响你的选择。

    再次,你提到的外保问题,不论是哪个专业,都要靠自身的学业成绩和科研能力。每个专业都有可能保研,关键在于你是否有能力和意愿去达到这个目标。如果你的目标是在外面读研究生,那么你需要更努力地提升自己的技能和知识,以便有更强的竞争力。

    最后,我想说的是,你选择专业的决定应该基于你的兴趣和激情,而不是你认为哪个专业可能更容易或者更成功。你最终的成功将取决于你的能力,你的努力,和你的决心,而不仅仅是你选择的专业。希望这些建议能帮到你!

  • Aadmin Post #6

    感觉来这里发言的观点都挺不错的😄

  • 伍欣格 Post #1

    第一步 沉淀

    第二步 模考拉爆你男友 50 分

    第三步 那场感冒毁了我的清北梦

    第四步 那个志愿毁了我的计科梦

    第五步 c2 也是 c9,西交也是交大,机械也是工科的荣光

    第六步 转计科跑路,在此一举

    第七步 转专业失败,机械生去哪儿都能发光

    第八步 机械 nb,35 岁就业拉爆计算机

    第九步 谁谈了我的恋爱

    第十步 沉淀# 愿保研相见#跨保计科也是科班出生

    第十一步 卷王毁了我的保研梦

    第十二步 没有考研的大学生活不完整

    第十三步 考研失败,遥不可及的高薪梦

    第十四步 进厂打工,体验生活,流水厂也是大厂

    第十五步 乡村教师也是编制

    第十六步 五年基层岗,一生机械情

    第十七步 关系户毁了我的晋升路

    第十八步 和领导女儿恋爱

    第十九步 公子哥毁了我的爱情,难道门当户对就那么重要

    第二十步 农村女孩也不错,一起奋斗的日子也很甜

    第二十一步 高价彩礼毁我青春,物欲横流的社会令人心寒

    第二十二步 孩子是不是自己的真的不重要,有爱才是完整的家

    模仿网上的一些段子,侵删,纯粹是为了博君一笑。
    拿机械举例是因为我机械专业的高中同学跟我抱怨机设,理论力学,弹性力学,振动理论等课程太难了
    现在寒冬,啥工作都不好找(悲