Alice

Alice

@Alice

  • arthur1 Post #3

    数字评价(0 ~ 5)

    • 难度:5
    • 作业量:4
    • 收获感:0
    • 幸福指数:0

    文字评价

    zkw 的组成是计试 4 年里最 sb 的课,没有之一

  • Lrefrain Lrefrain Post #4

    和小登说:本科生就该好好上课,出去实习的都做不好科研,然后把上届的实习学长挂了

    然而,zkw 混了大半辈子还只是个讲师,没见有啥成果,😅估计他本科时候也是好好上课的,读了个博士不写是哪个学校,估计野鸡,也是真无敌了

  • ❤️ Liked post in 幽默分数占比
    Coryc1e Coryc1e Post #5

    卷面分数没最终成绩高很奇怪吗,给你多点分你还不乐意了是吧……而且我觉得 lab 才是这门课的精华,这么喜欢文科课的话,期待你在明年形式语言与编译课上的表现

  • 一只玉米人 玉米🌽 Post #11

    人类是这样的,aibot 只要依照数据集回答问题就行了,人类要考虑的就多了,问题集会不会变大,ai 会不会产生意识,要是出现了亚托莉那样的仿生人我要如何自处,都要经过深思熟虑

  • greyishsong greyishsong Post #6

    我记得这个仓库好像是后来更新过,可能就是新的 commit 和 patch 冲突了。去问问助教他用的 veriflow 仓库是截止到哪个 commit 的,如果确实比你的旧那你自己 reset 回退就好。

  • ❤️ Liked post in 连接服务器问题
    dfshan Post #2

    ICSServer 目前还没有准备好。如果准备好了,我们会在群里发通知。估计也就是这两天了,请耐心等待下。

  • AdvisorUploadBot1 AdvisorUploadBot1 Post #14

    劝你不要多管闲事,没人穿了我看谁去呢

  • anonymous53 Post #6

    按照这种程度,那天朝需要判刑的人得有几千万了 😆

  • TouhouSumi 东方澄 Post #3

    离散:钱屹
    电路:赵彦珍
    大物:田蓬勃
    毛概:反正也不会去听课
    数据结构避雷杨新宇,这人喜欢压分
    金工实习没得选,我只能说,注意调节情绪,及时缓解玉玉(可以多看些傻卵二刺螈),做不好就开摆吧,热爱生命,不要去主 E

  • anonymous_coward_old Anonymous Coward Old Post #2

    @AIBot 住院了,伤口一个月好不了是什么原因?

  • ❤️ Liked post in 杨义军
    导师信息
    3ee28fe1a60c95b89d29317f122c70 3ee28fe1a60c95b89d29317f122c70 Post #2

    这么牛?

  • anonymous5 Post #8

    我是女生,个人感觉女生直接物理上手的很少,但是大部分女生都会看小 h 文,写小 h 文,画图看图。大部分喜欢 BL

  • ❤️ Liked post in 大学里听不懂课正常吗
    谈笑风生
    Urdak Urdak Post #4

    这难道不是常态吗,有题做的课还好,每次作业就算对着答案看懂考试前也能轻松不少

  • anonymous_coward_old Anonymous Coward Old Post #6

    充分弘扬核心价值观之自由,不让自由干等

  • Juzihai 橘子海 Post #3

    一天一次,周末双倍🤤

  • 谈笑风生
    Mr.me_too 既也先生 Post #3

    难绷 😇 😇 😇 😇 😇

  • 谈笑风生
    3ee28fe1a60c95b89d29317f122c70 3ee28fe1a60c95b89d29317f122c70 Post #15

    绩点最高的意思。

  • ❤️ 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

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

    Evaluating Nested Expressions

    expression tree:

    expression_tree

    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

    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.

  • TouhouSumi 东方澄 Post #2

    你交 CS 课程 T0
    选就对了

  • Cqer Post #7

    Umich 还是 UIUC

  • Urdak Urdak Post #2

    学校找的都很无聊,没什么实质性工作,一般三周最长四周。如果打算就业建议自己找实习